i18n: pages/docker

This commit is contained in:
a20070322 2024-04-30 11:13:30 +08:00
parent eae489e2e5
commit 1a9386904a
16 changed files with 160 additions and 234 deletions

View File

@ -1 +1 @@
JPOM_PROXY_HOST="127.0.0.1:2122" JPOM_PROXY_HOST="https://demo.jpom.top"

View File

@ -12,11 +12,13 @@ import page404 from './pages/404/404'
import build from './pages/build' import build from './pages/build'
import certificate from './pages/certificate' import certificate from './pages/certificate'
import dispatch from './pages/dispatch' import dispatch from './pages/dispatch'
import docker from './pages/docker'
export default { export default {
pages: { pages: {
404: page404, 404: page404,
build, build,
certificate, certificate,
dispatch dispatch,
docker
} }
} }

View File

@ -63,54 +63,6 @@ export default {
containerLabelExample: 'Container labels, such as: key1=values1&keyvalue2', containerLabelExample: 'Container labels, such as: key1=values1&keyvalue2',
autoStart: 'Auto Start', autoStart: 'Auto Start',
start: 'Start', start: 'Start',
port_1: 'Port', noStart: 'No Start'
container_1: 'Container',
rebuildContainer_1: 'Rebuild Container',
operationPrompt_1: 'Operation Prompt',
containerRebuildDesc_1:
'Container rebuild refers to creating an identical container using the already created container parameters.',
containerRestartDeleteBefore_1: 'Before restarting, the previous container will be automatically deleted.',
containerDataBackupWarning_1:
'If the container data directory is not mounted, please backup the data before using this feature.',
newContainerParamNotGuaranteed_1:
'This feature cannot guarantee that the new container and the previous container parameters are exactly the same. Please use it carefully.',
baseImage_1: 'Base Image',
containerName_1: 'Container Name:',
hostIp_1: 'Host IP',
containerPort_1: 'Container Port',
portProtocol_1: 'Port Protocol',
mountedVolume_1: 'Mounted Volume',
host_1: 'Host',
hostDirectory_1: 'Host Directory',
containerDirectory_1: 'Container Directory',
environmentVariables_1: 'Environment Variables',
variableName_1: 'Variable Name',
variableValue_1: 'Variable Value',
command_1: 'Command',
commandValue_1: 'Command Value',
fillRunningCommand_1: 'Fill in the running command',
hostname_1: 'Hostname',
network_1: 'Network',
networkMode_1: 'Network Mode: bridge, container:<name|id>, host, container, none',
createNetworkStack_1: 'Create a new network stack for containers on docker bridge',
containerNoNetwork_1: 'This container has no network',
reuseAnotherContainerNetworkStack_1: "Reuse another container's network stack",
useHostNetworkStack_1:
'Use the host network stack inside the container. Note: Host mode grants containers full access to local system services (such as D-bus), so it is considered insecure.',
restartPolicy_1: 'Restart Policy',
restartPolicyOptions_1: 'Restart Policy: no, always, unless-stopped, on-failure',
noAutoRestart_1: 'Do not automatically restart',
alwaysRestart_1: 'Always restart the container regardless of the exit code.',
restartOnFailure_1:
'Restart the container if it exits with a non-zero exit code. You can specify the number of times: on-failure:2',
restartUnlessStopped_1: 'Restart the container unless it has been stopped',
storageOptions_1: 'Storage Options',
configName_1: 'Configuration Name (e.g., size)',
configValue_1: 'Configuration Value (e.g., 5g)',
containerRuntime_1: 'Container Runtime',
containerLabels_1: 'Container Labels',
containerLabelExample_1: 'Container labels, e.g., key1=values1&keyvalue2',
autoStart_1: 'Auto Start',
start_1: 'Start'
} }
} }

View File

