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

加入lint校验

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