diff --git a/Flask/app.py b/Flask/app.py index 55ad8b0..1a37cf9 100644 --- a/Flask/app.py +++ b/Flask/app.py @@ -368,7 +368,6 @@ def config_get(): @app.route("/config/", methods=["POST"]) def config_post(): action = request.form - print(action) with open("/app/MsRewards-Reborn/user_data/proxy.json", "r") as inFile: proxys = json.load(inFile) with open("/app/MsRewards-Reborn/user_data/discord.json", "r") as inFile: @@ -376,22 +375,26 @@ def config_post(): with open("/app/MsRewards-Reborn/user_data/configs.json", "r") as inFile: configs = json.load(inFile) - comptes = { - "1":{"mail": action["mail1"], "pwd": action["pwd1"], "2fa": action["2fa1"]}, - "2":{"mail": action["mail2"], "pwd": action["pwd2"], "2fa": action["2fa2"]}, - "3":{"mail": action["mail3"], "pwd": action["pwd3"], "2fa": action["2fa3"]}, - "4":{"mail": action["mail4"], "pwd": action["pwd4"], "2fa": action["2fa4"]}, - "5":{"mail": action["mail5"], "pwd": action["pwd5"], "2fa": action["2fa5"]} - } - - configs[action["config"]] = { - "name" : action["name"] if action["name"] != "" else f"unnamed{action['config']}", - "proxy": action["proxy"], - "discord": action["discord"], - "time":"", - "enabled":"False", - "accounts": comptes + if action["data"] == "delete": + print(action["config"]) + configs.pop(action["config"]) + else : + comptes = { + "1":{"mail": action["mail1"], "pwd": action["pwd1"], "2fa": action["2fa1"]}, + "2":{"mail": action["mail2"], "pwd": action["pwd2"], "2fa": action["2fa2"]}, + "3":{"mail": action["mail3"], "pwd": action["pwd3"], "2fa": action["2fa3"]}, + "4":{"mail": action["mail4"], "pwd": action["pwd4"], "2fa": action["2fa4"]}, + "5":{"mail": action["mail5"], "pwd": action["pwd5"], "2fa": action["2fa5"]} } + + configs[action["config"]] = { + "name" : action["name"] if action["name"] != "" else f"unnamed{action['config']}", + "proxy": action["proxy"], + "discord": action["discord"], + "time":"", + "enabled":"False", + "accounts": comptes + } with open("/app/MsRewards-Reborn/user_data/configs.json", "w") as outFile: json.dump(configs, outFile) return(render_template("config.html", data=configs, discords=discords, proxys=proxys, configs=configs, len=maxi(configs))) diff --git a/Flask/templates/config.html b/Flask/templates/config.html index bf66852..20d5df3 100644 --- a/Flask/templates/config.html +++ b/Flask/templates/config.html @@ -128,7 +128,7 @@ - +