|
@@ -45,8 +45,9 @@
|
|
|
<el-button
|
|
<el-button
|
|
|
size="mini"
|
|
size="mini"
|
|
|
type="success"
|
|
type="success"
|
|
|
|
|
+ icon="el-icon-edit"
|
|
|
@click="handleShowImage(scope.$index, scope.row)"
|
|
@click="handleShowImage(scope.$index, scope.row)"
|
|
|
- >查看</el-button>
|
|
|
|
|
|
|
+ >编辑</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
@@ -124,6 +125,7 @@
|
|
|
center
|
|
center
|
|
|
>
|
|
>
|
|
|
<template>
|
|
<template>
|
|
|
|
|
+ <el-button type="success" size="mini" icon="el-icon-plus" @click="handleAddBind">添加</el-button>
|
|
|
<el-table
|
|
<el-table
|
|
|
:data="dockerBinds"
|
|
:data="dockerBinds"
|
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
@@ -136,14 +138,54 @@
|
|
|
prop="containerPath"
|
|
prop="containerPath"
|
|
|
label="container 路径"
|
|
label="container 路径"
|
|
|
/>
|
|
/>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ fixed="right"
|
|
|
|
|
+ label="操作"
|
|
|
|
|
+ width="120"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ type="danger"
|
|
|
|
|
+ @click="onDeleteBind(scope.$index, scope.row)"
|
|
|
|
|
+ >删除</el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
</template>
|
|
</template>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ title="添加 docker 目录映射"
|
|
|
|
|
+ append-to-body
|
|
|
|
|
+ :visible.sync="showAddBindDialog"
|
|
|
|
|
+ center
|
|
|
|
|
+ >
|
|
|
|
|
+ <template>
|
|
|
|
|
+ <el-form ref="form" :model="dockerBindForm" label-width="80px">
|
|
|
|
|
+ <el-form-item label="host 目录" style="width: 70%; padding-right: 2px">
|
|
|
|
|
+ <el-input v-model="dockerBindForm.hostPath" style="width: 70%; padding-right: 2px" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="container 目录" style="width: 70%; padding-right: 2px">
|
|
|
|
|
+ <el-input v-model="dockerBindForm.containerPath" style="width: 70%; padding-right: 2px" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item>
|
|
|
|
|
+ <el-button type="primary" @click="onAddBind">确定</el-button>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-dialog>
|
|
|
</el-container>
|
|
</el-container>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import { addCompiler, deleteCompiler, getCompilerList, getCompilerTypes, getImageBindList } from '@/api/devops'
|
|
|
|
|
|
|
+import {
|
|
|
|
|
+ addCompiler, addImageBind,
|
|
|
|
|
+ deleteCompiler,
|
|
|
|
|
+ deleteImageBind,
|
|
|
|
|
+ getCompilerList,
|
|
|
|
|
+ getCompilerTypes,
|
|
|
|
|
+ getImageBindList
|
|
|
|
|
+} from '@/api/devops'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'Compiler',
|
|
name: 'Compiler',
|
|
@@ -161,7 +203,6 @@ export default {
|
|
|
dataList: [],
|
|
dataList: [],
|
|
|
// **********************************************************************
|
|
// **********************************************************************
|
|
|
showAddDialog: false,
|
|
showAddDialog: false,
|
|
|
- showImageDialog: false,
|
|
|
|
|
form: {
|
|
form: {
|
|
|
type: 'none',
|
|
type: 'none',
|
|
|
name: '',
|
|
name: '',
|
|
@@ -171,7 +212,15 @@ export default {
|
|
|
compilerImage: ''
|
|
compilerImage: ''
|
|
|
},
|
|
},
|
|
|
compileTypes: [],
|
|
compileTypes: [],
|
|
|
- dockerBinds: []
|
|
|
|
|
|
|
+ // **********************************************************************
|
|
|
|
|
+ showImageDialog: false,
|
|
|
|
|
+ showAddBindDialog: false,
|
|
|
|
|
+ dockerBinds: [],
|
|
|
|
|
+ dockerBindForm: {
|
|
|
|
|
+ id: 0,
|
|
|
|
|
+ hostPath: '',
|
|
|
|
|
+ containerPath: ''
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
@@ -229,8 +278,12 @@ export default {
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
handleShowImage(index, row) {
|
|
handleShowImage(index, row) {
|
|
|
|
|
+ this.dockerBindForm.id = row.id
|
|
|
|
|
+ this.getImageBindListWrapper(row.id)
|
|
|
|
|
+ },
|
|
|
|
|
+ getImageBindListWrapper(id) {
|
|
|
const queryInfo = {}
|
|
const queryInfo = {}
|
|
|
- queryInfo.id = row.id
|
|
|
|
|
|
|
+ queryInfo.id = id
|
|
|
getImageBindList(queryInfo).then(resp => {
|
|
getImageBindList(queryInfo).then(resp => {
|
|
|
if (resp.code === 0) {
|
|
if (resp.code === 0) {
|
|
|
this.dockerBinds = resp.data
|
|
this.dockerBinds = resp.data
|
|
@@ -242,6 +295,40 @@ export default {
|
|
|
this.$message.error(error.message)
|
|
this.$message.error(error.message)
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ handleAddBind() {
|
|
|
|
|
+ this.showAddBindDialog = true
|
|
|
|
|
+ },
|
|
|
|
|
+ onAddBind() {
|
|
|
|
|
+ addImageBind(this.dockerBindForm).then(resp => {
|
|
|
|
|
+ if (resp.code === 0) {
|
|
|
|
|
+ this.getImageBindListWrapper(this.dockerBindForm.id)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.warning(resp.msg)
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(error => {
|
|
|
|
|
+ this.$message.error(error.message)
|
|
|
|
|
+ }).finally(() => {
|
|
|
|
|
+ this.showAddBindDialog = false
|
|
|
|
|
+ this.dockerBindForm.hostPath = ''
|
|
|
|
|
+ this.dockerBindForm.containerPath = ''
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ onDeleteBind(index, row) {
|
|
|
|
|
+ this.dockerBindForm.hostPath = row.hostPath
|
|
|
|
|
+ this.dockerBindForm.containerPath = row.containerPath
|
|
|
|
|
+ deleteImageBind(this.dockerBindForm).then(resp => {
|
|
|
|
|
+ if (resp.code === 0) {
|
|
|
|
|
+ this.getImageBindListWrapper(this.dockerBindForm.id)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.warning(resp.msg)
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(error => {
|
|
|
|
|
+ this.$message.error(error.message)
|
|
|
|
|
+ }).finally(() => {
|
|
|
|
|
+ this.dockerBindForm.hostPath = ''
|
|
|
|
|
+ this.dockerBindForm.containerPath = ''
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
handleEdit(index, row) {
|
|
handleEdit(index, row) {
|
|
|
this.$confirm('确定要删除 ' + row.name + '?', '提示', {
|
|
this.$confirm('确定要删除 ' + row.name + '?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
confirmButtonText: '确定',
|