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

更新部署

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