mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-09-22 16:00:51 +00:00
fix: update quick command batch separator (#12340)
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -1390,7 +1390,7 @@ const message = {
|
||||
groupDeleteHelper:
|
||||
'グループが削除された後、グループ内のすべての接続がデフォルトグループに移行されます。続けたいですか?',
|
||||
quickCommandBatchHelper:
|
||||
'1 行に 1 つのクイックコマンドを、名前|コマンド の形式で入力します。例: ディスク確認|df -h',
|
||||
'1 行に 1 つのクイックコマンドを、名前---コマンド の形式で入力します。例: ディスク確認---df -h',
|
||||
command: '指示',
|
||||
quickCmd: 'クイックコマンド',
|
||||
addHost: '追加',
|
||||
|
||||
@@ -1363,7 +1363,7 @@ const message = {
|
||||
noSuchCommand: '가져온 CSV 파일에서 빠른 명령어 데이터를 찾을 수 없습니다. 확인 후 다시 시도하세요!',
|
||||
quickCommandHelper: '"터미널 -> 터미널" 하단에서 빠른 명령을 사용할 수 있습니다.',
|
||||
groupDeleteHelper: '그룹을 제거하면 해당 그룹의 모든 연결이 기본 그룹으로 이동됩니다. 계속하시겠습니까?',
|
||||
quickCommandBatchHelper: '한 줄에 하나의 빠른 명령을 이름|명령 형식으로 입력하세요. 예: 디스크 확인|df -h',
|
||||
quickCommandBatchHelper: '한 줄에 하나의 빠른 명령을 이름---명령 형식으로 입력하세요. 예: 디스크 확인---df -h',
|
||||
command: '명령',
|
||||
quickCmd: '빠른 명령',
|
||||
addHost: '추가',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -1396,7 +1396,7 @@ const message = {
|
||||
quickCommandHelper: 'Вы можете использовать быстрые команды внизу страницы "Терминалы -> Терминалы".',
|
||||
groupDeleteHelper:
|
||||
'После удаления группы все подключения в группе будут перемещены в группу по умолчанию. Хотите продолжить?',
|
||||
quickCommandBatchHelper: 'Одна быстрая команда на строку в формате Имя|Команда, например: Проверить диск|df -h',
|
||||
quickCommandBatchHelper: 'Одна быстрая команда на строку в формате Имя---Команда, например: Проверить диск---df -h',
|
||||
command: 'Команда',
|
||||
quickCmd: 'Быстрая команда',
|
||||
addHost: 'Добавить',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -1302,7 +1302,7 @@ const message = {
|
||||
noSuchCommand: '匯入的CSV檔案中未能發現快速指令資料,請檢查後重試',
|
||||
quickCommandHelper: '常用命令列表,用於在終端介面底部快速選擇',
|
||||
groupDeleteHelper: '移除組後,組內所有連接將遷移到 default 組內,是否繼續?',
|
||||
quickCommandBatchHelper: '每行一條快速指令,以 名稱|命令 格式,例如:查看磁碟|df -h',
|
||||
quickCommandBatchHelper: '每行一條快速指令,以 名稱---命令 格式,例如:查看磁碟---df -h',
|
||||
command: '指令',
|
||||
addHost: '新增主機',
|
||||
localhost: '本機伺服器',
|
||||
|
||||
@@ -1311,7 +1311,7 @@ const message = {
|
||||
quickCommand: '快速命令',
|
||||
noSuchCommand: '导入的 csv 文件中未能发现快速命令数据,请检查后重试!',
|
||||
quickCommandHelper: '常用命令列表,用于在终端界面底部快速选择',
|
||||
quickCommandBatchHelper: '每行一条快速命令,以 名称|命令 格式,例如:查看磁盘|df -h',
|
||||
quickCommandBatchHelper: '每行一条快速命令,以 名称---命令 格式,例如:查看磁盘---df -h',
|
||||
command: '命令',
|
||||
addHost: '添加主机',
|
||||
localhost: '本地服务器',
|
||||
|
||||
@@ -112,10 +112,13 @@ const buildBatchCommands = (): Array<Command.CommandOperate> => {
|
||||
.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',
|
||||
|
||||
Reference in New Issue
Block a user