@riil-frontend/component-topology 2.14.2-alpha.21 → 2.14.2-alpha.22
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/build/index.css +1 -1
- package/build/index.js +6 -6
- package/es/components/BatchAttrMetric/index.module.scss +3 -3
- package/es/core/models/common/Alarm.js +44 -35
- package/es/models/topoAlarm.js +45 -27
- package/lib/components/BatchAttrMetric/index.module.scss +3 -3
- package/lib/core/models/common/Alarm.js +40 -30
- package/lib/models/topoAlarm.js +46 -31
- package/package.json +2 -2
package/lib/models/topoAlarm.js
CHANGED
|
@@ -84,10 +84,14 @@ var _default = {
|
|
|
84
84
|
_state$topoAlarm = state.topoAlarm, alarmDoc = _state$topoAlarm.alarmDoc, alarmRecord = _state$topoAlarm.alarmRecord, alarmList = _state$topoAlarm.alarmList;
|
|
85
85
|
_state$topoMod = state.topoMod, resAndMetrics = _state$topoMod.resAndMetrics, topoData = _state$topoMod.topoData;
|
|
86
86
|
resIdsList = resAndMetrics.resIdsList, alarmCiDoc = resAndMetrics.alarmCiDoc;
|
|
87
|
-
doc = (0, _extends2["default"])({}, alarmDoc);
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
doc = (0, _extends2["default"])({}, alarmDoc); // rlog.debug(
|
|
88
|
+
// " 归档处理告警信息.doc, alarmdata,resIdsList,alarmRecord",
|
|
89
|
+
// doc,
|
|
90
|
+
// alarmdata,
|
|
91
|
+
// resIdsList,
|
|
92
|
+
// alarmRecord
|
|
93
|
+
// );
|
|
94
|
+
// rlog.debug("topoAlarmMod.combAlarmData-alarmDoc, alarmRecord ", alarmDoc, alarmRecord );
|
|
91
95
|
|
|
92
96
|
record = _lodash["default"].uniq(alarmRecord);
|
|
93
97
|
|
|
@@ -105,34 +109,48 @@ var _default = {
|
|
|
105
109
|
|
|
106
110
|
var rid = alarmCiDoc[item.id];
|
|
107
111
|
|
|
108
|
-
_rlog["default"].debug("处理一条告警", item, rid,
|
|
112
|
+
_rlog["default"].debug("处理一条告警", item, rid, record);
|
|
109
113
|
|
|
110
114
|
if ((resIdsList || []).indexOf(rid) >= 0) {
|
|
111
|
-
if (record.indexOf(item.alertId) < 0
|
|
112
|
-
|
|
113
|
-
record.push(item.alertId);
|
|
114
|
-
|
|
115
|
-
if (doc.hasOwnProperty(rid)) {
|
|
116
|
-
if (doc[rid].findIndex(function (x) {
|
|
117
|
-
return x.alertId === item.alertId;
|
|
118
|
-
}) >= 0) {
|
|
119
|
-
doc[rid].push(item);
|
|
120
|
-
}
|
|
115
|
+
if (record.indexOf(item.alertId) < 0) {
|
|
116
|
+
_rlog["default"].debug("这是一条新告警");
|
|
121
117
|
|
|
122
|
-
|
|
118
|
+
if (item.status === "toDeal") {
|
|
119
|
+
record.push(item.alertId);
|
|
120
|
+
|
|
121
|
+
if (doc.hasOwnProperty(rid)) {
|
|
122
|
+
if (doc[rid].findIndex(function (x) {
|
|
123
|
+
return x.alertId === item.alertId;
|
|
124
|
+
}) < 0) {
|
|
125
|
+
var newArr = [].concat(doc[rid]);
|
|
126
|
+
newArr.push(item);
|
|
127
|
+
doc[rid] = newArr.sort(_topoData.sortList);
|
|
128
|
+
}
|
|
129
|
+
} else {
|
|
130
|
+
doc[rid] = [item];
|
|
131
|
+
}
|
|
123
132
|
} else {
|
|
124
|
-
|
|
133
|
+
_rlog["default"].warn("接收到异常告警");
|
|
125
134
|
}
|
|
126
|
-
} else
|
|
135
|
+
} else {
|
|
127
136
|
var sliceTag = doc[rid].findIndex(function (x) {
|
|
128
137
|
return x.alertId === item.alertId;
|
|
129
|
-
}); //
|
|
138
|
+
}); // rlog.debug(
|
|
139
|
+
// "已有资源告警-doc-rid-record-sliceTag-item",
|
|
140
|
+
// doc,
|
|
141
|
+
// rid,
|
|
142
|
+
// record,
|
|
143
|
+
// sliceTag,
|
|
144
|
+
// item
|
|
145
|
+
// );
|
|
130
146
|
|
|
131
147
|
if (item.status === "toDeal") {
|
|
132
148
|
if (doc[rid][sliceTag].level !== item.level) {
|
|
133
|
-
var
|
|
134
|
-
|
|
135
|
-
|
|
149
|
+
var _newArr = [].concat(doc[rid]);
|
|
150
|
+
|
|
151
|
+
_newArr.splice(sliceTag, 1, item);
|
|
152
|
+
|
|
153
|
+
doc[rid] = _newArr.sort(_topoData.sortList);
|
|
136
154
|
|
|
137
155
|
_rlog["default"].debug("告警变更", doc[rid], item);
|
|
138
156
|
} else {
|
|
@@ -140,11 +158,11 @@ var _default = {
|
|
|
140
158
|
}
|
|
141
159
|
} else {
|
|
142
160
|
if (sliceTag >= 0) {
|
|
143
|
-
var
|
|
161
|
+
var _newArr2 = [].concat(doc[rid]);
|
|
144
162
|
|
|
145
|
-
|
|
163
|
+
_newArr2.splice(sliceTag, 1);
|
|
146
164
|
|
|
147
|
-
doc[rid] =
|
|
165
|
+
doc[rid] = _newArr2;
|
|
148
166
|
}
|
|
149
167
|
|
|
150
168
|
_rlog["default"].debug("该告警移除状态-status", item.status, doc[rid], doc);
|
|
@@ -155,8 +173,6 @@ var _default = {
|
|
|
155
173
|
|
|
156
174
|
record.splice(record.indexOf(item.alertId), 1);
|
|
157
175
|
}
|
|
158
|
-
} else {
|
|
159
|
-
_rlog["default"].warn("收到一条异常告警", item);
|
|
160
176
|
}
|
|
161
177
|
}
|
|
162
178
|
};
|
|
@@ -178,11 +194,10 @@ var _default = {
|
|
|
178
194
|
return null;
|
|
179
195
|
}
|
|
180
196
|
}));
|
|
181
|
-
|
|
182
|
-
_rlog["default"].debug("告警归档结束", alarmList, alarmlist, doc, record);
|
|
183
|
-
|
|
184
197
|
eqFlag = _lodash["default"].isEqual(_lodash["default"].sortBy(alarmlist), _lodash["default"].sortBy(alarmList));
|
|
185
198
|
|
|
199
|
+
_rlog["default"].debug("告警归档结束", eqFlag, alarmList, alarmlist, doc, record);
|
|
200
|
+
|
|
186
201
|
_this2.update({
|
|
187
202
|
alarmDoc: doc,
|
|
188
203
|
alarmRecord: record,
|
|
@@ -194,7 +209,7 @@ var _default = {
|
|
|
194
209
|
alarmlist: alarmlist
|
|
195
210
|
});
|
|
196
211
|
|
|
197
|
-
case
|
|
212
|
+
case 14:
|
|
198
213
|
case "end":
|
|
199
214
|
return _context2.stop();
|
|
200
215
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riil-frontend/component-topology",
|
|
3
|
-
"version": "2.14.2-alpha.
|
|
3
|
+
"version": "2.14.2-alpha.22",
|
|
4
4
|
"description": "拓扑",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "build-scripts start",
|
|
@@ -111,6 +111,6 @@
|
|
|
111
111
|
"access": "public"
|
|
112
112
|
},
|
|
113
113
|
"license": "MIT",
|
|
114
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@2.14.2-alpha.
|
|
114
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@2.14.2-alpha.22/build/index.html",
|
|
115
115
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
|
116
116
|
}
|