diff --git a/src/views/virtualization/ImageDetail.vue b/src/views/virtualization/ImageDetail.vue index 35ccd10..5129f48 100644 --- a/src/views/virtualization/ImageDetail.vue +++ b/src/views/virtualization/ImageDetail.vue @@ -32,8 +32,13 @@ {{ statusLabel(detail.status) }} + + {{ detail.mode === 'remote' ? '远端模式' : '本地模式' }} + {{ detail.size ? formatSize(detail.size) : '-' }} {{ detail.path || '-' }} + {{ detail.url || '-' }} + {{ detail.source || '-' }} {{ detail.description || '-' }} {{ formatTimestamp(detail.created_at) }} {{ formatTimestamp(detail.updated_at) }} @@ -79,6 +84,11 @@ + + + + + @@ -160,7 +170,7 @@ const syncHostId = ref('') const reloadHostId = ref('') const formRef = ref(null) -const formData = reactive({ name: '', path: '', os_type: 'linux', type: 'system', description: '', status: '' }) +const formData = reactive({ name: '', path: '', os_type: 'linux', type: 'system', description: '', status: '', mode: 'local' }) const formRules = { name: [{ required: true, message: '请输入名称', trigger: 'blur' }], path: [{ required: true, message: '请输入路径', trigger: 'blur' }] @@ -232,7 +242,7 @@ const loadHostStatus = async () => { const handleEdit = () => { if (!detail.value) return const d = detail.value - Object.assign(formData, { name: d.name || '', path: d.path || '', os_type: d.os_type || 'linux', type: d.type || 'system', description: d.description || '', status: d.status || '' }) + Object.assign(formData, { name: d.name || '', path: d.path || '', os_type: d.os_type || 'linux', type: d.type || 'system', description: d.description || '', status: d.status || '', mode: d.mode || 'local' }) editDialogVisible.value = true } @@ -241,7 +251,7 @@ const handleSubmitEdit = () => { if (!valid) return submitLoading.value = true try { - const payload = { image_id: imageId.value, service_id: serviceId.value, image_name: formData.name, path: formData.path, os_type: formData.os_type, type: formData.type, description: formData.description || undefined, status: formData.status || undefined } + const payload = { image_id: imageId.value, service_id: serviceId.value, image_name: formData.name, path: formData.path, os_type: formData.os_type, type: formData.type, description: formData.description || undefined, status: formData.status || undefined, mode: formData.mode } Object.keys(payload).forEach(k => { if (payload[k] === undefined) delete payload[k] }) const res = await updateImage(payload) if (res?.data?.code === 200) { ElMessage.success('修改成功'); editDialogVisible.value = false; loadDetail() } diff --git a/src/views/virtualization/ImageManage.vue b/src/views/virtualization/ImageManage.vue index 9e3821d..6e6fbb7 100644 --- a/src/views/virtualization/ImageManage.vue +++ b/src/views/virtualization/ImageManage.vue @@ -54,6 +54,11 @@ {{ row.type === 'system' ? '系统' : '数据' }} + + +