@pisell/core 1.0.1 → 1.0.2
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/es/app/app.d.ts +15 -54
- package/es/app/app.js +33 -48
- package/es/app/const.js +3 -3
- package/es/app/index.d.ts +1 -1
- package/es/app/index.js +9 -11
- package/es/applicationManager/application.d.ts +2 -2
- package/es/applicationManager/application.js +9 -12
- package/es/applicationManager/index.js +4 -4
- package/es/config.js +5 -5
- package/es/data/index.d.ts +8 -29
- package/es/data/index.js +16 -8
- package/es/history/config.js +5 -5
- package/es/history/index.d.ts +1 -1
- package/es/history/index.js +4 -4
- package/es/hooks/useDelayedValue/index.js +1 -1
- package/es/hooks/useLowCode/index.js +5 -5
- package/es/hooks/useStore/index.d.ts +2 -2
- package/es/index.d.ts +0 -7
- package/es/index.js +8 -7
- package/es/indexDB/index.d.ts +3 -1
- package/es/indexDB/index.js +28 -22
- package/es/locales/index.d.ts +30 -89
- package/es/locales/index.js +202 -243
- package/es/locales/type.d.ts +3 -3
- package/es/logger/feishu.js +2 -2
- package/es/logger/index.d.ts +1 -1
- package/es/logger/index.js +31 -23
- package/es/menuManager/hooks.d.ts +10 -1
- package/es/menuManager/hooks.js +4 -6
- package/es/menuManager/index.d.ts +1 -1
- package/es/menuManager/index.js +3 -3
- package/es/models/global.js +8 -7
- package/es/models/index.d.ts +6 -6
- package/es/models/index.js +1 -2
- package/es/pubsub/index.d.ts +1 -1
- package/es/pubsub/index.js +3 -3
- package/es/request/cache.d.ts +1 -1
- package/es/request/cache.js +7 -6
- package/es/request/config.js +7 -7
- package/es/request/index.js +12 -11
- package/es/request/pisell2Request.d.ts +1 -1
- package/es/request/pisell2Request.js +5 -5
- package/es/request/type.d.ts +1 -0
- package/es/request/utils.js +5 -3
- package/es/routes/index.d.ts +2 -2
- package/es/routes/index.js +11 -17
- package/es/socket/components/SocketMonitorPage.js +255 -462
- package/es/socket/events.js +3 -3
- package/es/socket/heartbeat.js +6 -7
- package/es/socket/index.js +7 -7
- package/es/socket/monitor.d.ts +1 -1
- package/es/socket/monitor.js +24 -15
- package/es/socket/reconnect.js +9 -9
- package/es/socket/socket.js +11 -13
- package/es/socket/types.d.ts +2 -1
- package/es/socket/types.js +23 -7
- package/es/storage/index.d.ts +17 -42
- package/es/storage/index.js +55 -61
- package/es/tasks/index.d.ts +1 -1
- package/es/tasks/index.js +46 -22
- package/es/tasks/type.d.ts +4 -4
- package/es/tasks/useTasks.d.ts +2 -1
- package/es/tasks/useTasks.js +1 -1
- package/es/variables/VariablesProvider.js +3 -5
- package/es/variables/config.js +5 -5
- package/es/variables/index.d.ts +3 -3
- package/lib/app/app.d.ts +15 -54
- package/lib/app/app.js +7 -10
- package/lib/app/index.d.ts +1 -1
- package/lib/applicationManager/application.d.ts +2 -2
- package/lib/data/index.d.ts +8 -29
- package/lib/data/index.js +8 -22
- package/lib/history/index.d.ts +1 -1
- package/lib/hooks/useStore/index.d.ts +2 -2
- package/lib/index.d.ts +0 -7
- package/lib/index.js +0 -37
- package/lib/indexDB/index.d.ts +3 -1
- package/lib/indexDB/index.js +8 -18
- package/lib/locales/index.d.ts +30 -89
- package/lib/locales/index.js +111 -124
- package/lib/locales/type.d.ts +3 -3
- package/lib/logger/index.d.ts +1 -1
- package/lib/menuManager/hooks.d.ts +10 -1
- package/lib/menuManager/index.d.ts +1 -1
- package/lib/models/index.d.ts +6 -6
- package/lib/models/index.js +1 -2
- package/lib/pubsub/index.d.ts +1 -1
- package/lib/request/cache.d.ts +1 -1
- package/lib/request/config.js +2 -12
- package/lib/request/index.js +5 -1
- package/lib/request/pisell2Request.d.ts +1 -1
- package/lib/request/type.d.ts +1 -0
- package/lib/request/utils.js +2 -0
- package/lib/routes/index.d.ts +2 -2
- package/lib/socket/monitor.d.ts +1 -1
- package/lib/socket/types.d.ts +2 -1
- package/lib/storage/index.d.ts +17 -42
- package/lib/storage/index.js +35 -38
- package/lib/tasks/index.d.ts +1 -1
- package/lib/tasks/type.d.ts +4 -4
- package/lib/tasks/useTasks.d.ts +2 -1
- package/lib/variables/VariablesProvider.js +1 -1
- package/lib/variables/index.d.ts +3 -3
- package/package.json +11 -4
- package/es/locales/config.d.ts +0 -24
- package/es/locales/config.js +0 -59
- package/es/models/tasks.d.ts +0 -31
- package/es/models/tasks.js +0 -331
- package/es/models/tasksUtils.d.ts +0 -65
- package/es/models/tasksUtils.js +0 -179
- package/es/storage/config.d.ts +0 -3
- package/es/storage/config.js +0 -16
- package/es/storage/type.d.ts +0 -5
- package/es/storage/type.js +0 -1
- package/lib/locales/config.d.ts +0 -24
- package/lib/locales/config.js +0 -66
- package/lib/models/tasks.d.ts +0 -31
- package/lib/models/tasks.js +0 -199
- package/lib/models/tasksUtils.d.ts +0 -65
- package/lib/models/tasksUtils.js +0 -160
- package/lib/storage/config.d.ts +0 -3
- package/lib/storage/config.js +0 -38
- package/lib/storage/type.d.ts +0 -5
- package/lib/storage/type.js +0 -17
|
@@ -2,7 +2,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
|
|
|
2
2
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
3
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
4
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
-
function _iterableToArrayLimit(
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import React, { useState, useEffect, useCallback } from "react";
|
|
8
8
|
import socket from "../index";
|
|
@@ -12,8 +12,6 @@ import { SocketStatus } from "../index";
|
|
|
12
12
|
* 时间格式化函数
|
|
13
13
|
* @param timestamp 时间戳
|
|
14
14
|
*/
|
|
15
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
15
|
var formatTime = function formatTime(timestamp) {
|
|
18
16
|
if (timestamp === null) return "无";
|
|
19
17
|
var date = new Date(timestamp);
|
|
@@ -221,472 +219,267 @@ var SocketMonitorPage = function SocketMonitorPage() {
|
|
|
221
219
|
}
|
|
222
220
|
}
|
|
223
221
|
};
|
|
224
|
-
return /*#__PURE__*/
|
|
222
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
225
223
|
className: "socket-monitor-container",
|
|
226
224
|
style: {
|
|
227
225
|
padding: "20px"
|
|
226
|
+
}
|
|
227
|
+
}, /*#__PURE__*/React.createElement("h1", null, "Socket\u8FDE\u63A5\u76D1\u63A7"), /*#__PURE__*/React.createElement("div", {
|
|
228
|
+
className: "socket-selector",
|
|
229
|
+
style: {
|
|
230
|
+
marginBottom: "20px"
|
|
231
|
+
}
|
|
232
|
+
}, /*#__PURE__*/React.createElement("label", null, "\u9009\u62E9Socket: "), /*#__PURE__*/React.createElement("select", {
|
|
233
|
+
value: selectedKey || "",
|
|
234
|
+
onChange: function onChange(e) {
|
|
235
|
+
return setSelectedKey(e.target.value || null);
|
|
228
236
|
},
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
}
|
|
232
|
-
|
|
237
|
+
style: {
|
|
238
|
+
marginRight: "10px"
|
|
239
|
+
}
|
|
240
|
+
}, /*#__PURE__*/React.createElement("option", {
|
|
241
|
+
value: ""
|
|
242
|
+
}, "-- \u8BF7\u9009\u62E9 --"), socketKeys.map(function (key) {
|
|
243
|
+
return /*#__PURE__*/React.createElement("option", {
|
|
244
|
+
key: key,
|
|
245
|
+
value: key
|
|
246
|
+
}, key);
|
|
247
|
+
})), /*#__PURE__*/React.createElement("button", {
|
|
248
|
+
onClick: loadSocketList,
|
|
249
|
+
style: {
|
|
250
|
+
marginRight: "10px"
|
|
251
|
+
}
|
|
252
|
+
}, "\u5237\u65B0\u5217\u8868"), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("input", {
|
|
253
|
+
type: "checkbox",
|
|
254
|
+
checked: autoRefresh,
|
|
255
|
+
onChange: function onChange(e) {
|
|
256
|
+
return setAutoRefresh(e.target.checked);
|
|
257
|
+
}
|
|
258
|
+
}), "\u81EA\u52A8\u5237\u65B0")), currentSocket && /*#__PURE__*/React.createElement("div", {
|
|
259
|
+
className: "socket-actions",
|
|
260
|
+
style: {
|
|
261
|
+
marginBottom: "20px"
|
|
262
|
+
}
|
|
263
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
264
|
+
onClick: handleConnect,
|
|
265
|
+
disabled: currentSocket.isConnected(),
|
|
266
|
+
style: {
|
|
267
|
+
marginRight: "10px"
|
|
268
|
+
}
|
|
269
|
+
}, "\u8FDE\u63A5"), /*#__PURE__*/React.createElement("button", {
|
|
270
|
+
onClick: handleDisconnect,
|
|
271
|
+
disabled: !currentSocket.isConnected(),
|
|
272
|
+
style: {
|
|
273
|
+
marginRight: "10px"
|
|
274
|
+
}
|
|
275
|
+
}, "\u65AD\u5F00"), /*#__PURE__*/React.createElement("button", {
|
|
276
|
+
onClick: handleSendTestMessage,
|
|
277
|
+
disabled: !currentSocket.isConnected(),
|
|
278
|
+
style: {
|
|
279
|
+
marginRight: "10px"
|
|
280
|
+
}
|
|
281
|
+
}, "\u53D1\u9001\u6D4B\u8BD5\u6D88\u606F"), /*#__PURE__*/React.createElement("button", {
|
|
282
|
+
onClick: handleClearHistory,
|
|
283
|
+
style: {
|
|
284
|
+
marginRight: "10px"
|
|
285
|
+
}
|
|
286
|
+
}, "\u6E05\u9664\u5386\u53F2\u8BB0\u5F55"), /*#__PURE__*/React.createElement("button", {
|
|
287
|
+
onClick: handleResetStats
|
|
288
|
+
}, "\u91CD\u7F6E\u7EDF\u8BA1")), currentSocket && stats && /*#__PURE__*/React.createElement("div", {
|
|
289
|
+
className: "socket-stats",
|
|
290
|
+
style: {
|
|
291
|
+
marginBottom: "20px"
|
|
292
|
+
}
|
|
293
|
+
}, /*#__PURE__*/React.createElement("h2", null, "Socket\u72B6\u6001\u548C\u7EDF\u8BA1"), /*#__PURE__*/React.createElement("div", {
|
|
294
|
+
style: {
|
|
295
|
+
display: "flex",
|
|
296
|
+
flexWrap: "wrap"
|
|
297
|
+
}
|
|
298
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
299
|
+
style: {
|
|
300
|
+
flex: "1 1 300px",
|
|
301
|
+
margin: "0 20px 20px 0"
|
|
302
|
+
}
|
|
303
|
+
}, /*#__PURE__*/React.createElement("h3", null, "\u8FDE\u63A5\u4FE1\u606F"), /*#__PURE__*/React.createElement("table", {
|
|
304
|
+
style: {
|
|
305
|
+
width: "100%",
|
|
306
|
+
borderCollapse: "collapse"
|
|
307
|
+
}
|
|
308
|
+
}, /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("strong", null, "URL:")), /*#__PURE__*/React.createElement("td", null, currentSocket["url"])), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("strong", null, "\u5F53\u524D\u72B6\u6001:")), /*#__PURE__*/React.createElement("td", null, getStatusText(currentSocket.getStatus()))), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("strong", null, "\u9996\u6B21\u8FDE\u63A5\u65F6\u95F4:")), /*#__PURE__*/React.createElement("td", null, formatTime(stats.firstConnectTime))), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("strong", null, "\u6700\u540E\u8FDE\u63A5\u65F6\u95F4:")), /*#__PURE__*/React.createElement("td", null, formatTime(stats.lastConnectTime))), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("strong", null, "\u5F53\u524D\u8FDE\u63A5\u6301\u7EED\u65F6\u95F4:")), /*#__PURE__*/React.createElement("td", null, formatDuration(stats.currentConnectionDuration)))))), /*#__PURE__*/React.createElement("div", {
|
|
309
|
+
style: {
|
|
310
|
+
flex: "1 1 300px",
|
|
311
|
+
margin: "0 20px 20px 0"
|
|
312
|
+
}
|
|
313
|
+
}, /*#__PURE__*/React.createElement("h3", null, "\u7EDF\u8BA1\u6570\u636E"), /*#__PURE__*/React.createElement("table", {
|
|
314
|
+
style: {
|
|
315
|
+
width: "100%",
|
|
316
|
+
borderCollapse: "collapse"
|
|
317
|
+
}
|
|
318
|
+
}, /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("strong", null, "\u8FDE\u63A5\u6B21\u6570:")), /*#__PURE__*/React.createElement("td", null, stats.connectionCount)), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("strong", null, "\u91CD\u8FDE\u6B21\u6570:")), /*#__PURE__*/React.createElement("td", null, stats.reconnectionCount)), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("strong", null, "\u9519\u8BEF\u6B21\u6570:")), /*#__PURE__*/React.createElement("td", null, stats.errorCount)), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("strong", null, "\u5FC3\u8DF3\u53D1\u9001\u6B21\u6570:")), /*#__PURE__*/React.createElement("td", null, stats.heartbeatCount)), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("strong", null, "\u5FC3\u8DF3\u8D85\u65F6\u6B21\u6570:")), /*#__PURE__*/React.createElement("td", null, stats.heartbeatTimeoutCount))))), /*#__PURE__*/React.createElement("div", {
|
|
319
|
+
style: {
|
|
320
|
+
flex: "1 1 300px",
|
|
321
|
+
margin: "0 0 20px 0"
|
|
322
|
+
}
|
|
323
|
+
}, /*#__PURE__*/React.createElement("h3", null, "\u6D88\u606F\u7EDF\u8BA1"), /*#__PURE__*/React.createElement("table", {
|
|
324
|
+
style: {
|
|
325
|
+
width: "100%",
|
|
326
|
+
borderCollapse: "collapse"
|
|
327
|
+
}
|
|
328
|
+
}, /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("strong", null, "\u53D1\u9001\u6D88\u606F\u6570:")), /*#__PURE__*/React.createElement("td", null, stats.totalSent)), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("strong", null, "\u63A5\u6536\u6D88\u606F\u6570:")), /*#__PURE__*/React.createElement("td", null, stats.totalReceived)), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("strong", null, "\u53D1\u9001\u6570\u636E\u91CF:")), /*#__PURE__*/React.createElement("td", null, formatBytes(stats.bytesSent))), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("strong", null, "\u63A5\u6536\u6570\u636E\u91CF:")), /*#__PURE__*/React.createElement("td", null, formatBytes(stats.bytesReceived))), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("strong", null, "\u5E73\u5747\u6D88\u606F\u5927\u5C0F:")), /*#__PURE__*/React.createElement("td", null, formatBytes(stats.averageMessageSize)))))))), currentSocket && statusHistory.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
329
|
+
className: "socket-status-history",
|
|
330
|
+
style: {
|
|
331
|
+
marginBottom: "20px"
|
|
332
|
+
}
|
|
333
|
+
}, /*#__PURE__*/React.createElement("h2", null, "\u72B6\u6001\u53D8\u66F4\u5386\u53F2"), /*#__PURE__*/React.createElement("table", {
|
|
334
|
+
style: {
|
|
335
|
+
width: "100%",
|
|
336
|
+
borderCollapse: "collapse",
|
|
337
|
+
border: "1px solid #ddd"
|
|
338
|
+
}
|
|
339
|
+
}, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", {
|
|
340
|
+
style: {
|
|
341
|
+
backgroundColor: "#f2f2f2"
|
|
342
|
+
}
|
|
343
|
+
}, /*#__PURE__*/React.createElement("th", {
|
|
344
|
+
style: {
|
|
345
|
+
padding: "8px",
|
|
346
|
+
borderBottom: "1px solid #ddd",
|
|
347
|
+
textAlign: "left"
|
|
348
|
+
}
|
|
349
|
+
}, "\u65F6\u95F4"), /*#__PURE__*/React.createElement("th", {
|
|
350
|
+
style: {
|
|
351
|
+
padding: "8px",
|
|
352
|
+
borderBottom: "1px solid #ddd",
|
|
353
|
+
textAlign: "left"
|
|
354
|
+
}
|
|
355
|
+
}, "\u53D8\u66F4\u524D\u72B6\u6001"), /*#__PURE__*/React.createElement("th", {
|
|
356
|
+
style: {
|
|
357
|
+
padding: "8px",
|
|
358
|
+
borderBottom: "1px solid #ddd",
|
|
359
|
+
textAlign: "left"
|
|
360
|
+
}
|
|
361
|
+
}, "\u53D8\u66F4\u540E\u72B6\u6001"), /*#__PURE__*/React.createElement("th", {
|
|
362
|
+
style: {
|
|
363
|
+
padding: "8px",
|
|
364
|
+
borderBottom: "1px solid #ddd",
|
|
365
|
+
textAlign: "left"
|
|
366
|
+
}
|
|
367
|
+
}, "\u89E6\u53D1\u4E8B\u4EF6"))), /*#__PURE__*/React.createElement("tbody", null, statusHistory.map(function (item, index) {
|
|
368
|
+
return /*#__PURE__*/React.createElement("tr", {
|
|
369
|
+
key: index,
|
|
233
370
|
style: {
|
|
234
|
-
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
children: "\u9009\u62E9Socket: "
|
|
238
|
-
}), /*#__PURE__*/_jsxs("select", {
|
|
239
|
-
value: selectedKey || "",
|
|
240
|
-
onChange: function onChange(e) {
|
|
241
|
-
return setSelectedKey(e.target.value || null);
|
|
242
|
-
},
|
|
243
|
-
style: {
|
|
244
|
-
marginRight: "10px"
|
|
245
|
-
},
|
|
246
|
-
children: [/*#__PURE__*/_jsx("option", {
|
|
247
|
-
value: "",
|
|
248
|
-
children: "-- \u8BF7\u9009\u62E9 --"
|
|
249
|
-
}), socketKeys.map(function (key) {
|
|
250
|
-
return /*#__PURE__*/_jsx("option", {
|
|
251
|
-
value: key,
|
|
252
|
-
children: key
|
|
253
|
-
}, key);
|
|
254
|
-
})]
|
|
255
|
-
}), /*#__PURE__*/_jsx("button", {
|
|
256
|
-
onClick: loadSocketList,
|
|
257
|
-
style: {
|
|
258
|
-
marginRight: "10px"
|
|
259
|
-
},
|
|
260
|
-
children: "\u5237\u65B0\u5217\u8868"
|
|
261
|
-
}), /*#__PURE__*/_jsxs("label", {
|
|
262
|
-
children: [/*#__PURE__*/_jsx("input", {
|
|
263
|
-
type: "checkbox",
|
|
264
|
-
checked: autoRefresh,
|
|
265
|
-
onChange: function onChange(e) {
|
|
266
|
-
return setAutoRefresh(e.target.checked);
|
|
267
|
-
}
|
|
268
|
-
}), "\u81EA\u52A8\u5237\u65B0"]
|
|
269
|
-
})]
|
|
270
|
-
}), currentSocket && /*#__PURE__*/_jsxs("div", {
|
|
271
|
-
className: "socket-actions",
|
|
371
|
+
borderBottom: "1px solid #ddd"
|
|
372
|
+
}
|
|
373
|
+
}, /*#__PURE__*/React.createElement("td", {
|
|
272
374
|
style: {
|
|
273
|
-
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
onClick: handleConnect,
|
|
277
|
-
disabled: currentSocket.isConnected(),
|
|
278
|
-
style: {
|
|
279
|
-
marginRight: "10px"
|
|
280
|
-
},
|
|
281
|
-
children: "\u8FDE\u63A5"
|
|
282
|
-
}), /*#__PURE__*/_jsx("button", {
|
|
283
|
-
onClick: handleDisconnect,
|
|
284
|
-
disabled: !currentSocket.isConnected(),
|
|
285
|
-
style: {
|
|
286
|
-
marginRight: "10px"
|
|
287
|
-
},
|
|
288
|
-
children: "\u65AD\u5F00"
|
|
289
|
-
}), /*#__PURE__*/_jsx("button", {
|
|
290
|
-
onClick: handleSendTestMessage,
|
|
291
|
-
disabled: !currentSocket.isConnected(),
|
|
292
|
-
style: {
|
|
293
|
-
marginRight: "10px"
|
|
294
|
-
},
|
|
295
|
-
children: "\u53D1\u9001\u6D4B\u8BD5\u6D88\u606F"
|
|
296
|
-
}), /*#__PURE__*/_jsx("button", {
|
|
297
|
-
onClick: handleClearHistory,
|
|
298
|
-
style: {
|
|
299
|
-
marginRight: "10px"
|
|
300
|
-
},
|
|
301
|
-
children: "\u6E05\u9664\u5386\u53F2\u8BB0\u5F55"
|
|
302
|
-
}), /*#__PURE__*/_jsx("button", {
|
|
303
|
-
onClick: handleResetStats,
|
|
304
|
-
children: "\u91CD\u7F6E\u7EDF\u8BA1"
|
|
305
|
-
})]
|
|
306
|
-
}), currentSocket && stats && /*#__PURE__*/_jsxs("div", {
|
|
307
|
-
className: "socket-stats",
|
|
375
|
+
padding: "8px"
|
|
376
|
+
}
|
|
377
|
+
}, formatTime(item.timestamp)), /*#__PURE__*/React.createElement("td", {
|
|
308
378
|
style: {
|
|
309
|
-
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
flexWrap: "wrap"
|
|
317
|
-
},
|
|
318
|
-
children: [/*#__PURE__*/_jsxs("div", {
|
|
319
|
-
style: {
|
|
320
|
-
flex: "1 1 300px",
|
|
321
|
-
margin: "0 20px 20px 0"
|
|
322
|
-
},
|
|
323
|
-
children: [/*#__PURE__*/_jsx("h3", {
|
|
324
|
-
children: "\u8FDE\u63A5\u4FE1\u606F"
|
|
325
|
-
}), /*#__PURE__*/_jsx("table", {
|
|
326
|
-
style: {
|
|
327
|
-
width: "100%",
|
|
328
|
-
borderCollapse: "collapse"
|
|
329
|
-
},
|
|
330
|
-
children: /*#__PURE__*/_jsxs("tbody", {
|
|
331
|
-
children: [/*#__PURE__*/_jsxs("tr", {
|
|
332
|
-
children: [/*#__PURE__*/_jsx("td", {
|
|
333
|
-
children: /*#__PURE__*/_jsx("strong", {
|
|
334
|
-
children: "URL:"
|
|
335
|
-
})
|
|
336
|
-
}), /*#__PURE__*/_jsx("td", {
|
|
337
|
-
children: currentSocket["url"]
|
|
338
|
-
})]
|
|
339
|
-
}), /*#__PURE__*/_jsxs("tr", {
|
|
340
|
-
children: [/*#__PURE__*/_jsx("td", {
|
|
341
|
-
children: /*#__PURE__*/_jsx("strong", {
|
|
342
|
-
children: "\u5F53\u524D\u72B6\u6001:"
|
|
343
|
-
})
|
|
344
|
-
}), /*#__PURE__*/_jsx("td", {
|
|
345
|
-
children: getStatusText(currentSocket.getStatus())
|
|
346
|
-
})]
|
|
347
|
-
}), /*#__PURE__*/_jsxs("tr", {
|
|
348
|
-
children: [/*#__PURE__*/_jsx("td", {
|
|
349
|
-
children: /*#__PURE__*/_jsx("strong", {
|
|
350
|
-
children: "\u9996\u6B21\u8FDE\u63A5\u65F6\u95F4:"
|
|
351
|
-
})
|
|
352
|
-
}), /*#__PURE__*/_jsx("td", {
|
|
353
|
-
children: formatTime(stats.firstConnectTime)
|
|
354
|
-
})]
|
|
355
|
-
}), /*#__PURE__*/_jsxs("tr", {
|
|
356
|
-
children: [/*#__PURE__*/_jsx("td", {
|
|
357
|
-
children: /*#__PURE__*/_jsx("strong", {
|
|
358
|
-
children: "\u6700\u540E\u8FDE\u63A5\u65F6\u95F4:"
|
|
359
|
-
})
|
|
360
|
-
}), /*#__PURE__*/_jsx("td", {
|
|
361
|
-
children: formatTime(stats.lastConnectTime)
|
|
362
|
-
})]
|
|
363
|
-
}), /*#__PURE__*/_jsxs("tr", {
|
|
364
|
-
children: [/*#__PURE__*/_jsx("td", {
|
|
365
|
-
children: /*#__PURE__*/_jsx("strong", {
|
|
366
|
-
children: "\u5F53\u524D\u8FDE\u63A5\u6301\u7EED\u65F6\u95F4:"
|
|
367
|
-
})
|
|
368
|
-
}), /*#__PURE__*/_jsx("td", {
|
|
369
|
-
children: formatDuration(stats.currentConnectionDuration)
|
|
370
|
-
})]
|
|
371
|
-
})]
|
|
372
|
-
})
|
|
373
|
-
})]
|
|
374
|
-
}), /*#__PURE__*/_jsxs("div", {
|
|
375
|
-
style: {
|
|
376
|
-
flex: "1 1 300px",
|
|
377
|
-
margin: "0 20px 20px 0"
|
|
378
|
-
},
|
|
379
|
-
children: [/*#__PURE__*/_jsx("h3", {
|
|
380
|
-
children: "\u7EDF\u8BA1\u6570\u636E"
|
|
381
|
-
}), /*#__PURE__*/_jsx("table", {
|
|
382
|
-
style: {
|
|
383
|
-
width: "100%",
|
|
384
|
-
borderCollapse: "collapse"
|
|
385
|
-
},
|
|
386
|
-
children: /*#__PURE__*/_jsxs("tbody", {
|
|
387
|
-
children: [/*#__PURE__*/_jsxs("tr", {
|
|
388
|
-
children: [/*#__PURE__*/_jsx("td", {
|
|
389
|
-
children: /*#__PURE__*/_jsx("strong", {
|
|
390
|
-
children: "\u8FDE\u63A5\u6B21\u6570:"
|
|
391
|
-
})
|
|
392
|
-
}), /*#__PURE__*/_jsx("td", {
|
|
393
|
-
children: stats.connectionCount
|
|
394
|
-
})]
|
|
395
|
-
}), /*#__PURE__*/_jsxs("tr", {
|
|
396
|
-
children: [/*#__PURE__*/_jsx("td", {
|
|
397
|
-
children: /*#__PURE__*/_jsx("strong", {
|
|
398
|
-
children: "\u91CD\u8FDE\u6B21\u6570:"
|
|
399
|
-
})
|
|
400
|
-
}), /*#__PURE__*/_jsx("td", {
|
|
401
|
-
children: stats.reconnectionCount
|
|
402
|
-
})]
|
|
403
|
-
}), /*#__PURE__*/_jsxs("tr", {
|
|
404
|
-
children: [/*#__PURE__*/_jsx("td", {
|
|
405
|
-
children: /*#__PURE__*/_jsx("strong", {
|
|
406
|
-
children: "\u9519\u8BEF\u6B21\u6570:"
|
|
407
|
-
})
|
|
408
|
-
}), /*#__PURE__*/_jsx("td", {
|
|
409
|
-
children: stats.errorCount
|
|
410
|
-
})]
|
|
411
|
-
}), /*#__PURE__*/_jsxs("tr", {
|
|
412
|
-
children: [/*#__PURE__*/_jsx("td", {
|
|
413
|
-
children: /*#__PURE__*/_jsx("strong", {
|
|
414
|
-
children: "\u5FC3\u8DF3\u53D1\u9001\u6B21\u6570:"
|
|
415
|
-
})
|
|
416
|
-
}), /*#__PURE__*/_jsx("td", {
|
|
417
|
-
children: stats.heartbeatCount
|
|
418
|
-
})]
|
|
419
|
-
}), /*#__PURE__*/_jsxs("tr", {
|
|
420
|
-
children: [/*#__PURE__*/_jsx("td", {
|
|
421
|
-
children: /*#__PURE__*/_jsx("strong", {
|
|
422
|
-
children: "\u5FC3\u8DF3\u8D85\u65F6\u6B21\u6570:"
|
|
423
|
-
})
|
|
424
|
-
}), /*#__PURE__*/_jsx("td", {
|
|
425
|
-
children: stats.heartbeatTimeoutCount
|
|
426
|
-
})]
|
|
427
|
-
})]
|
|
428
|
-
})
|
|
429
|
-
})]
|
|
430
|
-
}), /*#__PURE__*/_jsxs("div", {
|
|
431
|
-
style: {
|
|
432
|
-
flex: "1 1 300px",
|
|
433
|
-
margin: "0 0 20px 0"
|
|
434
|
-
},
|
|
435
|
-
children: [/*#__PURE__*/_jsx("h3", {
|
|
436
|
-
children: "\u6D88\u606F\u7EDF\u8BA1"
|
|
437
|
-
}), /*#__PURE__*/_jsx("table", {
|
|
438
|
-
style: {
|
|
439
|
-
width: "100%",
|
|
440
|
-
borderCollapse: "collapse"
|
|
441
|
-
},
|
|
442
|
-
children: /*#__PURE__*/_jsxs("tbody", {
|
|
443
|
-
children: [/*#__PURE__*/_jsxs("tr", {
|
|
444
|
-
children: [/*#__PURE__*/_jsx("td", {
|
|
445
|
-
children: /*#__PURE__*/_jsx("strong", {
|
|
446
|
-
children: "\u53D1\u9001\u6D88\u606F\u6570:"
|
|
447
|
-
})
|
|
448
|
-
}), /*#__PURE__*/_jsx("td", {
|
|
449
|
-
children: stats.totalSent
|
|
450
|
-
})]
|
|
451
|
-
}), /*#__PURE__*/_jsxs("tr", {
|
|
452
|
-
children: [/*#__PURE__*/_jsx("td", {
|
|
453
|
-
children: /*#__PURE__*/_jsx("strong", {
|
|
454
|
-
children: "\u63A5\u6536\u6D88\u606F\u6570:"
|
|
455
|
-
})
|
|
456
|
-
}), /*#__PURE__*/_jsx("td", {
|
|
457
|
-
children: stats.totalReceived
|
|
458
|
-
})]
|
|
459
|
-
}), /*#__PURE__*/_jsxs("tr", {
|
|
460
|
-
children: [/*#__PURE__*/_jsx("td", {
|
|
461
|
-
children: /*#__PURE__*/_jsx("strong", {
|
|
462
|
-
children: "\u53D1\u9001\u6570\u636E\u91CF:"
|
|
463
|
-
})
|
|
464
|
-
}), /*#__PURE__*/_jsx("td", {
|
|
465
|
-
children: formatBytes(stats.bytesSent)
|
|
466
|
-
})]
|
|
467
|
-
}), /*#__PURE__*/_jsxs("tr", {
|
|
468
|
-
children: [/*#__PURE__*/_jsx("td", {
|
|
469
|
-
children: /*#__PURE__*/_jsx("strong", {
|
|
470
|
-
children: "\u63A5\u6536\u6570\u636E\u91CF:"
|
|
471
|
-
})
|
|
472
|
-
}), /*#__PURE__*/_jsx("td", {
|
|
473
|
-
children: formatBytes(stats.bytesReceived)
|
|
474
|
-
})]
|
|
475
|
-
}), /*#__PURE__*/_jsxs("tr", {
|
|
476
|
-
children: [/*#__PURE__*/_jsx("td", {
|
|
477
|
-
children: /*#__PURE__*/_jsx("strong", {
|
|
478
|
-
children: "\u5E73\u5747\u6D88\u606F\u5927\u5C0F:"
|
|
479
|
-
})
|
|
480
|
-
}), /*#__PURE__*/_jsx("td", {
|
|
481
|
-
children: formatBytes(stats.averageMessageSize)
|
|
482
|
-
})]
|
|
483
|
-
})]
|
|
484
|
-
})
|
|
485
|
-
})]
|
|
486
|
-
})]
|
|
487
|
-
})]
|
|
488
|
-
}), currentSocket && statusHistory.length > 0 && /*#__PURE__*/_jsxs("div", {
|
|
489
|
-
className: "socket-status-history",
|
|
379
|
+
padding: "8px"
|
|
380
|
+
}
|
|
381
|
+
}, getStatusText(item.from)), /*#__PURE__*/React.createElement("td", {
|
|
382
|
+
style: {
|
|
383
|
+
padding: "8px"
|
|
384
|
+
}
|
|
385
|
+
}, getStatusText(item.to)), /*#__PURE__*/React.createElement("td", {
|
|
490
386
|
style: {
|
|
491
|
-
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
}), /*#__PURE__*/_jsx("option", {
|
|
589
|
-
value: "in",
|
|
590
|
-
children: "\u63A5\u6536\u7684\u6D88\u606F"
|
|
591
|
-
}), /*#__PURE__*/_jsx("option", {
|
|
592
|
-
value: "out",
|
|
593
|
-
children: "\u53D1\u9001\u7684\u6D88\u606F"
|
|
594
|
-
})]
|
|
595
|
-
})]
|
|
596
|
-
}), messageHistory.length > 0 ? /*#__PURE__*/_jsxs("table", {
|
|
597
|
-
style: {
|
|
598
|
-
width: "100%",
|
|
599
|
-
borderCollapse: "collapse",
|
|
600
|
-
border: "1px solid #ddd"
|
|
601
|
-
},
|
|
602
|
-
children: [/*#__PURE__*/_jsx("thead", {
|
|
603
|
-
children: /*#__PURE__*/_jsxs("tr", {
|
|
604
|
-
style: {
|
|
605
|
-
backgroundColor: "#f2f2f2"
|
|
606
|
-
},
|
|
607
|
-
children: [/*#__PURE__*/_jsx("th", {
|
|
608
|
-
style: {
|
|
609
|
-
padding: "8px",
|
|
610
|
-
borderBottom: "1px solid #ddd",
|
|
611
|
-
textAlign: "left"
|
|
612
|
-
},
|
|
613
|
-
children: "\u65F6\u95F4"
|
|
614
|
-
}), /*#__PURE__*/_jsx("th", {
|
|
615
|
-
style: {
|
|
616
|
-
padding: "8px",
|
|
617
|
-
borderBottom: "1px solid #ddd",
|
|
618
|
-
textAlign: "left"
|
|
619
|
-
},
|
|
620
|
-
children: "\u65B9\u5411"
|
|
621
|
-
}), /*#__PURE__*/_jsx("th", {
|
|
622
|
-
style: {
|
|
623
|
-
padding: "8px",
|
|
624
|
-
borderBottom: "1px solid #ddd",
|
|
625
|
-
textAlign: "left"
|
|
626
|
-
},
|
|
627
|
-
children: "\u4E8B\u4EF6\u7C7B\u578B"
|
|
628
|
-
}), /*#__PURE__*/_jsx("th", {
|
|
629
|
-
style: {
|
|
630
|
-
padding: "8px",
|
|
631
|
-
borderBottom: "1px solid #ddd",
|
|
632
|
-
textAlign: "left"
|
|
633
|
-
},
|
|
634
|
-
children: "\u5927\u5C0F"
|
|
635
|
-
}), /*#__PURE__*/_jsx("th", {
|
|
636
|
-
style: {
|
|
637
|
-
padding: "8px",
|
|
638
|
-
borderBottom: "1px solid #ddd",
|
|
639
|
-
textAlign: "left"
|
|
640
|
-
},
|
|
641
|
-
children: "\u5185\u5BB9"
|
|
642
|
-
})]
|
|
643
|
-
})
|
|
644
|
-
}), /*#__PURE__*/_jsx("tbody", {
|
|
645
|
-
children: messageHistory.map(function (item) {
|
|
646
|
-
return /*#__PURE__*/_jsxs("tr", {
|
|
647
|
-
style: {
|
|
648
|
-
borderBottom: "1px solid #ddd"
|
|
649
|
-
},
|
|
650
|
-
children: [/*#__PURE__*/_jsx("td", {
|
|
651
|
-
style: {
|
|
652
|
-
padding: "8px"
|
|
653
|
-
},
|
|
654
|
-
children: formatTime(item.timestamp)
|
|
655
|
-
}), /*#__PURE__*/_jsx("td", {
|
|
656
|
-
style: {
|
|
657
|
-
padding: "8px"
|
|
658
|
-
},
|
|
659
|
-
children: item.direction === "in" ? "接收" : "发送"
|
|
660
|
-
}), /*#__PURE__*/_jsx("td", {
|
|
661
|
-
style: {
|
|
662
|
-
padding: "8px"
|
|
663
|
-
},
|
|
664
|
-
children: item.message.event
|
|
665
|
-
}), /*#__PURE__*/_jsx("td", {
|
|
666
|
-
style: {
|
|
667
|
-
padding: "8px"
|
|
668
|
-
},
|
|
669
|
-
children: formatBytes(item.size || 0)
|
|
670
|
-
}), /*#__PURE__*/_jsx("td", {
|
|
671
|
-
style: {
|
|
672
|
-
padding: "8px"
|
|
673
|
-
},
|
|
674
|
-
children: /*#__PURE__*/_jsx("pre", {
|
|
675
|
-
style: {
|
|
676
|
-
margin: 0,
|
|
677
|
-
maxWidth: "400px",
|
|
678
|
-
overflow: "auto"
|
|
679
|
-
},
|
|
680
|
-
children: JSON.stringify(item.message.data, null, 2)
|
|
681
|
-
})
|
|
682
|
-
})]
|
|
683
|
-
}, item.id);
|
|
684
|
-
})
|
|
685
|
-
})]
|
|
686
|
-
}) : /*#__PURE__*/_jsx("p", {
|
|
687
|
-
children: "\u6682\u65E0\u6D88\u606F\u8BB0\u5F55"
|
|
688
|
-
})]
|
|
689
|
-
})]
|
|
690
|
-
});
|
|
387
|
+
padding: "8px"
|
|
388
|
+
}
|
|
389
|
+
}, item.event || "-"));
|
|
390
|
+
})))), currentSocket && /*#__PURE__*/React.createElement("div", {
|
|
391
|
+
className: "socket-message-history"
|
|
392
|
+
}, /*#__PURE__*/React.createElement("h2", null, "\u6D88\u606F\u5386\u53F2\u8BB0\u5F55"), /*#__PURE__*/React.createElement("div", {
|
|
393
|
+
style: {
|
|
394
|
+
marginBottom: "10px"
|
|
395
|
+
}
|
|
396
|
+
}, /*#__PURE__*/React.createElement("label", null, "\u8FC7\u6EE4: "), /*#__PURE__*/React.createElement("select", {
|
|
397
|
+
value: messageFilter,
|
|
398
|
+
onChange: function onChange(e) {
|
|
399
|
+
return setMessageFilter(e.target.value);
|
|
400
|
+
},
|
|
401
|
+
style: {
|
|
402
|
+
marginRight: "10px"
|
|
403
|
+
}
|
|
404
|
+
}, /*#__PURE__*/React.createElement("option", {
|
|
405
|
+
value: "all"
|
|
406
|
+
}, "\u5168\u90E8\u6D88\u606F"), /*#__PURE__*/React.createElement("option", {
|
|
407
|
+
value: "in"
|
|
408
|
+
}, "\u63A5\u6536\u7684\u6D88\u606F"), /*#__PURE__*/React.createElement("option", {
|
|
409
|
+
value: "out"
|
|
410
|
+
}, "\u53D1\u9001\u7684\u6D88\u606F"))), messageHistory.length > 0 ? /*#__PURE__*/React.createElement("table", {
|
|
411
|
+
style: {
|
|
412
|
+
width: "100%",
|
|
413
|
+
borderCollapse: "collapse",
|
|
414
|
+
border: "1px solid #ddd"
|
|
415
|
+
}
|
|
416
|
+
}, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", {
|
|
417
|
+
style: {
|
|
418
|
+
backgroundColor: "#f2f2f2"
|
|
419
|
+
}
|
|
420
|
+
}, /*#__PURE__*/React.createElement("th", {
|
|
421
|
+
style: {
|
|
422
|
+
padding: "8px",
|
|
423
|
+
borderBottom: "1px solid #ddd",
|
|
424
|
+
textAlign: "left"
|
|
425
|
+
}
|
|
426
|
+
}, "\u65F6\u95F4"), /*#__PURE__*/React.createElement("th", {
|
|
427
|
+
style: {
|
|
428
|
+
padding: "8px",
|
|
429
|
+
borderBottom: "1px solid #ddd",
|
|
430
|
+
textAlign: "left"
|
|
431
|
+
}
|
|
432
|
+
}, "\u65B9\u5411"), /*#__PURE__*/React.createElement("th", {
|
|
433
|
+
style: {
|
|
434
|
+
padding: "8px",
|
|
435
|
+
borderBottom: "1px solid #ddd",
|
|
436
|
+
textAlign: "left"
|
|
437
|
+
}
|
|
438
|
+
}, "\u4E8B\u4EF6\u7C7B\u578B"), /*#__PURE__*/React.createElement("th", {
|
|
439
|
+
style: {
|
|
440
|
+
padding: "8px",
|
|
441
|
+
borderBottom: "1px solid #ddd",
|
|
442
|
+
textAlign: "left"
|
|
443
|
+
}
|
|
444
|
+
}, "\u5927\u5C0F"), /*#__PURE__*/React.createElement("th", {
|
|
445
|
+
style: {
|
|
446
|
+
padding: "8px",
|
|
447
|
+
borderBottom: "1px solid #ddd",
|
|
448
|
+
textAlign: "left"
|
|
449
|
+
}
|
|
450
|
+
}, "\u5185\u5BB9"))), /*#__PURE__*/React.createElement("tbody", null, messageHistory.map(function (item) {
|
|
451
|
+
return /*#__PURE__*/React.createElement("tr", {
|
|
452
|
+
key: item.id,
|
|
453
|
+
style: {
|
|
454
|
+
borderBottom: "1px solid #ddd"
|
|
455
|
+
}
|
|
456
|
+
}, /*#__PURE__*/React.createElement("td", {
|
|
457
|
+
style: {
|
|
458
|
+
padding: "8px"
|
|
459
|
+
}
|
|
460
|
+
}, formatTime(item.timestamp)), /*#__PURE__*/React.createElement("td", {
|
|
461
|
+
style: {
|
|
462
|
+
padding: "8px"
|
|
463
|
+
}
|
|
464
|
+
}, item.direction === "in" ? "接收" : "发送"), /*#__PURE__*/React.createElement("td", {
|
|
465
|
+
style: {
|
|
466
|
+
padding: "8px"
|
|
467
|
+
}
|
|
468
|
+
}, item.message.event), /*#__PURE__*/React.createElement("td", {
|
|
469
|
+
style: {
|
|
470
|
+
padding: "8px"
|
|
471
|
+
}
|
|
472
|
+
}, formatBytes(item.size || 0)), /*#__PURE__*/React.createElement("td", {
|
|
473
|
+
style: {
|
|
474
|
+
padding: "8px"
|
|
475
|
+
}
|
|
476
|
+
}, /*#__PURE__*/React.createElement("pre", {
|
|
477
|
+
style: {
|
|
478
|
+
margin: 0,
|
|
479
|
+
maxWidth: "400px",
|
|
480
|
+
overflow: "auto"
|
|
481
|
+
}
|
|
482
|
+
}, JSON.stringify(item.message.data, null, 2))));
|
|
483
|
+
}))) : /*#__PURE__*/React.createElement("p", null, "\u6682\u65E0\u6D88\u606F\u8BB0\u5F55")));
|
|
691
484
|
};
|
|
692
485
|
export default SocketMonitorPage;
|