|
|
@@ -74,64 +74,26 @@
|
|
|
:visible.sync="showAddDialog"
|
|
|
center
|
|
|
>
|
|
|
- <template>
|
|
|
- <el-form ref="form" :model="form" label-width="100px">
|
|
|
- <el-form-item label="仓库认证" prop="repoAuthName">
|
|
|
- <el-row :gutter="10">
|
|
|
- <el-col :span="14">
|
|
|
- <el-select
|
|
|
- v-model="form.repoAuthName"
|
|
|
- placeholder="请选择仓库认证"
|
|
|
- style="width: 100%"
|
|
|
- :disabled="repoAuthNames.length === 0"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(item, index) in repoAuthNames"
|
|
|
- :key="index"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- icon="el-icon-plus"
|
|
|
- @click="handleAddRepoAuth"
|
|
|
- >
|
|
|
- {{ repoAuthNames.length === 0 ? '暂无数据,去添加' : '新增认证' }}
|
|
|
- </el-button>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="仓库地址">
|
|
|
- <el-input v-model="form.registryUrl" style="width: 70%" placeholder="e.g. registry.cn-hangzhou.aliyuncs.com" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="命名空间">
|
|
|
- <el-input v-model="form.registryNamespace" style="width: 70%" placeholder="e.g. reghao/" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button type="primary" @click="onAddDockerRegistry">确定</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </template>
|
|
|
- </el-dialog>
|
|
|
- <el-dialog
|
|
|
- title="添加仓库认证"
|
|
|
- append-to-body
|
|
|
- :visible.sync="showAddRepoAuthDialog"
|
|
|
- center
|
|
|
- >
|
|
|
-
|
|
|
+ <registry-add-card
|
|
|
+ @close="showAddDialog = false"
|
|
|
+ @success="onAddSuccess"
|
|
|
+ />
|
|
|
</el-dialog>
|
|
|
</el-container>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { addDockerRegistry, deleteDockerRegistry, getDockerRegistryList, getRepoAuthNames } from '@/api/devops'
|
|
|
+import RegistryAddCard from '@/components/card/RegistryAddCard.vue'
|
|
|
+import {
|
|
|
+ deleteDockerRegistry,
|
|
|
+ getDockerRegistryList,
|
|
|
+} from '@/api/devops'
|
|
|
|
|
|
export default {
|
|
|
name: 'DockerRegistry',
|
|
|
+ components: {
|
|
|
+ RegistryAddCard
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
queryInfo: {
|
|
|
@@ -145,17 +107,7 @@ export default {
|
|
|
totalSize: 0,
|
|
|
dataList: [],
|
|
|
// **********************************************************************
|
|
|
- showAddDialog: false,
|
|
|
- repoAuthNames: [],
|
|
|
- form: {
|
|
|
- repoAuthName: '',
|
|
|
- registryUrl: '',
|
|
|
- registryNamespace: ''
|
|
|
- },
|
|
|
- // **********************************************************************
|
|
|
- showAddRepoAuthDialog: false,
|
|
|
- repoAuthForm: {
|
|
|
- }
|
|
|
+ showAddDialog: false
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
@@ -185,27 +137,9 @@ export default {
|
|
|
},
|
|
|
handleShowAdd() {
|
|
|
this.showAddDialog = true
|
|
|
- getRepoAuthNames().then(resp => {
|
|
|
- if (resp.code === 0) {
|
|
|
- this.repoAuthNames = resp.data
|
|
|
- } else {
|
|
|
- this.showAddDialog = false
|
|
|
- this.$message.info(resp.msg)
|
|
|
- }
|
|
|
- }).catch(error => {
|
|
|
- this.showAddDialog = false
|
|
|
- this.$message.error(error.message)
|
|
|
- })
|
|
|
},
|
|
|
- onAddDockerRegistry() {
|
|
|
- addDockerRegistry(this.form).then(resp => {
|
|
|
- this.$message.info(resp.msg)
|
|
|
- this.getData()
|
|
|
- }).catch(error => {
|
|
|
- this.$message.error(error.message)
|
|
|
- }).finally(() => {
|
|
|
- this.showAddDialog = false
|
|
|
- })
|
|
|
+ onAddSuccess() {
|
|
|
+ this.showAddDialog = false
|
|
|
},
|
|
|
handleEdit(index, row) {
|
|
|
this.$confirm('确定要删除 ' + row.registryUrl + '?', '提示', {
|
|
|
@@ -228,9 +162,6 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- handleAddRepoAuth() {
|
|
|
- this.showAddRepoAuthDialog = true
|
|
|
- },
|
|
|
handleUsage(row) {
|
|
|
this.$message.info('handleUsage')
|
|
|
}
|