Browse Source

fix: 解决容器 label 或者 env 为空导致无法编辑的问题 (#1580)

pull/1582/head
ssongliu 1 year ago committed by GitHub
parent
commit
f90c009782
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      frontend/src/api/modules/container.ts
  2. 2
      frontend/src/views/container/container/operate/index.vue

8
frontend/src/api/modules/container.ts

@ -98,7 +98,7 @@ export const createVolume = (params: Container.VolumeCreate) => {
// repo
export const checkRepoStatus = (id: number) => {
return http.post(`/containers/repo/status`, { id: id });
return http.post(`/containers/repo/status`, { id: id }, 40000);
};
export const searchImageRepo = (params: SearchWithPage) => {
return http.post<ResPage<Container.RepoInfo>>(`/containers/repo/search`, params);
@ -107,13 +107,13 @@ export const listImageRepo = () => {
return http.get<Container.RepoOptions>(`/containers/repo`);
};
export const createImageRepo = (params: Container.RepoCreate) => {
return http.post(`/containers/repo`, params);
return http.post(`/containers/repo`, params, 40000);
};
export const updateImageRepo = (params: Container.RepoUpdate) => {
return http.post(`/containers/repo/update`, params);
return http.post(`/containers/repo/update`, params, 40000);
};
export const deleteImageRepo = (params: Container.RepoDelete) => {
return http.post(`/containers/repo/del`, params);
return http.post(`/containers/repo/del`, params, 40000);
};
// composeTemplate

2
frontend/src/views/container/container/operate/index.vue

@ -250,6 +250,8 @@ const acceptParams = (params: DialogProps): void => {
itemCmd += `'${item}' `;
}
dialogData.value.rowData.cmdStr = itemCmd ? itemCmd.substring(0, itemCmd.length - 1) : '';
dialogData.value.rowData.labels = dialogData.value.rowData.labels || [];
dialogData.value.rowData.env = dialogData.value.rowData.env || [];
dialogData.value.rowData.labelsStr = dialogData.value.rowData.labels.join('\n');
dialogData.value.rowData.envStr = dialogData.value.rowData.env.join('\n');
dialogData.value.rowData.exposedPorts = dialogData.value.rowData.exposedPorts || [];

Loading…
Cancel
Save