This commit is contained in:
tanghc
2019-09-04 09:43:42 +08:00
parent 143237aeaf
commit 36ee797ea6
584 changed files with 1803 additions and 20788 deletions

View File

@@ -1,8 +1,8 @@
<template>
<div class="app-container">
<el-form :inline="true" :model="searchFormData" class="demo-form-inline" size="mini">
<el-form-item label="appKey">
<el-input v-model="searchFormData.appKey" :clearable="true" placeholder="appKey" style="width: 250px;" />
<el-form-item label="appId">
<el-input v-model="searchFormData.appKey" :clearable="true" placeholder="appId" style="width: 250px;" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="onSearchTable">查询</el-button>
@@ -22,7 +22,7 @@
/>
<el-table-column
prop="appKey"
label="appKey"
label="appId"
width="250"
/>
<el-table-column
@@ -105,7 +105,7 @@
label-width="120px"
size="mini"
>
<el-form-item label="appKey">
<el-form-item label="appId">
<span v-if="isvDialogFormData.id === 0" style="color: gray;">(系统自动生成)</span>
<span v-else>{{ isvDialogFormData.appKey }}</span>
</el-form-item>
@@ -149,7 +149,7 @@
:closable="false"
/>
</el-form-item>
<el-form-item :label="selfLabel('appKey')">
<el-form-item :label="selfLabel('appId')">
<span>{{ isvKeysFormData.appKey }}</span>
</el-form-item>
<el-form-item v-show="showKeys()" label="秘钥格式">

View File

@@ -16,7 +16,7 @@
:closable="false"
/>
</el-form-item>
<el-form-item :label="selfLabel('appKey')">
<el-form-item :label="selfLabel('appId')">
<div>{{ isvKeysFormData.appKey }}</div>
</el-form-item>
<el-form-item v-show="showKeys()" label="秘钥格式">

View File

