This commit is contained in:
李亮 2021-08-04 11:29:59 +08:00
parent a280b7ff6a
commit 1af8dcd90f
7 changed files with 39 additions and 68 deletions

33
package-lock.json generated
View File

@ -26,6 +26,7 @@
"jsonlint": "1.6.3",
"jszip": "3.2.1",
"levenary": "^1.1.1",
"moment": "^2.29.1",
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
"path-to-regexp": "2.4.0",
@ -38,7 +39,6 @@
"vue-codemirror": "^4.0.6",
"vue-count-to": "1.0.13",
"vue-json-editor": "^1.4.3",
"vue-json-viewer": "^2.2.19",
"vue-router": "3.0.2",
"vue-splitpane": "1.0.4",
"vuedraggable": "2.20.0",
@ -14147,6 +14147,14 @@
"random": "bin/random"
}
},
"node_modules/moment": {
"version": "2.29.1",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz",
"integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==",
"engines": {
"node": "*"
}
},
"node_modules/move-concurrently": {
"version": "1.0.1",
"resolved": "https://registry.npm.taobao.org/move-concurrently/download/move-concurrently-1.0.1.tgz",
@ -20903,15 +20911,6 @@
"npm": ">= 3.0.0"
}
},
"node_modules/vue-json-viewer": {
"version": "2.2.19",
"resolved": "https://registry.npmjs.org/vue-json-viewer/-/vue-json-viewer-2.2.19.tgz",
"integrity": "sha512-zXbnYwADWB7THcn17HBw9PhyXZDgvBFtfG0QE1cASr2vzXeTPtIKp0vkjuDdxOcvlHKU5Sj1uaLYiMCX+ULPOQ==",
"dependencies": {
"clipboard": "^2.0.4",
"vue": "^2.6.9"
}
},
"node_modules/vue-loader": {
"version": "15.9.7",
"resolved": "https://registry.nlark.com/vue-loader/download/vue-loader-15.9.7.tgz",
@ -33635,6 +33634,11 @@
"commander": "*"
}
},
"moment": {
"version": "2.29.1",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz",
"integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ=="
},
"move-concurrently": {
"version": "1.0.1",
"resolved": "https://registry.npm.taobao.org/move-concurrently/download/move-concurrently-1.0.1.tgz",
@ -39193,15 +39197,6 @@
"vue": "^2.2.6"
}
},
"vue-json-viewer": {
"version": "2.2.19",
"resolved": "https://registry.npmjs.org/vue-json-viewer/-/vue-json-viewer-2.2.19.tgz",
"integrity": "sha512-zXbnYwADWB7THcn17HBw9PhyXZDgvBFtfG0QE1cASr2vzXeTPtIKp0vkjuDdxOcvlHKU5Sj1uaLYiMCX+ULPOQ==",
"requires": {
"clipboard": "^2.0.4",
"vue": "^2.6.9"
}
},
"vue-loader": {
"version": "15.9.7",
"resolved": "https://registry.nlark.com/vue-loader/download/vue-loader-15.9.7.tgz",

View File

@ -103,21 +103,21 @@ export function putHostNetwork(name, data) {
// 虚拟机管理-镜像列表
export function getImages() {
return request({
url: '/v1/harvesterhci.io.virtualmachineimages',
url: '/virtual/v1/harvesterhci.io.virtualmachineimages',
method: 'get'
})
}
export function getImagesYaml(name) {
return request({
url: '/proxy/apis/cdi.kubevirt.io/v1beta1/namespaces/default/datavolumes/' + name,
url: '/virtual/apis/cdi.kubevirt.io/v1beta1/namespaces/default/virtualmachineimages/' + name,
method: 'get'
})
}
export function putImagesYaml(name, yaml) {
return request({
url: '/proxy/apis/cdi.kubevirt.io/v1beta1/namespaces/default/datavolumes/' + name,
url: '/virtual/apis/cdi.kubevirt.io/v1beta1/namespaces/default/virtualmachineimages/' + name,
method: 'put',
data: yaml
})

View File

@ -377,11 +377,9 @@ const getImagesList = () => {
obj.state = res.data[item].metadata.state.name
obj.creationTime = res.data[item].metadata.creationTimestamp
obj.aliveTime = res.data[item].metadata.fields[5]
obj.size = Number((res.data[item].status.size / 1024 / 1024).toString().match(/^\d+(?:\.\d{0,2})?/)) + 'MB'
obj.aliveTime = obj.aliveTime.replace('d', '天')
obj.aliveTime = obj.aliveTime.replace('h', '小时')
// obj.size = res.data[item].spec.pvc.resources.requests.storage
obj.size = '510mb'
console.log(res.data)
listResult[item] = obj
}
resolve({ total: res.data.length, rows: listResult })

View File

@ -115,8 +115,8 @@ export default {
this.$router.push({ path: `images/detail/config`, query: row })
break
case 3:
row.editYaml = true
// this.$router.push({ path: `images/detail/yaml`, query: row })
row.VirtualMachineCreate = true
this.$router.push({ path: `virtual-machine/create`, query: row })
break
case 4:
this.downloadHostYaml(row.name)

View File

@ -23,31 +23,12 @@
<el-tabs type="border-card" tab-position="left">
<el-tab-pane label="基本信息">
<h4>基本信息</h4>
<el-form-item label="资源类型" prop="resourceType">
<el-select v-model="formData.resourceType">
<el-option
v-for="item in options1"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item v-if="formData.resourceType==='VM Image'" label="镜像" :required="true">
<el-select v-model="formData.image">
<el-option
v-for="item in options2"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="大小" prop="size">
<el-input
v-model="formData.size"
><template slot="append">GIB</template></el-input>
</el-form-item>
<el-form-item prop="name"><el-input
v-model="formData.name"
placeholder="镜像地址"
:hide-required-asterisk="true"
/></el-form-item>
</el-tab-pane>
<el-tab-pane label="标签">
@ -131,7 +112,7 @@ export default {
},
methods: {
goBack() {
this.$router.push({ path: '/virtual/images.vue' })
this.$router.push({ path: '/virtual/images' })
},
addTag() {
this.formData.tag.push(

View File

@ -39,7 +39,7 @@ module.exports = {
proxy: {
'/oauth': {
ws: false,
target: 'http://119.45.100.73:30881/', /* Host */
target: 'http://119.45.100.73:30881/'/* Host */
},
// '^/v1': {
// ws: false,
@ -71,7 +71,7 @@ module.exports = {
'^/blockChain': {
ws: false,
target: 'http://106.53.150.192/',
changeOrigin: true,
changeOrigin: true
},
'^/api/': {
ws: false,
@ -80,17 +80,17 @@ module.exports = {
},
'^/apis/': {
ws: false,
target: 'http://119.45.100.73:30881/', /* Host */
target: 'http://119.45.100.73:30881/'/* Host */
// changeOrigin: true,
},
'^/virtual': {
ws: false,
target: 'http://106.53.150.192/',
changeOrigin: true,
changeOrigin: true
},
'^/function': {
ws: false,
target: 'http://106.53.150.192:8004/',
target: 'http://106.53.150.192:8004/'
// changeOrigin: true,
},
'/kapis/terminal.kubesphere.io': {

View File

@ -3195,7 +3195,7 @@
"resolved" "https://registry.npm.taobao.org/cli-width/download/cli-width-3.0.0.tgz"
"version" "3.0.0"
"clipboard@^2.0.4", "clipboard@2.0.4":
"clipboard@2.0.4":
"integrity" "sha1-g22v1mzw/qXXHOXVsL9ulYAJES0="
"resolved" "https://registry.npm.taobao.org/clipboard/download/clipboard-2.0.4.tgz?cache=0&sync_timestamp=1615410040723&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fclipboard%2Fdownload%2Fclipboard-2.0.4.tgz"
"version" "2.0.4"
@ -8144,6 +8144,11 @@
dependencies:
"commander" "*"
"moment@^2.29.1":
"integrity" "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ=="
"resolved" "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz"
"version" "2.29.1"
"move-concurrently@^1.0.1":
"integrity" "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I="
"resolved" "https://registry.npm.taobao.org/move-concurrently/download/move-concurrently-1.0.1.tgz"
@ -12075,14 +12080,6 @@
dependencies:
"vue" "^2.2.6"
"vue-json-viewer@^2.2.19":
"integrity" "sha512-zXbnYwADWB7THcn17HBw9PhyXZDgvBFtfG0QE1cASr2vzXeTPtIKp0vkjuDdxOcvlHKU5Sj1uaLYiMCX+ULPOQ=="
"resolved" "https://registry.npmjs.org/vue-json-viewer/-/vue-json-viewer-2.2.19.tgz"
"version" "2.2.19"
dependencies:
"clipboard" "^2.0.4"
"vue" "^2.6.9"
"vue-loader@^15.9.2":
"integrity" "sha1-FbBXdcPgw4QHZ5OTws5t9nOwEEQ="
"resolved" "https://registry.nlark.com/vue-loader/download/vue-loader-15.9.7.tgz"
@ -12125,7 +12122,7 @@
"resolved" "https://registry.npm.taobao.org/vue-template-es2015-compiler/download/vue-template-es2015-compiler-1.9.1.tgz"
"version" "1.9.1"
"vue@^2 || ^3.0.0-0", "vue@^2.2.6", "vue@^2.5.17", "vue@^2.6.9", "vue@^2.x", "vue@2.6.10", "vue@2.x":
"vue@^2 || ^3.0.0-0", "vue@^2.2.6", "vue@^2.5.17", "vue@^2.x", "vue@2.6.10", "vue@2.x":
"integrity" "sha1-pysaQqTYKnIepDjRtr9V5mGVxjc="
"resolved" "https://registry.nlark.com/vue/download/vue-2.6.10.tgz"
"version" "2.6.10"