support change while running

This commit is contained in:
2019-04-07 22:26:21 +08:00
committed by JerryYan
parent 16c68e5ceb
commit ce819185eb
4 changed files with 39 additions and 6 deletions

View File

@ -8,8 +8,8 @@ from liveDownloader import run as RUN
app = Flask("liveStatus")
app.config['JSON_AS_ASCII'] = False
CORS(app, supports_credentials=True)
url_for('static', filename='index.html')
url_for('static', filename='index.js')
# url_for('static', filename='index.html')
# url_for('static', filename='index.js')
@app.route("/")
@ -29,9 +29,30 @@ def readConfig():
@app.route("/config", methods=["POST"])
def writeConfig():
# TODO : 完善
Common.reloadConfig()
return jsonify({"message":"ok","code":200,"status":0,"data":request.form})
@app.route("/encode/insert", methods=["POST"])
def insertEncode():
if "filename" in request.form:
Common.encodeQueue.put(request.form["filename"])
return jsonify({"message":"ok","code":200,"status":0})
@app.route("/upload/insert", methods=["POST"])
def insertUpload():
if "filename" in request.form:
Common.uploadQueue.put(request.form["filename"])
return jsonify({"message":"ok","code":200,"status":0})
@app.route("/upload/finish", methods=["POST"])
def finishUpload():
Common.uploadQueue.put(True)
return jsonify({"message":"ok","code":200,"status":0})
@app.route("/stats", methods=["GET"])
def getAllStats():
return jsonify({"message":"ok","code":200,"status":0,"data":{