From 3e1d1f5360574cc1afa41de6cee6d68be691a90b Mon Sep 17 00:00:00 2001 From: JiriUhlir <149317995+JiriUhlir@users.noreply.github.com> Date: Wed, 27 May 2026 13:09:34 +0200 Subject: [PATCH] cz texty --- app/routes/apps.py | 108 ++++++++++++++++++++-------------------- app/routes/backups.py | 40 +++++++-------- app/static/portal.js | 2 +- app/templates/layout.py | 8 +-- 4 files changed, 79 insertions(+), 79 deletions(-) diff --git a/app/routes/apps.py b/app/routes/apps.py index 0598933..50707e4 100644 --- a/app/routes/apps.py +++ b/app/routes/apps.py @@ -41,22 +41,22 @@ def index(): memory_options = "" for value, label in [ - ("", "Default"), - ("256m", "256 MB - small service"), - ("512m", "512 MB - normal service"), - ("1g", "1 GB - larger service"), - ("2g", "2 GB - heavy service"), + ("", "Výchozí"), + ("256m", "256 MB - malá služba"), + ("512m", "512 MB - běžná služba"), + ("1g", "1 GB - větší služba"), + ("2g", "2 GB - náročná služba"), ]: selected = "selected" if memory == value else "" memory_options += f'' cpu_options = "" for value, label in [ - ("", "Default"), - ("0.25", "0.25 CPU - very small"), - ("0.50", "0.50 CPU - normal"), - ("1.00", "1 CPU - full core"), - ("2.00", "2 CPU - heavy"), + ("", "Výchozí"), + ("0.25", "0,25 CPU - velmi malá služba"), + ("0.50", "0,50 CPU - běžná služba"), + ("1.00", "1 CPU - celé jádro"), + ("2.00", "2 CPU - náročná služba"), ]: selected = "selected" if cpus == value else "" cpu_options += f'' @@ -75,68 +75,68 @@ def index():
- +
- Memory is RAM limit. CPU is max compute share. - Example: 0.50 = half CPU core, 1.00 = one full core. + Paměť je limit RAM. CPU určuje maximální podíl výpočetního výkonu. + Příklad: 0,50 = polovina jádra, 1,00 = celé jádro.
- Clone commands + Příkazy pro klonování
- +
- +
-
+ - +
""" if not rows: - rows = 'No apps deployed yet.' + rows = 'Zatím nejsou nasazené žádné aplikace.' return page( - "Apps", + "Aplikace", f"""
-

Apps

-

Create, deploy, clone, tune resources and delete services.

- + New App +

Aplikace

+

Vytváření, nasazení, klonování, nastavení prostředků a mazání služeb.

+ + Nová aplikace
-

Backups

-

Create backups and copy restore commands. Restore is intentionally manual and guarded.

- Manage Backups +

Zálohy

+

Vytváření záloh a kopírování příkazů pro obnovu. Obnova je záměrně ruční a chráněná.

+ Spravovat zálohy
-

Deployed Apps

+

Nasazené aplikace

