shopfloor menu: data-driven from menu.json (picker + webapp editor)
Replace the hardcoded GEA Shopfloor PC-type sub-menu with a data-driven one:
- menu.json on the enrollment share lists the shopfloor items {key=PCTYPE, label, hint, enabled}; key must match a shopfloor-setup/gea-shopfloor-* handler dir.
- select-shopfloor-type.ps1 renders it in WinPE and writes the chosen PCTYPE (mirrors the CMM bay picker); startnet.cmd runs it and falls back to the baked-in menu if the share/picker is unavailable.
- Webapp /shopfloor-menu editor: reorder/rename/hide/add items; the PC-type is a dropdown of existing handler dirs (can't wire a choice to a non-existent type); writes menu.json. Nav link under Tools.
Kills the duplicated-knowledge problem (menu list was hardcoded in startnet AND the handler dirs AND site-config); add a PC-type = drop in the handler dir + it appears in the menu.
This commit is contained in:
@@ -54,6 +54,19 @@ goto enroll_staged
|
||||
|
||||
:gea_shopfloor_submenu
|
||||
cls
|
||||
set PCTYPE=
|
||||
REM Data-driven PC-type menu: the PXE webapp maintains menu.json on the
|
||||
REM enrollment share; select-shopfloor-type.ps1 renders it and writes the
|
||||
REM chosen PCTYPE to X:\pctype.txt. Falls back to the baked-in menu below if
|
||||
REM the share or the picker is unavailable (mirrors the CMM bay picker).
|
||||
net use Y: \\172.16.9.1\enrollment /user:pxe-upload pxe /persistent:no >NUL 2>NUL
|
||||
del X:\pctype.txt 2>NUL
|
||||
if exist "Y:\shopfloor-setup\select-shopfloor-type.ps1" powershell.exe -NoProfile -ExecutionPolicy Bypass -File "Y:\shopfloor-setup\select-shopfloor-type.ps1" -MenuJson "Y:\shopfloor-setup\menu.json" -OutFile "X:\pctype.txt"
|
||||
if exist X:\pctype.txt set /p PCTYPE=<X:\pctype.txt
|
||||
if not "%PCTYPE%"=="" goto gea_shopfloor_have_type
|
||||
|
||||
:gea_shopfloor_submenu_fallback
|
||||
cls
|
||||
echo.
|
||||
echo ========================================
|
||||
echo GEA Shopfloor PC Sub-Type
|
||||
@@ -70,7 +83,6 @@ echo 8. Wax and Trace
|
||||
echo 9. Display (kiosk dashboard)
|
||||
echo 10. Part Marker (eDNC + Telesis Mark)
|
||||
echo.
|
||||
set PCTYPE=
|
||||
set /p ges_choice=Enter your choice (1-10):
|
||||
if "%ges_choice%"=="1" set PCTYPE=gea-shopfloor-collections
|
||||
if "%ges_choice%"=="2" set PCTYPE=gea-shopfloor-nocollections
|
||||
@@ -82,7 +94,9 @@ if "%ges_choice%"=="7" set PCTYPE=gea-shopfloor-heattreat
|
||||
if "%ges_choice%"=="8" set PCTYPE=gea-shopfloor-waxtrace
|
||||
if "%ges_choice%"=="9" set PCTYPE=gea-shopfloor-display
|
||||
if "%ges_choice%"=="10" set PCTYPE=gea-shopfloor-partmarker
|
||||
if "%PCTYPE%"=="" goto gea_shopfloor_submenu
|
||||
if "%PCTYPE%"=="" goto gea_shopfloor_submenu_fallback
|
||||
|
||||
:gea_shopfloor_have_type
|
||||
if "%PCTYPE%"=="gea-shopfloor-display" goto display_submenu
|
||||
if "%PCTYPE%"=="gea-shopfloor-keyence" goto keyence_submenu
|
||||
if "%PCTYPE%"=="gea-shopfloor-cmm" goto cmm_submenu
|
||||
|
||||
Reference in New Issue
Block a user