mirror of
https://github.com/ComputerScienceHouse/proxstar.git
synced 2025-03-09 15:40:09 +00:00
add settings page, add way to add/remove ignored pools
This commit is contained in:
parent
ecd7809749
commit
5fb7f66624
5 changed files with 126 additions and 0 deletions
|
|
@ -355,6 +355,37 @@ def delete_user(user):
|
|||
return '', 403
|
||||
|
||||
|
||||
@app.route("/settings")
|
||||
@auth.oidc_auth
|
||||
def settings():
|
||||
user = session['userinfo']['preferred_username']
|
||||
rtp = 'rtp' in session['userinfo']['groups']
|
||||
active = 'active' in session['userinfo']['groups']
|
||||
if rtp:
|
||||
ignored_pools = get_ignored_pools(db)
|
||||
return render_template(
|
||||
'settings.html',
|
||||
username=user,
|
||||
rtp=rtp,
|
||||
active=active,
|
||||
ignored_pools=ignored_pools)
|
||||
else:
|
||||
return '', 403
|
||||
|
||||
|
||||
@app.route("/pool/<string:pool>/ignore", methods=['POST', 'DELETE'])
|
||||
@auth.oidc_auth
|
||||
def ignored_pools(pool):
|
||||
if 'rtp' in session['userinfo']['groups']:
|
||||
if request.method == 'POST':
|
||||
add_ignored_pool(db, pool)
|
||||
elif request.method == "DELETE":
|
||||
delete_ignored_pool(db, pool)
|
||||
return '', 200
|
||||
else:
|
||||
return '', 403
|
||||
|
||||
|
||||
@app.route('/vm/<string:vmid>/rrd/<path:path>')
|
||||
@auth.oidc_auth
|
||||
def send_rrd(vmid, path):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue