From 95e66f21c8d61b7d5415517726dd82bc1c0f67a2 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 3 Aug 2026 15:37:04 +0000 Subject: [PATCH] fix: sequential menu numbers --- sources/python/main.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/sources/python/main.py b/sources/python/main.py index 7e5d714..c116f52 100644 --- a/sources/python/main.py +++ b/sources/python/main.py @@ -139,25 +139,24 @@ def main(): while True: undeployed = [k for k in cfg if k not in deployed] - print("─── Menu ───") - if undeployed: - print(f" Pending: {', '.join(undeployed)}") - print(" [1] Deploy all pending") - else: - print(" No nodes pending deployment.") - print(" [2] Add a new node") - if deployed: - print(" [3] Show status") - print(" [4] Remove a node") - print(" [5] Remote tunnel") - print(" [q] Quit") + opts = [] + if undeployed: opts.append(("Deploy pending", '1')) + opts.append(("Add a new node", '2')) + if deployed: opts.append(("Show status", '3')) + if deployed: opts.append(("Remove a node", '4')) + opts.append(("Remote tunnel", '5')) + opts.append(("Quit", 'q')) + + print("\n─── Menu ───") + if undeployed: print(f" Pending: {', '.join(undeployed)}") + for label, key in opts: + print(f" [{key}] {label}") c = input("\nChoice: ").strip() if c == "1" and undeployed: for name in undeployed: nc = cfg[name] - print(f"\nDeploying {name}...") deploy_container(name, nc["token"], nc.get("cloud","EU"), str(nc.get("port","8081")), nc.get("upstream_ip",""), str(nc.get("upstream_port","80")), "",