-
+
镜像:{{ formData.displayName }} {{ formData.state }}
@@ -14,12 +14,13 @@
标签: {{ formData.labels }}
+ 命名空间:{{ formData.namespace }}
存活时间:{{ formData.aliveTime }}
基本信息
{{ formData.message }}
-
+
@@ -55,7 +56,8 @@ export default {
resourceType: '镜像地址',
size: '大小',
description: '描述'
- }
+ },
+ loading: false
}
},
computed: {
@@ -73,6 +75,7 @@ export default {
this.$router.push({ path: '/virtual/images' })
},
getFormData() {
+ this.loading = true
getImages().then(res => {
for (let i = 0; i < res.data.length; i++) {
if (this.$route.query.name.toString() === res.data[i].metadata.name) {
@@ -87,28 +90,31 @@ export default {
name: data.metadata.name,
state: data.metadata.state.name,
labels: data.metadata.labels,
+ namespace: data.metadata.namespace,
aliveTime: data.metadata.fields[3].replace('d', '天').replace('h', '小时').replace('m', '分钟'),
description: data.metadata.annotations ? data.metadata.annotations['field.cattle.io/description'] : '-',
size: Number((data.status.size / 1024 / 1024).toString().match(/^\d+(?:\.\d{0,2})?/)) + 'MB',
resourceType: data.spec.url
}
+ this.loading = false
})
},
handleDropdown(command) {
switch (command) {
case '1':
- this.$refs.detail.disableConfig = false
+ this.$router.push({ path: `edit`, query: { name: this.$route.query.name, namespace: this.formData.namespace }})
break
case '2':
+ this.$router.push({ path: `edit`, query: { name: this.$route.query.name, namespace: this.formData.namespace, clone: true }})
break
case '6':
- this.viewYamlFunc(this.$route.query.name)
+ this.viewYamlFunc(this.$route.query.name, this.formData.namespace)
break
case '3':
- this.editYamlFunc(this.$route.query.name)
+ this.editYamlFunc(this.$route.query.name, this.formData.namespace)
break
case '4':
- this.downloadYamlFunc(this.$route.query.name, getImagesYaml)
+ this.downloadYamlFunc(this.$route.query.name, getImagesYaml, this.formData.namespace)
break
case 5:
break
diff --git a/src/views/virtualMachine/image/edit.vue b/src/views/virtualMachine/image/edit.vue
index 64850e9..50783d1 100644
--- a/src/views/virtualMachine/image/edit.vue
+++ b/src/views/virtualMachine/image/edit.vue
@@ -8,7 +8,7 @@