@ -2,107 +2,53 @@ export default {
c: { c: {
name: 'Name', name: 'Name',
containerName: 'Container Name', containerName: 'Container Name',
tag: 'Tag', label: 'Label',
pleaseSelectWorkspace: 'Please select workspace', selectWorkspace: 'Please select a workspace',
tagLimitToAlphaNumericWithLength1To10: 'Tags are limited to alphanumeric with a length of 1-10', labelRestriction: 'Label is restricted to alphanumeric characters with a length of 1-10'
name_1: 'Name',
containerName_1: 'Container Name',
tag_1: 'Tag',
pleaseSelectWorkspace_1: 'Please select workspace',
tagLimitToAlphaNumericWithLength1To10_11: 'Tag is limited to alphanumeric with length 1-10'
}, },
p: { p: {
currentWorkspaceDoesNotHaveDocker: 'The current workspace does not have Docker', noDockerInWorkspace: 'There is no Docker in the current workspace',
pleaseGoToSystemManagementAssetManagementDockerManagementToAddDockerOrAuthorizeAndAssignAnExistingDockerToThisWorkspace: goToDockerManagement:
'Please go to [System Management] -> [Asset Management] -> [Docker Management] to add a new Docker, or authorize and associate an existing Docker with this workspace', 'Please go to [System Management] -> [Asset Management] -> [Docker Management] to add a new Docker, or authorize and associate an existing Docker to this workspace',
goNow: 'Go now', goToNow: 'Go now',
noDocker: 'No Docker', noDocker: 'No Docker',
pressCtrOrAltOptionToQuicklyReturnToTheFirstPage: quickReturn: 'Hold Ctrl or Alt/Option key and click the button to quickly return to the first page',
'Press Ctr or Alt/Option and click the button to quickly return to the first page',
search: 'Search', search: 'Search',
workspaceSynchronization: 'Workspace Synchronization', workspaceSync: 'Workspace synchronization',
normal: 'Normal', statusNormal: 'Normal',
unableToConnect: 'Unable to connect', unableToConnect: 'Unable to connect',
clusterAssociatedDockerInfoIsLostCannotContinueToUseManagementFunctions: dockerInfoLost:
'The cluster-associated Docker information is lost, and management functions cannot be used', 'The associated Docker information for the cluster is lost and cannot continue to use management functions',
infoLost: 'Information lost', infoLost: 'Information lost',
console: 'Console', console: 'Console',
edit: 'Edit', edit: 'Edit',
delete: 'Delete', delete: 'Delete',
editDocker: 'Edit Docker', editDocker: 'Edit Docker',
tagIsUsedForContainerBuildingToSelectContainerFunctionFromTag: tagForContainerBuild: 'Tag is used for container build selection (fromTag)',
'Tags are used for container building to select container functions (fromTag)', enterTagName: 'Please enter a tag name with alphanumeric characters with a length of 1-10',
pleaseEnterTagNameAlphaNumericWithLength1To10:
'Please enter a tag name with alphanumeric characters and a length of 1-10',
add: 'Add', add: 'Add',
synchronizeToOtherWorkspaces: 'Synchronize to other workspaces', syncToOtherWorkspace: 'Synchronize to other workspaces',
warmPrompt: 'Warm prompt', warmTip: 'Friendly reminder',
synchronizationMechanismDeterminesThatTheContainerHostIsTheSameServerDocker: syncMechanism:
'The synchronization mechanism determines that the container host is the same server (Docker)', 'The synchronization mechanism determines that it is the same server (Docker) using the container host',
whenTheTargetWorkspaceDoesNotExistACorrespondingNodeItWillBeAutomaticallyCreatedADockerLogicDocker: createNewDocker:
'When the target workspace does not exist, a corresponding node will be automatically created, and a new Docker (logical Docker) will be created', 'When the target workspace does not have a corresponding node, a new Docker (logical Docker) will be automatically created',
whenTheTargetWorkspaceAlreadyExistsANodeItWillBeAutomaticallySynchronizedDockerRepositoryConfigurationInformation: syncDockerInfo:
'When the target workspace already exists, a node will be automatically synchronized, and Docker repository configuration information will be synchronized', 'When the target workspace already has a node, the Docker repository configuration information will be automatically synchronized',
selectWorkspace: 'Select workspace', chooseWorkspace: 'Choose workspace',
status: 'Status', status: 'Status',
version: 'Version', version: 'Version',
lastModifier: 'Last modifier', lastModifiedBy: 'Last modified by',
creationTime: 'Creation time', creationTime: 'Creation time',
modificationTime: 'Modification time', modificationTime: 'Modification time',
operation: 'Operation', action: 'Action',
pleaseFillInTheContainerName: 'Please fill in the container name', enterContainerName: 'Please enter a container name',
pleaseFillInTheContainerAddress: 'Please fill in the container address', enterContainerAddress: 'Please enter a container address',
pleaseFillInTheAssociatedContainerTag: 'Please fill in the associated container tag', enterAssociatedContainerTag: 'Please enter an associated container tag',
systemPrompt: 'System prompt', systemPrompt: 'System prompt',
areYouSureYouWantToDeleteThisRecordAfterDeletionTheAssociatedContainerTagWillBeUnavailableForBuilding: confirmDeletion:
'Are you sure you want to delete this record? After deletion, the associated container tag will be unavailable for building', 'Are you sure you want to delete this record? After deletion, the associated container tag for the build will no longer be usable',
confirm: 'Confirm', confirm: 'Confirm',
cancel: 'Cancel', cancel: 'Cancel'
currentWorkspaceDoesNotHaveDocker_1: 'The current workspace does not have Docker',
pleaseGoToSystemManagementAssetManagementDockerManagementToAddDockerOrAuthorizeAndAssignAnExistingDockerToThisWorkspace_1:
'Please go to [System Management] -> [Asset Management] -> [Docker Management] to add a new Docker, or authorize and assign an existing Docker to this workspace',
goNow_1: 'Go now',
noDocker_1: 'No Docker',
pressCtrOrAltOptionToQuicklyReturnToTheFirstPage_1:
'Press Ctr or Alt/Option and click the button to quickly return to the first page',
search_1: 'Search',
workspaceSynchronization_1: 'Workspace Synchronization',
normal_1: 'Normal',
unableToConnect_1: 'Unable to connect',
clusterAssociatedDockerInfoIsLostCannotContinueToUseManagementFunctions_1:
'The cluster-associated Docker information is lost, and management functions cannot be used',
infoLost_1: 'Information lost',
console_1: 'Console',
edit_1: 'Edit',
delete_1: 'Delete',
editDocker_1: 'Edit Docker',
tagIsUsedForContainerBuildingToSelectContainerFunctionFromTag_1:
'The tag is used for container building to select container function (fromTag)',
pleaseEnterTagNameAlphaNumericWithLength1To10_11:
'Please enter a tag name with alphanumeric characters and a length of 1-10',
add_1: 'Add',
synchronizeToOtherWorkspaces_1: 'Synchronize to other workspaces',
warmPrompt_1: 'Warm prompt',
synchronizationMechanismDeterminesThatTheContainerHostIsTheSameServerDocker_1:
'The synchronization mechanism determines that the container host is the same server (Docker)',
whenTheTargetWorkspaceDoesNotExistACorrespondingNodeItWillBeAutomaticallyCreatedADockerLogicDocker_1:
'When the target workspace does not exist, a corresponding node will be automatically created (a logical Docker)',
whenTheTargetWorkspaceAlreadyExistsANodeItWillBeAutomaticallySynchronizedDockerRepositoryConfigurationInformation_1:
'When the target workspace already exists, a node will be automatically synchronized with the Docker repository configuration information',
selectWorkspace_1: 'Select workspace',
status_1: 'Status',
version_1: 'Version',
lastModifier_1: 'Last modifier',
creationTime_1: 'Creation time',
modificationTime_1: 'Modification time',
operation_1: 'Operation',
pleaseFillInTheContainerName_1: 'Please fill in the container name',
pleaseFillInTheContainerAddress_1: 'Please fill in the container address',
pleaseFillInTheAssociatedContainerTag_1: 'Please fill in the associated container tag',
systemPrompt_1: 'System prompt',
areYouSureYouWantToDeleteThisRecordAfterDeletionTheAssociatedContainerTagWillBeUnavailableForBuilding_1:
'Are you sure you want to delete this record? After deletion, the associated container tag will be unavailable for building',
confirm_1: 'Confirm',
cancel_1: 'Cancel'
} }
} }

