fix: sequential menu numbers
This commit is contained in:
parent
1748371b34
commit
95e66f21c8
1 changed files with 12 additions and 13 deletions
|
|
@ -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")), "",
|
||||
|
|
|
|||
Loading…
Reference in a new issue