@@ -337,7 +337,7 @@ export default {
methods: {
// 加载树
loadTree: function() {
this.post('zookeeper.service.list', {}, function(resp) {
this.post('registry.service.list', {}, function(resp) {
const respData = resp.data
this.treeData = this.convertToTreeData(respData, 0)
})

View File

@@ -7,6 +7,7 @@
plain
size="mini"
icon="el-icon-plus"
style="display: none;"
@click.stop="addService"
>
新建服务
@@ -83,25 +84,16 @@
<el-table-column
prop="name"
label="接口名 (版本号)"
width="200"
width="350"
>
<template slot-scope="scope">
{{ scope.row.name + (scope.row.version ? ' (' + scope.row.version + ')' : '') }}
</template>
</el-table-column>
<el-table-column
prop="uri"
label="LoadBalance"
width="350"
>
<template slot-scope="scope">
{{ scope.row.uri + scope.row.path }}
</template>
</el-table-column>
<el-table-column
prop="roles"
label="访问权限"
width="100"
width="150"
>
<template slot-scope="scope">
<span v-html="roleRender(scope.row)"></span>
@@ -113,7 +105,7 @@
width="80"
>
<template slot-scope="scope">
<span v-if="scope.row.ignoreValidate === 0" style="color:#67C23A">校验</span>
<span v-if="scope.row.ignoreValidate === 0">校验</span>
<span v-if="scope.row.ignoreValidate === 1" style="color:#E6A23C">不校验</span>
</template>
</el-table-column>
@@ -123,7 +115,7 @@
width="120"
>
<template slot-scope="scope">
<span v-if="scope.row.mergeResult === 1" style="color:#67C23A"></span>
<span v-if="scope.row.mergeResult === 1"></span>
<span v-if="scope.row.mergeResult === 0" style="color:#E6A23C"></span>
</template>
</el-table-column>
@@ -140,7 +132,6 @@
</el-table-column>
<el-table-column
label="操作"
fixed="right"
width="100"
>
<template slot-scope="scope">
@@ -163,33 +154,18 @@
ref="routeDialogFormRef"
:model="routeDialogFormData"
:rules="routeDialogFormRules"
label-width="120px"
label-width="180px"
size="mini"
>
<el-input v-show="false" v-model="routeDialogFormData.id" />
<el-form-item label="接口名" prop="name">
<el-input v-model="routeDialogFormData.name" placeholder="接口名product.goods.list" :disabled="Boolean(routeDialogFormData.id)" />
</el-form-item>
<el-form-item label="版本号" prop="version">
<el-input v-model="routeDialogFormData.version" placeholder="版本号1.0" :disabled="Boolean(routeDialogFormData.id)" />
</el-form-item>
<el-form-item label="uri" prop="uri">
<el-input v-model="routeDialogFormData.uri" placeholder="如http://www.xx.com" :disabled="routePropDisabled()" />
</el-form-item>
<el-form-item label="path" prop="path">
<el-input v-model="routeDialogFormData.path" placeholder="如:/order/list" :disabled="routePropDisabled()" />
<el-form-item label="接口名 (版本号)">
{{ routeDialogFormData.name + (routeDialogFormData.version ? ' (' + routeDialogFormData.version + ')' : '') }}
</el-form-item>
<el-form-item label="签名校验">
<el-radio-group v-model="routeDialogFormData.ignoreValidate" :disabled="routePropDisabled()">
<el-radio :label="0" name="ignoreValidate">校验</el-radio>
<el-radio :label="1" name="ignoreValidate">不校验</el-radio>
</el-radio-group>
{{ routeDialogFormData.ignoreValidate ? '不校验' : '校验' }}
</el-form-item>
<el-form-item label="统一格式输出">
<el-radio-group v-model="routeDialogFormData.mergeResult" :disabled="routePropDisabled()">
<el-radio :label="1" name="mergeResult"></el-radio>
<el-radio :label="0" name="mergeResult"></el-radio>
</el-radio-group>
{{ routeDialogFormData.mergeResult === 1 ? '是' : '否' }}
</el-form-item>
<el-form-item label="状态">
<el-radio-group v-model="routeDialogFormData.status">
@@ -343,7 +319,7 @@ export default {
methods: {
// 加载树
loadTree: function() {
this.post('zookeeper.service.list', {}, function(resp) {
this.post('registry.service.list', {}, function(resp) {
const respData = resp.data
this.treeData = this.convertToTreeData(respData, 0)
this.$nextTick(() => {

View File

@@ -192,7 +192,7 @@
<script>
export default {
data() {
const regex = /^\w+(,\w+)*$/
const regex = /^\S+(,\S+)*$/
const userKeyContentValidator = (rule, value, callback) => {
if (value === '') {
callback(new Error('不能为空'))
@@ -272,18 +272,20 @@ export default {
this.loadTable()
},
onDisable: function(row) {
this.confirm('确定要禁用【' + row.serviceId + '】吗?', function(done) {
this.confirm(`确定要禁用 ${row.serviceId}(${row.ipPort}) 吗?`, function(done) {
this.post('service.instance.offline', row, function() {
this.tip('禁用成功')
done()
this.loadTableDelay()
})
})
},
onEnable: function(row) {
this.confirm('确定要启用【' + row.serviceId + '】吗?', function(done) {
this.confirm(`确定要启用 ${row.serviceId}(${row.ipPort}) 吗?`, function(done) {
this.post('service.instance.online', row, function() {
this.tip('启用成功')
done()
this.loadTableDelay()
})
})
},
@@ -293,34 +295,38 @@ export default {
})
},
onEnvPreOpen: function(row) {
this.confirm(`确定要开启 ${row.instanceId} 预发布吗?`, function(done) {
this.confirm(`确定要开启 ${row.serviceId}(${row.ipPort}) 预发布吗?`, function(done) {
this.post('service.instance.env.pre.open', row, function() {
this.tip('预发布成功')
done()
this.loadTableDelay()
})
})
},
onEnvPreClose: function(row) {
this.confirm(`确定要结束 ${row.instanceId} 预发布吗?`, function(done) {
this.confirm(`确定要结束 ${row.serviceId}(${row.ipPort}) 预发布吗?`, function(done) {
this.doEnvOnline(row, function() {
this.tip('操作成功')
done()
this.loadTableDelay()
})
})
},
onEnvGrayOpen: function(row) {
this.confirm(`确定要开启 ${row.instanceId} 灰度吗?`, function(done) {
this.confirm(`确定要开启 ${row.serviceId}(${row.ipPort}) 灰度吗?`, function(done) {
this.post('service.instance.env.gray.open', row, function() {
this.tip('开启成功')
done()
this.loadTableDelay()
})
})
},
onEnvGrayClose: function(row) {
this.confirm(`确定要结束 ${row.instanceId} 灰度吗?`, function(done) {
this.confirm(`确定要结束 ${row.serviceId}(${row.ipPort}) 灰度吗?`, function(done) {
this.doEnvOnline(row, function() {
this.tip('操作成功')
done()
this.loadTableDelay()
})
})
},
@@ -329,11 +335,13 @@ export default {
this.loadRouteList(serviceId)
this.post('service.gray.config.get', { serviceId: serviceId }, function(resp) {
this.grayDialogVisible = true
const data = resp.data
Object.assign(this.grayForm, {
serviceId: serviceId,
userKeyContent: data.userKeyContent || '',
grayRouteConfigList: this.createGrayRouteConfigList(data.nameVersionContent)
this.$nextTick(() => {
const data = resp.data
Object.assign(this.grayForm, {
serviceId: serviceId,
userKeyContent: data.userKeyContent || '',
grayRouteConfigList: this.createGrayRouteConfigList(data.nameVersionContent)
})
})
})
},
@@ -403,6 +411,12 @@ export default {
instanceCount = `(${onlineCount}/${childCount})`
}
return row.serviceId + instanceCount
},
loadTableDelay: function() {
const that = this
setTimeout(function() {
that.loadTable()
}, 2000)
}
}
}