|
|
@@ -22,7 +22,7 @@
|
|
|
/>
|
|
|
</el-select>
|
|
|
<el-select
|
|
|
- v-model="machine"
|
|
|
+ v-model="machineId"
|
|
|
size="mini"
|
|
|
placeholder="机器"
|
|
|
style="margin-left: 5px"
|
|
|
@@ -102,6 +102,7 @@
|
|
|
placeholder="标题"
|
|
|
/>
|
|
|
<el-button size="mini" type="success" icon="el-icon-search" style="margin-left: 5px" @click="onGetImages">查询</el-button>
|
|
|
+ <el-button size="mini" type="danger" icon="el-icon-search" style="margin-left: 5px" @click="onDeleteImages">删除未用镜像</el-button>
|
|
|
<el-table
|
|
|
ref="multipleTable"
|
|
|
:data="dataList1"
|
|
|
@@ -142,7 +143,7 @@ export default {
|
|
|
return {
|
|
|
env: 'test',
|
|
|
envList: [],
|
|
|
- machine: '',
|
|
|
+ machineId: '',
|
|
|
machineList: [],
|
|
|
queryInfo: {
|
|
|
type: '1',
|
|
|
@@ -217,7 +218,7 @@ export default {
|
|
|
formData.append('imageIds', imageIds)
|
|
|
|
|
|
const jsonPayload = {}
|
|
|
- jsonPayload.machineId = this.machine
|
|
|
+ jsonPayload.machineId = this.machineId
|
|
|
jsonPayload.ops = 'imageRm'
|
|
|
jsonPayload.payload = imageIds
|
|
|
this.sendMessage(JSON.stringify(jsonPayload))
|
|
|
@@ -241,7 +242,7 @@ export default {
|
|
|
const containerIds = []
|
|
|
containerIds.push(row.containerId)
|
|
|
const jsonPayload = {}
|
|
|
- jsonPayload.machineId = this.machine
|
|
|
+ jsonPayload.machineId = this.machineId
|
|
|
jsonPayload.ops = 'containerRm'
|
|
|
jsonPayload.payload = containerIds
|
|
|
this.sendMessage(JSON.stringify(jsonPayload))
|
|
|
@@ -254,20 +255,32 @@ export default {
|
|
|
},
|
|
|
onRefresh() {
|
|
|
const jsonPayload = {}
|
|
|
- jsonPayload.machineId = this.machine
|
|
|
+ jsonPayload.machineId = this.machineId
|
|
|
jsonPayload.ops = 'containerList'
|
|
|
this.sendMessage(JSON.stringify(jsonPayload))
|
|
|
},
|
|
|
onGetImages() {
|
|
|
+ if (this.machineId === '') {
|
|
|
+ this.$message.warning('请选择机器')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
const jsonPayload = {}
|
|
|
- jsonPayload.machineId = this.machine
|
|
|
+ jsonPayload.machineId = this.machineId
|
|
|
jsonPayload.ops = 'imageList'
|
|
|
jsonPayload.dockerQuery = this.queryInfo
|
|
|
this.sendMessage(JSON.stringify(jsonPayload))
|
|
|
this.showImageDialog = true
|
|
|
},
|
|
|
+ onDeleteImages() {
|
|
|
+ const jsonPayload = {}
|
|
|
+ jsonPayload.machineId = this.machineId
|
|
|
+ jsonPayload.ops = 'imageRmUnused'
|
|
|
+ jsonPayload.dockerQuery = this.queryInfo
|
|
|
+ this.sendMessage(JSON.stringify(jsonPayload))
|
|
|
+ },
|
|
|
onSelectChange() {
|
|
|
- this.machine = ''
|
|
|
+ this.machineId = ''
|
|
|
this.getMachineList(this.env)
|
|
|
},
|
|
|
onSelectChange1() {
|
|
|
@@ -277,7 +290,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
const jsonPayload = {}
|
|
|
- jsonPayload.machineId = this.machine
|
|
|
+ jsonPayload.machineId = this.machineId
|
|
|
jsonPayload.ops = 'containerList'
|
|
|
this.sendMessage(JSON.stringify(jsonPayload))
|
|
|
},
|