removed database configuration page, using instead SQlite, and integrated grafana interface

This commit is contained in:
piair
2023-08-24 21:18:36 +02:00
parent 1befff788d
commit 5c2fa42f51
11 changed files with 7 additions and 191 deletions

View File

@ -31,10 +31,9 @@ if secret == "":
"""
def daily_command():
subprocess.Popen(["git",'pull'])
subprocess.Popen(["pkill -9 chrome"])
subprocess.Popen(["pkill -9 Xvfb"])
subprocess.Popen(["pkill -9 undetected_chromedriver"])
subprocess.Popen(["pkill","-9","chrome"])
subprocess.Popen(["pkill","-9","Xvfb"])
subprocess.Popen(["pkill","-9", "undetected_chromedriver"])
scheduler = BackgroundScheduler()
scheduler.start()
@ -54,8 +53,6 @@ def start_ms(i):
log.close()
TriggerDict = {}
def update_jobs():
with open("/app/MsRewards-Reborn/user_data/configs.json", "r") as inFile:
@ -178,15 +175,6 @@ def load_user(userid):
#end of login stuff
"""
@app.route("/", methods=["post"])
def dev():
action = request.form
print(action)
if action == "dev":
print("dev action test")
return(f"<h1> TO IMPLEMENT - {action}</h1>")
@app.route("/")
def main():
with open("/app/MsRewards-Reborn/user_data/configs.json", "r") as inFile:
@ -329,36 +317,6 @@ def override_post():
return(render_template("override.html", data=configs))
@app.route("/database/")
def database_get():
with open("/app/MsRewards-Reborn/user_data/database.json", "r") as inFile:
database = json.load(inFile)
return(render_template("database.html", data = database))
@app.route("/database/", methods=["post"])
def database_post():
action = request.form
data = {
"host": action['address'],
"table": action['table'],
"usr": action['user'],
"pwd": action['password'],
"checked": ""
}
try :
if action["switch"] :
data['checked'] = "checked"
except:
pass
with open("/app/MsRewards-Reborn/user_data/database.json", "w") as inFile:
json.dump(data, inFile)
return(render_template("database.html", data = data))
@app.route("/config/")
def config_get():
with open("/app/MsRewards-Reborn/user_data/proxy.json", "r") as inFile:
@ -413,7 +371,6 @@ def logs():
@app.route('/download/<path:filename>', methods=['GET', 'POST'])
@login_required
def download(filename):
print("file send !")
return send_from_directory(directory='/app/MsRewards-Reborn/user_data/', path=filename, as_attachment=True)
@ -453,12 +410,6 @@ def maxi(dict):
return(m+1)
update_jobs()
edit_version()
subprocess.Popen(["bash",'/app/MsRewards-Reborn/config/request.sh'])
#if __name__ == '__main__':
# print("this is launched")
# setup_grafana()
# update_jobs()
# edit_version()
# app.run(host='0.0.0.0', port=1234, debug=True)
#