mirror of
https://gitea.augustin64.fr/piair/MsRewards-Reborn.git
synced 2025-06-13 14:34:45 +02:00
bruh ?
This commit is contained in:
321
Flask/app.py
Normal file
321
Flask/app.py
Normal file
@ -0,0 +1,321 @@
|
||||
from time import sleep
|
||||
import subprocess
|
||||
from flask import Flask, Response, redirect, url_for, request, session, abort, render_template
|
||||
from apscheduler.schedulers.background import BackgroundScheduler
|
||||
from apscheduler.triggers.cron import CronTrigger
|
||||
from flask_login import LoginManager, UserMixin, login_required, login_user, logout_user
|
||||
import json
|
||||
password = "RandomPassword"
|
||||
secret = "fe18d16cff64b8124792b8d512cecf90b79c4947707815ecf5c70446fdbc5101"
|
||||
|
||||
|
||||
"""
|
||||
Automatic start of MsRewards
|
||||
"""
|
||||
scheduler = BackgroundScheduler()
|
||||
scheduler.start()
|
||||
|
||||
trigger = CronTrigger(
|
||||
year="*", month="*", day="*", hour="2", minute="25", second="25"
|
||||
)
|
||||
|
||||
def start_ms():
|
||||
subprocess.Popen(["python3", "./V6.py", "-v", "2345"])
|
||||
|
||||
scheduler.add_job(
|
||||
start_ms,
|
||||
trigger=trigger,
|
||||
#args=["hello world"],
|
||||
name="Daily start",
|
||||
)
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Flask app
|
||||
"""
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
"""
|
||||
Login stuff
|
||||
"""
|
||||
# TODO : changer le secret
|
||||
# config
|
||||
app.config.update(
|
||||
SECRET_KEY = secret
|
||||
)
|
||||
|
||||
login_manager = LoginManager()
|
||||
login_manager.init_app(app)
|
||||
login_manager.login_view = "login"
|
||||
|
||||
# silly user model
|
||||
class User(UserMixin):
|
||||
def __init__(self, id):
|
||||
self.id = id
|
||||
self.name = "user" + str(id)
|
||||
self.password = password
|
||||
|
||||
def __repr__(self):
|
||||
return "%d/%s/%s" % (self.id, self.name, self.password)
|
||||
|
||||
users = [User(1)]
|
||||
@app.route("/login/", methods=["GET", "POST"])
|
||||
def login():
|
||||
if request.method == 'POST':
|
||||
if request.form['password'] == password:
|
||||
user = User(id)
|
||||
login_user(user)
|
||||
return(render_template("override.html"))
|
||||
else:
|
||||
return abort(401)
|
||||
else:
|
||||
return(render_template("login.html"))
|
||||
|
||||
|
||||
# handle login failed
|
||||
@app.errorhandler(401)
|
||||
def page_not_found(e):
|
||||
return(render_template("login.html"))
|
||||
|
||||
|
||||
# callback to reload the user object
|
||||
@login_manager.user_loader
|
||||
def load_user(userid):
|
||||
return 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():
|
||||
return(render_template("override.html"))
|
||||
|
||||
|
||||
@app.route("/discord/")
|
||||
def discord_get():
|
||||
with open("./user_data/discord.json", "r") as inFile:
|
||||
data = json.load(inFile)
|
||||
return(render_template("discord.html", data=data, len=len(data)))
|
||||
|
||||
|
||||
@app.route("/discord/", methods=["post"])
|
||||
def discord_post():
|
||||
with open("./user_data/discord.json", "r") as inFile:
|
||||
data = json.load(inFile)
|
||||
action = request.form
|
||||
|
||||
config = action["select"]
|
||||
successL = action["successL"]
|
||||
try :
|
||||
a = action["successT"]
|
||||
successT = "True"
|
||||
except:
|
||||
successT = "False"
|
||||
try :
|
||||
a = action["errorsT"]
|
||||
errorsT = "True"
|
||||
except:
|
||||
errorsT = "False"
|
||||
errorsL = action["errorsL"]
|
||||
name = action["name"] if action["name"] else f"unnamed{action['select']}"
|
||||
data[config] = {"errorsL" : errorsL, "errorsT": errorsT, "successT": successT, "successL": successL, "name": name}
|
||||
|
||||
with open("./user_data/discord.json", "w") as outFile:
|
||||
json.dump(data, outFile)
|
||||
return(render_template("discord.html", data=data, len=len(data)))
|
||||
|
||||
|
||||
@app.route("/dev/")
|
||||
def dev2():
|
||||
with open("./user_data/proxy.json", "r") as inFile:
|
||||
j = json.load(inFile)
|
||||
new_proxy = {"address": "ADDRESS", "port": "PORT", "name":"NAME"}
|
||||
max_index = 0
|
||||
for i in range(1, 50):
|
||||
try :
|
||||
print(j[str(i)])
|
||||
except :
|
||||
print(f"found {i - 1} proxys")
|
||||
max_index = i
|
||||
break
|
||||
j[f"{max_index}"] = new_proxy
|
||||
print(j)
|
||||
with open("./user_data/proxy.json", "w") as outfile:
|
||||
json.dump(j, outfile)
|
||||
return(render_template("dev.html"))
|
||||
|
||||
|
||||
@app.route("/settings/")
|
||||
def settings_get():
|
||||
with open("./user_data/settings.json", "r") as inFile:
|
||||
settings = json.load(inFile)
|
||||
return(render_template("settings.html", data=settings))
|
||||
|
||||
@app.route("/settings/", methods=["post"])
|
||||
def settings_post():
|
||||
settings = {}
|
||||
action = request.form
|
||||
settings['avatarlink'] = action["avatarlink"]
|
||||
with open("./user_data/settings.json", "w") as inFile:
|
||||
json.dump(settings, inFile)
|
||||
return(render_template("settings.html", data=settings))
|
||||
|
||||
|
||||
@app.route("/proxy/")
|
||||
def proxy_get():
|
||||
with open("./user_data/proxy.json", "r") as inFile:
|
||||
j = json.load(inFile)
|
||||
return(render_template("proxy.html", data=j, len=len(j)))
|
||||
|
||||
|
||||
@app.route("/proxy/", methods=["post"])
|
||||
def proxy_post():
|
||||
with open("./user_data/proxy.json", "r") as inFile:
|
||||
data = json.load(inFile)
|
||||
action = request.form
|
||||
try :
|
||||
config = action["select"]
|
||||
address = action["address"]
|
||||
port = action["port"]
|
||||
name = action["name"] if action["name"] else f"@unnamed{action['select']}"
|
||||
data[config] = {"address" : address, "port": port, "name": name}
|
||||
except :
|
||||
print("error : probably bad config")
|
||||
|
||||
with open("./user_data/proxy.json", "w") as outFile:
|
||||
json.dump(data, outFile)
|
||||
return(render_template("proxy.html", data=data, len=len(data)))
|
||||
|
||||
|
||||
@app.route("/override/")
|
||||
def override_get():
|
||||
return(render_template("override.html"))
|
||||
|
||||
|
||||
@app.route("/override/", methods=["post"])
|
||||
def override():
|
||||
subprocess.run(["python3", "./V6.py", "-v", "2345"])
|
||||
return(render_template("override.html"))
|
||||
|
||||
|
||||
@app.route("/database/")
|
||||
def database_get():
|
||||
with open("./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("./user_data/database.json", "w") as inFile:
|
||||
json.dump(data, inFile)
|
||||
|
||||
return(render_template("database.html", data = data))
|
||||
|
||||
|
||||
@app.route("/accounts/")
|
||||
def accounts_get():
|
||||
with open("./user_data/proxy.json", "r") as inFile:
|
||||
proxys = json.load(inFile)
|
||||
with open("./user_data/discord.json", "r") as inFile:
|
||||
discords = json.load(inFile)
|
||||
with open("./user_data/configs.json", "r") as inFile:
|
||||
configs = json.load(inFile)
|
||||
return(render_template("accounts.html", data=configs, discords=discords, proxys=proxys, configs=configs, len=len(configs)))
|
||||
|
||||
|
||||
@app.route("/accounts/", methods=["POST"])
|
||||
def accounts_post():
|
||||
action = request.form
|
||||
with open("./user_data/proxy.json", "r") as inFile:
|
||||
proxys = json.load(inFile)
|
||||
with open("./user_data/discord.json", "r") as inFile:
|
||||
discords = json.load(inFile)
|
||||
with open("./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"],
|
||||
"accounts": comptes
|
||||
}
|
||||
with open("./user_data/configs.json", "w") as outFile:
|
||||
json.dump(configs, outFile)
|
||||
return(render_template("accounts.html", data=configs, discords=discords, proxys=proxys, configs=configs, len=len(configs)))
|
||||
|
||||
|
||||
def read_config_txt(ligne):
|
||||
f = open("./user_data/config.cfg", "r")
|
||||
txt = f.readlines()
|
||||
f.close()
|
||||
if txt.count(txt) >1:
|
||||
raise NameError("Fail")
|
||||
|
||||
for i in range(len(txt)) :
|
||||
name = txt[i].split(" = ")[0]
|
||||
if name == ligne:
|
||||
ret = txt[i].split(" = ")[1]
|
||||
|
||||
f = open("./user_data/config.cfg", "w")
|
||||
for i in txt :
|
||||
f.write(i)
|
||||
f.close()
|
||||
return(ret.replace("\n", ""))
|
||||
|
||||
|
||||
def edit_config_txt(ligne, contenu):
|
||||
f = open("./user_data/config.cfg", "r")
|
||||
txt = f.readlines()
|
||||
f.close()
|
||||
if txt.count(txt) >1:
|
||||
raise NameError("Fail")
|
||||
|
||||
for i in range(len(txt)) :
|
||||
name = txt[i].split(" = ")[0]
|
||||
if name == ligne:
|
||||
txt[i] = name + " = " + str(contenu) + "\n"
|
||||
|
||||
f = open("./user_data/config.cfg", "w")
|
||||
for i in txt :
|
||||
f.write(i)
|
||||
f.close()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(host='0.0.0.0', port=3456, debug=True)
|
276
Flask/static/css/flask.css
Normal file
276
Flask/static/css/flask.css
Normal file
@ -0,0 +1,276 @@
|
||||
@import url('https://fonts.googleapis.com/css?family=Montserrat');
|
||||
html {
|
||||
text-align: center;
|
||||
font-family: Montserrat;
|
||||
height: 90%;
|
||||
}
|
||||
|
||||
form {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
a {
|
||||
color: white;
|
||||
}
|
||||
|
||||
|
||||
input[type=text] {
|
||||
|
||||
width: 90%;
|
||||
padding: 12px 20px;
|
||||
margin: 8px 0;
|
||||
background-color: #212121;
|
||||
border: 2px solid grey;
|
||||
border-radius: 4px;
|
||||
outline: none;
|
||||
color: white;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
input[type=password] {
|
||||
|
||||
width: 90%;
|
||||
padding: 12px 20px;
|
||||
margin: 8px 0;
|
||||
text-align: center;
|
||||
border: 2px solid grey;
|
||||
border-radius: 4px;
|
||||
outline: none;
|
||||
color: white;
|
||||
background-color: #212121;
|
||||
}
|
||||
|
||||
.button{
|
||||
border-radius: 4px;
|
||||
border: 2px solid grey;
|
||||
background-color: #212121;
|
||||
color: white;
|
||||
padding: 12px 20px;
|
||||
width: 70%;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.left-button{
|
||||
width: 10%;
|
||||
}
|
||||
|
||||
.ban{
|
||||
border-radius: 4px;
|
||||
border: 2px solid red;
|
||||
background-size: 200% 100%;
|
||||
background-image: linear-gradient(to right, #212121 50%, red 50%);
|
||||
-webkit-transition: background-position 0.5s;
|
||||
-moz-transition: background-position 0.5s;
|
||||
transition: background-position 0.5s;
|
||||
color: white;
|
||||
padding: 12px 20px;
|
||||
width: 70%;
|
||||
margin: 10px;
|
||||
}
|
||||
.ban:hover{
|
||||
background-position: -100% 0;
|
||||
}
|
||||
|
||||
.confirm{
|
||||
color: white;
|
||||
padding: 12px 20px;
|
||||
width: 70%;
|
||||
margin: 10px;
|
||||
background-size: 200% 100%;
|
||||
background-image: linear-gradient(to right, #212121 50%, green 50%);
|
||||
-webkit-transition: background-position 0.5s;
|
||||
-moz-transition: background-position 0.5s;
|
||||
transition: background-position 0.5s;
|
||||
border: 2px solid grey;
|
||||
}
|
||||
|
||||
.confirm:hover{
|
||||
background-position: -100% 0;
|
||||
}
|
||||
|
||||
.confirm{
|
||||
color: white;
|
||||
padding: 12px 20px;
|
||||
width: 70%;
|
||||
margin: 10px;
|
||||
background-size: 200% 100%;
|
||||
background-image: linear-gradient(to right, #212121 50%, green 50%);
|
||||
-webkit-transition: background-position 0.5s;
|
||||
-moz-transition: background-position 0.5s;
|
||||
transition: background-position 0.5s;
|
||||
border: 2px solid grey;
|
||||
}
|
||||
|
||||
.confirm:hover{
|
||||
background-position: -100% 0;
|
||||
}
|
||||
.unselected{
|
||||
border-radius: 4px;
|
||||
border: 2px solid grey;
|
||||
background-color: #212121;
|
||||
color: white;
|
||||
padding: 12px 20px;
|
||||
width: 70%;
|
||||
margin: 10px;
|
||||
}
|
||||
.selected{
|
||||
border-radius: 4px;
|
||||
border: 2px solid grey;
|
||||
background-color: dimgray;
|
||||
color: white;
|
||||
padding: 12px 20px;
|
||||
width: 70%;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
|
||||
button:hover{
|
||||
border: 2px solid white;
|
||||
}
|
||||
input:hover{
|
||||
border: 2px solid white;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.submit{
|
||||
border-radius: 4px;
|
||||
border: 2px solid grey;
|
||||
background-color: #212121;
|
||||
color: white;
|
||||
padding: 12px 20px;
|
||||
width: 100%;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #212121;
|
||||
color: #fff;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.left-pannel{
|
||||
flex: 1;
|
||||
margin: 20px;
|
||||
border: 1px solid #fff;
|
||||
border-radius: 5px;
|
||||
padding: 20px;
|
||||
width: 80%;
|
||||
height: 80%;
|
||||
|
||||
}
|
||||
|
||||
.content{
|
||||
flex: 3;
|
||||
margin: 20px;
|
||||
border: 1px solid #fff;
|
||||
border-radius: 5px;
|
||||
padding: 20px;
|
||||
width: 80%;
|
||||
height: 80%;
|
||||
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.row-item {
|
||||
margin: 10px 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#image img {
|
||||
display: block;
|
||||
margin: auto;
|
||||
width: 20%;
|
||||
}
|
||||
.comlumn-name{
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
For toggle switch
|
||||
*/
|
||||
|
||||
|
||||
input[type=checkbox]{
|
||||
height: 0;
|
||||
width: 0;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
label {
|
||||
margin: auto;
|
||||
cursor: pointer;
|
||||
text-indent: -9999px;
|
||||
width: 100px;
|
||||
height: 50px;
|
||||
background: grey;
|
||||
display: block;
|
||||
border-radius: 100px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/*
|
||||
width: height of label /2 ;
|
||||
height: height of label /2px;
|
||||
*/
|
||||
label:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
left: 5px;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: #fff;
|
||||
border-radius: 90px;
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
input:checked + label {
|
||||
background: #bada55;
|
||||
}
|
||||
|
||||
input:checked + label:after {
|
||||
left: calc(100% - 5px);
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
/*changer l'épaisseur du click */
|
||||
label:active:after {
|
||||
width: 30px;
|
||||
}
|
||||
|
||||
select {
|
||||
width: 90%;
|
||||
height: 100%;
|
||||
padding: 12px 20px;
|
||||
margin: 8px 0;
|
||||
background-color: #212121;
|
||||
border: 2px solid grey;
|
||||
border-radius: 4px;
|
||||
outline: none;
|
||||
color: white;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
select:hover {
|
||||
border: 2px solid white;
|
||||
}
|
BIN
Flask/static/favicon.ico
Normal file
BIN
Flask/static/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.9 KiB |
1
Flask/static/images/trash.svg
Normal file
1
Flask/static/images/trash.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50" width="50px" height="50px"><path d="M 21 0 C 19.355469 0 18 1.355469 18 3 L 18 5 L 10.1875 5 C 10.0625 4.976563 9.9375 4.976563 9.8125 5 L 8 5 C 7.96875 5 7.9375 5 7.90625 5 C 7.355469 5.027344 6.925781 5.496094 6.953125 6.046875 C 6.980469 6.597656 7.449219 7.027344 8 7 L 9.09375 7 L 12.6875 47.5 C 12.8125 48.898438 14.003906 50 15.40625 50 L 34.59375 50 C 35.996094 50 37.1875 48.898438 37.3125 47.5 L 40.90625 7 L 42 7 C 42.359375 7.003906 42.695313 6.816406 42.878906 6.503906 C 43.058594 6.191406 43.058594 5.808594 42.878906 5.496094 C 42.695313 5.183594 42.359375 4.996094 42 5 L 32 5 L 32 3 C 32 1.355469 30.644531 0 29 0 Z M 21 2 L 29 2 C 29.5625 2 30 2.4375 30 3 L 30 5 L 20 5 L 20 3 C 20 2.4375 20.4375 2 21 2 Z M 11.09375 7 L 38.90625 7 L 35.3125 47.34375 C 35.28125 47.691406 34.910156 48 34.59375 48 L 15.40625 48 C 15.089844 48 14.71875 47.691406 14.6875 47.34375 Z M 18.90625 9.96875 C 18.863281 9.976563 18.820313 9.988281 18.78125 10 C 18.316406 10.105469 17.988281 10.523438 18 11 L 18 44 C 17.996094 44.359375 18.183594 44.695313 18.496094 44.878906 C 18.808594 45.058594 19.191406 45.058594 19.503906 44.878906 C 19.816406 44.695313 20.003906 44.359375 20 44 L 20 11 C 20.011719 10.710938 19.894531 10.433594 19.6875 10.238281 C 19.476563 10.039063 19.191406 9.941406 18.90625 9.96875 Z M 24.90625 9.96875 C 24.863281 9.976563 24.820313 9.988281 24.78125 10 C 24.316406 10.105469 23.988281 10.523438 24 11 L 24 44 C 23.996094 44.359375 24.183594 44.695313 24.496094 44.878906 C 24.808594 45.058594 25.191406 45.058594 25.503906 44.878906 C 25.816406 44.695313 26.003906 44.359375 26 44 L 26 11 C 26.011719 10.710938 25.894531 10.433594 25.6875 10.238281 C 25.476563 10.039063 25.191406 9.941406 24.90625 9.96875 Z M 30.90625 9.96875 C 30.863281 9.976563 30.820313 9.988281 30.78125 10 C 30.316406 10.105469 29.988281 10.523438 30 11 L 30 44 C 29.996094 44.359375 30.183594 44.695313 30.496094 44.878906 C 30.808594 45.058594 31.191406 45.058594 31.503906 44.878906 C 31.816406 44.695313 32.003906 44.359375 32 44 L 32 11 C 32.011719 10.710938 31.894531 10.433594 31.6875 10.238281 C 31.476563 10.039063 31.191406 9.941406 30.90625 9.96875 Z"/></svg>
|
After Width: | Height: | Size: 2.2 KiB |
167
Flask/templates/accounts.html
Normal file
167
Flask/templates/accounts.html
Normal file
@ -0,0 +1,167 @@
|
||||
{% extends "base.html" %}
|
||||
{% block left_pannel %}
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/override';">override</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="selected" onclick="location.href = '/accounts';">accounts</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/discord';">discord</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/database';">database</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/proxy';">proxy</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/settings';">settings</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
{% block content %}
|
||||
{%if not current_user.is_authenticated %}
|
||||
<button class="unselected" onclick="location.href = '/login';">login</button>
|
||||
{% else %}
|
||||
<form method="post" action="/accounts/">
|
||||
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 10%;">config : </td>
|
||||
<td style="width: 40%;">
|
||||
<select onchange="changecat(this.value)" name="config">
|
||||
<option id="config" value="{{len}}">New config</option>
|
||||
{% for i in configs %}
|
||||
<option id="{{configs[i]['name']}}" value="{{i}}">{{configs[i]['name']}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
<td style="width: 10%;">name : </td>
|
||||
<td>
|
||||
<input type="text" id="name" name="name" value = "">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 10%;">Proxy : </td>
|
||||
<td style="width: 40%;">
|
||||
<select id="proxy" name="proxy">
|
||||
<option id="" value="-1">No proxy</option>
|
||||
{% for i in proxys %}
|
||||
<option id="{{proxys[i]['name']}}" value="{{i}}">{{proxys[i]['name']}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
<td style="width: 10%;">Discord : </td>
|
||||
<td>
|
||||
<select id="discord" name="discord">
|
||||
<option id="no discord" value="-1">No discord (not sure about the support)</option>
|
||||
{% for i in discords %}
|
||||
<option id="{{discords[i]['name']}}" value="{{i}}">{{discords[i]['name']}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br><br>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Mail</td>
|
||||
<td>Password</td>
|
||||
<td>2FA</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" id="mail1" name="mail1" value=""></td>
|
||||
<td><input type="text" id="pwd1" name="pwd1" value=""></td>
|
||||
<td><input type="text" id="2fa1" name="2fa1" value=""></td>
|
||||
<td class="left-button"><button class="ban" name="ban" value="">ban</button></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" id="mail2" name="mail2" value=""></td>
|
||||
<td><input type="text" id="pwd2" name="pwd2" value=""></td>
|
||||
<td><input type="text" id="2fa2" name="2fa2" value=""></td>
|
||||
<td class="left-button"><button class="ban" name="ban" value="">ban</button></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" id="mail3" name="mail3" value=""></td>
|
||||
<td><input type="text" id="pwd3" name="pwd3" value="" ></td>
|
||||
<td><input type="text" id="2fa3" name="2fa3" value=""></td>
|
||||
<td class="left-button"><button class="ban" name="ban" value="">ban</button></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" id="mail4" name="mail4" value=""></td>
|
||||
<td><input type="text" id="pwd4" name="pwd4" value="" ></td>
|
||||
<td><input type="text" id="2fa4" name="2fa4" value=""></td>
|
||||
<td class="left-button"><button class="ban" name="ban" value="">ban</button></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" id="mail5" name="mail5" value=""></td>
|
||||
<td><input type="text" id="pwd5" name="pwd5" value=""></td>
|
||||
<td><input type="text" id="2fa5" name="2fa5" value=""></td>
|
||||
<td class="left-button"><button class="ban" name="ban" value="">ban</button></td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
<input type="submit" class="confirm" name="data" id="submit" value="Update !" class="button"/>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function changecat(value) {
|
||||
data = JSON.parse('{{data|tojson}}'); //convertit le dictionnaire data en JSON
|
||||
console.log(this.value)
|
||||
if (value == "{{len}}"){
|
||||
document.getElementById("submit").value = "Create !";
|
||||
document.getElementById("discord").value = "-1";
|
||||
document.getElementById("proxy").value = "-1";
|
||||
document.getElementById("name").value = "";
|
||||
for (let i = 1; i < 6; i++) {
|
||||
document.getElementById("mail"+ i).value = "";
|
||||
document.getElementById("pwd"+ i).value = "" ;
|
||||
document.getElementById("2fa"+ i).value = "" ;
|
||||
}
|
||||
}
|
||||
else {
|
||||
document.getElementById("submit").value = "Update !";
|
||||
document.getElementById("discord").value = data[parseInt(value)]["discord"];
|
||||
document.getElementById("proxy").value = data[parseInt(value)]["proxy"];
|
||||
document.getElementById("name").value = data[parseInt(value)]["name"];
|
||||
for (let i = 1; i < 6; i++) {
|
||||
document.getElementById("mail"+ i).value = data[parseInt(value)]['accounts'][i]["mail"] ;
|
||||
document.getElementById("pwd"+ i).value = data[parseInt(value)]['accounts'][i]["pwd"] ;
|
||||
document.getElementById("2fa"+ i).value = data[parseInt(value)]['accounts'][i]["2fa"] ;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
{% endif %}
|
||||
{% endblock %}
|
25
Flask/templates/base.html
Normal file
25
Flask/templates/base.html
Normal file
@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<meta charset="utf-8">
|
||||
<link rel="icon" type="image/png" href="{{ url_for('static', filename='favicon.ico') }}">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>MS Rewards</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/flask.css') }}" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="left-pannel">
|
||||
{% block left_pannel %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
<div class="content">
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
94
Flask/templates/database.html
Normal file
94
Flask/templates/database.html
Normal file
@ -0,0 +1,94 @@
|
||||
{% extends "base.html" %}
|
||||
{% block left_pannel %}
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/override';">override</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/accounts';">accounts</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/discord';">discord</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="selected" onclick="location.href = '/database';">database</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/proxy';">proxy</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/settings';">settings</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
{% block content %}
|
||||
|
||||
{%if not current_user.is_authenticated %}
|
||||
<button class="unselected" onclick="location.href = '/login';">login</button>
|
||||
{% else %}
|
||||
<form method="post" action="/database/">
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td class="comlumn-name"></td>
|
||||
<td><input type="checkbox" id="switch" name="switch" {{data['checked']}} /><label for="switch">Toggle</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="comlumn-name">address : </td>
|
||||
<td><input type="text" name="address" value="{{ data['host']}}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="comlumn-name">table : </td>
|
||||
<td><input type="text" name="table" value="{{ data['table']}}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="comlumn-name">user : </td>
|
||||
<td><input type="text" name="user" value="{{ data['usr']}}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="comlumn-name">password : </td>
|
||||
<td><input type="text" name="password" value="{{ data['pwd']}}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><input type="submit" name="data" value="Update !" class="button"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
<script>
|
||||
function changecat(value) {
|
||||
if (value == "new"){
|
||||
document.getElementById("address").value = value;
|
||||
document.getElementById("port").value = value;
|
||||
document.getElementById("name").value = value;
|
||||
}
|
||||
else {
|
||||
document.getElementById("address").value = value;
|
||||
document.getElementById("port").value = value;
|
||||
document.getElementById("name").value = value;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{% endif %}
|
||||
{% endblock %}
|
97
Flask/templates/dev.html
Normal file
97
Flask/templates/dev.html
Normal file
@ -0,0 +1,97 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block left_pannel %}
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = 'override';">override</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = 'accounts';">accounts</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = 'discord';">discord</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = 'database';">database</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = 'proxy';">proxy</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = 'settings';">settings</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
{%if not current_user.is_authenticated %}
|
||||
<button class="unselected" onclick="location.href = '/login';">login</button>
|
||||
{% else %}
|
||||
<form method="post" action="/">
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<select name="select" onchange="changecat(this.value)">
|
||||
<option>AAAAA</option>
|
||||
<option>BBBBB</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="comlumn-name">name : </td>
|
||||
<td><input type="text" id="name" name="name" value="default-data"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="comlumn-name">address : </td>
|
||||
<td><input type="text" name="address" id="address" value="default-data"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="comlumn-name">port : </td>
|
||||
<td><input type="text" id="port" name="port" value="default-data"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><input type="submit" name="data" value="Update !" class="button"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
<script>
|
||||
function changecat(value) {
|
||||
if (value == "new"){
|
||||
document.getElementById("address").value = value;
|
||||
document.getElementById("port").value = value;
|
||||
document.getElementById("name").value = value;
|
||||
}
|
||||
else {
|
||||
document.getElementById("address").value = value;
|
||||
document.getElementById("port").value = value;
|
||||
document.getElementById("name").value = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
{% endif %}
|
||||
{% endblock %}
|
109
Flask/templates/discord.html
Normal file
109
Flask/templates/discord.html
Normal file
@ -0,0 +1,109 @@
|
||||
{% extends "base.html" %}
|
||||
{% block left_pannel %}
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/override';">override</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/accounts';">accounts</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="selected" onclick="location.href = '/discord';">discord</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/database';">database</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/proxy';">proxy</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/settings';">settings</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
|
||||
{%if not current_user.is_authenticated %}
|
||||
<button class="unselected" onclick="location.href = '/login';">login</button>
|
||||
{% else %}
|
||||
<form method="post" action="/discord/">
|
||||
<table>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<select name="select" onchange="changecat(this.value)">
|
||||
<option selected id="new" value="{{ len }}">Create new Discord config</option>
|
||||
{% for i in data %}
|
||||
<option id="{{data[i]['name']}}" value="{{i}}">{{data[i]['name']}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="comlumn-name">name</td>
|
||||
<td><input type="text" id="name" name="name" value=""></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="comlumn-name">Send errors</td>
|
||||
<td><input type="checkbox" id="errorsT" name="errorsT" /><label for="errorsT">Toggle</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="comlumn-name">Send success</td>
|
||||
<td><input type="checkbox" id="successT" name="successT" /><label for="successT">Toggle</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="comlumn-name">Success link</td>
|
||||
<td><input type="text" id="successL" name="successL" value=""></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="comlumn-name">Failure Link</td>
|
||||
<td><input type="text" id="errorsL" name="errorsL" value=""></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><input type="submit" name="DISCORD" id="submit" value="Create !" class="button"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
<script>
|
||||
function changecat(value) {
|
||||
data = JSON.parse('{{data|tojson}}'); //convertit le dictionnaire data en JSON
|
||||
|
||||
if (value == "{{len}}"){
|
||||
document.getElementById("name").value = "";
|
||||
document.getElementById("submit").value = "Create !";
|
||||
document.getElementById("successT").checked = false;
|
||||
document.getElementById("errorsT").checked = false;
|
||||
document.getElementById("successL").value = "";
|
||||
document.getElementById("errorsL").value = "";
|
||||
}
|
||||
else {
|
||||
console.log(data[parseInt(value)]["successL"]);
|
||||
document.getElementById("submit").value = "Update";
|
||||
document.getElementById("successT").checked = data[parseInt(value)]["successT"] == "True";
|
||||
document.getElementById("errorsT").checked = data[parseInt(value)]["errorsT"] == "True";
|
||||
document.getElementById("successL").value = data[parseInt(value)]["successL"];
|
||||
document.getElementById("errorsL").value = data[parseInt(value)]["errorsL"];
|
||||
document.getElementById("name").value = data[parseInt(value)]["name"];
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
{% endif %}
|
||||
{% endblock %}
|
57
Flask/templates/login.html
Normal file
57
Flask/templates/login.html
Normal file
@ -0,0 +1,57 @@
|
||||
{% extends "base.html" %}
|
||||
{% block left_pannel %}
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/override';">override</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/accounts';">accounts</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/discord';">discord</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/database';">database</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/proxy';">proxy</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/settings';">settings</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
|
||||
{%if not current_user.is_authenticated %}
|
||||
<form method="post" action="/login/">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="comlumn-name">password</td>
|
||||
<td><input type="text" name="password"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><input type="submit" name="DISCORD" value="send" class="button"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
|
||||
{% else %}
|
||||
<h1>Already logged in</h1>
|
||||
{% endif %}
|
||||
{% endblock %}
|
53
Flask/templates/override.html
Normal file
53
Flask/templates/override.html
Normal file
@ -0,0 +1,53 @@
|
||||
{% extends "base.html" %}
|
||||
{% block left_pannel %}
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="selected" onclick="location.href = '/override';">override</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/accounts';">accounts</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/discord';">discord</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/database';">database</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/proxy';">proxy</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/settings';">settings</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{%if not current_user.is_authenticated %}
|
||||
<button class="unselected" onclick="location.href = '/login';">login</button>
|
||||
|
||||
|
||||
{% else %}
|
||||
|
||||
|
||||
<h1>Not Implemented, watch terminal</h1>
|
||||
<form method="post" action="/override/">
|
||||
<input type="submit" name="data" value="Run bot" class="button"/>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
{%endblock %}
|
104
Flask/templates/proxy.html
Normal file
104
Flask/templates/proxy.html
Normal file
@ -0,0 +1,104 @@
|
||||
{% extends "base.html" %}
|
||||
{% block left_pannel %}
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/override';">override</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/accounts';">accounts</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/discord';">discord</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/database';">database</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="selected" onclick="location.href = '/proxy';">proxy</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/settings';">settings</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
{% block content %}
|
||||
|
||||
{%if not current_user.is_authenticated %}
|
||||
<button class="unselected" onclick="location.href = '/login';">login</button>
|
||||
{% else %}
|
||||
<form method="post" action="/proxy/">
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td class="comlumn-name"></td>
|
||||
<td>
|
||||
<select name="select" onchange="changecat(this.value)">
|
||||
<option selected id="new" value="{{ len }}">Create new proxy</option>
|
||||
{% for i in data %}
|
||||
<option id="{{data[i]['name']}}" value="{{i}}">{{data[i]['name']}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="comlumn-name">name : </td>
|
||||
<td><input type="text" name="name" value="" id="name"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="comlumn-name">address : </td>
|
||||
<td><input type="text" name="address" value="" id="address"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="comlumn-name">port : </td>
|
||||
<td><input type="text" name="port" value="" id="port"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><input type="submit" name="data" id="submit" value="Create" class="button"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
<script>
|
||||
function changecat(value) {
|
||||
data = JSON.parse('{{data|tojson}}'); //convertit le dictionnaire data en JSON
|
||||
if (value == "{{len}}"){
|
||||
document.getElementById("submit").value = "Create";
|
||||
document.getElementById("address").value = "";
|
||||
document.getElementById("port").value = "";
|
||||
document.getElementById("name").value = "";
|
||||
}
|
||||
else {
|
||||
document.getElementById("submit").value = "Update";
|
||||
document.getElementById("address").value = data[parseInt(value)]["address"];
|
||||
document.getElementById("port").value = data[parseInt(value)]["port"];
|
||||
document.getElementById("name").value = data[parseInt(value)]["name"];
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
58
Flask/templates/settings.html
Normal file
58
Flask/templates/settings.html
Normal file
@ -0,0 +1,58 @@
|
||||
{% extends "base.html" %}
|
||||
{% block left_pannel %}
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/override';">override</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/accounts';">accounts</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/discord';">discord</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/database';">database</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="unselected" onclick="location.href = '/proxy';">proxy</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<button class="selected" onclick="location.href = '/settings';">settings</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{%if not current_user.is_authenticated %}
|
||||
<button class="unselected" onclick="location.href = '/login';">login</button>
|
||||
{% else %}
|
||||
<form method="post" action="/settings/">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="comlumn-name">avatar url :</td>
|
||||
<td><input type="text" name="avatarlink" value="{{data['avatarlink']}}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<input type="submit" name="settings" id="submit" value="update" class="button"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
{% endif %}
|
||||
{%endblock %}
|
||||
|
Reference in New Issue
Block a user