@datalabz_/dashboard-kit 6.0.15 → 6.0.16
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/README.md +12 -3
- package/package.json +1 -1
- package/v4.js +1 -1
- package/v5.js +1 -1
- package/v6.js +24 -6
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ header filters, and the layout inside each panel; the kit owns the rest
|
|
|
22
22
|
snapshot export).
|
|
23
23
|
|
|
24
24
|
The LLM-facing authoring contract — what to write vs. what the kit provides —
|
|
25
|
-
is
|
|
25
|
+
is each project's `reason-ops-dashboard` skill ([iGaming's](../projects/igaming/pack/skills/reason-ops-dashboard/SKILL.md)).
|
|
26
26
|
It must always link the **current** major (see below). This file is the
|
|
27
27
|
human-facing overview and the working rules for changing the kit; it is not an
|
|
28
28
|
API reference. The SQL gateway the kit calls is
|
|
@@ -107,8 +107,17 @@ The answer always goes to the dashboard's parent, whoever asked.
|
|
|
107
107
|
## Gateway endpoint
|
|
108
108
|
|
|
109
109
|
`v6` has no default gateway (`v4` and `v5` still fall back to the iGaming one). The host sends `endpoint`
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
in `CUSTOM_DASHBOARDS_PARAMS`; without a valid one the dashboard shows an error and does not boot. The
|
|
111
|
+
token rides on every call to it, so the kit takes only a gateway on its own list (`GATEWAYS` in `v6.js`),
|
|
112
|
+
or http on localhost for development, from any sender; anything else is ignored with a console warning.
|
|
113
|
+
|
|
114
|
+
| Gateway | For |
|
|
115
|
+
| --- | --- |
|
|
116
|
+
| `https://aidqgateway.draftplaza.com/aidq` | iGaming |
|
|
117
|
+
| `https://aidqgateway.pokerplaza.com/aidq` | poker |
|
|
118
|
+
| `https://connector.invalid/aidq` | a Claude artifact, whose host script answers the call through the connector |
|
|
119
|
+
|
|
120
|
+
A new platform or gateway is a kit release.
|
|
112
121
|
|
|
113
122
|
## Drillthrough
|
|
114
123
|
|
package/package.json
CHANGED
package/v4.js
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
let _activeTabId = '';
|
|
21
21
|
let _sections = []; // { id, label, load, loaded, errors }
|
|
22
22
|
let _title = '';
|
|
23
|
-
let _gitVer = '
|
|
23
|
+
let _gitVer = 'eadd2b4'; // replaced at deploy: sed -i "s/eadd2b4/$(git rev-parse --short HEAD)/g" v4.js
|
|
24
24
|
let _calls = []; // System Info call log
|
|
25
25
|
let _sectionErrors = {}; // sectionId → error count
|
|
26
26
|
let _generation = 0;
|
package/v5.js
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
let _activeTabId = '';
|
|
21
21
|
let _sections = []; // { id, label, load, loaded, errors }
|
|
22
22
|
let _title = '';
|
|
23
|
-
let _gitVer = '
|
|
23
|
+
let _gitVer = 'eadd2b4'; // replaced at deploy: sed -i "s/eadd2b4/$(git rev-parse --short HEAD)/g" v4.js
|
|
24
24
|
let _calls = []; // System Info call log
|
|
25
25
|
let _sectionErrors = {}; // sectionId → error count
|
|
26
26
|
let _generation = 0;
|
package/v6.js
CHANGED
|
@@ -3,8 +3,17 @@
|
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
5
|
// No default gateway: each BackOffice has its own, and a default would send one platform's
|
|
6
|
-
// token to another's gateway. The
|
|
6
|
+
// token to another's gateway. The host names it via `endpoint` in CUSTOM_DASHBOARDS_PARAMS;
|
|
7
7
|
// without one the dashboard does not boot.
|
|
8
|
+
// The token rides on every call to the endpoint, so the host may name only one of these. Any
|
|
9
|
+
// sender may, which is how an artifact's host script (it shares the page, so it is not the
|
|
10
|
+
// parent) can; what stops a script in the page from redirecting the token is this list, not who
|
|
11
|
+
// sent the message. A new platform or gateway is a kit release.
|
|
12
|
+
const GATEWAYS = [
|
|
13
|
+
'https://aidqgateway.draftplaza.com/aidq', // iGaming
|
|
14
|
+
'https://aidqgateway.pokerplaza.com/aidq', // poker
|
|
15
|
+
'https://connector.invalid/aidq', // a Claude artifact: its host answers the call through the connector
|
|
16
|
+
];
|
|
8
17
|
// Retry is off: 1 = a single attempt. Set to 2 to re-enable one retry for
|
|
9
18
|
// whatever _isRetryable allows (no response, 5xx, 200 without rows).
|
|
10
19
|
const MAX_ATTEMPTS = 1;
|
|
@@ -20,7 +29,7 @@
|
|
|
20
29
|
let _activeTabId = '';
|
|
21
30
|
let _sections = []; // { id, label, load, loaded, errors }
|
|
22
31
|
let _title = '';
|
|
23
|
-
let _gitVer = '
|
|
32
|
+
let _gitVer = 'eadd2b4'; // replaced at deploy: sed -i "s/eadd2b4/$(git rev-parse --short HEAD)/g" v6.js
|
|
24
33
|
let _calls = []; // System Info call log
|
|
25
34
|
let _pageErrors = []; // System Info: errors no load() caught (a handler's, a timer's, the page script's)
|
|
26
35
|
let _sectionErrors = {}; // sectionId → error count
|
|
@@ -1192,6 +1201,16 @@ html[data-dk-setup="true"] .dk-resp-toggle {
|
|
|
1192
1201
|
} catch { return false; }
|
|
1193
1202
|
}
|
|
1194
1203
|
|
|
1204
|
+
// One of GATEWAYS, or a local one for development (http on localhost).
|
|
1205
|
+
function _isKnownGateway(v) {
|
|
1206
|
+
if (typeof v !== 'string' || !v) return false;
|
|
1207
|
+
try {
|
|
1208
|
+
const u = new URL(v);
|
|
1209
|
+
if (u.protocol === 'http:' && (u.hostname === 'localhost' || u.hostname === '127.0.0.1')) return true;
|
|
1210
|
+
return GATEWAYS.some(function (g) { return new URL(g).href === u.href; });
|
|
1211
|
+
} catch { return false; }
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1195
1214
|
// ── Filters a parent can ask for ──────────────────────────────────────────────
|
|
1196
1215
|
// DK_GET_FILTERS_INFO from the parent is answered with DK_FILTERS_INFO: the header controls a
|
|
1197
1216
|
// dashboard can be opened with, which is what the kit can write into a header control at its first boot. So
|
|
@@ -1349,11 +1368,10 @@ html[data-dk-setup="true"] .dk-resp-toggle {
|
|
|
1349
1368
|
_authToken = e.data.token;
|
|
1350
1369
|
}
|
|
1351
1370
|
|
|
1352
|
-
//
|
|
1353
|
-
//
|
|
1354
|
-
// ignored and the current endpoint stays.
|
|
1371
|
+
// Any sender, but only a known gateway (GATEWAYS). Anything else is ignored and the current
|
|
1372
|
+
// endpoint stays.
|
|
1355
1373
|
if (e.data.endpoint !== undefined) {
|
|
1356
|
-
if (
|
|
1374
|
+
if (_isKnownGateway(e.data.endpoint)) _endpoint = e.data.endpoint;
|
|
1357
1375
|
else console.warn('[DashboardKit] endpoint ignored:', e.data.endpoint);
|
|
1358
1376
|
}
|
|
1359
1377
|
|