Merge branch 'dev-2.0' of https://git.mesalab.cn/nezha/nezha-fronted into dev-2.0

This commit is contained in:
chenjinsong
2021-05-25 16:34:34 +08:00
25 changed files with 56 additions and 39 deletions

View File

@@ -124,3 +124,8 @@
display: inline-block;
margin-right: 5px;
}
span:first-letter,div:first-letter{
text-transform: capitalize;
}

View File

@@ -643,7 +643,7 @@ export default {
this.modelStaticData(chartInfo, filterType)
} else {
// 没有数据的设置提示信息暂无数据-针对每一个图
const len = chartItem.elements.length
const len = chartItem.elements ? chartItem.elements.length : 0
if (len === 0) {
this.$nextTick(() => {
if (this.$refs['editChart' + chartItem.id] && this.$refs['editChart' + chartItem.id].length > 0) {
@@ -693,7 +693,6 @@ export default {
})
// 一个图表的所有element单独获取数据
axios.all(axiosArr).then((res) => {
if (res.length > 0) {
const series = []
let singleStatRlt = ''

View File

@@ -315,7 +315,6 @@ export default {
this.tempDom.width = span.offsetWidth
},
start (event) {
// console.log('start', event, this.dataList);
event.item.querySelector('.chartTitle').style.background = '#d8dce1'
const projectAndAssetFeatureInfos = event.item.querySelectorAll('.feature-content')
if (projectAndAssetFeatureInfos && projectAndAssetFeatureInfos.length > 0) {
@@ -611,9 +610,11 @@ export default {
return
}
if (param.from == fromRoute.chartTemp) { // 模板列表
if (this.panelDataList[0] && this.panelDataList[0].children) {
this.panelDataList[0].children.forEach((item1, i) => {
item1.chartIndex = i
})
}
this.dataList = this.panelDataList
this.$nextTick(() => {
this.dataList.forEach((item, index) => {

View File

@@ -515,7 +515,7 @@ export default {
// this.$store.commit('addConsole');
},
show (id, host, accountId, port) {
this.addConsole(id, host, accountId, port)
this.addConsole(id, host, accountId, port,'asset')
this.consoleShow = true
},
initDialog () {

View File

@@ -357,7 +357,7 @@ export default {
.record-console {
padding: 10px 4px 10px 10px;
background-color: black;
height: calc(100% - 80px);
height: calc(100% - 65px);
}
.terminal-replay-progress {
height: 20px;

View File

@@ -457,7 +457,7 @@ const cn = {
module: '模块'
},
endpoint: {
endpoint: 'Endpoints'
endpoint: 'Endpoint'
},
dataCenter: {
dataCenter: '数据中心',

View File

@@ -458,16 +458,16 @@ const en = {
total: 'Total'
},
project: {
project: 'Projects',
project: 'Project',
name: 'Name',
module: 'Module',
endpoint: 'Endpoint'
},
module: {
module: 'Modules'
module: 'Module'
},
endpoint: {
endpoint: 'Endpoints'
endpoint: 'Endpoint'
},
dataCenter: {
dataCenter: 'Data center',
@@ -475,7 +475,7 @@ const en = {
promServer: 'Prom server'
},
alert: {
alertMessage: 'Alert messages',
alertMessage: 'Module name / Alert Message',
level: 'Priority',
alertRule: 'Alert rule',
ruleNum: 'Rule num',
@@ -562,7 +562,7 @@ const en = {
copySuccess: 'Copy success'
},
asset: {
asset: 'Asset',
asset: 'Module name / Asset ',
assets: 'Asset', // '资产'
editAsset: 'Edit asset', // '编辑资产'
createAsset: 'New asset', // '编辑资产'
@@ -1268,6 +1268,7 @@ const en = {
createEndpoint: 'New endpoint', // "新增Endpoint"
editEndpoint: 'Edit endpoint', // "编辑Endpoint"
endpoint: 'Endpoint ', // "Endpoint"
endpoints: 'Module name / Endpoint',
endpointId: 'Endpoint ID', // "Endpoint ID"
list: 'List',
host: 'Host', // "Host"

View File

@@ -160,8 +160,9 @@ export default {
}
this.$delete(url + '?seq=' + this.importResult.seq).then(response => {
if (response.code == 200) {
const linkId = this.link ? this.link.id : ''
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') })
this.$emit('afterImport')
this.$emit('afterImport', linkId)
} else {
this.$message.error(response.msg)
}
@@ -183,7 +184,8 @@ export default {
this.$post(this.importUrl, form, { 'Content-Type': 'multipart/form-data' }).then(response => {
if (response.code == 200 && response.msg == 'success') {
this.importResult = response.data
this.$emit('afterImport')
const linkId = this.link ? this.link.id : ''
this.$emit('afterImport', linkId)
this.importBox.type = 3
this.importBox.width = '600px'
} else {

View File

@@ -1,7 +1,7 @@
<template>
<div class="mc" @click.self="clickOutside">
<div class="right-box right-box-project-alert">
<div class="right-box-title">{{$t('project.endpoint.endpoint')}}</div>
<div class="right-box-title">{{$t('project.endpoint.endpoints')}}</div>
<nz-data-list
ref="dataList"
:api="url"

View File

@@ -22,7 +22,7 @@
<!-- ChartTemplate -->
<el-form-item :label="$t('config.model.ChartTemplate')" prop="ChartTemplate">
<v-selectpage
:data="'visual/panel/chart'"
:data="chartlList"
:tb-columns="ChartSearchShowFields"
:params="{
varType: 1, panelId: 0,
@@ -115,7 +115,7 @@ export default {
},
created () {
this.getBrandList()
// this.ChartTemplateList()
this.ChartTemplateList()
},
methods: {
clickOutside () {
@@ -198,13 +198,13 @@ export default {
assetData.totalRow = resp.data.total
return assetData
}
}
},
/* 获取chart列表数据 */
// ChartTemplateList () {
// this.$get('visual/panel/chart', { pageSize: -1, varType: 1, panelId: 0 }).then(res => {
// this.chartlList = res.data.list
// })
// }
ChartTemplateList () {
this.$get('visual/panel/chart', { pageSize: -1, varType: 1, panelId: 0, groupId: 0 }).then(res => {
this.chartlList = res.data.list
})
}
}
}
</script>

View File

@@ -37,11 +37,11 @@
<template v-if="editData.authType === assetConstants.authTypeData.key">
<!-- Key支持私钥 -->
<el-form-item :label="$t('asset.privateKey')" prop="authPriKey">
<el-input v-model="editData.authPriKey" size="small"/>
<el-input v-model="editData.authPriKey" size="small" type="password" autocomplete="new-password"/>
</el-form-item>
</template>
<el-form-item :label="$t('asset.pin')" prop="authPin">
<el-input v-model="editData.authPin" size="small"/>
<el-input v-model="editData.authPin" size="small" type="password" autocomplete="new-password"/>
</el-form-item>
<el-form-item :label="$t('asset.port')" prop="authProtocolPort">
<el-input v-model="editData.authProtocolPort" size="small"/>

View File

@@ -228,7 +228,7 @@ export default {
} else if (this.from === fromRoute.endpoint) { // 来自endpoint时取endpointId
this.editChartTemp.varIds = this.obj.varIds
} else {
this.editChartTemp.varIds = this.transfer.selectedData.map(item => item.id)
this.editChartTemp.varIds = this.$refs.transfer.selectedData.map(item => item.id)
}
this.$refs.userForm.validate((valid) => {
if (valid) {

View File

@@ -155,7 +155,7 @@
</span>
</div>
</el-tab-pane>
<el-tab-pane label="Parameter" name="Parameter">
<el-tab-pane :label="$t('project.endpoint.param')" name="Parameter">
<div id="module-box-params" ref="labelBoxScrollbar" style="height: 100%; overflow: auto;">
<div v-for="(item, index) in editEndpoint.paramObj" :key="index" class="param-box-row">
<el-form-item :prop="'paramObj.' + index + '.key'" class="param-box-row-key">

View File

@@ -88,7 +88,7 @@
<el-form-item :label="$t('config.model.ChartTemplate')" prop="ChartTemplate">
<v-selectpage
v-model="editModule.chartIds"
:data="'visual/panel/chart'"
:data="chartlList"
:language="language"
:multiple="true"
:params="{
@@ -648,14 +648,14 @@ export default {
},
/* 获取chart列表数据 */
ChartTemplateList () {
this.$get('visual/panel/chart', { pageSize: -1, varType: 2, panelId: 0 }).then(res => {
this.$get('visual/panel/chart', { pageSize: -1, varType: 2, panelId: 0, returnChildren: 0, groupId: 0 }).then(res => {
this.chartlList = res.data.list
})
}
},
mounted () {
this.getWalkData()
// this.ChartTemplateList()
this.ChartTemplateList()
},
created () {
this.getProjectList()

View File

@@ -14,6 +14,7 @@
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"
@row-dblclick="(row)=>{$emit('messageDetail', row)}"
>
<el-table-column
:resizable="false"

View File

@@ -9,6 +9,7 @@
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"
@row-dblclick="(row)=>{queryMessage(row)}"
>
<el-table-column
:resizable="false"

View File

@@ -8,6 +8,7 @@
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"
@row-dblclick="(row)=>{$emit('showBottomBox', 'panelTab', row)}"
>
<el-table-column
:resizable="false"

View File

@@ -8,6 +8,7 @@
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"
@row-dblclick="(row)=>{showBottomBox('panel', row)}"
>
<el-table-column
:resizable="false"

View File

@@ -8,6 +8,7 @@
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"
@row-dblclick="(row)=>{$emit('showBottomBox', 'panelTab', row)}"
>
<el-table-column
:resizable="false"

View File

@@ -8,6 +8,7 @@
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"
@row-dblclick="(row)=>{showBottomBox('endpoint', row)}"
>
<el-table-column
:resizable="false"

View File

@@ -9,6 +9,7 @@
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"
@row-dblclick="(row)=>{changeProjectTopo(row)}"
>
<el-table-column
:resizable="false"

View File

@@ -8,6 +8,7 @@
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"
@row-dblclick="(row)=>{showBottomBox(row.status==0 ? 'monitorTab' : 'cmdTab', row)}"
>
<el-table-column
:resizable="false"

View File

@@ -8,6 +8,7 @@
@header-dragend="dragend"
@sort-change="tableDataSort"
@selection-change="selectionChange"
@row-dblclick="(row)=>{showBottomBox('operationLogTab', row)}"
>
<el-table-column
:resizable="false"

View File

@@ -609,6 +609,7 @@ export default {
}
}
},
deleteMessage () {}
}
}
</script>

View File

@@ -251,12 +251,11 @@ export default {
}
},
methods: {
cli ([id, host, account]) {
cli (row) {
const consoleParam = {
id: id,
host: host,
accountId: account.id,
port: account.port
id: row.id,
host: row.manageIp,
port: row.authProtocolPort
}
this.$store.commit('addConsole', consoleParam)
},