From 26c4e8323f952708b50d2d9914dd54b33cdf3339 Mon Sep 17 00:00:00 2001 From: ssongliu Date: Thu, 26 Mar 2026 10:46:10 +0800 Subject: [PATCH] fix: update quick command batch separator (#12340) --- frontend/src/lang/modules/en.ts | 2 +- frontend/src/lang/modules/es-es.ts | 2 +- frontend/src/lang/modules/ja.ts | 2 +- frontend/src/lang/modules/ko.ts | 2 +- frontend/src/lang/modules/ms.ts | 2 +- frontend/src/lang/modules/pt-br.ts | 2 +- frontend/src/lang/modules/ru.ts | 2 +- frontend/src/lang/modules/tr.ts | 2 +- frontend/src/lang/modules/zh-Hant.ts | 2 +- frontend/src/lang/modules/zh.ts | 2 +- frontend/src/views/terminal/command/operate/index.vue | 7 +++++-- 11 files changed, 15 insertions(+), 12 deletions(-) diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index fabe181e8..2f5ed5c4b 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -1378,7 +1378,7 @@ const message = { noSuchCommand: 'No quick command data found in the imported CSV file, check and try again!', quickCommandHelper: 'You can use the quick commands at the bottom of the "Terminals -> Terminals".', quickCommandBatchHelper: - 'One quick command per line, using the Name|Command format, for example: Check disk|df -h', + 'One quick command per line, using the Name---Command format, for example: Check disk---df -h', groupDeleteHelper: 'After the group is removed, all connections in the group will be migrated to the default group. Continue?', command: 'Command', diff --git a/frontend/src/lang/modules/es-es.ts b/frontend/src/lang/modules/es-es.ts index 45ce5fa39..781afe2ff 100644 --- a/frontend/src/lang/modules/es-es.ts +++ b/frontend/src/lang/modules/es-es.ts @@ -1419,7 +1419,7 @@ const message = { groupDeleteHelper: 'Después de eliminar el grupo, todas las conexiones pasarán al grupo predeterminado. ¿Desea continuar?', quickCommandBatchHelper: - 'Un comando rápido por línea, usando el formato Nombre|Comando, por ejemplo: Ver disco|df -h', + 'Un comando rápido por línea, usando el formato Nombre---Comando, por ejemplo: Ver disco---df -h', command: 'Comando', quickCmd: 'Comando rápido', addHost: 'Agregar', diff --git a/frontend/src/lang/modules/ja.ts b/frontend/src/lang/modules/ja.ts index bae8f599a..245db5ed7 100644 --- a/frontend/src/lang/modules/ja.ts +++ b/frontend/src/lang/modules/ja.ts @@ -1390,7 +1390,7 @@ const message = { groupDeleteHelper: 'グループが削除された後、グループ内のすべての接続がデフォルトグループに移行されます。続けたいですか?', quickCommandBatchHelper: - '1 行に 1 つのクイックコマンドを、名前|コマンド の形式で入力します。例: ディスク確認|df -h', + '1 行に 1 つのクイックコマンドを、名前---コマンド の形式で入力します。例: ディスク確認---df -h', command: '指示', quickCmd: 'クイックコマンド', addHost: '追加', diff --git a/frontend/src/lang/modules/ko.ts b/frontend/src/lang/modules/ko.ts index 3f3fce38f..3031a4ffe 100644 --- a/frontend/src/lang/modules/ko.ts +++ b/frontend/src/lang/modules/ko.ts @@ -1363,7 +1363,7 @@ const message = { noSuchCommand: '가져온 CSV 파일에서 빠른 명령어 데이터를 찾을 수 없습니다. 확인 후 다시 시도하세요!', quickCommandHelper: '"터미널 -> 터미널" 하단에서 빠른 명령을 사용할 수 있습니다.', groupDeleteHelper: '그룹을 제거하면 해당 그룹의 모든 연결이 기본 그룹으로 이동됩니다. 계속하시겠습니까?', - quickCommandBatchHelper: '한 줄에 하나의 빠른 명령을 이름|명령 형식으로 입력하세요. 예: 디스크 확인|df -h', + quickCommandBatchHelper: '한 줄에 하나의 빠른 명령을 이름---명령 형식으로 입력하세요. 예: 디스크 확인---df -h', command: '명령', quickCmd: '빠른 명령', addHost: '추가', diff --git a/frontend/src/lang/modules/ms.ts b/frontend/src/lang/modules/ms.ts index 7bc44bd29..46d034efc 100644 --- a/frontend/src/lang/modules/ms.ts +++ b/frontend/src/lang/modules/ms.ts @@ -1404,7 +1404,7 @@ const message = { groupDeleteHelper: 'Selepas kumpulan dikeluarkan, semua sambungan dalam kumpulan akan dipindahkan ke kumpulan lalai. Adakah anda mahu meneruskan?', quickCommandBatchHelper: - 'Satu arahan pantas setiap baris, menggunakan format Nama|Arahan, contohnya: Semak cakera|df -h', + 'Satu arahan pantas setiap baris, menggunakan format Nama---Arahan, contohnya: Semak cakera---df -h', command: 'Arahan', quickCmd: 'Arahan pantas', addHost: 'Tambah', diff --git a/frontend/src/lang/modules/pt-br.ts b/frontend/src/lang/modules/pt-br.ts index b0baa95f0..83baf60b8 100644 --- a/frontend/src/lang/modules/pt-br.ts +++ b/frontend/src/lang/modules/pt-br.ts @@ -1412,7 +1412,7 @@ const message = { groupDeleteHelper: 'Após o grupo ser removido, todas as conexões no grupo serão migradas para o grupo padrão. Você deseja continuar?', quickCommandBatchHelper: - 'Um comando rápido por linha, usando o formato Nome|Comando, por exemplo: Ver disco|df -h', + 'Um comando rápido por linha, usando o formato Nome---Comando, por exemplo: Ver disco---df -h', command: 'Comando', quickCmd: 'Comando rápido', addHost: 'Adicionar', diff --git a/frontend/src/lang/modules/ru.ts b/frontend/src/lang/modules/ru.ts index f3ae850ad..8f1a4e4ee 100644 --- a/frontend/src/lang/modules/ru.ts +++ b/frontend/src/lang/modules/ru.ts @@ -1396,7 +1396,7 @@ const message = { quickCommandHelper: 'Вы можете использовать быстрые команды внизу страницы "Терминалы -> Терминалы".', groupDeleteHelper: 'После удаления группы все подключения в группе будут перемещены в группу по умолчанию. Хотите продолжить?', - quickCommandBatchHelper: 'Одна быстрая команда на строку в формате Имя|Команда, например: Проверить диск|df -h', + quickCommandBatchHelper: 'Одна быстрая команда на строку в формате Имя---Команда, например: Проверить диск---df -h', command: 'Команда', quickCmd: 'Быстрая команда', addHost: 'Добавить', diff --git a/frontend/src/lang/modules/tr.ts b/frontend/src/lang/modules/tr.ts index 39f68b483..42827e34b 100644 --- a/frontend/src/lang/modules/tr.ts +++ b/frontend/src/lang/modules/tr.ts @@ -1401,7 +1401,7 @@ const message = { groupDeleteHelper: 'Grup kaldırıldıktan sonra, gruptaki tüm bağlantılar varsayılan gruba taşınacaktır. Devam etmek istiyor musunuz?', quickCommandBatchHelper: - 'Her satıra bir hızlı komut, Ad|Komut formatında girin, örneğin: Diski kontrol et|df -h', + 'Her satıra bir hızlı komut, Ad---Komut formatında girin, örneğin: Diski kontrol et---df -h', command: 'Komut', quickCmd: 'Hızlı komut', addHost: 'Ekle', diff --git a/frontend/src/lang/modules/zh-Hant.ts b/frontend/src/lang/modules/zh-Hant.ts index 98f812c1f..0fbd18573 100644 --- a/frontend/src/lang/modules/zh-Hant.ts +++ b/frontend/src/lang/modules/zh-Hant.ts @@ -1302,7 +1302,7 @@ const message = { noSuchCommand: '匯入的CSV檔案中未能發現快速指令資料,請檢查後重試', quickCommandHelper: '常用命令列表,用於在終端介面底部快速選擇', groupDeleteHelper: '移除組後,組內所有連接將遷移到 default 組內,是否繼續?', - quickCommandBatchHelper: '每行一條快速指令,以 名稱|命令 格式,例如:查看磁碟|df -h', + quickCommandBatchHelper: '每行一條快速指令,以 名稱---命令 格式,例如:查看磁碟---df -h', command: '指令', addHost: '新增主機', localhost: '本機伺服器', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 7d1e6b38f..8d2782532 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -1311,7 +1311,7 @@ const message = { quickCommand: '快速命令', noSuchCommand: '导入的 csv 文件中未能发现快速命令数据,请检查后重试!', quickCommandHelper: '常用命令列表,用于在终端界面底部快速选择', - quickCommandBatchHelper: '每行一条快速命令,以 名称|命令 格式,例如:查看磁盘|df -h', + quickCommandBatchHelper: '每行一条快速命令,以 名称---命令 格式,例如:查看磁盘---df -h', command: '命令', addHost: '添加主机', localhost: '本地服务器', diff --git a/frontend/src/views/terminal/command/operate/index.vue b/frontend/src/views/terminal/command/operate/index.vue index 1133930aa..6b4d5d4db 100644 --- a/frontend/src/views/terminal/command/operate/index.vue +++ b/frontend/src/views/terminal/command/operate/index.vue @@ -112,10 +112,13 @@ const buildBatchCommands = (): Array => { .map((line) => line.trim()) .filter(Boolean); return lines.map((line) => { - const separatorIndex = line.indexOf('|'); + const tripleDashSeparator = '---'; + const tripleDashIndex = line.indexOf(tripleDashSeparator); + const separator = tripleDashIndex > 0 ? tripleDashSeparator : ''; + const separatorIndex = separator ? line.indexOf(separator) : -1; const hasCustomName = separatorIndex > 0; const name = hasCustomName ? line.slice(0, separatorIndex).trim() : line; - const command = hasCustomName ? line.slice(separatorIndex + 1).trim() : line; + const command = hasCustomName ? line.slice(separatorIndex + separator.length).trim() : line; return { id: 0, type: 'command',