some more ui work
This commit is contained in:
@@ -2,6 +2,7 @@ from applets.disks import bp
|
||||
from flask import Flask, request, session, redirect, \
|
||||
url_for, render_template, flash, Blueprint
|
||||
import dmm.lsblk as lsblk
|
||||
from flask import current_app
|
||||
|
||||
@bp.route('/disks')
|
||||
def disks():
|
||||
@@ -10,7 +11,23 @@ def disks():
|
||||
"""
|
||||
blockdevs = lsblk.list_block_devices()
|
||||
print(lsblk.list_block_devices())
|
||||
return render_template('disks.html', blockdevs=blockdevs)
|
||||
menu = current_app.config['CONFIG']['settings']['menu_order'].split(" ")
|
||||
next_step_url = menu[menu.index("disks")+1]
|
||||
if menu[menu.index("disks")] == 1:
|
||||
previous_step_url = False
|
||||
else:
|
||||
previous_step_url = menu[menu.index("disks")-1]
|
||||
|
||||
add_disks_button = ' <button class="button iis-info"> <img src="/static/icons/tab-new-symbolic.svg"> Add Disk or Filesystem </button>'
|
||||
add_swap_button = ' <button class="button iis-info"> <img src="/static/icons/tab-new-symbolic.svg"> Swap Configuration </button>'
|
||||
bottom_menu = add_disks_button + add_swap_button
|
||||
|
||||
return render_template('disks.html', blockdevs=blockdevs,
|
||||
menu=current_app.config['CONFIG']['settings']['menu'],
|
||||
menu_order=current_app.config['CONFIG']['settings']['menu_order'].split(),
|
||||
previous_step = previous_step_url,
|
||||
next_step = next_step_url,
|
||||
bottom_menu = bottom_menu)
|
||||
|
||||
|
||||
@bp.route('/disks/partition/<part>')
|
||||
@@ -18,6 +35,16 @@ def disks_partition(part):
|
||||
"""
|
||||
Partition modal for the webui partition screen.
|
||||
"""
|
||||
return render_template('disks_partition.html')
|
||||
return render_template('disks_partition.html',
|
||||
menu=current_app.config['CONFIG']['settings']['menu'])
|
||||
|
||||
|
||||
def build_menu():
|
||||
"""
|
||||
Define menu items and paths.
|
||||
"""
|
||||
# proper one once translations are done:
|
||||
#current_app.config['CONFIG']['settings']['menu']['welcome'] = (build_stringlist()['menu_item'], "/welcome", 10)
|
||||
current_app.config['CONFIG']['settings']['menu']['disks'] = ("Disks", "/disks", 30)
|
||||
|
||||
build_menu()
|
||||
|
||||
Reference in New Issue
Block a user