Commit 58fb478a authored by derong.zhang's avatar derong.zhang

处理切换服务时有未发布内容问题

parent 75958a61
......@@ -19,7 +19,7 @@ module.exports = {
},
// Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST
host: '0.0.0.0', // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: true,
errorOverlay: true,
......
......@@ -34,13 +34,13 @@
</template>
<script>
import {logout} from '../api/user.api'
export default {
export default {
data () {
return {
isCollapsed: false
}
},
computed : {
computed: {
menuitemClasses: function () {
return [
'menu-item',
......@@ -58,7 +58,7 @@ import {logout} from '../api/user.api'
})
}
}
}
}
</script>
<style scoped>
.layout{
......
......@@ -2,7 +2,7 @@
<div class="mainconfiguration">
<div class="mainconfiguration_header">
<span><span class="selectsertitle">请选择要配置的服务:</span>
<Select v-model="server" style="width:82%" @on-change="selectserver" @on-open-change="selectserverchange">
<Select v-model="server" style="width:82%" @on-change="selectserver">
<Option v-for="item in serviceList" :value="item" :key="item">{{ item }}</Option>
</Select>
</span>
......@@ -107,12 +107,19 @@
</div>
</Modal>
<Modal v-model="changeserverModal" :mask-closable = 'false' :footer-hide='true' width='300'>
<h3 class="delatediv">是否确认切换服务?</h3>
<h3 class="delatediv">有尚未发布的配置,是否确认切换服务?切换会导致未发布的配置丢失。</h3>
<div class="rollbackdivbtn">
<Button type="primary" size='small' style="margin:0 20px" @click="changeserverModal = false">取消</Button>
<Button type="primary" size='small' style="margin:0 20px" @click="coloechangeserver">取消</Button>
<Button type="primary" size='small' @click="confiechangeserver">确认</Button>
</div>
</Modal>
<Modal v-model="changedivModal" :mask-closable = 'false' :footer-hide='true' width='300'>
<h3 class="delatediv">有尚未发布的配置,是否确认切换列表?切换会导致未发布的配置丢失。</h3>
<div class="rollbackdivbtn">
<Button type="primary" size='small' style="margin:0 20px" @click="changedivModal = false">取消</Button>
<Button type="primary" size='small' @click="confiechangediv">确认</Button>
</div>
</Modal>
<Modal v-model="updateconfigModal" :mask-closable = 'false' :footer-hide='true' width='400'>
<h3 class="updatediv">修改</h3>
<div class="updatedivclass">
......@@ -159,7 +166,7 @@
</div>
<div class="rollbackdivbtn">
<Button type="primary" size='small' style="margin:0 20px" @click="ContrastModal = false">取消</Button>
<Button type="primary" size='small' @click="confirfabu">保存</Button>
<Button type="primary" size='small' @click="confirfabu">发布</Button>
</div>
</Modal>
<Modal v-model="ContrasttestModal" :mask-closable = 'false' :footer-hide='true' width='500'>
......@@ -167,16 +174,16 @@
<div class="updatetestclass">
<p>
<span v-if="aftertestmostatuorigen">原配置:开启</span>
<span v-else>原配置:开启</span>
<span v-else>原配置:关闭</span>
</p>
<p>
<span v-if="aftertestmostatus">新配置:开启</span>
<span v-else>新配置:开启</span>
<span v-else>新配置:关闭</span>
</p>
</div>
<div class="rollbackdivbtn">
<Button type="primary" size='small' style="margin:0 20px" @click="ContrasttestModal = false">取消</Button>
<Button type="primary" size='small' @click="confirfabu">保存</Button>
<Button type="primary" size='small' @click="confirfabu">发布</Button>
</div>
</Modal>
<Modal v-model="ContrastnodeModal" :mask-closable = 'false' :footer-hide='true' width='500'>
......@@ -189,7 +196,7 @@
</div>
<div class="rollbackdivbtn">
<Button type="primary" size='small' style="margin:0 20px" @click="ContrastnodeModal = false">取消</Button>
<Button type="primary" size='small' @click="confirnode">保存</Button>
<Button type="primary" size='small' @click="confirnode">发布</Button>
</div>
</Modal>
</div>
......@@ -210,11 +217,14 @@ export default {
listonecolortest: false,
colorupdata: false,
ContrastModal: false,
changedivModal: false,
testdiv: false,
contrastlist: [],
logDataorigen: [],
clickIndex1: 0,
rollbackModal: false,
origenselectserver: '',
paramscontent: [],
delateModal: false,
updateconfigModal: false,
updatetestModal: false,
......@@ -241,6 +251,7 @@ export default {
updateweight: '',
newupdateweight: '',
key: 'url_auth_list',
changekey: '',
service_name: '',
version: '',
formInline: {
......@@ -368,6 +379,12 @@ export default {
},
methods: {
testmo (key) {
this.changekey = key
if (this.colorupdata === true) {
this.changedivModal = true
return
}
this.contrastlist = []
this.listonecolorauth = false
this.listonecolorfor = false
this.listonecolorint = false
......@@ -375,6 +392,8 @@ export default {
this.listonecolordoma = false
this.listonecolortest = true
this.isShowList = false
this.colorupdatacolor = false
this.colorupdata = false
this.key = key
this.testdiv = true
this.getkeytext(key)
......@@ -385,7 +404,13 @@ export default {
getconfigurelist(data).then(data => {
this.testmostatus = data.body
this.aftertestmostatuorigen = data.body
data.body == false ? this.closetest = true : this.opentest = false
if (data.body === true) {
this.opentest = true
this.closetest = false
} else {
this.closetest = true
this.opentest = false
}
})
},
opentestradio (data) {
......@@ -401,68 +426,114 @@ export default {
this.testmostatus = this.aftertestmostatus
this.colorupdata = true
this.colorupdatacolor = true
this.origenselectserver = this.server
// this.testmostatus = this.aftertestmostatus === 'true' ? '开启' : '关闭'
},
serviceAdministrator (key) {
this.changekey = key
if (this.colorupdata === true) {
this.changedivModal = true
return
}
this.contrastlist = []
this.listonecolorauth = false
this.listonecolorfor = false
this.listonecolorint = false
this.listonecolorserv = true
this.listonecolordoma = false
this.listonecolortest = false
this.colorupdatacolor = false
this.colorupdata = false
this.isShowList = true
this.testdiv = false
this.key = key
this.logData = []
this.getkeytext(key)
this.getconfigurlist(key, this.server)
},
domainnameprefixlist (key) {
this.changekey = key
if (this.colorupdata === true) {
this.changedivModal = true
return
}
this.contrastlist = []
this.listonecolorauth = false
this.listonecolorfor = false
this.listonecolorint = false
this.listonecolorserv = false
this.listonecolordoma = true
this.listonecolortest = false
this.colorupdatacolor = false
this.colorupdata = false
this.isShowList = true
this.testdiv = false
this.key = key
this.logData = []
this.getkeytext(key)
this.getconfigurlist(key, this.server)
},
internallylist (key) {
this.changekey = key
if (this.colorupdata === true) {
this.changedivModal = true
return
}
this.contrastlist = []
this.listonecolorauth = false
this.listonecolorfor = false
this.listonecolorint = true
this.listonecolorserv = false
this.listonecolordoma = false
this.listonecolortest = false
this.colorupdatacolor = false
this.colorupdata = false
this.isShowList = true
this.testdiv = false
this.key = key
this.logData = []
this.getkeytext(key)
this.getconfigurlist(key, this.server)
},
foreignlist (key) {
this.changekey = key
if (this.colorupdata === true) {
this.changedivModal = true
return
}
this.contrastlist = []
this.listonecolorauth = false
this.listonecolorfor = true
this.listonecolorint = false
this.listonecolorserv = false
this.listonecolordoma = false
this.listonecolortest = false
this.colorupdatacolor = false
this.colorupdata = false
this.isShowList = true
this.testdiv = false
this.key = key
this.logData = []
this.getkeytext(key)
this.getconfigurlist(key, this.server)
},
authenticationlist (key) {
this.changekey = key
if (this.colorupdata === true) {
this.changedivModal = true
return
}
this.contrastlist = []
this.listonecolorauth = true
this.listonecolorfor = false
this.listonecolorint = false
this.listonecolorserv = false
this.listonecolordoma = false
this.listonecolortest = false
this.colorupdatacolor = false
this.colorupdata = false
this.isShowList = true
this.testdiv = false
this.key = key
this.logData = []
this.getkeytext(key)
......@@ -473,12 +544,17 @@ export default {
this.$Message.error('请先输入要添加的内容')
return
}
if (this.contrastlist.length === 0) {
this.contrastlist = []
} else {
this.contrastlist.push(this.singlebaraddition)
}
this.logData.push({sort: this.singlebaraddition})
this.logparamsarr.push(this.singlebaraddition)
this.singlebaraddition = ''
this.colorupdata = true
this.colorupdatacolor = true
this.origenselectserver = this.server
},
alladd () {
this.alladdModal = true
......@@ -496,11 +572,17 @@ export default {
this.logparamsarr = arr
arr.map(item => {
this.logData.push({sort: item})
if (this.contrastlist.length === 0) {
this.contrastlist = []
} else {
this.contrastlist.push(item)
}
// this.contrastlist.push(item)
})
this.alladdModal = false
this.colorupdata = true
this.colorupdatacolor = true
this.origenselectserver = this.server
},
colsealladdmodal () {
this.alladdModal = false
......@@ -508,8 +590,12 @@ export default {
},
clear () {
this.logData = []
// this.contrastlist = []
this.singlebaraddition = ''
this.logparamsarr = []
this.colorupdatacolor = true
this.colorupdata = true
this.origenselectserver = this.server
},
rollback () {
let data = {
......@@ -569,6 +655,9 @@ export default {
return item != this.delateconfigurecontent
})
this.delateModal = false
this.colorupdata = true
this.colorupdatacolor = true
this.origenselectserver = this.server
},
updateconfigclick (data) {
this.updateconfig = data.sort
......@@ -580,8 +669,24 @@ export default {
this.updateconfigModal = false
this.colorupdata = true
this.colorupdatacolor = true
this.origenselectserver = this.server
},
updatetestclick () {
let data = {
key: this.key,
service_name: this.server
}
getconfigurelist(data).then(data => {
this.testmostatus = data.body
this.aftertestmostatuorigen = data.body
if (data.body === true) {
this.opentest = true
this.closetest = false
} else {
this.closetest = true
this.opentest = false
}
})
this.updatetestModal = true
},
updatenode (data) {
......@@ -634,30 +739,46 @@ export default {
key: this.key,
service_name: this.server
}
let params = this.logparamsarr
postconfigurelist(data, params).then(data => {
if (this.key === 'test_mode') {
this.paramscontent = this.aftertestmostatus === true ? 'true' : 'false'
} else {
this.paramscontent = this.logparamsarr
}
// let params = this.logparamsarr
postconfigurelist(data, this.paramscontent).then(data => {
if (data.code === 200) {
this.$Message.success('发布成功')
this.colorupdata = false
this.colorupdatacolor = false
this.ContrastModal = false
this.ContrasttestModal = false
this.contrastlist = this.logDataorigen
}
})
},
selectserver (data) {
if (this.colorupdatacolor === true) {
this.changeserverModal = true
return
}
this.service_name = data
this.getnodeList()
this.getkeytext('url_auth_list')
this.getconfigurlist('url_auth_list', this.server)
},
selectserverchange () {
if (this.colorupdatacolor === true) {
this.changeserverModal = true
}
coloechangeserver () {
this.server = this.origenselectserver
this.changeserverModal = false
},
confiechangeserver () {
this.service_name = this.server
this.getnodeList()
this.getkeytext('url_auth_list')
this.getconfigurlist('url_auth_list', this.server)
this.colorupdatacolor = false
this.changeserverModal = false
this.colorupdatacolor = false
this.colorupdata = false
},
getnodeList () {
let data = {
......@@ -693,6 +814,109 @@ export default {
}
})
},
confiechangediv () {
if (this.changekey === 'url_white_list') {
this.listonecolorauth = false
this.listonecolorfor = true
this.listonecolorint = false
this.listonecolorserv = false
this.listonecolordoma = false
this.listonecolortest = false
this.isShowList = true
this.logData = []
this.contrastlist = []
this.testdiv = false
this.getkeytext(this.changekey)
this.getconfigurlist(this.changekey, this.server)
}
if (this.changekey === 'url_auth_list') {
this.listonecolorauth = true
this.listonecolorfor = false
this.listonecolorint = false
this.listonecolorserv = false
this.listonecolordoma = false
this.listonecolortest = false
this.isShowList = true
this.testdiv = false
this.logData = []
this.contrastlist = []
this.getkeytext(this.changekeyy)
this.getconfigurlist(this.changekey, this.server)
}
if (this.changekey === 'url_black_list') {
this.listonecolorauth = false
this.listonecolorfor = false
this.listonecolorint = true
this.listonecolorserv = false
this.listonecolordoma = false
this.listonecolortest = false
this.isShowList = true
this.testdiv = false
this.logData = []
this.contrastlist = []
this.getkeytext(this.changekey)
this.getconfigurlist(this.changekey, this.server)
}
if (this.changekey === 'domain_prefix') {
this.listonecolorauth = false
this.listonecolorfor = false
this.listonecolorint = false
this.listonecolorserv = false
this.listonecolordoma = true
this.listonecolortest = false
this.isShowList = true
this.testdiv = false
this.logData = []
this.contrastlist = []
this.getkeytext(this.changekey)
this.getconfigurlist(this.changekey, this.server)
}
if (this.changekey === 'service_owner') {
this.listonecolorauth = false
this.listonecolorfor = false
this.listonecolorint = false
this.listonecolorserv = true
this.listonecolordoma = false
this.listonecolortest = false
this.isShowList = true
this.testdiv = false
this.logData = []
this.contrastlist = []
this.getkeytext(this.changekey)
this.getconfigurlist(this.changekey, this.server)
}
if (this.changekey === 'test_mode') {
this.listonecolorauth = false
this.listonecolorfor = false
this.listonecolorint = false
this.listonecolorserv = false
this.listonecolordoma = false
this.listonecolortest = true
this.isShowList = false
this.testdiv = true
this.logData = []
this.contrastlist = []
this.getkeytext(this.changekey)
let data = {
key: this.changekey,
service_name: this.server
}
getconfigurelist(data).then(data => {
this.testmostatus = data.body
this.aftertestmostatuorigen = data.body
if (data.body === true) {
this.opentest = true
this.closetest = false
} else {
this.closetest = true
this.opentest = false
}
})
}
this.colorupdata = false
this.colorupdatacolor = false
this.changedivModal = false
},
confireupdatenode () {
this.nodeData[this.updatenodeIndex].Meta.weight = this.updateweight
this.nodeData[this.updatenodeIndex].updatacolorclass = true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment