[IMP] script todo: regrouper les opérations SSH dans un sous-menu Deploy
Le menu Deploy listait 11 entrées « SSH - … » à plat, ce qui le surchargeait. Elles sont déplacées dans un sous-menu « SSH (hôte distant)… » (prompt_execute_deploy_ssh), comme le sous-menu QEMU. Le menu Deploy tient désormais en 5 entrées : ── Local ── [1] Cloner ERPLibre localement [2] Configurer sshfs ── Distant & services ── [3] SSH (hôte distant)… -> sous-menu (11 opérations SSH) [4] NTFY [5] QEMU/KVM… Le fil d'Ariane affiche « TODO › Execute › Deploy › SSH » dans le sous-menu. Les libellés et actions SSH sont inchangés (traductions réutilisées). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
5a408f1061
commit
4688e7c606
2 changed files with 65 additions and 35 deletions
|
|
@ -547,6 +547,7 @@ class TODO:
|
|||
"prompt_execute_rtk": "RTK",
|
||||
"prompt_execute_update": "Update",
|
||||
"prompt_execute_deploy": "Deploy",
|
||||
"prompt_execute_deploy_ssh": "SSH",
|
||||
"prompt_execute_qemu": "QEMU/KVM",
|
||||
}
|
||||
|
||||
|
|
@ -716,19 +717,8 @@ class TODO:
|
|||
{"section": t("Local")},
|
||||
{"prompt_description": t("Clone ERPLibre locally (git clone)")},
|
||||
{"prompt_description": t("Configure sshfs")},
|
||||
{"section": t("SSH (remote host)")},
|
||||
{"prompt_description": t("SSH - Check connection")},
|
||||
{"prompt_description": t("SSH - Sync files (rsync)")},
|
||||
{"prompt_description": t("SSH - Install ERPLibre")},
|
||||
{"prompt_description": t("SSH - Start Odoo")},
|
||||
{"prompt_description": t("SSH - Stop Odoo")},
|
||||
{"prompt_description": t("SSH - Restart Odoo")},
|
||||
{"prompt_description": t("SSH - Service status")},
|
||||
{"prompt_description": t("SSH - View logs")},
|
||||
{"prompt_description": t("SSH - Run make target")},
|
||||
{"prompt_description": t("SSH - Install systemd service")},
|
||||
{"prompt_description": t("SSH - Configure nginx + SSL")},
|
||||
{"section": t("Virtualization & notifications")},
|
||||
{"section": t("Remote & services")},
|
||||
{"prompt_description": t("SSH (remote host)...")},
|
||||
{
|
||||
"prompt_description": t(
|
||||
"Deploy - Install NTFY notification server"
|
||||
|
|
@ -752,34 +742,62 @@ class TODO:
|
|||
elif status == "2":
|
||||
self._configure_sshfs()
|
||||
elif status == "3":
|
||||
self._deploy_ssh_check()
|
||||
self.prompt_execute_deploy_ssh()
|
||||
elif status == "4":
|
||||
self._deploy_ssh_push()
|
||||
elif status == "5":
|
||||
self._deploy_ssh_install()
|
||||
elif status == "6":
|
||||
self._deploy_ssh_run()
|
||||
elif status == "7":
|
||||
self._deploy_ssh_stop()
|
||||
elif status == "8":
|
||||
self._deploy_ssh_restart()
|
||||
elif status == "9":
|
||||
self._deploy_ssh_status()
|
||||
elif status == "10":
|
||||
self._deploy_ssh_logs()
|
||||
elif status == "11":
|
||||
self._deploy_ssh_make()
|
||||
elif status == "12":
|
||||
self._deploy_ssh_install_systemd()
|
||||
elif status == "13":
|
||||
self._deploy_ssh_install_nginx()
|
||||
elif status == "14":
|
||||
self._deploy_ntfy_server()
|
||||
elif status == "15":
|
||||
elif status == "5":
|
||||
self.prompt_execute_qemu()
|
||||
else:
|
||||
print(t("Command not found !"))
|
||||
|
||||
def prompt_execute_deploy_ssh(self):
|
||||
"""Sous-menu : opérations de déploiement sur un hôte distant via SSH."""
|
||||
print(f"🤖 {t('Deploy ERPLibre to a remote host over SSH!')}")
|
||||
choices = [
|
||||
{"prompt_description": t("SSH - Check connection")},
|
||||
{"prompt_description": t("SSH - Sync files (rsync)")},
|
||||
{"prompt_description": t("SSH - Install ERPLibre")},
|
||||
{"prompt_description": t("SSH - Start Odoo")},
|
||||
{"prompt_description": t("SSH - Stop Odoo")},
|
||||
{"prompt_description": t("SSH - Restart Odoo")},
|
||||
{"prompt_description": t("SSH - Service status")},
|
||||
{"prompt_description": t("SSH - View logs")},
|
||||
{"prompt_description": t("SSH - Run make target")},
|
||||
{"prompt_description": t("SSH - Install systemd service")},
|
||||
{"prompt_description": t("SSH - Configure nginx + SSL")},
|
||||
]
|
||||
help_info = self.fill_help_info(choices)
|
||||
|
||||
while True:
|
||||
status = click.prompt(help_info)
|
||||
print()
|
||||
if status == "0":
|
||||
return False
|
||||
elif status == "1":
|
||||
self._deploy_ssh_check()
|
||||
elif status == "2":
|
||||
self._deploy_ssh_push()
|
||||
elif status == "3":
|
||||
self._deploy_ssh_install()
|
||||
elif status == "4":
|
||||
self._deploy_ssh_run()
|
||||
elif status == "5":
|
||||
self._deploy_ssh_stop()
|
||||
elif status == "6":
|
||||
self._deploy_ssh_restart()
|
||||
elif status == "7":
|
||||
self._deploy_ssh_status()
|
||||
elif status == "8":
|
||||
self._deploy_ssh_logs()
|
||||
elif status == "9":
|
||||
self._deploy_ssh_make()
|
||||
elif status == "10":
|
||||
self._deploy_ssh_install_systemd()
|
||||
elif status == "11":
|
||||
self._deploy_ssh_install_nginx()
|
||||
else:
|
||||
print(t("Command not found !"))
|
||||
|
||||
# ------------------------------------------------------------------ #
|
||||
# QEMU / KVM (libvirt) VM deployment
|
||||
# ------------------------------------------------------------------ #
|
||||
|
|
|
|||
|
|
@ -149,6 +149,18 @@ TRANSLATIONS = {
|
|||
"fr": "SSH (hôte distant)",
|
||||
"en": "SSH (remote host)",
|
||||
},
|
||||
"Remote & services": {
|
||||
"fr": "Distant & services",
|
||||
"en": "Remote & services",
|
||||
},
|
||||
"SSH (remote host)...": {
|
||||
"fr": "SSH (hôte distant)…",
|
||||
"en": "SSH (remote host)...",
|
||||
},
|
||||
"Deploy ERPLibre to a remote host over SSH!": {
|
||||
"fr": "Déployer ERPLibre sur un hôte distant via SSH !",
|
||||
"en": "Deploy ERPLibre to a remote host over SSH!",
|
||||
},
|
||||
"Virtualization & notifications": {
|
||||
"fr": "Virtualisation & notifications",
|
||||
"en": "Virtualization & notifications",
|
||||
|
|
|
|||
Loading…
Reference in a new issue