Commit b67b7b64 authored by derong.zhang's avatar derong.zhang

加入lint校验

parent f003ce5f
...@@ -24,6 +24,20 @@ module.exports = { ...@@ -24,6 +24,20 @@ module.exports = {
// allow async-await // allow async-await
'generator-star-spacing': 'off', 'generator-star-spacing': 'off',
// allow debugger during development // allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'arrow-parens': 0,
// allow async-await
'generator-star-spacing': 0,
"eqeqeq": 0,
"no-unused-vars": 0,
'semi': 0,
"handle-callback-err": 0,
"no-array-constructor": 0,
"no-irregular-whitespace": 0,
"no-tabs": 0,
"no-mixed-spaces-and-tabs": 0,
"no-useless-escape": 0,
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
} }
} }
...@@ -3,43 +3,43 @@ import { ...@@ -3,43 +3,43 @@ import {
sapi sapi
} from '../config' } from '../config'
import qs from 'qs' import qs from 'qs'
//获取服务列表 // 获取服务列表
export function getservicelist () { export function getservicelist () {
return axios.get(`/heimdallr/service/list`) return axios.get(`/heimdallr/service/list`)
} }
//获取文字说明 // 获取文字说明
export function getkey (key) { export function getkey (key) {
return axios.get(`/heimdallr/get-key-explain/${key}`) return axios.get(`/heimdallr/get-key-explain/${key}`)
} }
//获取配置列表 // 获取配置列表
export function getconfigurelist (data) { export function getconfigurelist (data) {
return axios.get(`/heimdallr/config/service/${data.key}/${data.service_name}`) return axios.get(`/heimdallr/config/service/${data.key}/${data.service_name}`)
} }
//发布 // 发布
export function postconfigurelist (data,params) { export function postconfigurelist (data, params) {
return axios.post(`/heimdallr/config/service/${data.key}/${data.service_name}`,params,{headers: { return axios.post(`/heimdallr/config/service/${data.key}/${data.service_name}`, params, {headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}}) }})
} }
//获取版本 // 获取版本
export function getVersionnumber(data) { export function getVersionnumber (data) {
return axios.get(`/heimdallr/config-version/service/${data.key}/${data.service_name}/list`) return axios.get(`/heimdallr/config-version/service/${data.key}/${data.service_name}/list`)
} }
//回滚版本 // 回滚版本
export function rollbacknum(data) { export function rollbacknum (data) {
return axios.get(`/heimdallr/config-version/service/${data.key}/${data.service_name}/set/${data.version}`) return axios.get(`/heimdallr/config-version/service/${data.key}/${data.service_name}/set/${data.version}`)
} }
//获取节点列表 // 获取节点列表
export function getnodelist(data) { export function getnodelist (data) {
return axios.get(`/heimdallr/node/list/${data.service_name}`) return axios.get(`/heimdallr/node/list/${data.service_name}`)
} }
//获取节点配置 // 获取节点配置
export function getnodeconfig(data) { export function getnodeconfig (data) {
return axios.get(`/heimdallr/config/node/${data.service_name}/${data.node_id}`) return axios.get(`/heimdallr/config/node/${data.service_name}/${data.node_id}`)
} }
//设置节点配置 // 设置节点配置
export function nodeconfig(data,weight) { export function nodeconfig (data, weight) {
return axios.post(`/heimdallr/config/node/${data.service_name}/${data.node_id}`,weight,{headers: { return axios.post(`/heimdallr/config/node/${data.service_name}/${data.node_id}`, weight, {headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}}) }})
} }
...@@ -3,7 +3,7 @@ import { ...@@ -3,7 +3,7 @@ import {
sapi sapi
} from '../config' } from '../config'
export function login (data) { export function login (data) {
return axios.get(`/heimdallr/login`,{headers: { return axios.get(`/heimdallr/login`, {headers: {
'heimdallr-user': data 'heimdallr-user': data
}}) }})
} }
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<div class="list_right_configure"> <div class="list_right_configure">
<div class="configure_content" v-show="isShowList"> <div class="configure_content" v-show="isShowList">
<p class="configure_content_configure"> <p class="configure_content_configure">
<span><Input v-model="singlebaraddition" placeholder="请输入配置项" style="width: 75%;margin-top:1%;float:left;margin-left:2%" /></span> <span><Input v-model="singlebaraddition" placeholder="请输入配置项" style="width: 65%;margin-top:1%;float:left;margin-left:2%" /></span>
<Button type="primary" size = 'small' style="margin:1.2% 0 0 1%;float:left" @click="oneadd">单条添加</Button> <Button type="primary" size = 'small' style="margin:1.2% 0 0 1%;float:left" @click="oneadd">单条添加</Button>
<span style="float:right;margin:1.2% 2% 0% 1%"> <span style="float:right;margin:1.2% 2% 0% 1%">
<Button type="primary" size = 'small' @click="clear">清空</Button> <Button type="primary" size = 'small' @click="clear">清空</Button>
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
</div> </div>
</template> </template>
<script> <script>
import {getservicelist,getkey,getconfigurelist,postconfigurelist,getVersionnumber,rollbacknum,getnodelist,nodeconfig} from '../../api/mainconfigguration.server' import {getservicelist, getkey, getconfigurelist, postconfigurelist, getVersionnumber, rollbacknum, getnodelist, nodeconfig} from '../../api/mainconfigguration.server'
export default { export default {
data () { data () {
return { return {
...@@ -237,15 +237,15 @@ export default { ...@@ -237,15 +237,15 @@ export default {
title: '状态', title: '状态',
key: 'Status', key: 'Status',
align: 'center', align: 'center',
render: (h, params) =>{ render: (h, params) => {
return h('div', params.row.Status == 'passing' ? 'up': 'down') return h('div', params.row.Status == 'passing' ? 'up' : 'down')
}, }
}, },
{ {
title: '权重', title: '权重',
key: 'weight', key: 'weight',
align: 'center', align: 'center',
render: (h, params) =>{ render: (h, params) => {
return h('div', params.row.Meta.weight || 100) return h('div', params.row.Meta.weight || 100)
} }
}, },
...@@ -265,7 +265,7 @@ export default { ...@@ -265,7 +265,7 @@ export default {
}, },
on: { on: {
click: () => { click: () => {
this.updatenode (params.row) this.updatenode(params.row)
} }
} }
}, '修改'), }, '修改'),
...@@ -295,70 +295,70 @@ export default { ...@@ -295,70 +295,70 @@ export default {
this.isShowList = false this.isShowList = false
this.key = key this.key = key
this.getkeytext(key) this.getkeytext(key)
let data ={ let data = {
key: key, key: key,
service_name: this.server service_name: this.server
} }
getconfigurelist(data).then(data =>{ getconfigurelist(data).then(data => {
this.testmostatus = data.body // this.testmostatus = data.body
this.testmostatus == 'false' ? '关闭' : '开启' this.testmostatus = data.body == 'false' ? '关闭' : '开启'
data.body == false ? this.closetest = true : this.opentest = false data.body == false ? this.closetest = true : this.opentest = false
}) })
}, },
opentestradio (data) { opentestradio (data) {
this.closetest = ! this.closetest this.closetest = !this.closetest
this.aftertestmostatus = true this.aftertestmostatus = true
}, },
closetestradio (data) { closetestradio (data) {
this.opentest = ! this.opentest this.opentest = !this.opentest
this.aftertestmostatus = false this.aftertestmostatus = false
}, },
confireupdaterido () { confireupdaterido () {
this.updatetestModal = false this.updatetestModal = false
this.testmostatus = this.aftertestmostatus this.testmostatus = this.aftertestmostatus
this.testmostatus == 'true' ? '开启' : '关闭' this.testmostatus = this.aftertestmostatus == 'true' ? '开启' : '关闭'
}, },
serviceAdministrator (key) { serviceAdministrator (key) {
this.isShowList = true this.isShowList = true
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.isShowList = true this.isShowList = true
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.isShowList = true this.isShowList = true
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.isShowList = true this.isShowList = true
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.isShowList = true this.isShowList = true
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)
}, },
oneadd () { oneadd () {
if (this.singlebaraddition == '') { if (this.singlebaraddition == '') {
this.$Message.error('请先输入要添加的内容') this.$Message.error('请先输入要添加的内容')
return return
} }
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 = ''
}, },
...@@ -370,14 +370,14 @@ export default { ...@@ -370,14 +370,14 @@ export default {
this.$Message.error('请先输入要添加的内容') this.$Message.error('请先输入要添加的内容')
return return
} }
let str = this.formInline.alladdcontent.replace(/\[|]/g,'') let str = this.formInline.alladdcontent.replace(/\[|]/g, '')
str = str.replace(/\n/g,'') str = str.replace(/\n/g, '')
str = str.replace(/\"/g,'') str = str.replace(/\"/g, '')
str = str.replace(/\'/g,'') str = str.replace(/\'/g, '')
let arr = str.split(',') let arr = str.split(',')
this.logparamsarr = arr this.logparamsarr = arr
arr.map(item =>{ arr.map(item => {
this.logData.push({sort:item}) this.logData.push({sort: item})
}) })
this.alladdModal = false this.alladdModal = false
}, },
...@@ -393,16 +393,16 @@ export default { ...@@ -393,16 +393,16 @@ export default {
rollback () { rollback () {
this.rollbackModal = true this.rollbackModal = true
let data = { let data = {
service_name : this.versionNumber, service_name: this.versionNumber,
key: this.key key: this.key
} }
getVersionnumber(data).then(data =>{ getVersionnumber(data).then(data => {
this.rollbacklist = data.body this.rollbacklist = data.body
this.content = data.body.length == 0 ? '' : data.body[0].value this.content = data.body.length == 0 ? '' : data.body[0].value
this.version = data.body.length == 0 ? '' : data.body[0].key this.version = data.body.length == 0 ? '' : data.body[0].key
}) })
}, },
selectlist (value,key) { selectlist (value, key) {
this.content = value this.content = value
this.version = key this.version = key
}, },
...@@ -411,12 +411,12 @@ export default { ...@@ -411,12 +411,12 @@ export default {
this.$Message.error('没有要回滚的内容') this.$Message.error('没有要回滚的内容')
return return
} }
let data ={ let data = {
key: this.key, key: this.key,
service_name: this.server, service_name: this.server,
version: this.version version: this.version
} }
rollbacknum(data).then(data =>{ rollbacknum(data).then(data => {
if (data.code === 200) { if (data.code === 200) {
this.rollbackModal = false this.rollbackModal = false
this.$Message.success('回滚成功') this.$Message.success('回滚成功')
...@@ -452,7 +452,7 @@ export default { ...@@ -452,7 +452,7 @@ export default {
}, },
getserlist () { getserlist () {
return getservicelist().then((data) => { return getservicelist().then((data) => {
let k='' let k = ''
for (k in data.body) { for (k in data.body) {
this.serviceList.push(k) this.serviceList.push(k)
this.server = this.serviceList[0] this.server = this.serviceList[0]
...@@ -462,18 +462,18 @@ export default { ...@@ -462,18 +462,18 @@ export default {
}, },
getkeytext (key) { getkeytext (key) {
getkey(key).then((data) => { getkey(key).then((data) => {
this.textExplain = data.body.replace(/\n/g,"<br/>") this.textExplain = data.body.replace(/\n/g, '<br/>')
}) })
}, },
getconfigurlist (key,service_name) { getconfigurlist (key, service) {
let data ={ let data = {
key: key, key: key,
service_name: service_name service_name: service
} }
getconfigurelist(data).then(data =>{ getconfigurelist(data).then(data => {
data.body.map(item =>{ data.body.map(item => {
this.logData.push({ this.logData.push({
sort:item sort: item
}) })
}) })
}) })
...@@ -483,12 +483,12 @@ export default { ...@@ -483,12 +483,12 @@ export default {
this.$Message.error('请先添加要发布的内容') this.$Message.error('请先添加要发布的内容')
return return
} }
let data ={ let data = {
key: this.key, key: this.key,
service_name: this.server service_name: this.server
} }
let params = this.logparamsarr let params = this.logparamsarr
postconfigurelist(data,params).then(data => { postconfigurelist(data, params).then(data => {
if (data.code === 200) { if (data.code === 200) {
this.$Message.success('发布成功') this.$Message.success('发布成功')
} }
...@@ -513,8 +513,8 @@ export default { ...@@ -513,8 +513,8 @@ export default {
node_id: data.Id, node_id: data.Id,
service_name: this.server service_name: this.server
} }
let weight = { weight: data.Meta.weight ? data.Meta.weight : 100} let weight = {weight: data.Meta.weight ? data.Meta.weight : 100}
nodeconfig(params,weight).then(data => { nodeconfig(params, weight).then(data => {
if (data.code === 200) { if (data.code === 200) {
this.$Message.success('发布成功') this.$Message.success('发布成功')
} else { } else {
......
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