@kwirthmagnify/kwirth-plugin-provider-debug 0.1.1 → 0.1.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/front.js +32 -3
- package/package.json +1 -1
package/front.js
CHANGED
|
@@ -99,6 +99,8 @@
|
|
|
99
99
|
this.events = [];
|
|
100
100
|
this.providers = [];
|
|
101
101
|
this.signals = [];
|
|
102
|
+
this.configAccepted = false;
|
|
103
|
+
this.subscribed = false;
|
|
102
104
|
this.paused = false;
|
|
103
105
|
this.started = false;
|
|
104
106
|
}
|
|
@@ -437,7 +439,23 @@
|
|
|
437
439
|
}
|
|
438
440
|
}
|
|
439
441
|
}
|
|
440
|
-
), /* @__PURE__ */ import_react3.default.createElement(import_material3.Tooltip, { title: "Previous match (Shift+Enter)" }, /* @__PURE__ */ import_react3.default.createElement("span", null, /* @__PURE__ */ import_react3.default.createElement(import_material3.IconButton, { size: "small", "aria-label": "Previous match", disabled: found.length === 0, onClick: () => goToMatch(matchPos - 1) }, /* @__PURE__ */ import_react3.default.createElement(import_icons_material2.ArrowUpward, { fontSize: "small" })))), /* @__PURE__ */ import_react3.default.createElement(import_material3.Tooltip, { title: "Next match (Enter)" }, /* @__PURE__ */ import_react3.default.createElement("span", null, /* @__PURE__ */ import_react3.default.createElement(import_material3.IconButton, { size: "small", "aria-label": "Next match", disabled: found.length === 0, onClick: () => goToMatch(matchPos + 1) }, /* @__PURE__ */ import_react3.default.createElement(import_icons_material2.ArrowDownward, { fontSize: "small" })))), /* @__PURE__ */ import_react3.default.createElement(import_material3.Tooltip, { title: "Clear captured events" }, /* @__PURE__ */ import_react3.default.createElement("span", null, /* @__PURE__ */ import_react3.default.createElement(import_material3.IconButton, { size: "small", "aria-label": "Clear captured events", onClick: clear, disabled: data.events.length === 0 && data.signals.length === 0 }, /* @__PURE__ */ import_react3.default.createElement(import_icons_material2.DeleteSweep, { fontSize: "small" })))))) }), /* @__PURE__ */ import_react3.default.createElement(import_material3.CardContent, null, /* @__PURE__ */ import_react3.default.createElement(import_material3.Stack, { direction: "column", spacing: 1, sx: { mb: 1 } }, /* @__PURE__ */ import_react3.default.createElement(import_material3.Stack, { direction: "row", spacing: 1, alignItems: "center", flexWrap: "wrap", useFlexGap: true }, /* @__PURE__ */ import_react3.default.createElement(import_material3.Typography, { variant: "caption", color: "text.secondary" }, "Running providers"), formatProviders()
|
|
442
|
+
), /* @__PURE__ */ import_react3.default.createElement(import_material3.Tooltip, { title: "Previous match (Shift+Enter)" }, /* @__PURE__ */ import_react3.default.createElement("span", null, /* @__PURE__ */ import_react3.default.createElement(import_material3.IconButton, { size: "small", "aria-label": "Previous match", disabled: found.length === 0, onClick: () => goToMatch(matchPos - 1) }, /* @__PURE__ */ import_react3.default.createElement(import_icons_material2.ArrowUpward, { fontSize: "small" })))), /* @__PURE__ */ import_react3.default.createElement(import_material3.Tooltip, { title: "Next match (Enter)" }, /* @__PURE__ */ import_react3.default.createElement("span", null, /* @__PURE__ */ import_react3.default.createElement(import_material3.IconButton, { size: "small", "aria-label": "Next match", disabled: found.length === 0, onClick: () => goToMatch(matchPos + 1) }, /* @__PURE__ */ import_react3.default.createElement(import_icons_material2.ArrowDownward, { fontSize: "small" })))), /* @__PURE__ */ import_react3.default.createElement(import_material3.Tooltip, { title: "Clear captured events" }, /* @__PURE__ */ import_react3.default.createElement("span", null, /* @__PURE__ */ import_react3.default.createElement(import_material3.IconButton, { size: "small", "aria-label": "Clear captured events", onClick: clear, disabled: data.events.length === 0 && data.signals.length === 0 }, /* @__PURE__ */ import_react3.default.createElement(import_icons_material2.DeleteSweep, { fontSize: "small" })))))) }), /* @__PURE__ */ import_react3.default.createElement(import_material3.CardContent, null, /* @__PURE__ */ import_react3.default.createElement(import_material3.Stack, { direction: "column", spacing: 1, sx: { mb: 1 } }, /* @__PURE__ */ import_react3.default.createElement(import_material3.Stack, { direction: "row", spacing: 1, alignItems: "center", flexWrap: "wrap", useFlexGap: true }, /* @__PURE__ */ import_react3.default.createElement(import_material3.Typography, { variant: "caption", color: "text.secondary" }, "Running providers"), formatProviders(), /* @__PURE__ */ import_react3.default.createElement(import_material3.Stack, { direction: "row", spacing: 1, sx: { ml: "auto" } }, /* @__PURE__ */ import_react3.default.createElement(
|
|
443
|
+
import_material3.Chip,
|
|
444
|
+
{
|
|
445
|
+
label: "config",
|
|
446
|
+
size: "small",
|
|
447
|
+
color: data.configAccepted ? "success" : "default",
|
|
448
|
+
variant: data.configAccepted ? "filled" : "outlined"
|
|
449
|
+
}
|
|
450
|
+
), /* @__PURE__ */ import_react3.default.createElement(
|
|
451
|
+
import_material3.Chip,
|
|
452
|
+
{
|
|
453
|
+
label: "subscribed",
|
|
454
|
+
size: "small",
|
|
455
|
+
color: data.subscribed ? "success" : "default",
|
|
456
|
+
variant: data.subscribed ? "filled" : "outlined"
|
|
457
|
+
}
|
|
458
|
+
))), data.signals.map((s, index) => /* @__PURE__ */ import_react3.default.createElement(import_material3.Typography, { key: index, variant: "caption", color: "text.secondary" }, "*** ", s, " ***"))), /* @__PURE__ */ import_react3.default.createElement(import_material3.Box, { ref: boxRef, sx: { display: "flex", flexDirection: "column", overflowY: "auto", overflowX: "hidden", width: "100%", flexGrow: 1, height: `calc(100vh - ${boxTop}px - 35px)` } }, /* @__PURE__ */ import_react3.default.createElement(import_material3.Box, { sx: { flex: 1, overflowY: "auto", ml: 1, mr: 1 } }, data.events.map((e, index) => formatEvent(e, index, current))))));
|
|
441
459
|
};
|
|
442
460
|
|
|
443
461
|
// src/front/ProviderDebugChannel.ts
|
|
@@ -493,8 +511,15 @@
|
|
|
493
511
|
return { action: import_kwirth_common_front.EChannelRefreshAction.REFRESH };
|
|
494
512
|
case import_kwirth_common.EInstanceMessageType.SIGNAL: {
|
|
495
513
|
const signalMessage = JSON.parse(wsEvent.data);
|
|
496
|
-
|
|
497
|
-
|
|
514
|
+
const startResponse = signalMessage.flow === import_kwirth_common.EInstanceMessageFlow.RESPONSE && signalMessage.action === import_kwirth_common.EInstanceMessageAction.START;
|
|
515
|
+
if (startResponse) channelObject.instanceId = signalMessage.instance;
|
|
516
|
+
if (startResponse && signalMessage.level === void 0) {
|
|
517
|
+
data.configAccepted = true;
|
|
518
|
+
return { action: import_kwirth_common_front.EChannelRefreshAction.REFRESH };
|
|
519
|
+
}
|
|
520
|
+
if (startResponse && signalMessage.level === import_kwirth_common.ESignalMessageLevel.INFO) {
|
|
521
|
+
data.subscribed = true;
|
|
522
|
+
return { action: import_kwirth_common_front.EChannelRefreshAction.REFRESH };
|
|
498
523
|
}
|
|
499
524
|
if (signalMessage.text) data.signals.push(signalMessage.text);
|
|
500
525
|
return { action: import_kwirth_common_front.EChannelRefreshAction.REFRESH };
|
|
@@ -513,6 +538,8 @@
|
|
|
513
538
|
const data = channelObject.data;
|
|
514
539
|
data.events = [];
|
|
515
540
|
data.signals = [];
|
|
541
|
+
data.configAccepted = false;
|
|
542
|
+
data.subscribed = false;
|
|
516
543
|
data.paused = false;
|
|
517
544
|
data.started = true;
|
|
518
545
|
return true;
|
|
@@ -529,6 +556,8 @@
|
|
|
529
556
|
}
|
|
530
557
|
stopChannel(channelObject) {
|
|
531
558
|
const data = channelObject.data;
|
|
559
|
+
data.configAccepted = false;
|
|
560
|
+
data.subscribed = false;
|
|
532
561
|
data.paused = false;
|
|
533
562
|
data.started = false;
|
|
534
563
|
return true;
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"id": "provider-debug",
|
|
5
5
|
"name": "@kwirthmagnify/kwirth-plugin-provider-debug",
|
|
6
6
|
"displayName": "Provider Debug",
|
|
7
|
-
"version": "0.1.
|
|
7
|
+
"version": "0.1.2",
|
|
8
8
|
"description": "Provider debugging channel for Kwirth - subscribes to a running provider and streams its raw events",
|
|
9
9
|
"icon": "DataObjectOutlined",
|
|
10
10
|
"requiresRestart": false,
|