mirror of
https://github.com/ComputerScienceHouse/proxstar.git
synced 2025-03-09 15:40:09 +00:00
Black Linting
This commit is contained in:
parent
dff517d822
commit
0665cae5c4
2 changed files with 15 additions and 4 deletions
|
@ -46,7 +46,7 @@ from proxstar.db import (
|
||||||
set_template_info,
|
set_template_info,
|
||||||
add_shared_pool,
|
add_shared_pool,
|
||||||
get_shared_pool,
|
get_shared_pool,
|
||||||
get_shared_pools
|
get_shared_pools,
|
||||||
)
|
)
|
||||||
from proxstar.vnc import (
|
from proxstar.vnc import (
|
||||||
add_vnc_target,
|
add_vnc_target,
|
||||||
|
@ -228,8 +228,17 @@ def list_pools():
|
||||||
user.rtp = False
|
user.rtp = False
|
||||||
proxmox = connect_proxmox()
|
proxmox = connect_proxmox()
|
||||||
user_pools = get_pool_cache(db) if user.rtp else []
|
user_pools = get_pool_cache(db) if user.rtp else []
|
||||||
shared_pools = map(lambda pool: {"name": pool.name, "members": pool.members, "vms": proxmox.pools(pool.name).get()['members']}, get_shared_pools(db, user.name, user.rtp))
|
shared_pools = map(
|
||||||
return render_template('list_pools.html', user=user, user_pools=user_pools, shared_pools=shared_pools)
|
lambda pool: {
|
||||||
|
"name": pool.name,
|
||||||
|
"members": pool.members,
|
||||||
|
"vms": proxmox.pools(pool.name).get()['members'],
|
||||||
|
},
|
||||||
|
get_shared_pools(db, user.name, user.rtp),
|
||||||
|
)
|
||||||
|
return render_template(
|
||||||
|
'list_pools.html', user=user, user_pools=user_pools, shared_pools=shared_pools
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.route('/isos')
|
@app.route('/isos')
|
||||||
|
@ -607,12 +616,13 @@ def ignored_pools(pool):
|
||||||
else:
|
else:
|
||||||
return '', 403
|
return '', 403
|
||||||
|
|
||||||
|
|
||||||
@app.route('/pool/shared/create', methods=['GET', 'POST'])
|
@app.route('/pool/shared/create', methods=['GET', 'POST'])
|
||||||
@auth.oidc_auth
|
@auth.oidc_auth
|
||||||
def create_shared_pool():
|
def create_shared_pool():
|
||||||
user = User(session['userinfo']['preferred_username'])
|
user = User(session['userinfo']['preferred_username'])
|
||||||
if request.method == 'GET':
|
if request.method == 'GET':
|
||||||
return render_template('create_pool.html',user=user)
|
return render_template('create_pool.html', user=user)
|
||||||
elif request.method == 'POST':
|
elif request.method == 'POST':
|
||||||
name = request.form['name']
|
name = request.form['name']
|
||||||
members = request.form['members'].split(';')
|
members = request.form['members'].split(';')
|
||||||
|
|
|
@ -55,6 +55,7 @@ class Allowed_Users(Base):
|
||||||
__tablename__ = 'allowed_users'
|
__tablename__ = 'allowed_users'
|
||||||
id = Column(String(32), primary_key=True)
|
id = Column(String(32), primary_key=True)
|
||||||
|
|
||||||
|
|
||||||
@default_repr
|
@default_repr
|
||||||
class Shared_Pools(Base):
|
class Shared_Pools(Base):
|
||||||
__tablename__ = 'shared_pools'
|
__tablename__ = 'shared_pools'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue