From 8a9f70851b2b16fb07686b8884f7c76478e307e1 Mon Sep 17 00:00:00 2001 From: CityFun <31820853+zhengkunwang223@users.noreply.github.com> Date: Tue, 13 May 2025 16:14:03 +0800 Subject: [PATCH] feat: add some translate (#8615) --- frontend/src/lang/modules/en.ts | 3 +- frontend/src/lang/modules/ja.ts | 3 +- frontend/src/lang/modules/ko.ts | 3 +- frontend/src/lang/modules/ms.ts | 3 +- frontend/src/lang/modules/pt-br.ts | 3 +- frontend/src/lang/modules/ru.ts | 3 +- frontend/src/lang/modules/zh-Hant.ts | 3 +- frontend/src/lang/modules/zh.ts | 1 + frontend/src/utils/util.ts | 29 ++----------------- .../runtime/php/supervisor/create/index.vue | 1 + 10 files changed, 19 insertions(+), 33 deletions(-) diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 82b21a16a..b8d9d37e6 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -2749,7 +2749,8 @@ const message = { environment: 'Environment Variable', pythonHelper: 'Please provide a complete start command, for example: pip install -r requirements.txt && python manage.py runserver 0.0.0.0:5000', - donetHelper: 'Please fill in the complete startup comman, for example: dotnet MyWebApp.dll', + donetHelper: 'Please fill in the complete startup command, for example dotnet MyWebApp.dll', + dirHelper: 'Note: Please fill in the directory path inside the container', }, process: { pid: 'Process ID', diff --git a/frontend/src/lang/modules/ja.ts b/frontend/src/lang/modules/ja.ts index 18bb02bc8..846749503 100644 --- a/frontend/src/lang/modules/ja.ts +++ b/frontend/src/lang/modules/ja.ts @@ -2615,7 +2615,8 @@ const message = { goDirHelper: 'ディレクトリまたはサブディレクトリには、goファイルまたはバイナリファイルを含める必要があります。', pythonHelper: '完全な起動コマンドを提供します。たとえば、「PIP Install -R Repormations.txt && python manage.py runserver 0.0.0.0:5000」。', - dotnetHelper: '完全な起動コマンドを提供します。たとえば、「dotnet mywebapp.dll」。', + donetHelper: '完全な起動コマンドを入力してください。例えば、dotnet MyWebApp.dll', + dirHelper: 'ノート: コンテナ内のディレクトリパスを入力してください', }, process: { pid: 'プロセスID', diff --git a/frontend/src/lang/modules/ko.ts b/frontend/src/lang/modules/ko.ts index 7606e53ff..ca52c8490 100644 --- a/frontend/src/lang/modules/ko.ts +++ b/frontend/src/lang/modules/ko.ts @@ -2571,7 +2571,8 @@ const message = { goDirHelper: '디렉터리 또는 하위 디렉터리는 Go 또는 바이너리 파일을 포함해야 합니다.', pythonHelper: '전체 시작 명령을 제공하세요. 예: "pip install -r requirements.txt && python manage.py runserver 0.0.0.0:5000".', - dotnetHelper: '전체 시작 명령을 제공하세요. 예: "dotnet MyWebApp.dll".', + donetHelper: '완전한 시작 명령을 입력하세요. 예: dotnet MyWebApp.dll', + dirHelper: '주의: 컨테이너 내의 디렉토리 경로를 입력하세요', }, process: { pid: '프로세스 ID', diff --git a/frontend/src/lang/modules/ms.ts b/frontend/src/lang/modules/ms.ts index 963bc2215..a10523815 100644 --- a/frontend/src/lang/modules/ms.ts +++ b/frontend/src/lang/modules/ms.ts @@ -2675,7 +2675,8 @@ const message = { goDirHelper: 'Direktori atau subdirektori mesti mengandungi fail Go atau binari.', pythonHelper: 'Sediakan arahan permulaan penuh. Contohnya, "pip install -r requirements.txt && python manage.py runserver 0.0.0.0:5000".', - dotnetHelper: 'Sediakan arahan permulaan penuh. Contohnya, "dotnet MyWebApp.dll".', + donetHelper: 'Sila isi arahan pelancaran lengkap, contohnya dotnet MyWebApp.dll', + dirHelper: 'Nota: Sila isi laluan direktori di dalam bekas', }, process: { pid: 'Process ID', diff --git a/frontend/src/lang/modules/pt-br.ts b/frontend/src/lang/modules/pt-br.ts index f4500d4f0..bb3880094 100644 --- a/frontend/src/lang/modules/pt-br.ts +++ b/frontend/src/lang/modules/pt-br.ts @@ -2675,7 +2675,8 @@ const message = { goDirHelper: 'O diretório ou subdiretório deve conter arquivos Go ou binários.', pythonHelper: 'Forneça um comando completo de inicialização. Por exemplo, "pip install -r requirements.txt && python manage.py runserver 0.0.0.0:5000".', - dotnetHelper: 'Forneça um comando completo de inicialização. Por exemplo, "dotnet MyWebApp.dll".', + donetHelper: 'Por favor, preencha o comando completo de inicialização, por exemplo, dotnet MyWebApp.dll', + dirHelper: 'Nota: Preencha o caminho do diretório dentro do contêiner', }, process: { pid: 'ID do Processo', diff --git a/frontend/src/lang/modules/ru.ts b/frontend/src/lang/modules/ru.ts index 74a8f95d7..cf0c81ebd 100644 --- a/frontend/src/lang/modules/ru.ts +++ b/frontend/src/lang/modules/ru.ts @@ -2668,7 +2668,8 @@ const message = { goDirHelper: 'Директория или поддиректория должна содержать файлы Go или бинарные файлы.', pythonHelper: 'Укажите полную команду запуска. Например, "pip install -r requirements.txt && python manage.py runserver 0.0.0.0:5000".', - dotnetHelper: 'Укажите полную команду запуска. Например, "dotnet MyWebApp.dll".', + donetHelper: 'Пожалуйста, укажите полную команду запуска, например, dotnet MyWebApp.dll', + dirHelper: 'Примечание: Укажите путь к каталогу внутри контейнера', }, process: { pid: 'ID процесса', diff --git a/frontend/src/lang/modules/zh-Hant.ts b/frontend/src/lang/modules/zh-Hant.ts index 8c538aded..7f8200926 100644 --- a/frontend/src/lang/modules/zh-Hant.ts +++ b/frontend/src/lang/modules/zh-Hant.ts @@ -2541,7 +2541,8 @@ const message = { environment: '環境變數', pythonHelper: '請填寫完整啟動指令,例如:pip install -r requirements.txt && python manage.py runserver 0.0.0.0:5000', - donetHelper: '請填入完整啟動指令,例如 dotnet MyWebApp.dll', + donetHelper: '請填寫完整的啟動命令,例如 dotnet MyWebApp.dll', + dirHelper: '說明:請填寫容器內的目錄路徑', }, process: { pid: '進程ID', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 07ac82fee..1411280fd 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -2533,6 +2533,7 @@ const message = { pythonHelper: '请填写完整启动命令,例如:pip install -r requirements.txt && python manage.py runserver 0.0.0.0:5000', donetHelper: '请填写完整启动命令,例如 dotnet MyWebApp.dll', + dirHelper: '说明:请填写容器内的目录路径', }, process: { pid: '进程ID', diff --git a/frontend/src/utils/util.ts b/frontend/src/utils/util.ts index 8e8a05074..0662596a3 100644 --- a/frontend/src/utils/util.ts +++ b/frontend/src/utils/util.ts @@ -552,32 +552,9 @@ export function toLowerCase(str: string) { } export function downloadFile(filePath: string, currentNode: string) { - const url = `${import.meta.env.VITE_API_URL as string}/files/download`; - const path = encodeURIComponent(filePath); - - fetch(`${url}?path=${path}`, { - method: 'GET', - headers: { - CurrentNode: currentNode, - }, - }) - .then((response) => { - if (!response.ok) { - throw new Error('Network response was not ok'); - } - return response.blob(); - }) - .then((blob) => { - const downloadUrl = window.URL.createObjectURL(blob); - const a = document.createElement('a'); - a.href = downloadUrl; - a.download = filePath.split('/').pop() || 'downloaded-file'; - document.body.appendChild(a); - a.click(); - a.remove(); - window.URL.revokeObjectURL(downloadUrl); - }) - .catch(() => {}); + let url = `${import.meta.env.VITE_API_URL as string}/files/download?operateNode=${currentNode}&`; + let path = encodeURIComponent(filePath); + window.open(url + 'path=' + path, '_blank'); } export function downloadWithContent(content: string, fileName: string) { diff --git a/frontend/src/views/website/runtime/php/supervisor/create/index.vue b/frontend/src/views/website/runtime/php/supervisor/create/index.vue index 2d52b801f..cd5942e62 100644 --- a/frontend/src/views/website/runtime/php/supervisor/create/index.vue +++ b/frontend/src/views/website/runtime/php/supervisor/create/index.vue @@ -21,6 +21,7 @@ + {{ $t('runtime.dirHelper') }}