fix: 镜像导出增加默认值 (#988)

pull/989/head
ssongliu 2023-05-10 16:16:15 +08:00 committed by GitHub
parent 1e4ea2f8c3
commit dbb94942df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 2 deletions

View File

@ -493,6 +493,7 @@ const message = {
imageBuild: 'Image build', imageBuild: 'Image build',
pathSelect: 'Path', pathSelect: 'Path',
label: 'Label', label: 'Label',
imageTag: 'Image Tag',
push: 'Push', push: 'Push',
fileName: 'FileName', fileName: 'FileName',
export: 'Export', export: 'Export',

View File

@ -518,6 +518,7 @@ const message = {
build: '', build: '',
pathSelect: '', pathSelect: '',
label: '', label: '',
imageTag: '',
push: '', push: '',
fileName: '', fileName: '',
export: '', export: '',

View File

@ -173,6 +173,7 @@ const buttons = [
label: i18n.global.t('container.tag'), label: i18n.global.t('container.tag'),
click: (row: Container.ImageInfo) => { click: (row: Container.ImageInfo) => {
let params = { let params = {
itemName: row.tags.length !== 0 ? row.tags[0].split(':')[0] : '',
repos: repos.value, repos: repos.value,
sourceID: row.id, sourceID: row.id,
}; };

View File

@ -79,8 +79,8 @@ const dialogData = ref<DialogProps>({
const acceptParams = async (params: DialogProps): Promise<void> => { const acceptParams = async (params: DialogProps): Promise<void> => {
drawerVisiable.value = true; drawerVisiable.value = true;
form.tags = params.tags; form.tags = params.tags;
form.tagName = form.tags.length !== 0 ? form.tags[0] : '';
form.path = ''; form.path = '';
form.tagName = '';
form.name = ''; form.name = '';
dialogData.value.repos = params.repos; dialogData.value.repos = params.repos;
}; };

View File

@ -1,7 +1,7 @@
<template> <template>
<el-drawer v-model="drawerVisiable" :destroy-on-close="true" :close-on-click-modal="false" size="50%"> <el-drawer v-model="drawerVisiable" :destroy-on-close="true" :close-on-click-modal="false" size="50%">
<template #header> <template #header>
<DrawerHeader :header="$t('container.image') + ' Tag'" :back="handleClose" /> <DrawerHeader :header="$t('container.imageTag')" :resource="form.itemName" :back="handleClose" />
</template> </template>
<el-form v-loading="loading" label-position="top" ref="formRef" :model="form" label-width="80px"> <el-form v-loading="loading" label-position="top" ref="formRef" :model="form" label-width="80px">
<el-row type="flex" justify="center"> <el-row type="flex" justify="center">
@ -56,6 +56,7 @@ const loading = ref(false);
const drawerVisiable = ref(false); const drawerVisiable = ref(false);
const repos = ref(); const repos = ref();
const form = reactive({ const form = reactive({
itemName: '',
sourceID: '', sourceID: '',
fromRepo: true, fromRepo: true,
repoID: 1, repoID: 1,
@ -63,6 +64,7 @@ const form = reactive({
}); });
interface DialogProps { interface DialogProps {
itemName: string;
repos: Array<Container.RepoOptions>; repos: Array<Container.RepoOptions>;
sourceID: string; sourceID: string;
} }
@ -70,6 +72,7 @@ interface DialogProps {
const acceptParams = async (params: DialogProps): Promise<void> => { const acceptParams = async (params: DialogProps): Promise<void> => {
drawerVisiable.value = true; drawerVisiable.value = true;
form.repoID = 1; form.repoID = 1;
form.itemName = params.itemName;
form.sourceID = params.sourceID; form.sourceID = params.sourceID;
form.targetName = ''; form.targetName = '';
form.fromRepo = true; form.fromRepo = true;