@blueking/monitor-alarm-center 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +89 -40
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -193209,6 +193209,7 @@ var Popup$2 = withInstall$2(/* @__PURE__ */ defineComponent({
|
|
|
193209
193209
|
var popper2;
|
|
193210
193210
|
var showTimeout;
|
|
193211
193211
|
var hideTimeout;
|
|
193212
|
+
var _showTs = 0;
|
|
193212
193213
|
var triggerEl = /* @__PURE__ */ ref(null);
|
|
193213
193214
|
var overlayEl = /* @__PURE__ */ ref(null);
|
|
193214
193215
|
var popperEl = /* @__PURE__ */ ref(null);
|
|
@@ -193371,7 +193372,7 @@ var Popup$2 = withInstall$2(/* @__PURE__ */ defineComponent({
|
|
|
193371
193372
|
if (!(parent22 !== document.body || rect2.width === 0 && rect2.height === 0)) {
|
|
193372
193373
|
popper2.state.elements.reference = triggerEl.value;
|
|
193373
193374
|
popper2.update();
|
|
193374
|
-
} else setVisible(false, { trigger: getTriggerType({ type: "mouseenter" }) });
|
|
193375
|
+
} else if (props2.trigger !== "click") setVisible(false, { trigger: getTriggerType({ type: "mouseenter" }) });
|
|
193375
193376
|
}
|
|
193376
193377
|
if (props2.showArrow) arrowStyle.value = getArrowStyle();
|
|
193377
193378
|
return;
|
|
@@ -193396,6 +193397,7 @@ var Popup$2 = withInstall$2(/* @__PURE__ */ defineComponent({
|
|
|
193396
193397
|
}
|
|
193397
193398
|
}
|
|
193398
193399
|
function show(ev) {
|
|
193400
|
+
_showTs = Date.now();
|
|
193399
193401
|
clearAllTimeout();
|
|
193400
193402
|
showTimeout = setTimeout(function() {
|
|
193401
193403
|
setVisible(true, { trigger: getTriggerType(ev) });
|
|
@@ -193436,6 +193438,8 @@ var Popup$2 = withInstall$2(/* @__PURE__ */ defineComponent({
|
|
|
193436
193438
|
}
|
|
193437
193439
|
}
|
|
193438
193440
|
function onDocumentMouseDown(ev) {
|
|
193441
|
+
if (Date.now() - _showTs < 200) return;
|
|
193442
|
+
if (ev.target.closest && ev.target.closest('[data-td-popup="' + id + '"]')) return;
|
|
193439
193443
|
var _popperEl$value, _triggerEl$value;
|
|
193440
193444
|
if ((_popperEl$value = popperEl.value) !== null && _popperEl$value !== void 0 && _popperEl$value.contains(ev.target)) return;
|
|
193441
193445
|
if ((_triggerEl$value = triggerEl.value) !== null && _triggerEl$value !== void 0 && _triggerEl$value.contains(ev.target)) return;
|
|
@@ -193494,7 +193498,22 @@ var Popup$2 = withInstall$2(/* @__PURE__ */ defineComponent({
|
|
|
193494
193498
|
getOverlayStyle(),
|
|
193495
193499
|
hidePopup && { visibility: "hidden" }
|
|
193496
193500
|
],
|
|
193497
|
-
"onClick":
|
|
193501
|
+
"onClick": function(e3) {
|
|
193502
|
+
e3.stopPropagation();
|
|
193503
|
+
onOverlayClick(e3);
|
|
193504
|
+
},
|
|
193505
|
+
"onMousedown": function(e3) {
|
|
193506
|
+
e3.stopPropagation();
|
|
193507
|
+
},
|
|
193508
|
+
"onMouseup": function(e3) {
|
|
193509
|
+
e3.stopPropagation();
|
|
193510
|
+
},
|
|
193511
|
+
"onPointerdown": function(e3) {
|
|
193512
|
+
e3.stopPropagation();
|
|
193513
|
+
},
|
|
193514
|
+
"onPointerup": function(e3) {
|
|
193515
|
+
e3.stopPropagation();
|
|
193516
|
+
},
|
|
193498
193517
|
"onMouseenter": onMouseenter,
|
|
193499
193518
|
"onMouseleave": onMouseLeave
|
|
193500
193519
|
}), [createVNode("div", {
|
|
@@ -249339,9 +249358,11 @@ const TypeEnum = {
|
|
|
249339
249358
|
SEVERITY_UP: "SEVERITY_UP",
|
|
249340
249359
|
ACTION: "ACTION",
|
|
249341
249360
|
ALERT_QOS: "ALERT_QOS",
|
|
249342
|
-
EVENT_DROP: "EVENT_DROP"
|
|
249361
|
+
EVENT_DROP: "EVENT_DROP",
|
|
249362
|
+
USER_ACTION: "USER_ACTION"
|
|
249343
249363
|
};
|
|
249344
249364
|
const OperateMap = {
|
|
249365
|
+
[TypeEnum.USER_ACTION]: `【${window.i18n.t("用户操作")}】`,
|
|
249345
249366
|
[TypeEnum.CREATE]: `【${window.i18n.t("告警产生")}】`,
|
|
249346
249367
|
[TypeEnum.CONVERGE]: `【${window.i18n.t("告警收敛")}】`,
|
|
249347
249368
|
[TypeEnum.RECOVER]: `【${window.i18n.t("告警恢复")}】`,
|
|
@@ -249358,6 +249379,7 @@ const OperateMap = {
|
|
|
249358
249379
|
[TypeEnum.EVENT_DROP]: `【${window.i18n.t("事件忽略")}】`
|
|
249359
249380
|
};
|
|
249360
249381
|
const iconMap = {
|
|
249382
|
+
[TypeEnum.USER_ACTION]: "👤",
|
|
249361
249383
|
[TypeEnum.CREATE]: "🚨",
|
|
249362
249384
|
[TypeEnum.CONVERGE]: "🎯",
|
|
249363
249385
|
[TypeEnum.RECOVER]: "✅",
|
|
@@ -249425,61 +249447,65 @@ const AlarmRecords = /* @__PURE__ */ defineComponent({
|
|
|
249425
249447
|
} = useI18n$1();
|
|
249426
249448
|
const loadingRef = useTemplateRef("scrollRef");
|
|
249427
249449
|
const circulationFilter = /* @__PURE__ */ shallowRef([{
|
|
249428
|
-
id:
|
|
249450
|
+
id: TypeEnum.USER_ACTION,
|
|
249451
|
+
name: t3("用户操作"),
|
|
249452
|
+
icon: iconMap[TypeEnum.USER_ACTION]
|
|
249453
|
+
}, {
|
|
249454
|
+
id: TypeEnum.CREATE,
|
|
249429
249455
|
name: t3("告警产生"),
|
|
249430
|
-
icon:
|
|
249456
|
+
icon: iconMap[TypeEnum.CREATE]
|
|
249431
249457
|
}, {
|
|
249432
|
-
id:
|
|
249458
|
+
id: TypeEnum.CONVERGE,
|
|
249433
249459
|
name: t3("告警收敛"),
|
|
249434
|
-
icon:
|
|
249460
|
+
icon: iconMap[TypeEnum.CONVERGE]
|
|
249435
249461
|
}, {
|
|
249436
|
-
id:
|
|
249462
|
+
id: TypeEnum.RECOVER,
|
|
249437
249463
|
name: t3("告警恢复"),
|
|
249438
|
-
icon:
|
|
249464
|
+
icon: iconMap[TypeEnum.RECOVER]
|
|
249439
249465
|
}, {
|
|
249440
|
-
id:
|
|
249466
|
+
id: TypeEnum.RECOVERING,
|
|
249441
249467
|
name: t3("告警恢复中"),
|
|
249442
|
-
icon:
|
|
249468
|
+
icon: iconMap[TypeEnum.RECOVERING]
|
|
249443
249469
|
}, {
|
|
249444
|
-
id:
|
|
249470
|
+
id: TypeEnum.CLOSE,
|
|
249445
249471
|
name: t3("告警关闭"),
|
|
249446
|
-
icon:
|
|
249472
|
+
icon: iconMap[TypeEnum.CLOSE]
|
|
249447
249473
|
}, {
|
|
249448
|
-
id:
|
|
249474
|
+
id: TypeEnum.DELAY_RECOVER,
|
|
249449
249475
|
name: t3("延迟恢复"),
|
|
249450
|
-
icon:
|
|
249476
|
+
icon: iconMap[TypeEnum.DELAY_RECOVER]
|
|
249451
249477
|
}, {
|
|
249452
|
-
id:
|
|
249478
|
+
id: TypeEnum.ABORT_RECOVER,
|
|
249453
249479
|
name: t3("中断恢复"),
|
|
249454
|
-
icon:
|
|
249480
|
+
icon: iconMap[TypeEnum.ABORT_RECOVER]
|
|
249455
249481
|
}, {
|
|
249456
|
-
id:
|
|
249482
|
+
id: TypeEnum.SYSTEM_RECOVER,
|
|
249457
249483
|
name: t3("系统恢复"),
|
|
249458
|
-
icon:
|
|
249484
|
+
icon: iconMap[TypeEnum.SYSTEM_RECOVER]
|
|
249459
249485
|
}, {
|
|
249460
|
-
id:
|
|
249486
|
+
id: TypeEnum.SYSTEM_CLOSE,
|
|
249461
249487
|
name: t3("系统关闭"),
|
|
249462
|
-
icon:
|
|
249488
|
+
icon: iconMap[TypeEnum.SYSTEM_CLOSE]
|
|
249463
249489
|
}, {
|
|
249464
|
-
id:
|
|
249490
|
+
id: TypeEnum.ACK,
|
|
249465
249491
|
name: t3("告警确认"),
|
|
249466
|
-
icon:
|
|
249492
|
+
icon: iconMap[TypeEnum.ACK]
|
|
249467
249493
|
}, {
|
|
249468
|
-
id:
|
|
249494
|
+
id: TypeEnum.SEVERITY_UP,
|
|
249469
249495
|
name: t3("告警级别调整"),
|
|
249470
|
-
icon:
|
|
249496
|
+
icon: iconMap[TypeEnum.SEVERITY_UP]
|
|
249471
249497
|
}, {
|
|
249472
|
-
id:
|
|
249498
|
+
id: TypeEnum.ACTION,
|
|
249473
249499
|
name: t3("处理动作"),
|
|
249474
|
-
icon:
|
|
249500
|
+
icon: iconMap[TypeEnum.ACTION]
|
|
249475
249501
|
}, {
|
|
249476
|
-
id:
|
|
249502
|
+
id: TypeEnum.ALERT_QOS,
|
|
249477
249503
|
name: t3("告警流控"),
|
|
249478
|
-
icon:
|
|
249504
|
+
icon: iconMap[TypeEnum.ALERT_QOS]
|
|
249479
249505
|
}, {
|
|
249480
|
-
id:
|
|
249506
|
+
id: TypeEnum.EVENT_DROP,
|
|
249481
249507
|
name: t3("事件忽略"),
|
|
249482
|
-
icon:
|
|
249508
|
+
icon: iconMap[TypeEnum.EVENT_DROP]
|
|
249483
249509
|
}]);
|
|
249484
249510
|
const checked = /* @__PURE__ */ shallowRef(circulationFilter.value.map((item2) => item2.id));
|
|
249485
249511
|
const oldChecked = /* @__PURE__ */ shallowRef(circulationFilter.value.map((item2) => item2.id));
|
|
@@ -249673,7 +249699,7 @@ const AlarmRecords = /* @__PURE__ */ defineComponent({
|
|
|
249673
249699
|
let dom = null;
|
|
249674
249700
|
const convergeDom = () => {
|
|
249675
249701
|
return item2.contents.map((content, i2) => {
|
|
249676
|
-
const showTip = i2 === item2.index && item2.source_time && (item2.operate ===
|
|
249702
|
+
const showTip = i2 === item2.index && item2.source_time && (item2.operate === TypeEnum.CREATE || item2.operate === TypeEnum.CONVERGE || item2.operate === TypeEnum.EVENT_DROP);
|
|
249677
249703
|
return withDirectives(createVNode("span", {
|
|
249678
249704
|
"key": i2,
|
|
249679
249705
|
"class": {
|
|
@@ -249697,7 +249723,7 @@ const AlarmRecords = /* @__PURE__ */ defineComponent({
|
|
|
249697
249723
|
}
|
|
249698
249724
|
dom = createVNode("span", null, [withDirectives(createVNode("span", {
|
|
249699
249725
|
"class": {
|
|
249700
|
-
"tip-dashed": item2.operate ===
|
|
249726
|
+
"tip-dashed": item2.operate === TypeEnum.CREATE || item2.operate === TypeEnum.CONVERGE
|
|
249701
249727
|
},
|
|
249702
249728
|
"onClick": () => item2.is_multiple && this.beforeCollapseChange(item2)
|
|
249703
249729
|
}, [item2.count > 1 ? `${this.$t("当前事件流水过多,收敛{count}条。", {
|
|
@@ -249708,7 +249734,7 @@ const AlarmRecords = /* @__PURE__ */ defineComponent({
|
|
|
249708
249734
|
disabled: !item2.source_time,
|
|
249709
249735
|
allowHTML: false
|
|
249710
249736
|
}]]), child]);
|
|
249711
|
-
if (item2.operate ===
|
|
249737
|
+
if (item2.operate === TypeEnum.ACTION) {
|
|
249712
249738
|
const textList = item2.contents[0].split("$");
|
|
249713
249739
|
let link2 = null;
|
|
249714
249740
|
if (item2.action_plugin_type === "notice") {
|
|
@@ -249730,15 +249756,15 @@ const AlarmRecords = /* @__PURE__ */ defineComponent({
|
|
|
249730
249756
|
];
|
|
249731
249757
|
}
|
|
249732
249758
|
} else if (item2.operate === "ANOMALY_NOTICE") ;
|
|
249733
|
-
else if (item2.operate ===
|
|
249759
|
+
else if (item2.operate === TypeEnum.ACK || item2.operate === TypeEnum.USER_ACTION) {
|
|
249734
249760
|
dom = [item2.contents[0], createVNode("span", {
|
|
249735
249761
|
"key": "alarm-ack",
|
|
249736
249762
|
"class": "alarm-ack"
|
|
249737
249763
|
}, [item2.contents[1]])];
|
|
249738
|
-
} else if (item2.contents.length > 1 && (item2.operate ===
|
|
249764
|
+
} else if (item2.contents.length > 1 && (item2.operate === TypeEnum.CREATE || item2.operate === TypeEnum.CONVERGE || item2.operate === TypeEnum.EVENT_DROP)) {
|
|
249739
249765
|
dom = convergeDom();
|
|
249740
249766
|
}
|
|
249741
|
-
if (item2.operate ===
|
|
249767
|
+
if (item2.operate === TypeEnum.EVENT_DROP) {
|
|
249742
249768
|
if (item2.count > 1) {
|
|
249743
249769
|
dom = createVNode("span", null, [withDirectives(createVNode("span", {
|
|
249744
249770
|
"class": "tip-dashed"
|
|
@@ -273783,7 +273809,6 @@ class AlertService extends AlarmService {
|
|
|
273783
273809
|
} else {
|
|
273784
273810
|
paramsClone.query_string = window.APM_QUERY_STRING || "";
|
|
273785
273811
|
}
|
|
273786
|
-
console.log("getFilterTableList = ", paramsClone);
|
|
273787
273812
|
const data3 = await searchAlert(
|
|
273788
273813
|
{
|
|
273789
273814
|
...paramsClone,
|
|
@@ -315606,6 +315631,8 @@ const AlarmTrendChart = /* @__PURE__ */ defineComponent({
|
|
|
315606
315631
|
t: t3
|
|
315607
315632
|
} = useI18n$1();
|
|
315608
315633
|
const store = useAlarmCenterStore();
|
|
315634
|
+
const handleAlarmTrendChartZoomChange = inject("handleAlarmTrendChartZoomChange", (_2) => {
|
|
315635
|
+
});
|
|
315609
315636
|
const apiMap = {
|
|
315610
315637
|
[AlarmType.ALERT]: "alert_v2.alertDateHistogram",
|
|
315611
315638
|
[AlarmType.ACTION]: "alert_v2.actionDateHistogram",
|
|
@@ -315718,6 +315745,8 @@ const AlarmTrendChart = /* @__PURE__ */ defineComponent({
|
|
|
315718
315745
|
};
|
|
315719
315746
|
};
|
|
315720
315747
|
const handleDataZoomChange = (dataZoom) => {
|
|
315748
|
+
console.log("dataZoom = ", dataZoom);
|
|
315749
|
+
handleAlarmTrendChartZoomChange(dataZoom);
|
|
315721
315750
|
store.timeRange = dataZoom;
|
|
315722
315751
|
};
|
|
315723
315752
|
return {
|
|
@@ -316438,6 +316467,11 @@ const AlarmCenter = /* @__PURE__ */ defineComponent({
|
|
|
316438
316467
|
if (bridgeProps.queryString) {
|
|
316439
316468
|
window.APM_QUERY_STRING = bridgeProps.queryString;
|
|
316440
316469
|
}
|
|
316470
|
+
const handleAlarmTrendChartZoomChange = (v2) => {
|
|
316471
|
+
console.log("handleAlarmTrendChartZoomChange = ", v2);
|
|
316472
|
+
bridgeEmit("alarmTrendChartZoomChange", v2);
|
|
316473
|
+
};
|
|
316474
|
+
provide("handleAlarmTrendChartZoomChange", handleAlarmTrendChartZoomChange);
|
|
316441
316475
|
const {
|
|
316442
316476
|
handleGetUserConfig: handleGetResidentSettingUserConfig,
|
|
316443
316477
|
handleSetUserConfig: handleSetResidentSettingUserConfig
|
|
@@ -316557,6 +316591,14 @@ const AlarmCenter = /* @__PURE__ */ defineComponent({
|
|
|
316557
316591
|
defaultFavoriteId.value = null;
|
|
316558
316592
|
currentFavorite.value = null;
|
|
316559
316593
|
});
|
|
316594
|
+
watch(bridgeProps, () => {
|
|
316595
|
+
alarmStore.refreshImmediate = bridgeProps.refreshImmediate;
|
|
316596
|
+
alarmStore.refreshInterval = Number(bridgeProps.refreshInterval);
|
|
316597
|
+
alarmStore.timeRange = bridgeProps.timeRange;
|
|
316598
|
+
}, {
|
|
316599
|
+
immediate: true,
|
|
316600
|
+
deep: true
|
|
316601
|
+
});
|
|
316560
316602
|
const updateIsCollapsed = (v2) => {
|
|
316561
316603
|
isCollapsed.value = v2;
|
|
316562
316604
|
};
|
|
@@ -316762,12 +316804,16 @@ const AlarmCenter = /* @__PURE__ */ defineComponent({
|
|
|
316762
316804
|
const handlePreviousDetail = () => {
|
|
316763
316805
|
let index2 = data3.value.findIndex((item2) => item2.id === alarmId.value);
|
|
316764
316806
|
index2 = index2 === -1 ? 0 : index2;
|
|
316765
|
-
|
|
316807
|
+
const target2 = data3.value[index2 === 0 ? data3.value.length - 1 : index2 - 1];
|
|
316808
|
+
alarmId.value = target2.id;
|
|
316809
|
+
alarmBizId.value = target2.bk_biz_id;
|
|
316766
316810
|
};
|
|
316767
316811
|
const handleNextDetail = () => {
|
|
316768
316812
|
let index2 = data3.value.findIndex((item2) => item2.id === alarmId.value);
|
|
316769
316813
|
index2 = index2 === -1 ? 0 : index2;
|
|
316770
|
-
|
|
316814
|
+
const target2 = data3.value[index2 === data3.value.length - 1 ? 0 : index2 + 1];
|
|
316815
|
+
alarmId.value = target2.id;
|
|
316816
|
+
alarmBizId.value = target2.bk_biz_id;
|
|
316771
316817
|
};
|
|
316772
316818
|
const autoShowAlertDialog = () => {
|
|
316773
316819
|
const alertAction = route?.query?.autoShowAlertAction;
|
|
@@ -316926,6 +316972,9 @@ const AlarmCenter = /* @__PURE__ */ defineComponent({
|
|
|
316926
316972
|
getUrlParams();
|
|
316927
316973
|
setUrlParams();
|
|
316928
316974
|
});
|
|
316975
|
+
onBeforeUnmount(() => {
|
|
316976
|
+
window.APM_QUERY_STRING = "";
|
|
316977
|
+
});
|
|
316929
316978
|
return {
|
|
316930
316979
|
isFirstInit,
|
|
316931
316980
|
quickFilterList,
|