|
|
@@ -142,7 +142,24 @@
|
|
|
:visible.sync="showBindDomainDialog"
|
|
|
center
|
|
|
>
|
|
|
- <template />
|
|
|
+ <template>
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-plus" style="margin: 5px" @click="handleAddDomain">添加</el-button>
|
|
|
+ <div>
|
|
|
+ <el-row v-if="showElInput">
|
|
|
+ <el-input v-model="appDomainForm.domain" style="width: 300px; margin: 5px" />
|
|
|
+ <el-button size="mini" type="text" style="margin: 5px" @click="onAddDomain()">确定</el-button>
|
|
|
+ <el-button size="mini" type="text" style="margin: 5px" @click="showElInput = false">取消</el-button>
|
|
|
+ </el-row>
|
|
|
+ <el-row v-for="(domain, index) in domainList" :key="index">
|
|
|
+ <el-input
|
|
|
+ :value="domain"
|
|
|
+ style="width: 300px; margin: 5px"
|
|
|
+ readonly
|
|
|
+ />
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-delete" style="margin: 5px" @click="onDeleteDomain(domain)">删除</el-button>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</el-dialog>
|
|
|
<el-dialog
|
|
|
title="拷贝应用配置"
|
|
|
@@ -479,10 +496,11 @@
|
|
|
|
|
|
<script>
|
|
|
import {
|
|
|
+ addAppBindDomain,
|
|
|
addAppConfig, addAppDeployConfig,
|
|
|
- copyAppConfig,
|
|
|
+ copyAppConfig, deleteAppBindDomain,
|
|
|
deleteAppConfig, deleteAppDeployConfig,
|
|
|
- eraseAppRepo,
|
|
|
+ eraseAppRepo, getAppBindDomain,
|
|
|
getAppConfig,
|
|
|
getAppConfigList,
|
|
|
getAppDeployConfigList,
|
|
|
@@ -511,6 +529,12 @@ export default {
|
|
|
dataList: [],
|
|
|
// **********************************************************************
|
|
|
showBindDomainDialog: false,
|
|
|
+ domainList: [],
|
|
|
+ showElInput: false,
|
|
|
+ appDomainForm: {
|
|
|
+ appId: '',
|
|
|
+ domain: ''
|
|
|
+ },
|
|
|
// **********************************************************************
|
|
|
showAddDialog: false,
|
|
|
repoAuthList: [],
|
|
|
@@ -632,7 +656,47 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
handleBindDomain(index, row) {
|
|
|
- this.showBindDomainDialog = true
|
|
|
+ this.appDomainForm.appId = row.appId
|
|
|
+ this.getAppBindDomainWrapper(row.appId)
|
|
|
+ },
|
|
|
+ getAppBindDomainWrapper(appId) {
|
|
|
+ getAppBindDomain(appId).then(resp => {
|
|
|
+ if (resp.code === 0) {
|
|
|
+ this.domainList = resp.data
|
|
|
+ this.showBindDomainDialog = true
|
|
|
+ } else {
|
|
|
+ this.$message.warning(resp.msg)
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ this.$message.error(error.message)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleAddDomain() {
|
|
|
+ this.showElInput = true
|
|
|
+ },
|
|
|
+ onAddDomain() {
|
|
|
+ addAppBindDomain(this.appDomainForm).then(resp => {
|
|
|
+ if (resp.code === 0) {
|
|
|
+ this.getAppBindDomainWrapper(this.appDomainForm.appId)
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ this.$message.error(error.message)
|
|
|
+ }).finally(() => {
|
|
|
+ this.showElInput = false
|
|
|
+ this.appDomainForm.domain = ''
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onDeleteDomain(domain) {
|
|
|
+ this.appDomainForm.domain = domain
|
|
|
+ deleteAppBindDomain(this.appDomainForm).then(resp => {
|
|
|
+ if (resp.code === 0) {
|
|
|
+ this.getAppBindDomainWrapper(this.appDomainForm.appId)
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ this.$message.error(error.message)
|
|
|
+ }).finally(() => {
|
|
|
+ this.appDomainForm.domain = ''
|
|
|
+ })
|
|
|
},
|
|
|
handleCopy(index, row) {
|
|
|
this.copyForm.appId = row.appId
|