NEZ-1045 fix: agent 编辑页面增加 protocol 下拉框

This commit is contained in:
@changcode
2021-10-08 13:41:53 +08:00
parent ac76890f2a
commit 4f53c91128
7 changed files with 33 additions and 7 deletions

View File

@@ -103,6 +103,16 @@ export const agent2 = {
} }
] ]
} }
],
protocol: [
{
label: 'http',
value: 1
},
{
label: 'https',
value: 2
}
] ]
} }

View File

@@ -810,6 +810,7 @@ const cn = {
dataCenter: '数据中心', dataCenter: '数据中心',
up: 'UP', up: 'UP',
down: 'Down', down: 'Down',
protocol: '协议',
agent: { agent: {
agent: '客户端', agent: '客户端',
title: '下载客户端', title: '下载客户端',

View File

@@ -805,6 +805,7 @@ const en = {
down: 'Down', down: 'Down',
host: 'Host', host: 'Host',
port: 'Port', port: 'Port',
protocol: 'Protocol',
agent: { agent: {
agent: 'Agent', agent: 'Agent',
title: 'Download agent', title: 'Download agent',

View File

@@ -56,9 +56,16 @@
</el-form-item> </el-form-item>
<el-form-item label="Token" prop="token"> <el-form-item label="Token" prop="token">
<el-input maxlength="64" show-word-limit id="prom-box-input-token" v-model="editPromServer.token" class="right-box-row-with-btn" placeholder="" size="small" type="text"> <el-input maxlength="64" show-word-limit id="prom-box-input-token" v-model="editPromServer.token" class="right-box-row-with-btn" placeholder="" size="small" type="text">
<i slot="suffix" class="nz-icon nz-icon-refresh" @click="refreshToken"></i> <!-- <i slot="suffix" class="nz-icon nz-icon-refresh" @click="refreshToken"></i>-->
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('config.agent.protocol')" prop="protocol">
<el-select v-model="editPromServer.protocol" placeholder="" class="right-box__select" popper-class="right-box-select-top right-public-box-dropdown-top prevent-clickoutside" size="small" value-key="value">
<el-option v-for="item in agent2.protocol" :key="item.value" :label="item.label" :value="item.value">
<span class="panel-dropdown-label-txt" >{{item.label}}</span>
</el-option>
</el-select>
</el-form-item>
</el-form> </el-form>
</div> </div>

View File

@@ -47,6 +47,10 @@
</div> </div>
</el-popover> </el-popover>
</span> </span>
<span v-else-if="item.prop === 'protocol'">
<span v-if="scope.row[item.prop] === 1">http</span>
<span v-if="scope.row[item.prop] === 2">https</span>
</span>
<span v-else-if="scope.row[item.prop]">{{scope.row[item.prop]}}</span> <span v-else-if="scope.row[item.prop]">{{scope.row[item.prop]}}</span>
<template v-else>-</template> <template v-else>-</template>
</template> </template>
@@ -118,6 +122,11 @@ export default {
prop: 'checkTime', prop: 'checkTime',
show: false, show: false,
minWidth: 150 minWidth: 150
}, {
label: this.$t('config.agent.protocol'),
prop: 'protocol',
show: false,
minWidth: 150
} }
] ]
} }

View File

@@ -127,7 +127,8 @@ export default {
id: '', id: '',
host: '', host: '',
port: 10090, port: 10090,
dc: { id: '', name: '', location: '' } dc: { id: '', name: '', location: '' },
protocol: 'http'
}, },
agent: agent, agent: agent,
agent2: agent2, agent2: agent2,

View File

@@ -7,7 +7,7 @@
</transition> </transition>
</div> </div>
<div class="main-container" style="padding-right: 0"> <div class="main-container" style="padding-right: 0">
<div class="top-tools"> <div class="top-tools" style="z-index: 10">
<div v-if="panelData.length == 0" class="top-tool-left" style="margin-left: 10px;"> <div v-if="panelData.length == 0" class="top-tool-left" style="margin-left: 10px;">
<button id="panel-add-panel" class="nz-btn nz-btn-style-light nz-btn-size-small" @click="toAdd"><i class="nz-icon nz-icon-create-square"></i>&nbsp;&nbsp;{{$t("dashboard.panel.createPanelTitleSec")}}</button> <button id="panel-add-panel" class="nz-btn nz-btn-style-light nz-btn-size-small" @click="toAdd"><i class="nz-icon nz-icon-create-square"></i>&nbsp;&nbsp;{{$t("dashboard.panel.createPanelTitleSec")}}</button>
</div> </div>
@@ -557,10 +557,7 @@ export default {
} else { } else {
this.showPanel.id = '' this.showPanel.id = ''
this.filter.panelId = '' this.filter.panelId = ''
this.isLoading = true this.isLoading = !response.data.list.length === 0
if (response.data.list.length == 0) {
this.showPanel = false
}
} }
this.pageObj.total = response.data.total this.pageObj.total = response.data.total
if (!isInitData && (this.panel.id === '' || this.panel.id === this.showPanel.id)) { if (!isInitData && (this.panel.id === '' || this.panel.id === this.showPanel.id)) {