fixed things, like auto adding account to database
This commit is contained in:
parent
820efd8126
commit
6efc77c512
@ -64,9 +64,7 @@
|
|||||||
<li>reorder config</li>
|
<li>reorder config</li>
|
||||||
<li>real override</li>
|
<li>real override</li>
|
||||||
<li>ban button</li>
|
<li>ban button</li>
|
||||||
<li>pourquoi tout ne se lance pas bien ? - </li>
|
<li>pourquoi tout ne se lance pas bien ?</li>
|
||||||
<li>avoir un afficheur de logs</li>
|
|
||||||
<li>permettre de changer le mot de passe</li>
|
|
||||||
<li>synchroniser le mot de passe de grafana et celui du bot</li>
|
<li>synchroniser le mot de passe de grafana et celui du bot</li>
|
||||||
</ul>
|
</ul>
|
||||||
<br><br>
|
<br><br>
|
||||||
@ -79,7 +77,7 @@
|
|||||||
<li><a href="/download/settings.json">download settings</a></li>
|
<li><a href="/download/settings.json">download settings</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<br>
|
<br><br>
|
||||||
<h2>Upload your files</h2>
|
<h2>Upload your files</h2>
|
||||||
<form method="POST" action="/upload_file/" enctype=multipart/form-data>
|
<form method="POST" action="/upload_file/" enctype=multipart/form-data>
|
||||||
<table id="table">
|
<table id="table">
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
sleep 30
|
sleep 30
|
||||||
curl -X "POST" "http://192.168.1.32:5555/grafana/api/datasources" \
|
curl -X "POST" "http://localhost:1234/grafana/api/datasources" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
--user admin:admin \
|
--user admin:admin \
|
||||||
--data-raw $'{"id":1,"uid":"bed26262-6b98-4dfc-a95d-f8bd39b5d09c","orgId":1,"name":"SQLite","type":"frser-sqlite-datasource","typeName":"SQLite","typeLogoUrl":"public/plugins/frser-sqlite-datasource/img/logo.svg","access":"proxy","url":"","user":"","database":"","basicAuth":false,"isDefault":true,"jsonData":{"attachLimit":0,"path":"/app/MsRewards-Reborn/MsRewards.db","pathPefix":"file:"},"readOnly":false}'
|
--data-raw $'{"id":1,"uid":"bed26262-6b98-4dfc-a95d-f8bd39b5d09c","orgId":1,"name":"SQLite","type":"frser-sqlite-datasource","typeName":"SQLite","typeLogoUrl":"public/plugins/frser-sqlite-datasource/img/logo.svg","access":"proxy","url":"","user":"","database":"","basicAuth":false,"isDefault":true,"jsonData":{"attachLimit":0,"path":"/app/MsRewards-Reborn/MsRewards.db","pathPefix":"file:"},"readOnly":false}'
|
||||||
|
|
||||||
curl 'http://192.168.1.32:5555/grafana/api/dashboards/import' \
|
curl 'http://localhost:1234/grafana/api/dashboards/import' \
|
||||||
-H 'content-type: application/json' \
|
-H 'content-type: application/json' \
|
||||||
-H 'x-grafana-org-id: 1' \
|
-H 'x-grafana-org-id: 1' \
|
||||||
--user admin:admin \
|
--user admin:admin \
|
||||||
|
@ -18,8 +18,14 @@ def update_row(compte, points, mycursor, mydb):
|
|||||||
|
|
||||||
# update the value of last_pts for the table comptes
|
# update the value of last_pts for the table comptes
|
||||||
def update_last(compte, points, mycursor, mydb):
|
def update_last(compte, points, mycursor, mydb):
|
||||||
sql = f"UPDATE comptes SET last_pts = {points} WHERE compte = '{compte}';"
|
sql1 = f"UPDATE comptes SET last_pts = {points} WHERE compte = '{compte}';"
|
||||||
mycursor.execute(sql)
|
sql2 = f"select * from comptes where nom = '{compte}'"
|
||||||
|
sql3 = "INSERT INTO comptes (compte, last_pts,banned) VALUES ('{compte}', {points}, 0)"
|
||||||
|
cmd = mycursor.execute(sql2)
|
||||||
|
if len(list(cmd)) == 0:
|
||||||
|
mycursor.execute(sql3)
|
||||||
|
else :
|
||||||
|
mycursor.execute(sql1)
|
||||||
mydb.commit()
|
mydb.commit()
|
||||||
#printf(mycursor.rowcount, "record(s) updated")
|
#printf(mycursor.rowcount, "record(s) updated")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user