Merge branch 'codeCheck' of https://git.mesalab.cn/nezha/nezha-fronted into codeCheck
This commit is contained in:
@@ -2373,15 +2373,26 @@ li{
|
|||||||
}
|
}
|
||||||
.right-box-form .nz-icon-minus-medium{
|
.right-box-form .nz-icon-minus-medium{
|
||||||
padding: 2px 6px;
|
padding: 2px 6px;
|
||||||
background: rgba(236,127,102,.1);
|
background-color: rgba(236,127,102,.1);
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
.right-box-form .form-row-item .nz-icon-minus-position{
|
.nz-icon-copy {
|
||||||
|
padding: 2px 6px;
|
||||||
|
color: $global-text-color-active;
|
||||||
|
background-color: #FDF5E9;
|
||||||
|
border-radius: 2px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.nz-icon-minus-position{
|
||||||
|
display: inline-flex;
|
||||||
|
flex-direction: column;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
right: -40px;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
right: -55px;
|
transform: translateY(-50%);
|
||||||
transform: translate(-50%,-50%);
|
height: 70px;
|
||||||
|
justify-content: space-around;
|
||||||
}
|
}
|
||||||
.right-box-form>.el-form-item.half-form-item-other{
|
.right-box-form>.el-form-item.half-form-item-other{
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|||||||
@@ -464,7 +464,6 @@ export const tableSet = {
|
|||||||
//是否需要排序
|
//是否需要排序
|
||||||
sortableShow(prop,from){
|
sortableShow(prop,from){
|
||||||
switch(prop){
|
switch(prop){
|
||||||
case 'id':
|
|
||||||
case 'alertRule':
|
case 'alertRule':
|
||||||
case 'severity':
|
case 'severity':
|
||||||
case 'startAt':
|
case 'startAt':
|
||||||
@@ -504,7 +503,13 @@ export const tableSet = {
|
|||||||
case 'alertNum':
|
case 'alertNum':
|
||||||
return'custom';
|
return'custom';
|
||||||
case 'state':
|
case 'state':
|
||||||
if( from === 'operationlog'){
|
if( from === 'operationlog' ){
|
||||||
|
return false
|
||||||
|
}else{
|
||||||
|
return'custom'
|
||||||
|
}
|
||||||
|
case 'id':
|
||||||
|
if( from === 'alertSilence' ){
|
||||||
return false
|
return false
|
||||||
}else{
|
}else{
|
||||||
return'custom'
|
return'custom'
|
||||||
|
|||||||
@@ -923,7 +923,12 @@ const cn = {
|
|||||||
matcher:'Matcher',
|
matcher:'Matcher',
|
||||||
reason:'原因',
|
reason:'原因',
|
||||||
selectTime:'请选择时间',
|
selectTime:'请选择时间',
|
||||||
selectMather:'必填项'
|
selectMather:'必填项',
|
||||||
|
datacenter:'数据中心',
|
||||||
|
project:'项目',
|
||||||
|
module:'模块',
|
||||||
|
endpoint:'endpoint',
|
||||||
|
asset:'资产',
|
||||||
},
|
},
|
||||||
P1Rule:'P1: 万分紧急,可导致业务瘫痪的告警',
|
P1Rule:'P1: 万分紧急,可导致业务瘫痪的告警',
|
||||||
P2Rule:'P2: 急需处理,但不影响业务的告警',
|
P2Rule:'P2: 急需处理,但不影响业务的告警',
|
||||||
|
|||||||
@@ -928,7 +928,13 @@ const en = {
|
|||||||
matcher:'Matcher',
|
matcher:'Matcher',
|
||||||
reason:'Reason',
|
reason:'Reason',
|
||||||
selectTime:'Please select time',
|
selectTime:'Please select time',
|
||||||
selectMather:'Required'
|
selectMather:'Required',
|
||||||
|
datacenter:'datacenter',
|
||||||
|
project:'project',
|
||||||
|
module:'module',
|
||||||
|
endpoint:'endpoint',
|
||||||
|
asset:'asset',
|
||||||
|
|
||||||
},
|
},
|
||||||
P1Rule:'P1: Critical, alarm that can cause business paralysis',
|
P1Rule:'P1: Critical, alarm that can cause business paralysis',
|
||||||
P2Rule:'P2: Major, alarm that do not affect the business',
|
P2Rule:'P2: Major, alarm that do not affect the business',
|
||||||
|
|||||||
@@ -71,9 +71,14 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</template>
|
</template>
|
||||||
</el-row>
|
</el-row>
|
||||||
<span class="nz-icon-minus-medium nz-icon-minus-position">
|
<div class="nz-icon-minus-position">
|
||||||
<i class="nz-icon nz-icon-minus" @click="removeExpression(index)"></i>
|
<span class="nz-icon-minus-medium">
|
||||||
</span>
|
<i @click="removeExpression(index)" class="nz-icon nz-icon-minus"></i>
|
||||||
|
</span>
|
||||||
|
<span class="nz-icon-copy">
|
||||||
|
<i @click="copyExpression(index)" class="nz-icon nz-icon-override"></i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<!--tooltip-->
|
<!--tooltip-->
|
||||||
@@ -1564,6 +1569,17 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
copyExpression(index) {
|
||||||
|
this.selection.pen.data.expressArr.push(this.selection.pen.data.expressArr[index]);
|
||||||
|
this.selection.pen.data.legends.push(this.selection.pen.data.legends[index]);
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.expressions.forEach((ex, index) => {
|
||||||
|
if (ex) {
|
||||||
|
this.$refs[`promql-${index}`][0].metricChange(ex);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
valueMappingAdd(){
|
valueMappingAdd(){
|
||||||
if(this.selection.pen.data.valueMappingSort==='desc'){
|
if(this.selection.pen.data.valueMappingSort==='desc'){
|
||||||
this.selection.pen.data.valueMapping.push({
|
this.selection.pen.data.valueMapping.push({
|
||||||
@@ -1835,8 +1851,12 @@
|
|||||||
width: calc(100% - 120px);
|
width: calc(100% - 120px);
|
||||||
padding: 20px 20px 20px 0;
|
padding: 20px 20px 20px 0;
|
||||||
}
|
}
|
||||||
|
.form-row-item .nz-icon-minus-position .nz-icon-minus-medium {
|
||||||
.form-row-item .nz-icon-minus-position {
|
background: rgba(236, 127, 102, 0.1);
|
||||||
|
padding: 2px 6px;
|
||||||
|
color: #EC7F66;
|
||||||
|
}
|
||||||
|
/*.form-row-item .nz-icon-minus-position {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
right: -55px;
|
right: -55px;
|
||||||
@@ -1849,7 +1869,7 @@
|
|||||||
.nz-icon-minus {
|
.nz-icon-minus {
|
||||||
color: #EC7F66;
|
color: #EC7F66;
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
.tooltip-box {
|
.tooltip-box {
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
|
|||||||
@@ -232,7 +232,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}else{
|
}else{
|
||||||
this.$post('/alert/silence',params).then(response=>{
|
this.$post('alert/silence',params).then(response=>{
|
||||||
this.prevent_opt.save=false;
|
this.prevent_opt.save=false;
|
||||||
if(response.code===200){
|
if(response.code===200){
|
||||||
this.$message({duration:1000,type:'success',message:this.$t("tip.saveSuccess")});
|
this.$message({duration:1000,type:'success',message:this.$t("tip.saveSuccess")});
|
||||||
@@ -273,7 +273,7 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
getRuleList(){
|
getRuleList(){
|
||||||
this.$get('/alert/rule',{pageNo:1,pageSize:-1}).then(response=>{
|
this.$get('alert/rule',{pageNo:1,pageSize:-1}).then(response=>{
|
||||||
if(response.code==200){
|
if(response.code==200){
|
||||||
this.ruleList=response.data.list;
|
this.ruleList=response.data.list;
|
||||||
}
|
}
|
||||||
@@ -333,7 +333,7 @@
|
|||||||
this.editAlertSilence.linkId=linkId?linkId:'';
|
this.editAlertSilence.linkId=linkId?linkId:'';
|
||||||
this.editAlertSilence.name='';
|
this.editAlertSilence.name='';
|
||||||
if(val==='datacenter'){
|
if(val==='datacenter'){
|
||||||
this.$get('/idc',{pageNo:1,pageSize:-1}).then(response=>{
|
this.$get('idc',{pageNo:1,pageSize:-1}).then(response=>{
|
||||||
if(response.code==200){
|
if(response.code==200){
|
||||||
firstArr=response.data.list;
|
firstArr=response.data.list;
|
||||||
if(linkId){
|
if(linkId){
|
||||||
@@ -347,7 +347,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(val==='asset'){
|
if(val==='asset'){
|
||||||
this.$get('/asset?pageNo=1&pageSize=-1').then(res=>{
|
this.$get('asset?pageNo=1&pageSize=-1').then(res=>{
|
||||||
if(res.code==200){
|
if(res.code==200){
|
||||||
let arr=[];
|
let arr=[];
|
||||||
res.data.list.forEach(asset=>{
|
res.data.list.forEach(asset=>{
|
||||||
@@ -372,7 +372,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(val==='project'){
|
if(val==='project'){
|
||||||
this.$get('/project',{pageNo:1,pageSize:-1}).then(response=>{
|
this.$get('project',{pageNo:1,pageSize:-1}).then(response=>{
|
||||||
if(response.code==200){
|
if(response.code==200){
|
||||||
firstArr=response.data.list;
|
firstArr=response.data.list;
|
||||||
if(linkId){
|
if(linkId){
|
||||||
@@ -387,7 +387,7 @@
|
|||||||
|
|
||||||
|
|
||||||
if(val==='module'){
|
if(val==='module'){
|
||||||
this.$get('/module?pageNo=1&pageSize=-1').then(res=>{
|
this.$get('module?pageNo=1&pageSize=-1').then(res=>{
|
||||||
if(res.code==200){
|
if(res.code==200){
|
||||||
let arr=[];
|
let arr=[];
|
||||||
res.data.list.forEach(module=>{
|
res.data.list.forEach(module=>{
|
||||||
@@ -411,7 +411,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(val==='endpoint'){
|
if(val==='endpoint'){
|
||||||
this.$get('/endpoint?pageNo=1&pageSize=-1').then(res=>{
|
this.$get('endpoint?pageNo=1&pageSize=-1').then(res=>{
|
||||||
if(res.code=200){
|
if(res.code=200){
|
||||||
let arr=[];
|
let arr=[];
|
||||||
res.data.list.forEach(item=>{
|
res.data.list.forEach(item=>{
|
||||||
|
|||||||
@@ -453,7 +453,7 @@
|
|||||||
cancelButtonText:this.$t("tip.no"),
|
cancelButtonText:this.$t("tip.no"),
|
||||||
type:'warning'
|
type:'warning'
|
||||||
}).then(()=>{
|
}).then(()=>{
|
||||||
this.$delete("/alert/silence?ids="+row.id).then(response=>{
|
this.$delete("alert/silence?ids="+row.id).then(response=>{
|
||||||
this.prevent_opt.save=false;
|
this.prevent_opt.save=false;
|
||||||
if(response.code===200){
|
if(response.code===200){
|
||||||
this.$message({type:'success',message:this.$t("tip.deleteSuccess")});
|
this.$message({type:'success',message:this.$t("tip.deleteSuccess")});
|
||||||
@@ -477,7 +477,7 @@
|
|||||||
cancelButtonText:this.$t("tip.no"),
|
cancelButtonText:this.$t("tip.no"),
|
||||||
type:'warning'
|
type:'warning'
|
||||||
}).then(()=>{
|
}).then(()=>{
|
||||||
this.$delete("/alert/silence?ids="+row.id).then(response=>{
|
this.$delete("alert/silence?ids="+row.id).then(response=>{
|
||||||
this.prevent_opt.save=false;
|
this.prevent_opt.save=false;
|
||||||
if(response.code===200){
|
if(response.code===200){
|
||||||
this.$message({type:'success',message:this.$t("tip.deleteSuccess")});
|
this.$message({type:'success',message:this.$t("tip.deleteSuccess")});
|
||||||
|
|||||||
@@ -323,20 +323,25 @@
|
|||||||
></promql-input>
|
></promql-input>
|
||||||
-->
|
-->
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col style="width: 120px; padding-right: 20px; text-align: left; padding-left:10px; color: #666">
|
<el-col style="width: 120px; padding-right: 20px; text-align: left; padding-left:10px; color: #666">
|
||||||
{{$t('dashboard.panel.chartForm.legend')}}
|
{{$t('dashboard.panel.chartForm.legend')}}
|
||||||
<el-popover placement="top" trigger="hover" width="211">
|
<el-popover placement="top" trigger="hover" width="211">
|
||||||
<div style="word-break:keep-all;">{{$t('dashboard.panel.chartForm.legendTip')}}</div>
|
<div style="word-break:keep-all;">{{$t('dashboard.panel.chartForm.legendTip')}}</div>
|
||||||
<i @mouseover="rz" class="nz-icon nz-icon-info-normal" slot="reference" style="font-size: 14px; -webkit-transform:scale(0.75);display:inline-block;"></i>
|
<i @mouseover="rz" class="nz-icon nz-icon-info-normal" slot="reference" style="font-size: 14px; -webkit-transform:scale(0.75);display:inline-block;"></i>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col style="width: calc(100% - 120px);">
|
<el-col style="width: calc(100% - 120px);">
|
||||||
<el-input size="small" type="text" v-model="legends[index-1]" ></el-input>
|
<el-input size="small" type="text" v-model="legends[index-1]" ></el-input>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<span class="nz-icon-minus-medium nz-icon-minus-position">
|
<div class="nz-icon-minus-position">
|
||||||
<i class="nz-icon nz-icon-minus" @click="removeExpression(index - 1)"></i>
|
<span class="nz-icon-minus-medium">
|
||||||
</span>
|
<i @click="removeExpression(index - 1)" class="nz-icon nz-icon-minus"></i>
|
||||||
|
</span>
|
||||||
|
<span class="nz-icon-copy" v-if="!isSingleStat">
|
||||||
|
<i @click="copyExpression(index - 1)" class="nz-icon nz-icon-override"></i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
<!--value mapping start-->
|
<!--value mapping start-->
|
||||||
@@ -739,6 +744,20 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
copyExpression(index) {
|
||||||
|
this.expressions.push(this.expressions[index]);
|
||||||
|
this.legends.push(this.legends[index]);
|
||||||
|
this.promqlKeys.push(getUUID());
|
||||||
|
this.elementIds.push("");
|
||||||
|
this.promqlCount++;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.expressions.forEach((ex, index) => {
|
||||||
|
if (ex) {
|
||||||
|
this.$refs[`promql-${index}`][0].metricChange(ex);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
save() {
|
save() {
|
||||||
this.$refs['chartForm'].validate((valid) => {
|
this.$refs['chartForm'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
|||||||
Reference in New Issue
Block a user