Commit 9b28222b authored by 温海元's avatar 温海元
parents 2473d68f 8f78c6fb
module.exports = { module.exports = {
NODE_ENV: '"development"', NODE_ENV: '"development"',
ENV_CONFIG: '"dev"', ENV_CONFIG: '"dev"',
QA_API: '"http://127.0.0.1:3003"', // QA_API: '"http://127.0.0.1:3003"',
// QA_API: '"http://qaapi.liangkebang.com"', QA_API: '"http://qaapi.liangkebang.com"',
TESTDATA_API: '"http://172.30.220.22:3333"', TESTDATA_API: '"http://172.30.220.22:3333"',
PIPELINE_API:'"http://pipes.liangkebang.com"' PIPELINE_API:'"http://pipes.liangkebang.com"',
HOLMES_API: '"//localhost:8084"'
} }
...@@ -6,4 +6,5 @@ module.exports = { ...@@ -6,4 +6,5 @@ module.exports = {
TESTDATA_API: '"//testdata.liangkebang.com"', TESTDATA_API: '"//testdata.liangkebang.com"',
PIPELINE_API: '"//pipes.liangkebang.com"', PIPELINE_API: '"//pipes.liangkebang.com"',
PIPELINE_API_JAVA:'"//pipes.liangkebang.com"', PIPELINE_API_JAVA:'"//pipes.liangkebang.com"',
HOLMES_API: '"//holmes-yxm.liangkebang.net"',
} }
import request from '@/utils/requestHolmes'
export function buildJenkinsJob(paramsInfo) {
return request({
url: '/jenkins/build',
method: 'get',
params: paramsInfo
})
}
import axios from 'axios'
const service = axios.create(
{
baseURL: process.env.HOLMES_API,
timeout: 500000
}
)
// request interceptor
service.interceptors.request.use(
)
// response interceptor
service.interceptors.response.use(
response => response,
error => {
console.log('error' + error) // for debug
return Promise.reject(error)
}
)
export default service
...@@ -150,7 +150,10 @@ export default { ...@@ -150,7 +150,10 @@ export default {
description: this.group, description: this.group,
cluster: this.cluster, cluster: this.cluster,
dependant: { dependant: {
base: this.dependant.base base: this.dependant.base,
java: this.dependant.java,
ui: this.dependant.ui,
node: this.dependant.node
} }
} }
......
...@@ -160,6 +160,7 @@ ...@@ -160,6 +160,7 @@
<svg-icon icon-class="service"/> <svg-icon icon-class="service"/>
{{ item._id.toUpperCase() }} 服务 {{ item._id.toUpperCase() }} 服务
<div style="float: right"> <div style="float: right">
<el-button type="primary" size="mini" round @click="deployMaster(FormatTabledata[item._id])">一键部署master</el-button>
<el-button type="warning" size="mini" round @click="getRepository(item._id)">新增服务</el-button> <el-button type="warning" size="mini" round @click="getRepository(item._id)">新增服务</el-button>
<el-button type="success" size="mini" round @click="refresh">刷新状态</el-button> <el-button type="success" size="mini" round @click="refresh">刷新状态</el-button>
<el-button type="danger" size="mini" round @click="restartAll(FormatTabledata[item._id])">重置所有服务</el-button> <el-button type="danger" size="mini" round @click="restartAll(FormatTabledata[item._id])">重置所有服务</el-button>
...@@ -456,6 +457,7 @@ import JsonEditor from '@/components/JsonEditor' ...@@ -456,6 +457,7 @@ import JsonEditor from '@/components/JsonEditor'
import permission from '@/directive/permission/index.js' // 权限判断指令 import permission from '@/directive/permission/index.js' // 权限判断指令
import { getHostName } from '@/api/proconfig' import { getHostName } from '@/api/proconfig'
import { getNotify } from '@/api/notify' import { getNotify } from '@/api/notify'
import { buildJenkinsJob } from '@/api/holmes'
export default { export default {
components: { JsonEditor }, components: { JsonEditor },
directives: { permission }, directives: { permission },
...@@ -551,12 +553,30 @@ export default { ...@@ -551,12 +553,30 @@ export default {
this.getServicelist() this.getServicelist()
}, },
// 重置所有服务
restartAll(serviceList) { restartAll(serviceList) {
for (var x in serviceList) { for (var x in serviceList) {
this.restartService(serviceList[x]) this.restartService(serviceList[x])
} }
}, },
// 一键部署master
deployMaster(serviceList) {
for (var x in serviceList) {
buildJenkinsJob({
type: serviceList[x].labels.type,
project: serviceList[x].serviceName,
branch: 'master',
namespace: this.namespace
}).then((resp) => {
this.$message({
type: 'success',
message: '服务' + serviceList[x].serviceName + '部署master分支成功!'
})
})
}
},
refreshInterval(value) { refreshInterval(value) {
this.$store.dispatch('changeSwitch', value) this.$store.dispatch('changeSwitch', value)
if (value) { if (value) {
......
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