@blueking/monitor-alarm-center 0.0.2 → 0.0.3

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.
Files changed (2) hide show
  1. package/index.js +81 -40
  2. 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": onOverlayClick,
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: "CREATE",
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: "CONVERGE",
249458
+ id: TypeEnum.CONVERGE,
249433
249459
  name: t3("告警收敛"),
249434
- icon: "🎯"
249460
+ icon: iconMap[TypeEnum.CONVERGE]
249435
249461
  }, {
249436
- id: "RECOVER",
249462
+ id: TypeEnum.RECOVER,
249437
249463
  name: t3("告警恢复"),
249438
- icon: "✅"
249464
+ icon: iconMap[TypeEnum.RECOVER]
249439
249465
  }, {
249440
- id: "RECOVERING",
249466
+ id: TypeEnum.RECOVERING,
249441
249467
  name: t3("告警恢复中"),
249442
- icon: "🔄"
249468
+ icon: iconMap[TypeEnum.RECOVERING]
249443
249469
  }, {
249444
- id: "CLOSE",
249470
+ id: TypeEnum.CLOSE,
249445
249471
  name: t3("告警关闭"),
249446
- icon: "❌"
249472
+ icon: iconMap[TypeEnum.CLOSE]
249447
249473
  }, {
249448
- id: "DELAY_RECOVER",
249474
+ id: TypeEnum.DELAY_RECOVER,
249449
249475
  name: t3("延迟恢复"),
249450
- icon: "⏰"
249476
+ icon: iconMap[TypeEnum.DELAY_RECOVER]
249451
249477
  }, {
249452
- id: "ABORT_RECOVER",
249478
+ id: TypeEnum.ABORT_RECOVER,
249453
249479
  name: t3("中断恢复"),
249454
- icon: "🔌"
249480
+ icon: iconMap[TypeEnum.ABORT_RECOVER]
249455
249481
  }, {
249456
- id: "SYSTEM_RECOVER",
249482
+ id: TypeEnum.SYSTEM_RECOVER,
249457
249483
  name: t3("系统恢复"),
249458
- icon: "✅"
249484
+ icon: iconMap[TypeEnum.SYSTEM_RECOVER]
249459
249485
  }, {
249460
- id: "SYSTEM_CLOSE",
249486
+ id: TypeEnum.SYSTEM_CLOSE,
249461
249487
  name: t3("系统关闭"),
249462
- icon: "❌"
249488
+ icon: iconMap[TypeEnum.SYSTEM_CLOSE]
249463
249489
  }, {
249464
- id: "ACK",
249490
+ id: TypeEnum.ACK,
249465
249491
  name: t3("告警确认"),
249466
- icon: "✔︎"
249492
+ icon: iconMap[TypeEnum.ACK]
249467
249493
  }, {
249468
- id: "SEVERITY_UP",
249494
+ id: TypeEnum.SEVERITY_UP,
249469
249495
  name: t3("告警级别调整"),
249470
- icon: "📉📈"
249496
+ icon: iconMap[TypeEnum.SEVERITY_UP]
249471
249497
  }, {
249472
- id: "ACTION",
249498
+ id: TypeEnum.ACTION,
249473
249499
  name: t3("处理动作"),
249474
- icon: "🔧"
249500
+ icon: iconMap[TypeEnum.ACTION]
249475
249501
  }, {
249476
- id: "ALERT_QOS",
249502
+ id: TypeEnum.ALERT_QOS,
249477
249503
  name: t3("告警流控"),
249478
- icon: "🚦"
249504
+ icon: iconMap[TypeEnum.ALERT_QOS]
249479
249505
  }, {
249480
- id: "EVENT_DROP",
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 === "CREATE" || item2.operate === "CONVERGE" || item2.operate === "EVENT_DROP");
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 === "CREATE" || item2.operate === "CONVERGE"
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 === "ACTION") {
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 === "ACK") {
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 === "CREATE" || item2.operate === "CONVERGE" || item2.operate === "EVENT_DROP")) {
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 === "EVENT_DROP") {
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,
@@ -316557,6 +316582,15 @@ const AlarmCenter = /* @__PURE__ */ defineComponent({
316557
316582
  defaultFavoriteId.value = null;
316558
316583
  currentFavorite.value = null;
316559
316584
  });
316585
+ watch(bridgeProps, () => {
316586
+ console.log("bridgeProps change === ", bridgeProps);
316587
+ alarmStore.refreshImmediate = bridgeProps.refreshImmediate;
316588
+ alarmStore.refreshInterval = Number(bridgeProps.refreshInterval);
316589
+ alarmStore.timeRange = bridgeProps.timeRange;
316590
+ }, {
316591
+ immediate: true,
316592
+ deep: true
316593
+ });
316560
316594
  const updateIsCollapsed = (v2) => {
316561
316595
  isCollapsed.value = v2;
316562
316596
  };
@@ -316762,12 +316796,16 @@ const AlarmCenter = /* @__PURE__ */ defineComponent({
316762
316796
  const handlePreviousDetail = () => {
316763
316797
  let index2 = data3.value.findIndex((item2) => item2.id === alarmId.value);
316764
316798
  index2 = index2 === -1 ? 0 : index2;
316765
- alarmId.value = data3.value[index2 === 0 ? data3.value.length - 1 : index2 - 1].id;
316799
+ const target2 = data3.value[index2 === 0 ? data3.value.length - 1 : index2 - 1];
316800
+ alarmId.value = target2.id;
316801
+ alarmBizId.value = target2.bk_biz_id;
316766
316802
  };
316767
316803
  const handleNextDetail = () => {
316768
316804
  let index2 = data3.value.findIndex((item2) => item2.id === alarmId.value);
316769
316805
  index2 = index2 === -1 ? 0 : index2;
316770
- alarmId.value = data3.value[index2 === data3.value.length - 1 ? 0 : index2 + 1].id;
316806
+ const target2 = data3.value[index2 === data3.value.length - 1 ? 0 : index2 + 1];
316807
+ alarmId.value = target2.id;
316808
+ alarmBizId.value = target2.bk_biz_id;
316771
316809
  };
316772
316810
  const autoShowAlertDialog = () => {
316773
316811
  const alertAction = route?.query?.autoShowAlertAction;
@@ -316926,6 +316964,9 @@ const AlarmCenter = /* @__PURE__ */ defineComponent({
316926
316964
  getUrlParams();
316927
316965
  setUrlParams();
316928
316966
  });
316967
+ onBeforeUnmount(() => {
316968
+ window.APM_QUERY_STRING = "";
316969
+ });
316929
316970
  return {
316930
316971
  isFirstInit,
316931
316972
  quickFilterList,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueking/monitor-alarm-center",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "蓝鲸监控告警中心抽取出来的独立库,主要提供给APM等宿主使用",
5
5
  "scripts": {},
6
6
  "files": [