Skip to content

Commit f13a8af

Browse files
author
tangjiawei
committed
Merge remote-tracking branch 'origin/dev' into dev
2 parents 8d6e1e9 + 82e8b2a commit f13a8af

File tree

3 files changed

+69
-55
lines changed

3 files changed

+69
-55
lines changed

monitor-ui/src/views/custom-view/view-config-index.vue

+26-18
Original file line numberDiff line numberDiff line change
@@ -222,32 +222,31 @@
222222
</div>
223223
</template>
224224
</AuthDialog>
225-
<ModalComponent :modelConfig="processConfigModel">
226-
<div slot="processConfig" style="padding: 0 12px;">
227-
<section>
228-
<div style="display: flex;">
229-
<div class="port-title">
230-
<span>{{$t('m_tableKey_role')}}:</span>
231-
</div>
232-
<div class="port-title">
233-
<span>{{$t('m_custom_dashboard')}}:</span>
234-
</div>
225+
226+
<Modal v-model="isShowProcessConfigModel" :title="$t(processConfigModel.modalTitle)" :mask-closable="false">
227+
<div style="padding: 0 12px; max-height: 500px; overflow-y: auto">
228+
<div style="display: flex;">
229+
<div class="port-title">
230+
<span>{{$t('m_tableKey_role')}}:</span>
235231
</div>
236-
</section>
237-
<section v-for="(pl, plIndex) in processConfigModel.dashboardConfig" :key="plIndex">
232+
<div class="port-title">
233+
<span>{{$t('m_custom_dashboard')}}:</span>
234+
</div>
235+
</div>
236+
<div v-for="(pl, plIndex) in processConfigModel.dashboardConfig" :key="plIndex">
238237
<div class="port-config">
239238
<div style="width: 40%">
240239
<label>{{pl.display_role_name}}:</label>
241240
</div>
242241
<div style="width: 55%">
243-
<Select filterable clearable v-model="pl.main_page_id" style="width:200px" :placeholder="$t('m_please_select') + $t('m_dashboard_for_role')">
242+
<Select filterable clearable v-model="pl.main_page_id" class='dashboard-config-selection' :placeholder="$t('m_please_select') + $t('m_dashboard_for_role')">
244243
<Option v-for="item in pl.options" :value="item.id" :key="item.id">{{ item.option_text }}</Option>
245244
</Select>
246245
</div>
247246
</div>
248-
</section>
247+
</div>
249248
</div>
250-
</ModalComponent>
249+
</Modal>
251250
<ExportChartModal
252251
:isModalShow="isModalShow"
253252
:pannelId="pannelId"
@@ -370,7 +369,8 @@ export default {
370369
},
371370
isModalShow: false,
372371
pannelId: null,
373-
panalName: ''
372+
panalName: '',
373+
isShowProcessConfigModel: false
374374
}
375375
},
376376
mounted() {
@@ -443,7 +443,8 @@ export default {
443443
})
444444
this.request('POST','/monitor/api/v1/dashboard/custom/main/set', params, () => {
445445
this.$Message.success(this.$t('m_tips_success'))
446-
this.$root.JQ('#set_dashboard_modal').modal('hide')
446+
this.isShowProcessConfigModel = false
447+
// this.$root.JQ('#set_dashboard_modal').modal('hide')
447448
this.getViewList()
448449
})
449450
},
@@ -533,7 +534,7 @@ export default {
533534
setDashboard() {
534535
this.request('GET',this.pathMap.portalConfig, '', responseData => {
535536
this.processConfigModel.dashboardConfig = responseData
536-
this.$root.JQ('#set_dashboard_modal').modal('show')
537+
this.isShowProcessConfigModel = true
537538
})
538539
},
539540
goToPanal(panalItem, type) {
@@ -667,6 +668,13 @@ body::-webkit-scrollbar {
667668
// display: none;
668669
}
669670
671+
.dashboard-config-selection {
672+
width:200px;
673+
.ivu-select-selection {
674+
height: 34px;
675+
}
676+
}
677+
670678
</style>
671679

672680
<style scoped lang="less">

monitor-ui/src/views/monitor-config/business-monitor-group-config.vue

+7-6
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
<Row v-for="(item, itemIndex) in businessConfig.retcode_string_map" :key="itemIndex" class='action-row'>
153153
<Col span="3">
154154
<Select v-model="item.regulative"
155-
:disabled="view || retcodeItemDisabled(item)"
155+
:disabled="view || retcodeItemDisabled(item, itemIndex)"
156156
style="width:90%"
157157
@on-change='onRegulativeChange(item)'
158158
>
@@ -162,7 +162,7 @@
162162
</Col>
163163
<Col span="3">
164164
<Input v-model.trim="item.source_value"
165-
:disabled="view || retcodeItemDisabled(item)"
165+
:disabled="view || retcodeItemDisabled(item, itemIndex)"
166166
@on-change="(e) => onSourceValueChange(e, item)"
167167
style="width:90%"
168168
@on-blur="refreshPage"
@@ -172,7 +172,7 @@
172172

173173
<Col span="4">
174174
<Input v-model.trim="item.matchingSourceValue"
175-
:disabled="view || retcodeItemDisabled(item) || item.regulative === 0"
175+
:disabled="view || retcodeItemDisabled(item, itemIndex) || item.regulative === 0"
176176
style="width:90%"
177177
@on-change="debounceRefresh"
178178
@on-blur="refreshPage"
@@ -186,15 +186,15 @@
186186
type="info"
187187
ghost
188188
size="small"
189-
:disabled="view || retcodeItemDisabled(item) || !item.source_value || !item.matchingSourceValue || item.regulative === 0"
189+
:disabled="view || retcodeItemDisabled(item, itemIndex) || !item.source_value || !item.matchingSourceValue || item.regulative === 0"
190190
@click="onMatchButtonClick(item)"
191191
>
192192
{{$t('m_match')}}
193193
</Button>
194194
</Col>
195195

196196
<Col span="4">
197-
<Input v-model.trim="item.target_value" :disabled="view || retcodeItemDisabled(item) || (!item.matchingResult && item.regulative === 1)" style="width:90%"></Input>
197+
<Input v-model.trim="item.target_value" :disabled="view || retcodeItemDisabled(item, itemIndex) || (!item.matchingResult && item.regulative === 1)" style="width:90%"></Input>
198198
</Col>
199199
<Col span="2">
200200
<span style="line-height: 32px;">{{ $t('m_' + item.value_type) }}</span>
@@ -550,10 +550,11 @@ export default {
550550
debounceRefresh: debounce(function (){
551551
this.refreshPage()
552552
}, 1000),
553-
retcodeItemDisabled(item) {
553+
retcodeItemDisabled(item, index = -1) {
554554
return item.regulative === this.templateRetCode.regulative
555555
&& item.source_value === this.templateRetCode.source_value
556556
&& item.target_value === this.templateRetCode.target_value
557+
&& index === 0
557558
},
558559
onRegulativeChange(item) {
559560
item.matchingSourceValue = ''

monitor-ui/src/views/monitor-config/log-template-config/custom-regex.vue

+36-31
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108

109109
<script>
110110
import {
111-
isEmpty, hasIn, cloneDeep, remove, intersection, find
111+
isEmpty, hasIn, cloneDeep, remove, intersection, find, findIndex
112112
} from 'lodash'
113113
import Vue from 'vue'
114114
import TagMapConfig from './tag-map-config.vue'
@@ -159,7 +159,7 @@ export default {
159159
render: (h, params) => (
160160
<Input
161161
value={params.row.name}
162-
disabled={this.isOperationBoxDisabled(params.row)}
162+
disabled={this.isOperationBoxDisabled(params.row, 'paramList', params.index)}
163163
placeholder={this.$t('m_metric_key_placeholder')}
164164
onInput={v => {
165165
this.changeVal('param_list', params.index, 'name', v)
@@ -184,7 +184,7 @@ export default {
184184
</div>
185185
<Input
186186
value={params.row.regular}
187-
disabled={this.isOperationBoxDisabled(params.row)}
187+
disabled={this.isOperationBoxDisabled(params.row, 'paramList', params.index)}
188188
onInput={v => {
189189
this.changeVal('param_list', params.index, 'regular', v)
190190
}}
@@ -226,7 +226,7 @@ export default {
226226
<Button
227227
size="small"
228228
type="primary"
229-
disabled={this.isOperationBoxDisabled(params.row)}
229+
disabled={this.isOperationBoxDisabled(params.row, 'paramList', params.index)}
230230
icon="md-create"
231231
onClick={() => this.editTagMapping(params.index)}
232232
>
@@ -246,7 +246,7 @@ export default {
246246
size="small"
247247
type="error"
248248
style="margin-right:5px;"
249-
disabled={this.isOperationBoxDisabled(params.row) || this.configInfo.param_list.length === 1}
249+
disabled={this.isOperationBoxDisabled(params.row, 'paramList', params.index) || this.configInfo.param_list.length === 1}
250250
onClick={() => this.deleteAction('param_list', params.index)}
251251
>
252252
<Icon type="md-trash" size="16"></Icon>
@@ -263,7 +263,7 @@ export default {
263263
render: (h, params) => (
264264
<div class="color_system">
265265
<ColorPicker value={params.row.color_group || ''}
266-
disabled={this.isOperationBoxDisabled(params.row, 'metricList')}
266+
disabled={this.isOperationBoxDisabled(params.row, 'metricList', params.index)}
267267
on-on-open-change={
268268
isShow => this.changeColorGroup(isShow, this.configInfo.metric_list[params.index], 'color_group')
269269
}
@@ -285,7 +285,7 @@ export default {
285285
<Input
286286
clearable
287287
value={params.row.display_name}
288-
disabled={this.isOperationBoxDisabled(params.row, 'metricList')}
288+
disabled={this.isOperationBoxDisabled(params.row, 'metricList', params.index)}
289289
onInput={v => {
290290
this.changeVal('metric_list', params.index, 'display_name', v)
291291
}}
@@ -306,7 +306,7 @@ export default {
306306
<Input
307307
clearable
308308
value={params.row.metric}
309-
disabled={this.isOperationBoxDisabled(params.row, 'metricList')}
309+
disabled={this.isOperationBoxDisabled(params.row, 'metricList', params.index)}
310310
placeholder={this.$t('m_metric_key_placeholder')}
311311
onInput={v => {
312312
this.changeVal('metric_list', params.index, 'metric', v)
@@ -328,7 +328,7 @@ export default {
328328
)
329329
},
330330
{
331-
title: this.$t('m_statistical_parameters'),
331+
title: this.$t('m_statistical_parameters'), // 统计参数
332332
key: 'log_param_name',
333333
width: 130,
334334
renderHeader: () => (
@@ -348,7 +348,7 @@ export default {
348348
filterable
349349
clearable
350350
value={params.row.log_param_name}
351-
disabled={this.isOperationBoxDisabled(params.row, 'metricList')}
351+
disabled={this.isOperationBoxDisabled(params.row, 'metricList', params.index)}
352352
on-on-change={v => {
353353
this.changeVal('metric_list', params.index, 'log_param_name', v)
354354
}}
@@ -377,7 +377,7 @@ export default {
377377
<Select
378378
filterable
379379
value={params.row.tag_config}
380-
disabled={this.isOperationBoxDisabled(params.row, 'metricList')}
380+
disabled={this.isOperationBoxDisabled(params.row, 'metricList', params.index)}
381381
multiple
382382
on-on-change={v => {
383383
this.changeVal('metric_list', params.index, 'tag_config', v)
@@ -430,7 +430,7 @@ export default {
430430
<Select
431431
filterable
432432
clearable
433-
disabled={params.row.log_param_name==='' || this.isOperationBoxDisabled(params.row, 'metricList')}
433+
disabled={params.row.log_param_name==='' || this.isOperationBoxDisabled(params.row, 'metricList', params.index)}
434434
value={params.row.agg_type}
435435
on-on-change={v => {
436436
this.changeVal('metric_list', params.index, 'agg_type', v)
@@ -452,7 +452,7 @@ export default {
452452
render: (h, params) =>
453453
(
454454
<i-switch value={params.row.auto_alarm}
455-
disabled={this.isOperationBoxDisabled(params.row, 'metricList')}
455+
disabled={this.isOperationBoxDisabled(params.row, 'metricList', params.index)}
456456
on-on-change={val => {
457457
if (!val) {
458458
Vue.set(this.configInfo.metric_list[params.index], 'range_config', cloneDeep(initRangeConfigMap))
@@ -471,7 +471,7 @@ export default {
471471
? (
472472
<Select
473473
value={params.row.range_config.operator}
474-
disabled={this.isOperationBoxDisabled(params.row, 'metricList')}
474+
disabled={this.isOperationBoxDisabled(params.row, 'metricList', params.index)}
475475
on-on-change={v => {
476476
this.configInfo.metric_list[params.index].range_config.operator = v
477477
}}
@@ -494,7 +494,7 @@ export default {
494494
render: (h, params) => params.row.auto_alarm ? (
495495
<Input
496496
value={params.row.range_config.threshold}
497-
disabled={this.isOperationBoxDisabled(params.row, 'metricList')}
497+
disabled={this.isOperationBoxDisabled(params.row, 'metricList', params.index)}
498498
on-on-change={v => {
499499
this.configInfo.metric_list[params.index].range_config.threshold = v.target.value
500500
}}
@@ -510,7 +510,7 @@ export default {
510510
render: (h, params) => params.row.auto_alarm ? (
511511
<Input
512512
value={params.row.range_config.time}
513-
disabled={this.isOperationBoxDisabled(params.row, 'metricList')}
513+
disabled={this.isOperationBoxDisabled(params.row, 'metricList', params.index)}
514514
on-on-change={v => {
515515
this.configInfo.metric_list[params.index].range_config.time = v.target.value
516516
}}
@@ -526,7 +526,7 @@ export default {
526526
render: (h, params) => params.row.auto_alarm ? (
527527
<Select
528528
value={params.row.range_config.time_unit}
529-
disabled={this.isOperationBoxDisabled(params.row, 'metricList')}
529+
disabled={this.isOperationBoxDisabled(params.row, 'metricList', params.index)}
530530
on-on-change={v => {
531531
this.configInfo.metric_list[params.index].range_config.time_unit = v
532532
}}
@@ -549,7 +549,7 @@ export default {
549549
render: (h, params) => (
550550
<div style="text-align: left; cursor: pointer;display: inline-flex;">
551551
<Button
552-
disabled={this.configInfo.metric_list.length === 1 || this.isOperationBoxDisabled(params.row, 'metricList')}
552+
disabled={this.configInfo.metric_list.length === 1 || this.isOperationBoxDisabled(params.row, 'metricList', params.index)}
553553
size="small"
554554
type="error"
555555
style="margin-right:5px;"
@@ -935,9 +935,11 @@ export default {
935935
responseData.forEach(item => {
936936
this.isNumericValue[item.name] = !this.isNumericString(item.demo_match_value)
937937
})
938-
// this.configInfo.metric_list.forEach(item => {
939-
// item.agg_type = ''
940-
// })
938+
this.configInfo.metric_list.forEach((item, index) => {
939+
if (!this.isOperationBoxDisabled(item, 'metricList', index)) {
940+
item.agg_type = ''
941+
}
942+
})
941943
}, {isNeedloading: false})
942944
},
943945
isNumericString(str) {
@@ -1007,37 +1009,40 @@ export default {
10071009
})
10081010
}
10091011
},
1010-
isOperationBoxDisabled(item, type = 'paramList') {
1012+
isOperationBoxDisabled(item, type = 'paramList', index=-2) {
10111013
if (this.view) {
10121014
return true
10131015
}
10141016
if (this.isInTemplatePage) {
10151017
return false
10161018
}
10171019
if (!isEmpty(item) && type) {
1018-
return type === 'paramList' ? this.isParamsListItemDisabled(this.templateParamList, item) : this.isMetricItemDisabled(this.templateMetricList, item)
1020+
return type === 'paramList' ? this.isParamsListItemDisabled(this.templateParamList, item, index) : this.isMetricItemDisabled(this.templateMetricList, item, index)
10191021
}
10201022
return this.isBaseCustomeTemplateEdit || this.isBaseCustomeTemplateCopy || this.isBaseCustomeTemplateAdd
10211023
10221024
},
1023-
isParamsListItemDisabled(list, item) {
1024-
const findItem = find(list, {
1025+
isParamsListItemDisabled(list, item, index=-2) {
1026+
const compareObj = {
10251027
name: item.name,
10261028
regular: item.regular,
10271029
demo_match_value: item.demo_match_value
1028-
})
1029-
return !isEmpty(findItem)
1030+
}
1031+
const findItem = find(list, compareObj)
1032+
1033+
return !isEmpty(findItem) && index === findIndex(list, compareObj)
10301034
},
1031-
isMetricItemDisabled(list, item) {
1032-
const findItem = find(list, {
1035+
isMetricItemDisabled(list, item, index=-2) {
1036+
const compareObj = {
10331037
color_group: item.color_group,
10341038
display_name: item.display_name,
10351039
metric: item.metric,
10361040
log_param_name: item.log_param_name,
10371041
agg_type: item.agg_type,
10381042
auto_alarm: item.auto_alarm
1039-
})
1040-
return !isEmpty(findItem)
1043+
}
1044+
const findItem = find(list, compareObj)
1045+
return !isEmpty(findItem) && index === findIndex(list, compareObj)
10411046
}
10421047
},
10431048
components: {

0 commit comments

Comments
 (0)