-
-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #149 from LoRexxar/develop
Develop
- Loading branch information
Showing
32 changed files
with
176 additions
and
408 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,5 @@ Werkzeug==0.16.0 | |
esprima==4.0.1 | ||
jsbeautifier==1.10.2 | ||
bs4 | ||
django | ||
django | ||
mysqlclient==2.0.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env python | ||
# encoding: utf-8 | ||
''' | ||
@author: LoRexxar | ||
@contact: lorexxar@gmail.com | ||
@file: web.py | ||
@time: 2021/7/1 18:03 | ||
@desc: | ||
''' | ||
|
||
import os | ||
import requests | ||
|
||
from Kunlun_M.settings import REMOTE_URL, REMOTE_URL_APITOKEN | ||
|
||
from utils.log import logger | ||
|
||
|
||
def upload_log(logpath): | ||
""" | ||
上传日志到远程 | ||
:param logpath: | ||
:return: | ||
""" | ||
|
||
remote_upload_url = "{}/backend/uploadlog?apitoken={}".format(REMOTE_URL,REMOTE_URL_APITOKEN) | ||
|
||
if not os.path.exists(logpath): | ||
logger.warning("[UPLOAD LOG] log {} not exist.".format(logpath)) | ||
return False | ||
|
||
files = { | ||
"file": open(logpath, "rb") | ||
} | ||
|
||
r = requests.post(remote_upload_url, files=files) | ||
|
||
if r.status_code != 200: | ||
logger.warning("[UPLOAD LOG] upload log to {} error. response is {}".format(REMOTE_URL, r.text)) | ||
return False | ||
|
||
logger.info("[UPLOAD LOG] upload log {} success".format(logpath)) | ||
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.