fix: compose file edit env (#8833)

Refs: #8826
This commit is contained in:
2025-05-26 17:34:17 +08:00 committed by GitHub
parent 1716e42ffe
commit 5d25f972ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 8 deletions

View file

@ -302,6 +302,8 @@ export namespace Container {
name: string;
path: string;
content: string;
env: Array<string>;
createdBy: string;
}
export interface TemplateCreate {

View file

@ -73,21 +73,19 @@ const onSubmitEdit = async () => {
name: name.value,
path: path.value,
content: content.value,
env: environmentStr.value,
createdBy: createdBy.value,
env: environmentStr.value?.split('\n') || [],
};
if (environmentStr.value != undefined) {
param.env = environmentStr.value.split('\n');
emit('search');
}
loading.value = true;
await composeUpdate(param)
.then(() => {
loading.value = false;
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
composeVisible.value = false;
if (environmentStr.value) {
emit('search');
}
})
.catch(() => {
.finally(() => {
loading.value = false;
});
};

View file

@ -85,7 +85,7 @@
</template>
</LayoutContent>
<EditDialog ref="dialogEditRef" />
<EditDialog ref="dialogEditRef" @search="search" />
<CreateDialog @search="search" ref="dialogRef" />
<DeleteDialog @search="search" ref="dialogDelRef" />
</div>
@ -190,6 +190,8 @@ const onEdit = async (row: Container.ComposeInfo) => {
name: row.name,
path: row.path,
content: res.data,
env: row.env,
createdBy: row.createdBy,
};
dialogEditRef.value!.acceptParams(params);
};