[IMP] script todo: group the Deploy menu into sections (SSH, ...)
fill_help_info() now renders {"section": "..."} entries as a header line
without consuming a number, so numbering stays continuous over the real
commands (the hardcoded elif chains keep matching). The Deploy menu is
split into "Local", "SSH (remote host)" and "Virtualization &
notifications", making the long SSH block easy to scan.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ef78b9d315
commit
2020e15b5e
2 changed files with 26 additions and 2 deletions
|
|
@ -555,15 +555,24 @@ class TODO:
|
||||||
return header + t("Command:")
|
return header + t("Command:")
|
||||||
|
|
||||||
def fill_help_info(self, choices):
|
def fill_help_info(self, choices):
|
||||||
|
# Une entrée {"section": "..."} affiche un titre de section SANS
|
||||||
|
# consommer de numéro : la numérotation reste continue sur les vraies
|
||||||
|
# commandes (compatible avec les elif codés en dur des menus).
|
||||||
help_info = self._menu_header() + "\n"
|
help_info = self._menu_header() + "\n"
|
||||||
help_end = f"[0] {t('Back')}\n"
|
help_end = f"[0] {t('Back')}\n"
|
||||||
for i, instance in enumerate(choices):
|
n = 0
|
||||||
|
for instance in choices:
|
||||||
|
section = instance.get("section")
|
||||||
|
if section:
|
||||||
|
help_info += f"\n── {section} ──\n"
|
||||||
|
continue
|
||||||
|
n += 1
|
||||||
desc_key = instance.get("prompt_description_key")
|
desc_key = instance.get("prompt_description_key")
|
||||||
if desc_key:
|
if desc_key:
|
||||||
desc = t(desc_key)
|
desc = t(desc_key)
|
||||||
else:
|
else:
|
||||||
desc = instance["prompt_description"]
|
desc = instance["prompt_description"]
|
||||||
help_info += f"[{i + 1}] " + desc + "\n"
|
help_info += f"[{n}] " + desc + "\n"
|
||||||
help_info += help_end
|
help_info += help_end
|
||||||
return help_info
|
return help_info
|
||||||
|
|
||||||
|
|
@ -692,8 +701,10 @@ class TODO:
|
||||||
def prompt_execute_deploy(self):
|
def prompt_execute_deploy(self):
|
||||||
print(f"🤖 {t('Deploy ERPLibre to a local directory!')}")
|
print(f"🤖 {t('Deploy ERPLibre to a local directory!')}")
|
||||||
choices = [
|
choices = [
|
||||||
|
{"section": t("Local")},
|
||||||
{"prompt_description": t("Clone ERPLibre locally (git clone)")},
|
{"prompt_description": t("Clone ERPLibre locally (git clone)")},
|
||||||
{"prompt_description": t("Configure sshfs")},
|
{"prompt_description": t("Configure sshfs")},
|
||||||
|
{"section": t("SSH (remote host)")},
|
||||||
{"prompt_description": t("SSH - Check connection")},
|
{"prompt_description": t("SSH - Check connection")},
|
||||||
{"prompt_description": t("SSH - Sync files (rsync)")},
|
{"prompt_description": t("SSH - Sync files (rsync)")},
|
||||||
{"prompt_description": t("SSH - Install ERPLibre")},
|
{"prompt_description": t("SSH - Install ERPLibre")},
|
||||||
|
|
@ -705,6 +716,7 @@ class TODO:
|
||||||
{"prompt_description": t("SSH - Run make target")},
|
{"prompt_description": t("SSH - Run make target")},
|
||||||
{"prompt_description": t("SSH - Install systemd service")},
|
{"prompt_description": t("SSH - Install systemd service")},
|
||||||
{"prompt_description": t("SSH - Configure nginx + SSL")},
|
{"prompt_description": t("SSH - Configure nginx + SSL")},
|
||||||
|
{"section": t("Virtualization & notifications")},
|
||||||
{
|
{
|
||||||
"prompt_description": t(
|
"prompt_description": t(
|
||||||
"Deploy - Install NTFY notification server"
|
"Deploy - Install NTFY notification server"
|
||||||
|
|
|
||||||
|
|
@ -141,6 +141,18 @@ TRANSLATIONS = {
|
||||||
"fr": "Configurer sshfs",
|
"fr": "Configurer sshfs",
|
||||||
"en": "Configure sshfs",
|
"en": "Configure sshfs",
|
||||||
},
|
},
|
||||||
|
"Local": {
|
||||||
|
"fr": "Local",
|
||||||
|
"en": "Local",
|
||||||
|
},
|
||||||
|
"SSH (remote host)": {
|
||||||
|
"fr": "SSH (hôte distant)",
|
||||||
|
"en": "SSH (remote host)",
|
||||||
|
},
|
||||||
|
"Virtualization & notifications": {
|
||||||
|
"fr": "Virtualisation & notifications",
|
||||||
|
"en": "Virtualization & notifications",
|
||||||
|
},
|
||||||
"SSH address input method": {
|
"SSH address input method": {
|
||||||
"fr": "Méthode de saisie de l'adresse SSH",
|
"fr": "Méthode de saisie de l'adresse SSH",
|
||||||
"en": "SSH address input method",
|
"en": "SSH address input method",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue