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

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

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