Commit 073e2e18 authored by 智勇's avatar 智勇

更新部署

parent ef326dcd
...@@ -134,6 +134,14 @@ export function modifyCluService(data) { ...@@ -134,6 +134,14 @@ export function modifyCluService(data) {
}) })
} }
export function modifyDeploy(data) {
return request({
url: '/k8s/service/modifyDeploy',
method: 'post',
data
})
}
export function fetchServiceDetails(data) { export function fetchServiceDetails(data) {
return request({ return request({
url: '/k8s/service/details', url: '/k8s/service/details',
......
<template> <template>
<div> <div>
<div style="padding:10px 20px" > <div style="padding:10px 20px" >
<div style="float:right"> <div style="float:right;font-size:13px">
<span style="font-size:13px">自动刷新</span> <span>自动刷新</span>
<el-switch v-model="timer" @change="refreshInterval"/> <el-switch v-model="timer" @change="refreshInterval"/>
<span class="link-type" style="margin-left:20px" @click="openConf()">遇到问题?</span>
</div> </div>
</div> </div>
...@@ -79,11 +80,11 @@ ...@@ -79,11 +80,11 @@
{{ scope.row.status | formatStatus }} {{ scope.row.status | formatStatus }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="更多" width="80" fixed="right"> <el-table-column label="操作" width="80" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-dropdown> <el-dropdown>
<el-button type="primary" size="mini"> <el-button type="primary" size="mini">
点击 更多
</el-button> </el-button>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="getServiceDetails(scope.row)"> <el-dropdown-item @click.native="getServiceDetails(scope.row)">
...@@ -134,15 +135,14 @@ ...@@ -134,15 +135,14 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="image" prop="image"
label="镜像" width="280"
> label="镜像">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.image | filterTag }} {{ scope.row.image | filterTag }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="createdAt" prop="createdAt"
width="180"
label="创建时间" label="创建时间"
/> />
<el-table-column <el-table-column
...@@ -152,6 +152,19 @@ ...@@ -152,6 +152,19 @@
{{ scope.row.status | formatStatus }} {{ scope.row.status | formatStatus }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
v-if="item._id==='java'"
show-overflow-tooltip
label="Mock">
<template slot-scope="scope">
<el-tooltip v-show="scope.row.labels.mock==='1'" placement="top">
<div slot="content">使用apollo集群k8s-mock进行启动</div>
<span v-if="scope.row.labels.mock==='1'"></span>
</el-tooltip>
</template>
</el-table-column>
<el-table-column <el-table-column
v-if="item._id==='java'" v-if="item._id==='java'"
label="调试"> label="调试">
...@@ -160,7 +173,7 @@ ...@@ -160,7 +173,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="操作"> label="控制台/日志">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tooltip class="item" effect="dark" content="控制台" placement="top"> <el-tooltip class="item" effect="dark" content="控制台" placement="top">
<el-button type="primary" icon="el-icon-tickets" circle @click="linkShell(scope.row)"/> <el-button type="primary" icon="el-icon-tickets" circle @click="linkShell(scope.row)"/>
...@@ -170,11 +183,11 @@ ...@@ -170,11 +183,11 @@
</el-tooltip> </el-tooltip>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="更多" width="80" fixed="right"> <el-table-column label="操作" width="80" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-dropdown> <el-dropdown>
<el-button type="primary" size="mini"> <el-button type="primary" size="mini">
点击 更多
</el-button> </el-button>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="getServiceDetails(scope.row)"> <el-dropdown-item @click.native="getServiceDetails(scope.row)">
...@@ -185,6 +198,7 @@ ...@@ -185,6 +198,7 @@
<svg-icon icon-class="f5"/> <svg-icon icon-class="f5"/>
更新服务 更新服务
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item @click.native="restartService(scope.row)"> <el-dropdown-item @click.native="restartService(scope.row)">
<svg-icon icon-class="restart"/> <svg-icon icon-class="restart"/>
重置服务 重置服务
...@@ -198,6 +212,11 @@ ...@@ -198,6 +212,11 @@
<svg-icon icon-class="delete"/> <svg-icon icon-class="delete"/>
删除服务 删除服务
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item @click.native="updateDeploy(scope.row)">
<svg-icon icon-class="f5"/>
更新部署
</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</template> </template>
...@@ -234,7 +253,7 @@ ...@@ -234,7 +253,7 @@
</el-row> </el-row>
<div v-show="is_mock"> <div v-show="is_mock">
<p class="title-sub">是否使用mock</p> <p class="title-sub">是否使用mock<span style="font-size: 12px">(使用apollo集群k8s-mock进行启动)</span></p>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="14"> <el-col :span="14">
<el-select v-model="mock.key" filterable clearable class="elSelect" placeholder="请选择是否使用mock"> <el-select v-model="mock.key" filterable clearable class="elSelect" placeholder="请选择是否使用mock">
...@@ -266,7 +285,7 @@ ...@@ -266,7 +285,7 @@
</el-col> </el-col>
</el-row> </el-row>
<p v-if="label==='node'||label==='java'" class="title-sub">是否调试模式(执行测试时选择默认选项否即可) </p> <p v-if="label==='node'||label==='java'" class="title-sub">是否调试模式<span style="font-size: 12px">(执行测试时选择默认选项否即可)</span> </p>
<el-row v-if="label==='node'||label==='java'" :gutter="20"> <el-row v-if="label==='node'||label==='java'" :gutter="20">
<el-col :span="14"> <el-col :span="14">
<el-select v-model="debug.key" filterable clearable class="elSelect" placeholder="请选择是否调试模式,执行测试时请选择否"> <el-select v-model="debug.key" filterable clearable class="elSelect" placeholder="请选择是否调试模式,执行测试时请选择否">
...@@ -350,7 +369,7 @@ ...@@ -350,7 +369,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="resetForm('form')">取 消</el-button> <el-button @click="dialogHost=false">取 消</el-button>
<el-button type="primary" @click="submitHost('form')">确 定</el-button> <el-button type="primary" @click="submitHost('form')">确 定</el-button>
</div> </div>
</el-dialog> </el-dialog>
...@@ -365,6 +384,7 @@ import { ...@@ -365,6 +384,7 @@ import {
CreateCluService, CreateCluService,
fetchServiceDetails, fetchServiceDetails,
modifyCluService, modifyCluService,
modifyDeploy,
// fetchServiceInstance, // fetchServiceInstance,
deleteClusterService, deleteClusterService,
redeployClusterService, redeployClusterService,
...@@ -468,6 +488,10 @@ export default { ...@@ -468,6 +488,10 @@ export default {
} }
}, },
openConf() {
window.open('http://confluence.quantgroup.cn/pages/viewpage.action?pageId=20546803', '_blank')
},
getRepository(label) { getRepository(label) {
this.label = label this.label = label
this.reponame = '' this.reponame = ''
...@@ -570,10 +594,7 @@ export default { ...@@ -570,10 +594,7 @@ export default {
} }
}) })
}, },
resetForm(formName) {
this.$refs[formName].resetFields()
this.dialogHost = false
},
updateService(value) { updateService(value) {
this.tagName = '' this.tagName = ''
this.updateDialog = true this.updateDialog = true
...@@ -587,6 +608,23 @@ export default { ...@@ -587,6 +608,23 @@ export default {
} }
}) })
}, },
updateDeploy(value) {
const self = this
const image = value.image.split('/').slice(1).join('/')
const mock = value.labels.mock ? `'${value.labels.mock}'` : value.labels.mock
modifyDeploy({ serviceName: value.serviceName, image, namespace: this.namespace, type: value.labels.type, mock }).then(res => {
this.$message({
message: `更新${value.serviceName}成功`,
type: 'success',
duration: 1000,
onClose() {
self.getServicelist()
}
})
})
},
updateClusterService() { updateClusterService() {
const self = this const self = this
modifyCluService({ serviceName: this.serviceName, image: this.tagName, namespace: this.namespace, type: this.type }).then(res => { modifyCluService({ serviceName: this.serviceName, image: this.tagName, namespace: this.namespace, type: this.type }).then(res => {
......
...@@ -49,10 +49,14 @@ export default { ...@@ -49,10 +49,14 @@ export default {
sync() { sync() {
reloadMq({ host: this.mqUrl }).then(res => { reloadMq({ host: this.mqUrl }).then(res => {
const self = this
this.$message({ this.$message({
message: '同步成功', message: '同步成功',
type: 'success', type: 'success',
duration: 2000 duration: 1000,
onClose() {
self.goBack()
}
}) })
}) })
} }
......
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