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

This commit is contained in:
zhangyu
2020-07-06 16:14:18 +08:00
4 changed files with 38 additions and 17 deletions

View File

@@ -19,6 +19,7 @@ const cn = {
search: "搜索",
add: "新增",
option: "操作",
remark: "描述",
clearAll: "清空",
clear: "清除",
name: "名称",
@@ -34,7 +35,7 @@ const cn = {
unavailable: "不可用",
available: "可用",
createChart: "新增图表",
createProject: "新增项目",
createProject: "新增业务系统",
createAsset: "新增资产",
createAlertRule: "新增告警规则",
createAccount: "新增用户名",
@@ -138,6 +139,9 @@ const cn = {
},
singleStat:{
label:"SingleStat"
},
alertList:{
label:"告警列表"
}
},
statisticsVal:{
@@ -159,6 +163,7 @@ const cn = {
legendTip: "使用名称或表达式控制时间序列的名称。例如{{hostname}将替换为标签主机名的标签值。",
option: "操作",
alertParam:{
param:'参数',
select:'选择',
alertRule:'告警规则',
level:'级别',
@@ -262,7 +267,7 @@ const cn = {
}
},
project: {
project: "项目",
project: "业务系统",
name: "名称",
module: "组件",
endpoint: "Endpoint"
@@ -803,6 +808,13 @@ const cn = {
}
},
project: {
chart: {
basicTitle: "基础信息",
alertStat: "告警状态",
endpointStat: "Endpoint状态",
projectInfo: "业务系统信息",
endpointInfo: "Endpoint信息"
},
project: {
project: "系统",
projectName: "系统名称",

View File

@@ -1,6 +1,6 @@
<template>
<div class="metric-editor" v-clickoutside="clickout" :class="{'metric-editor-rb': styleType == 2}">
<div :id="id" class="editor-core" ref="editor" ></div>
<div :id="id" class="editor-core" ref="editor" :style="{height: styleType == 2 ? 'auto' : ''}"></div>
<span class="nz-input-append editor-clear" style="display: none" @click="clearContent"><i class="el-icon-circle-close"></i></span>
<div class="metric-editor-popper" :style="{left:popperPos.left+'px'}">
<div class="metric-popper-main" v-show="showType&&Object.keys(showSuggestions).length>0">
@@ -71,6 +71,9 @@
this.queryMetrics();
},
methods:{
test() {
console.info(1)
},
userChange:function(char,operation,newContent,oldContent){
this.changeSuggestions('type')
this.dealSpecilChar(char,operation);
@@ -792,7 +795,10 @@
$temp.getPosition();
$temp.formatContent();
}
})
//监听文本区域的高度
let lineHeight = 16;
});
this.registerKeydown();
},
watch:{
@@ -904,18 +910,20 @@
overflow: hidden;
}
.metric-editor.metric-editor-rb {
min-height: 32px;
border-radius: 4px;
height: auto;
border: 1px solid #DCDFE6;
box-sizing: border-box;
.editor-clear {
padding-top: 4px;
}
height: 32px;
.ql-container.ql-snow {
border-radius: 4px;
border: 1px solid #DCDFE6;
box-sizing: border-box;
border: none;
.ql-editor {
padding: 6px 0 !important;
padding: 5px 0 !important;
>p {
padding-left: 15px;
padding: 0 26px 0 15px;
font-size: 12px;
color: rgb(96, 98, 102);
}

View File

@@ -377,7 +377,7 @@ instance_cpu_time_ns{app="fox", proc="widget", rev="4d3a513", env="prod", job="c
if (res.length > 0) {
this.tableData = [];
this.tableLabels = [];
console.log(111111111111111111111,res)
//console.log(111111111111111111111,res)
res.forEach((response, index) => {
if (response.data&&response.status == 'success') {
let data = response.data.result;

View File

@@ -1,17 +1,17 @@
<template>
<div class="promqlInput" :style="{height:(errorMsg || appendMsg)?'50px':'36px'}">
<div class="promqlInput" :style="{height:(errorMsg || appendMsg)?'50px':'auto'}">
<div class="query-row">
<div class="query-input">
<!--explore页面的样式-->
<template v-if="styleType == 1">
<div class="metric-btn" v-if="plugins.indexOf('metric') > -1">
<el-dropdown class="metric-selector" >
<div class="metric-btn" v-if="plugins.indexOf('metric-selector') > -1">
<el-dropdown class="metric-selector">
<el-dropdown-menu style="display: none"></el-dropdown-menu>
<el-button class="metric-btn nz-btn nz-btn-size-normal nz-btn-style-light" @click="toggleDropdown">Metric &nbsp;<i class="el-icon-arrow-down"></i></el-button>
<el-cascader-panel v-show="dropDownVisible" v-model="cascaderValue" slot="dropdown" ref="metricSelector" :props="{emitPath:false}" :options="metricOptions" @change="metricChange"></el-cascader-panel>
</el-dropdown>
</div>
<div class="input-box" @click="dropDownVisible=false">
<div class="input-box" @click="dropDownVisible=false" v-if="plugins.indexOf('metric-input') > -1">
<!-- <el-autocomplete :placeholder="$t('dashboard.metricPreview.inputTip')" :fetch-suggestions="filterInput" clearable @clear="clearExpression" :trigger-on-focus="false" v-model="expressionList[index]" @blur="expressionChange" style="width: 100%;height:36px"></el-autocomplete>-->
<editor :styleType="styleType" :metric-list="metricStore" v-model="expressionList[index]" ref="editor" @on-enter="expressionChange" @on-blur="expressionChange" ></editor>
<div class="append-msg error" v-if="errorMsg"><span>{{errorMsg}}</span></div>
@@ -29,7 +29,7 @@
</el-dropdown>
<label style="line-height: 30px;" v-else>{{$t("alert.config.expr")}}</label>
</el-col>
<el-col style="width: calc(100% - 120px);">
<el-col style="width: calc(100% - 120px); height: 100%;">
<div class="input-box" @click="dropDownVisible=false" v-if="plugins.indexOf('metric-input') > -1">
<editor :styleType="styleType" :metric-list="metricStore" v-model="expressionList[index]" ref="editor" @on-enter="expressionChange" @on-blur="expressionChange" ></editor>
<div class="append-msg error" v-if="errorMsg"><span>{{errorMsg}}</span></div>
@@ -183,7 +183,7 @@
height: 36px;
width: 100%;
display: flex;
margin-bottom: 10px;
margin-bottom: 18px;
}
.promqlInput .query-row{
width: 100%;
@@ -223,6 +223,7 @@
}
.query-input .input-box{
width: 100%;
height: 100%;
}
.metric-btn{
height: 36px !important;