- + - - + + - + {rows}
AppAplikace StatusDocsResourcesDokumentaceProstředky GitActionsAkce
@@ -148,34 +148,34 @@ def index(): @router.get("/new-app", response_class=HTMLResponse) def new_app_form(): return page( - "New App", + "Nová aplikace", """
-

Create New App

-

This creates Gitea repo, webhook, local workspace, initial commit and deploys the service.

+

Vytvořit novou aplikaci

+

Vytvoří Gitea repozitář, webhook, lokální workspace, první commit a nasadí službu.

-
+

-
- +
+

-
+

- +
-

← Back

+

← Zpět

""", ) @@ -184,7 +184,7 @@ def new_app_form(): @router.post("/new-app", response_class=HTMLResponse) def create_app(app_id: str = Form(...), app_name: str = Form(...), template: str = Form(...)): if template != "python-fastapi": - return HTMLResponse("Unsupported template", status_code=400) + return HTMLResponse("Nepodporovaná šablona", status_code=400) create_result = run_command([NEW_APP_SCRIPT, app_id, app_name]) deploy_result = run_command([DEPLOY_SCRIPT, app_id]) @@ -192,16 +192,16 @@ def create_app(app_id: str = Form(...), app_name: str = Form(...), template: str status = "OK" if create_result.returncode == 0 and deploy_result.returncode == 0 else "FAILED" return render_result( - title=f"Create App: {status}", + title=f"Vytvoření aplikace: {status}", back_url="/portal", sections=[ - ("Create Output", create_result.stdout), - ("Create Error", create_result.stderr), - ("Deploy Output", deploy_result.stdout), - ("Deploy Error", deploy_result.stderr), + ("Výstup vytvoření", create_result.stdout), + ("Chyba vytvoření", create_result.stderr), + ("Výstup nasazení", deploy_result.stdout), + ("Chyba nasazení", deploy_result.stderr), ], extra_link=f"/apps/{html.escape(app_id)}/docs", - extra_label="Open Swagger", + extra_label="Otevřít Swagger", ) @@ -211,9 +211,9 @@ def delete_app(app_id: str = Form(...)): status = "OK" if result.returncode == 0 else "FAILED" return render_result( - title=f"Delete App: {status}", + title=f"Smazání aplikace: {status}", back_url="/portal", - sections=[("Output", result.stdout), ("Error", result.stderr)], + sections=[("Výstup", result.stdout), ("Chyba", result.stderr)], ) @@ -244,12 +244,12 @@ def update_resources(app_id: str = Form(...), memory: str = Form(""), cpus: str status = "OK" if compose_result.returncode == 0 and deploy_result.returncode == 0 else "FAILED" return render_result( - title=f"Update Resources: {status}", + title=f"Úprava prostředků: {status}", back_url="/portal", sections=[ - ("Compose Output", compose_result.stdout), - ("Compose Error", compose_result.stderr), - ("Deploy Output", deploy_result.stdout), - ("Deploy Error", deploy_result.stderr), + ("Výstup compose", compose_result.stdout), + ("Chyba compose", compose_result.stderr), + ("Výstup nasazení", deploy_result.stdout), + ("Chyba nasazení", deploy_result.stderr), ], ) diff --git a/app/routes/backups.py b/app/routes/backups.py index b3d5b4f..5c19111 100644 --- a/app/routes/backups.py +++ b/app/routes/backups.py @@ -35,52 +35,52 @@ def backups_page():
- +
- +
-
Restore is dangerous and must be run manually over SSH.
+
Obnova je nebezpečná a musí se spustit ručně přes SSH.
-
+ - +
""" if not rows: - rows = 'No backups found.' + rows = 'Nebyly nalezeny žádné zálohy.' return page( - "Backups", + "Zálohy", f"""
-

Backup Management

+

Správa záloh

- Backups do not include the backup directory itself. - Restoring an older backup should not delete newer .tar.gz files. - Restore remains manual to avoid accidental overwrite. + Zálohy neobsahují samotný adresář se zálohami. + Obnova starší zálohy by neměla smazat novější soubory .tar.gz. + Obnova zůstává ruční, aby nedošlo k nechtěnému přepsání dat.

- +
-

Available Backups

+

Dostupné zálohy

- - - - + + + + {rows}
BackupPathRestore CommandActionsZálohaCestaPříkaz pro obnovuAkce
@@ -95,9 +95,9 @@ def create_backup(): status = "OK" if result.returncode == 0 else "FAILED" return render_result( - title=f"Create Backup: {status}", + title=f"Vytvoření zálohy: {status}", back_url="/portal/backups", - sections=[("Output", result.stdout), ("Error", result.stderr)], + sections=[("Výstup", result.stdout), ("Chyba", result.stderr)], ) @@ -106,7 +106,7 @@ def delete_backup(backup_path: str = Form(...)): target = Path(backup_path) if not is_backup_path(target): - return HTMLResponse("Invalid backup path", status_code=400) + return HTMLResponse("Neplatná cesta k záloze", status_code=400) target = target.resolve() if target.exists(): diff --git a/app/static/portal.js b/app/static/portal.js index 58fd50e..a48eab2 100644 --- a/app/static/portal.js +++ b/app/static/portal.js @@ -10,7 +10,7 @@ function copyText(button) { navigator.clipboard.writeText(value); const label = button.textContent; - button.textContent = "Copied"; + button.textContent = "Zkopírováno"; window.setTimeout(() => { button.textContent = label; }, 1200); diff --git a/app/templates/layout.py b/app/templates/layout.py index ff0c990..3c5f62c 100644 --- a/app/templates/layout.py +++ b/app/templates/layout.py @@ -18,9 +18,9 @@ def page(title: str, body: str) -> str: AppFactory
@@ -50,7 +50,7 @@ def render_result(title, back_url, sections, extra_link=None, extra_label=None):

{html.escape(title)}

{extra} -

← Back

+

← Zpět

{rendered_sections}