diff --git a/webapp/app.py b/webapp/app.py index 1c46bcf..b2b10ed 100644 --- a/webapp/app.py +++ b/webapp/app.py @@ -1026,6 +1026,8 @@ def startnet_editor(): boot_menu=boot_menu, lint=lint, snapshots=snapshots, + shopfloor_items=read_shopfloor_menu(), + shopfloor_available=available_pctypes(), image_types=config.IMAGE_TYPES, friendly_names=config.FRIENDLY_NAMES, ) @@ -1225,7 +1227,7 @@ def shopfloor_menu(): items = json.loads(request.form.get("items", "[]")) except json.JSONDecodeError: flash("Invalid menu payload.", "danger") - return redirect(url_for("shopfloor_menu")) + return redirect(url_for("startnet_editor") + "#tab-shopfloor") valid = set(available_pctypes()) clean = [] for it in items: @@ -1246,7 +1248,7 @@ def shopfloor_menu(): }) if not clean: flash("Refused to save an empty menu.", "danger") - return redirect(url_for("shopfloor_menu")) + return redirect(url_for("startnet_editor") + "#tab-shopfloor") try: os.makedirs(SHOPFLOOR_SETUP_DIR, exist_ok=True) with open(SHOPFLOOR_MENU_JSON, "w") as fh: @@ -1255,15 +1257,9 @@ def shopfloor_menu(): flash("Shopfloor boot menu saved - WinPE reads it at next boot.", "success") except OSError as exc: flash(f"Could not write menu.json: {exc}", "danger") - return redirect(url_for("shopfloor_menu")) + return redirect(url_for("startnet_editor") + "#tab-shopfloor") - return render_template( - "shopfloor_menu.html", - items=read_shopfloor_menu(), - available=available_pctypes(), - image_types=config.IMAGE_TYPES, - friendly_names=config.FRIENDLY_NAMES, - ) + return redirect(url_for("startnet_editor") + "#tab-shopfloor") # --------------------------------------------------------------------------- diff --git a/webapp/templates/base.html b/webapp/templates/base.html index 3cfb0ed..f5dc74e 100644 --- a/webapp/templates/base.html +++ b/webapp/templates/base.html @@ -58,15 +58,9 @@