View File

@ -58,6 +58,7 @@ export default {
containerLabels: '容器标签', containerLabels: '容器标签',
containerLabelExample: '容器标签,如key1=values1&keyvalue2', containerLabelExample: '容器标签,如key1=values1&keyvalue2',
autoStart: '自动启动', autoStart: '自动启动',
start: '启动' start: '启动',
noStart: '未启动'
} }
} }

View File

@ -2,52 +2,47 @@ export default {
c: { c: {
name: '名称', name: '名称',
containerName: '容器名称', containerName: '容器名称',
tag: '标签', label: '标签',
pleaseSelectWorkspace: '请选择工作空间', selectWorkspace: '请选择工作空间',
tagLimitToAlphaNumericWithLength1To10: '标签限制为字母数字且长度 1-10' labelRestriction: '标签限制为字母数字且长度 1-10'
}, },
p: { p: {
currentWorkspaceDoesNotHaveDocker: '当前工作空间还没有 Docker', noDockerInWorkspace: '当前工作空间还没有 Docker',
pleaseGoToSystemManagementAssetManagementDockerManagementToAddDockerOrAuthorizeAndAssignAnExistingDockerToThisWorkspace: goToDockerManagement:
'请到【系统管理】-> 【资产管理】-> 【Docker管理】新增Docker或者将已新增的Docker授权关联、分配到此工作空间', '请到【系统管理】-> 【资产管理】-> 【Docker管理】新增Docker或者将已新增的Docker授权关联、分配到此工作空间',
goNow: '现在就去', goToNow: '现在就去',
noDocker: '没有docker', noDocker: '没有docker',
pressCtrOrAltOptionToQuicklyReturnToTheFirstPage: '按住 Ctr 或者 Alt/Option 键点击按钮快速回到第一页', quickReturn: '按住 Ctr 或者 Alt/Option 键点击按钮快速回到第一页',
search: '搜索', search: '搜索',
workspaceSynchronization: '工作空间同步', workspaceSync: '工作空间同步',
normal: '正常', statusNormal: '正常',
unableToConnect: '无法连接', unableToConnect: '无法连接',
clusterAssociatedDockerInfoIsLostCannotContinueToUseManagementFunctions: dockerInfoLost: '集群关联的 docker 信息丢失,不能继续使用管理功能',
'集群关联的 docker 信息丢失,不能继续使用管理功能',
infoLost: '信息丢失', infoLost: '信息丢失',
console: '控制台', console: '控制台',
edit: '编辑', edit: '编辑',
delete: '删除', delete: '删除',
editDocker: '编辑 Docker', editDocker: '编辑 Docker',
tagIsUsedForContainerBuildingToSelectContainerFunctionFromTag: '标签用于容器构建选择容器功能fromTag', tagForContainerBuild: '标签用于容器构建选择容器功能fromTag',
pleaseEnterTagNameAlphaNumericWithLength1To10: '请输入标签名 字母数字 长度 1-10', enterTagName: '请输入标签名 字母数字 长度 1-10',
add: '新增', add: '新增',
synchronizeToOtherWorkspaces: '同步到其他工作空间', syncToOtherWorkspace: '同步到其他工作空间',
warmPrompt: '温馨提示', warmTip: '温馨提示',
synchronizationMechanismDeterminesThatTheContainerHostIsTheSameServerDocker: syncMechanism: '同步机制采用容器 host 确定是同一个服务器docker',
'同步机制采用容器 host 确定是同一个服务器docker', createNewDocker: '当目标工作空间不存在对应的节点时候将自动创建一个新的docker逻辑docker',
whenTheTargetWorkspaceDoesNotExistACorrespondingNodeItWillBeAutomaticallyCreatedADockerLogicDocker: syncDockerInfo: '当目标工作空间已经存在节点时候将自动同步 docker 仓库配置信息',
'当目标工作空间不存在对应的节点时候将自动创建一个新的docker逻辑docker', chooseWorkspace: '选择工作空间',
whenTheTargetWorkspaceAlreadyExistsANodeItWillBeAutomaticallySynchronizedDockerRepositoryConfigurationInformation:
'当目标工作空间已经存在节点时候将自动同步 docker 仓库配置信息',
selectWorkspace: '选择工作空间',
status: '状态', status: '状态',
version: '版本', version: '版本',
lastModifier: '最后修改人', lastModifiedBy: '最后修改人',
creationTime: '创建时间', creationTime: '创建时间',
modificationTime: '修改时间', modificationTime: '修改时间',
operation: '操作', action: '操作',
pleaseFillInTheContainerName: '请填写容器名称', enterContainerName: '请填写容器名称',
pleaseFillInTheContainerAddress: '请填写容器地址', enterContainerAddress: '请填写容器地址',
pleaseFillInTheAssociatedContainerTag: '请填写关联容器标签', enterAssociatedContainerTag: '请填写关联容器标签',
systemPrompt: '系统提示', systemPrompt: '系统提示',
areYouSureYouWantToDeleteThisRecordAfterDeletionTheAssociatedContainerTagWillBeUnavailableForBuilding: confirmDeletion: '真的要删除该记录么?删除后构建关联的容器标签将无法使用',
'真的要删除该记录么?删除后构建关联的容器标签将无法使用',
confirm: '确认', confirm: '确认',
cancel: '取消' cancel: '取消'
} }

View File

@ -44,13 +44,16 @@
<a-button type="primary" size="small" :loading="childLoading" @click="loadData">{{ <a-button type="primary" size="small" :loading="childLoading" @click="loadData">{{
$tl('p.refresh') $tl('p.refresh')
}}</a-button> }}</a-button>
<a-statistic-countdown <a-statistic-countdown
format=" {{$tl('p.seconds')}}" format="s"
:title="$tl('p.refreshCountdown')" :title="$tl('p.refreshCountdown')"
:value="countdownTime" :value="countdownTime"
@finish="silenceLoadData" @finish="silenceLoadData"
/> >
<template #suffix>
<div style="font-size: 12px">{{ $tl('p.seconds') }}</div>
</template>
</a-statistic-countdown>
</a-space> </a-space>
</template> </template>
<template #bodyCell="{ column, text, record }"> <template #bodyCell="{ column, text, record }">

View File

@ -333,7 +333,7 @@
><a-switch ><a-switch
v-model:checked="temp.autorun" v-model:checked="temp.autorun"
:checked-children="$tl('p.start')" :checked-children="$tl('p.start')"
un-checked-children="不{{$tl('p.start')}}" :un-checked-children="$tl('p.noStart')"
/></a-col> /></a-col>
<a-col :span="4" style="text-align: right"> <a-col :span="4" style="text-align: right">
<a-tooltip> <a-tooltip>

View File

@ -42,11 +42,15 @@
</div> </div>
<a-button type="primary" :loading="loading" @click="loadData">{{ $tl('c.search') }}</a-button> <a-button type="primary" :loading="loading" @click="loadData">{{ $tl('c.search') }}</a-button>
<a-statistic-countdown <a-statistic-countdown
format=" {{$tl('c.seconds')}}" format="s"
:title="$tl('c.refreshCountdown')" :title="$tl('c.refreshCountdown') + ' '"
:value="countdownTime" :value="countdownTime"
@finish="autoUpdate" @finish="autoUpdate"
/> >
<template #suffix>
<div style="font-size: 12px">{{ $tl('c.seconds') }}</div>
</template>
</a-statistic-countdown>
</a-space> </a-space>
</template> </template>
<template #bodyCell="{ column, text, record }"> <template #bodyCell="{ column, text, record }">
@ -310,11 +314,15 @@
</div> </div>
<a-button type="primary" :loading="loading" @click="loadData">{{ $tl('c.search') }}</a-button> <a-button type="primary" :loading="loading" @click="loadData">{{ $tl('c.search') }}</a-button>
<a-statistic-countdown <a-statistic-countdown
format=" {{$tl('c.seconds')}}" format="s"
:title="$tl('c.refreshCountdown')" :title="$tl('c.refreshCountdown') + ' '"
:value="countdownTime" :value="countdownTime"
@finish="autoUpdate" @finish="autoUpdate"
/> >
<template #suffix>
<div style="font-size: 12px">{{ $tl('c.seconds') }}</div>
</template>
</a-statistic-countdown>
</a-space> </a-space>
</template> </template>
<a-collapse v-if="list && list.length"> <a-collapse v-if="list && list.length">

View File

@ -1,13 +1,10 @@
<template> <template>
<div> <div>
<template v-if="useSuggestions"> <template v-if="useSuggestions">
<a-result <a-result :title="$tl('p.noDockerInWorkspace')" :sub-title="$tl('p.goToDockerManagement')">
title="当前工作空间还没有 Docker"
sub-title="请到【系统管理】-> 【资产管理】-> 【Docker管理】新增Docker或者将已新增的Docker授权关联、分配到此工作空间"
>
<template #extra> <template #extra>
<router-link to="/system/assets/docker-list"> <router-link to="/system/assets/docker-list">
<a-button key="console" type="primary">现在就去</a-button></router-link <a-button key="console" type="primary">{{ $tl('p.goToNow') }}</a-button></router-link
> >
</template> </template>
</a-result> </a-result>
@ -19,7 +16,7 @@
default-auto-refresh default-auto-refresh
:auto-refresh-time="5" :auto-refresh-time="5"
table-name="docker-list" table-name="docker-list"
empty-description="没有docker" :empty-description="$tl('p.noDocker')"
:active-page="activePage" :active-page="activePage"
size="middle" size="middle"
:data-source="list" :data-source="list"
@ -38,16 +35,19 @@
<a-space wrap class="search-box"> <a-space wrap class="search-box">
<a-input <a-input
v-model:value="listQuery['%name%']" v-model:value="listQuery['%name%']"
placeholder="名称" :placeholder="$tl('c.name')"
class="search-input-item" class="search-input-item"
@press-enter="loadData" @press-enter="loadData"
/> />
<a-tooltip title="按住 Ctr 或者 Alt/Option 键点击按钮快速回到第一页"> <a-tooltip :title="$tl('p.quickReturn')">
<a-button type="primary" :loading="loading" @click="loadData">搜索</a-button> <a-button type="primary" :loading="loading" @click="loadData">{{ $tl('p.search') }}</a-button>
</a-tooltip> </a-tooltip>
<a-button type="primary" :disabled="!tableSelections || !tableSelections.length" @click="syncToWorkspaceShow" <a-button
>工作空间同步</a-button type="primary"
:disabled="!tableSelections || !tableSelections.length"
@click="syncToWorkspaceShow"
>{{ $tl('p.workspaceSync') }}</a-button
> >
</a-space> </a-space>
</template> </template>
@ -60,14 +60,14 @@
<template v-else-if="column.dataIndex instanceof Array && column.dataIndex.includes('status')"> <template v-else-if="column.dataIndex instanceof Array && column.dataIndex.includes('status')">
<template v-if="record.machineDocker"> <template v-if="record.machineDocker">
<a-tag v-if="record.machineDocker.status === 1" color="green">正常</a-tag> <a-tag v-if="record.machineDocker.status === 1" color="green">{{ $tl('p.statusNormal') }}</a-tag>
<a-tooltip v-else :title="record.machineDocker.failureMsg"> <a-tooltip v-else :title="record.machineDocker.failureMsg">
<a-tag color="red">无法连接</a-tag> <a-tag color="red">{{ $tl('p.unableToConnect') }}</a-tag>
</a-tooltip> </a-tooltip>
</template> </template>
<a-tooltip v-else title="集群关联的 docker 信息丢失,不能继续使用管理功能"> <a-tooltip v-else :title="$tl('p.dockerInfoLost')">
<a-tag color="red">信息丢失</a-tag> <a-tag color="red">{{ $tl('p.infoLost') }}</a-tag>
</a-tooltip> </a-tooltip>
</template> </template>
<template v-else-if="column.dataIndex === 'tags'"> <template v-else-if="column.dataIndex === 'tags'">
@ -89,10 +89,10 @@
type="primary" type="primary"
:disabled="!record.machineDocker || record.machineDocker.status !== 1" :disabled="!record.machineDocker || record.machineDocker.status !== 1"
@click="handleConsole(record)" @click="handleConsole(record)"
>控制台</a-button >{{ $tl('p.console') }}</a-button
> >
<a-button size="small" type="primary" @click="handleEdit(record)">编辑</a-button> <a-button size="small" type="primary" @click="handleEdit(record)">{{ $tl('p.edit') }}</a-button>
<a-button size="small" type="primary" danger @click="handleDelete(record)">删除</a-button> <a-button size="small" type="primary" danger @click="handleDelete(record)">{{ $tl('p.delete') }}</a-button>
</a-space> </a-space>
</template> </template>
</template> </template>
@ -102,16 +102,20 @@
v-model:open="editVisible" v-model:open="editVisible"
destroy-on-close destroy-on-close
:confirm-loading="confirmLoading" :confirm-loading="confirmLoading"
title="编辑 Docker" :title="$tl('p.editDocker')"
:mask-closable="false" :mask-closable="false"
@ok="handleEditOk" @ok="handleEditOk"
> >
<a-form ref="editForm" :rules="rules" :model="temp" :label-col="{ span: 4 }" :wrapper-col="{ span: 18 }"> <a-form ref="editForm" :rules="rules" :model="temp" :label-col="{ span: 4 }" :wrapper-col="{ span: 18 }">
<a-form-item label="容器名称" name="name"> <a-form-item :label="$tl('c.containerName')" name="name">
<a-input v-model:value="temp.name" placeholder="容器名称" /> <a-input v-model:value="temp.name" :placeholder="$tl('c.containerName')" />
</a-form-item> </a-form-item>
<a-form-item label="标签" name="tagInput" help="标签用于容器构建选择容器功能fromTag"> <a-form-item
:label="$tl('c.label')"
name="tagInput"
:help="`${$tl('c.label')} 用于容器构建选择容器功能fromTag`"
>
<a-space direction="vertical" style="width: 100%"> <a-space direction="vertical" style="width: 100%">
<div> <div>
<a-tooltip v-for="(tag, index) in temp.tagsArray" :key="index" :title="tag"> <a-tooltip v-for="(tag, index) in temp.tagsArray" :key="index" :title="tag">
@ -135,7 +139,7 @@
v-model:value="temp.tagInput" v-model:value="temp.tagInput"
type="text" type="text"
size="small" size="small"
placeholder="请输入标签名 字母数字 长度 1-10" :placeholder="$tl('p.enterTagName')"
@blur="handleInputConfirm" @blur="handleInputConfirm"
@keyup.enter="handleInputConfirm" @keyup.enter="handleInputConfirm"
/> />
@ -145,7 +149,7 @@
style="borderstyle: dashed" style="borderstyle: dashed"
@click="showInput" @click="showInput"
> >
<PlusOutlined /> 新增 <PlusOutlined /> {{ $tl('p.add') }}
</a-tag> </a-tag>
</template> </template>
</a-space> </a-space>
@ -166,22 +170,22 @@
v-model:open="syncToWorkspaceVisible" v-model:open="syncToWorkspaceVisible"
destroy-on-close destroy-on-close
:confirm-loading="confirmLoading" :confirm-loading="confirmLoading"
title="同步到其他工作空间" :title="$tl('p.syncToOtherWorkspace')"
:mask-closable="false" :mask-closable="false"
@ok="handleSyncToWorkspace" @ok="handleSyncToWorkspace"
> >
<a-alert message="温馨提示" type="warning"> <a-alert :message="$tl('p.warmTip')" type="warning">
<template #description> <template #description>
<ul> <ul>
<li>同步机制采用容器 host 确定是同一个服务器docker</li> <li>{{ $tl('p.syncMechanism') }}</li>
<li>当目标工作空间不存在对应的节点时候将自动创建一个新的docker逻辑docker</li> <li>{{ $tl('p.createNewDocker') }}</li>
<li>当目标工作空间已经存在节点时候将自动同步 docker 仓库配置信息</li> <li>{{ $tl('p.syncDockerInfo') }}</li>
</ul> </ul>
</template> </template>
</a-alert> </a-alert>
<a-form :model="temp" :label-col="{ span: 6 }" :wrapper-col="{ span: 14 }"> <a-form :model="temp" :label-col="{ span: 6 }" :wrapper-col="{ span: 14 }">
<a-form-item> </a-form-item> <a-form-item> </a-form-item>
<a-form-item label="选择工作空间" name="workspaceId"> <a-form-item :label="$tl('p.chooseWorkspace')" name="workspaceId">
<a-select <a-select
v-model:value="temp.workspaceId" v-model:value="temp.workspaceId"
show-search show-search
@ -195,7 +199,7 @@
) )
} }
" "
placeholder="请选择工作空间" :placeholder="$tl('c.selectWorkspace')"
> >
<a-select-option v-for="item in workspaceList" :key="item.id" :disabled="getWorkspaceId() === item.id">{{ <a-select-option v-for="item in workspaceList" :key="item.id" :disabled="getWorkspaceId() === item.id">{{
item.name item.name
@ -236,7 +240,7 @@ export default {
columns: [ columns: [
{ {
title: '名称', title: this.$tl('c.name'),
dataIndex: 'name', dataIndex: 'name',
ellipsis: true, ellipsis: true,
width: 100 width: 100
@ -249,33 +253,33 @@ export default {
tooltip: true tooltip: true
}, },
{ {
title: '状态', title: this.$tl('p.status'),
dataIndex: ['machineDocker', 'status'], dataIndex: ['machineDocker', 'status'],
ellipsis: true, ellipsis: true,
align: 'center', align: 'center',
width: '100px' width: '100px'
}, },
{ {
title: 'docker版本', title: `docker${this.$tl('p.version')}`,
dataIndex: ['machineDocker', 'dockerVersion'], dataIndex: ['machineDocker', 'dockerVersion'],
ellipsis: true, ellipsis: true,
width: '120px', width: '120px',
tooltip: true tooltip: true
}, },
{ {
title: '标签', title: this.$tl('c.label'),
dataIndex: 'tags', dataIndex: 'tags',
width: 100, width: 100,
ellipsis: true ellipsis: true
}, },
{ {
title: '最后修改人', title: this.$tl('p.lastModifiedBy'),
dataIndex: 'modifyUser', dataIndex: 'modifyUser',
width: '120px', width: '120px',
ellipsis: true ellipsis: true
}, },
{ {
title: '创建时间', title: this.$tl('p.creationTime'),
dataIndex: 'createTimeMillis', dataIndex: 'createTimeMillis',
ellipsis: true, ellipsis: true,
sorter: true, sorter: true,
@ -283,7 +287,7 @@ export default {
width: '170px' width: '170px'
}, },
{ {
title: '修改时间', title: this.$tl('p.modificationTime'),
dataIndex: 'modifyTimeMillis', dataIndex: 'modifyTimeMillis',
sorter: true, sorter: true,
ellipsis: true, ellipsis: true,
@ -291,7 +295,7 @@ export default {
width: '170px' width: '170px'
}, },
{ {
title: '操作', title: this.$tl('p.action'),
dataIndex: 'operation', dataIndex: 'operation',
fixed: 'right', fixed: 'right',
@ -301,16 +305,16 @@ export default {
], ],
rules: { rules: {
// id: [{ required: true, message: "Please input ID", trigger: "blur" }], // id: [{ required: true, message: "Please input ID", trigger: "blur" }],
name: [{ required: true, message: '请填写容器名称', trigger: 'blur' }], name: [{ required: true, message: this.$tl('p.enterContainerName'), trigger: 'blur' }],
host: [{ required: true, message: '请填写容器地址', trigger: 'blur' }], host: [{ required: true, message: this.$tl('p.enterContainerAddress'), trigger: 'blur' }],
tagInput: [ tagInput: [
// { required: true, message: "Please input ID", trigger: "blur" }, // { required: true, message: "Please input ID", trigger: "blur" },
{ pattern: /^\w{1,10}$/, message: '标签限制为字母数字且长度 1-10' } { pattern: /^\w{1,10}$/, message: this.$tl('c.labelRestriction') }
], ],
tag: [ tag: [
{ required: true, message: '请填写关联容器标签', trigger: 'blur' }, { required: true, message: this.$tl('p.enterAssociatedContainerTag'), trigger: 'blur' },
{ pattern: /^\w{1,10}$/, message: '标签限制为字母数字且长度 1-10' } { pattern: /^\w{1,10}$/, message: this.$tl('c.labelRestriction') }
] ]
}, },
workspaceList: [], workspaceList: [],
@ -360,6 +364,9 @@ export default {
this.loadData() this.loadData()
}, },
methods: { methods: {
$tl(key, ...args) {
return this.$t(`pages.docker.list.${key}`, ...args)
},
// //
loadData(pointerEvent) { loadData(pointerEvent) {
this.loading = true this.loading = true
@ -452,11 +459,11 @@ export default {
// //
handleDelete(record) { handleDelete(record) {
$confirm({ $confirm({
title: '系统提示', title: this.$tl('p.systemPrompt'),
zIndex: 1009, zIndex: 1009,
content: '真的要删除该记录么?删除后构建关联的容器标签将无法使用', content: this.$tl('p.confirmDeletion'),
okText: '确认', okText: this.$tl('p.confirm'),
cancelText: '取消', cancelText: this.$tl('p.cancel'),
onOk: () => { onOk: () => {
return deleteDcoker({ return deleteDcoker({
id: record.id id: record.id
@ -530,7 +537,7 @@ export default {
handleSyncToWorkspace() { handleSyncToWorkspace() {
if (!this.temp.workspaceId) { if (!this.temp.workspaceId) {
$notification.warn({ $notification.warn({
message: '请选择工作空间' message: this.$tl('c.selectWorkspace')
}) })
return false return false
} }

View File

@ -25,7 +25,7 @@
<a-switch <a-switch
v-model:checked="timestamps" v-model:checked="timestamps"
:checked-children="$tl('p.show')" :checked-children="$tl('p.show')"
un-checked-children="不{{$tl('p.show')}}" :un-checked-children="$tl('p.hide')"
/> />
</div> </div>
<a-button type="primary" size="small" @click="initWebSocket" <a-button type="primary" size="small" @click="initWebSocket"

View File

@ -47,11 +47,15 @@
<a-button type="primary" :loading="loading" @click="loadData">{{ $tl('p.search') }}</a-button> <a-button type="primary" :loading="loading" @click="loadData">{{ $tl('p.search') }}</a-button>
<a-statistic-countdown <a-statistic-countdown
format=" {{$tl('p.sSeconds')}}" format="s"
:title="$tl('p.refreshCountdown')" :title="$tl('p.refreshCountdown')"
:value="countdownTime" :value="countdownTime"
@finish="loadData" @finish="loadData"
/> >
<template #suffix>
<div style="font-size: 12px">{{ $tl('p.sSeconds') }}</div>
</template>
</a-statistic-countdown>
</a-space> </a-space>
</template> </template>
<template #bodyCell="{ column, text, record }"> <template #bodyCell="{ column, text, record }">

View File

@ -22,7 +22,7 @@
<a-switch <a-switch
v-model:checked="timestamps" v-model:checked="timestamps"
:checked-children="$tl('p.show')" :checked-children="$tl('p.show')"
un-checked-children="不{{$tl('p.show')}}" :un-checked-children="$tl('p.hide')"
/> />
</div> </div>
<a-button type="primary" size="small" @click="init"><ReloadOutlined /> {{ $tl('p.refresh') }} </a-button> <a-button type="primary" size="small" @click="init"><ReloadOutlined /> {{ $tl('p.refresh') }} </a-button>

View File

@ -28,11 +28,15 @@
<a-button type="primary" :loading="loading" @click="loadData">{{ $tl('p.search') }}</a-button> <a-button type="primary" :loading="loading" @click="loadData">{{ $tl('p.search') }}</a-button>
<a-button type="primary" @click="handleAdd">{{ $tl('p.create') }}</a-button> <a-button type="primary" @click="handleAdd">{{ $tl('p.create') }}</a-button>
<a-statistic-countdown <a-statistic-countdown
format=" {{$tl('p.seconds')}}" format="s"
:title="$tl('p.refreshCountdown')" :title="$tl('p.refreshCountdown')"
:value="countdownTime" :value="countdownTime"
@finish="loadData" @finish="loadData"
/> >
<template #suffix>
<div style="font-size: 12px">{{ $tl('p.seconds') }}</div>
</template>
</a-statistic-countdown>
</a-space> </a-space>
</template> </template>

View File

@ -62,11 +62,15 @@
</a-tooltip> </a-tooltip>
<a-button type="primary" :loading="loading" @click="loadData">{{ $tl('p.search') }}</a-button> <a-button type="primary" :loading="loading" @click="loadData">{{ $tl('p.search') }}</a-button>
<a-statistic-countdown <a-statistic-countdown
format=" {{$tl('p.seconds')}}" format="s"
:title="$tl('p.refreshCountdown')" :title="$tl('p.refreshCountdown')"
:value="countdownTime" :value="countdownTime"
@finish="loadData" @finish="loadData"
/> >
<template #suffix>
<div style="font-size: 12px">{{ $tl('p.seconds') }}</div>
</template>
</a-statistic-countdown>
</a-space> </a-space>
</template> </template>

View File

@ -64,7 +64,7 @@ export default defineConfig(({ mode }: ConfigEnv) => {
proxy: { proxy: {
// http // http
'/api': { '/api': {
target: `http://${HOST}`, target: HOST.includes('http') ? HOST : `http://${HOST}`,
changeOrigin: true, changeOrigin: true,
ws: true, ws: true,
rewrite: (path) => path.replace(/^\/api/, ''), rewrite: (path) => path.replace(/^\/api/, ''),