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

pull/1582/head
ssongliu 2023-07-07 17:45:06 +08:00 committed by GitHub
parent a54913f788
commit f90c009782
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -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

View File

@ -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 || [];