adonisjs-server-stats 1.10.0 → 1.11.0
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 +23 -14
- package/dist/core/config-utils.d.ts +8 -0
- package/dist/core/constants.d.ts +4 -0
- package/dist/core/dashboard-data-controller.d.ts +16 -0
- package/dist/core/dashboard-data-helpers.d.ts +12 -0
- package/dist/core/debug-data-controller.d.ts +4 -0
- package/dist/core/define-config-helpers.d.ts +25 -0
- package/dist/core/feature-detect-helpers.d.ts +36 -0
- package/dist/core/field-resolvers.d.ts +64 -0
- package/dist/core/formatters-helpers.d.ts +23 -0
- package/dist/core/formatters.d.ts +15 -0
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +599 -509
- package/dist/core/log-utils-helpers.d.ts +13 -0
- package/dist/core/metrics.d.ts +3 -28
- package/dist/core/pagination.d.ts +0 -9
- package/dist/core/server-stats-controller.d.ts +6 -0
- package/dist/core/transmit-helpers.d.ts +7 -0
- package/dist/core/types-dashboard.d.ts +178 -0
- package/dist/core/types-diagnostics.d.ts +85 -0
- package/dist/core/types.d.ts +10 -442
- package/dist/react/CacheSection-BYN53kYO.js +135 -0
- package/dist/react/CacheStatsBar-CRodCOeP.js +27 -0
- package/dist/react/CacheTab-DOhuK05d.js +106 -0
- package/dist/react/{ConfigSection-DfFd-WRq.js → ConfigSection-B9EHh4Rp.js} +1 -1
- package/dist/react/{ConfigTab-Bdg8YMer.js → ConfigTab-C8kriE2b.js} +1 -1
- package/dist/react/CustomPaneTab-CvzQS_Wh.js +99 -0
- package/dist/react/EmailPreviewOverlay-BmXOAvqG.js +58 -0
- package/dist/react/EmailsSection-BJyFJf7A.js +226 -0
- package/dist/react/EmailsTab-Ch8jp10B.js +110 -0
- package/dist/react/{EventsSection-ByQ-9blq.js → EventsSection-DJPwHeT8.js} +28 -27
- package/dist/react/EventsTab-B-FoehXC.js +58 -0
- package/dist/react/{FilterBar-DQRXpWrb.js → FilterBar-CQ7bD669.js} +15 -15
- package/dist/react/{InternalsContent-DBzsI0CG.js → InternalsContent-O8ino9oM.js} +133 -109
- package/dist/react/InternalsSection-B6VlVx5f.js +22 -0
- package/dist/react/InternalsTab-CkEKpRMU.js +17 -0
- package/dist/react/JobStatsBar-C7RslAFE.js +30 -0
- package/dist/react/JobsSection-DWF4i1t_.js +167 -0
- package/dist/react/JobsTab-DqnifQXV.js +129 -0
- package/dist/react/LogEntryRow-CMMkqA9M.js +43 -0
- package/dist/react/LogsSection-C1xC5aP4.js +198 -0
- package/dist/react/LogsTab-CS4sLfLw.js +79 -0
- package/dist/react/{OverviewSection-C4T1ur51.js → OverviewSection-CxvfOR0v.js} +70 -80
- package/dist/react/QueriesSection-CrMdU5Ax.js +458 -0
- package/dist/react/{QueriesTab-osLUWd4L.js → QueriesTab-x85PjkyS.js} +38 -40
- package/dist/react/RequestsSection-DETN9oZb.js +321 -0
- package/dist/react/{RoutesSection-BUSkM6PY.js → RoutesSection-CmorkJeC.js} +2 -2
- package/dist/react/RoutesTab-CbzBOzpc.js +68 -0
- package/dist/react/SplitPaneWrapper-BiIgT4ND.js +49 -0
- package/dist/react/TimeAgoCell-o3KigGfM.js +8 -0
- package/dist/react/{TimelineTab-Covg5weo.js → TimelineTab-Ue9tUD_n.js} +76 -102
- package/dist/react/index-DwDK-4oX.js +1121 -0
- package/dist/react/index.js +6 -6
- package/dist/react/react/components/shared/CacheStatsBar.d.ts +13 -0
- package/dist/react/react/components/shared/EmailPreviewOverlay.d.ts +29 -0
- package/dist/react/react/components/{Dashboard/shared → shared}/FilterBar.d.ts +4 -3
- package/dist/react/react/components/shared/JobStatsBar.d.ts +12 -0
- package/dist/react/react/components/shared/LogEntryRow.d.ts +9 -0
- package/dist/react/react/components/shared/RelatedLogs.d.ts +2 -2
- package/dist/react/react/components/shared/SplitPaneWrapper.d.ts +7 -0
- package/dist/react/react/components/shared/TimeAgoCell.d.ts +17 -0
- package/dist/react/react/hooks/useDashboardData.d.ts +4 -8
- package/dist/react/react/hooks/useDiagnosticsData.d.ts +14 -0
- package/dist/react/style.css +1 -1
- package/dist/src/collectors/app_collector.d.ts +0 -8
- package/dist/src/collectors/app_collector.js +45 -52
- package/dist/src/collectors/auto_detect.d.ts +0 -23
- package/dist/src/collectors/auto_detect.js +33 -55
- package/dist/src/collectors/db_pool_collector.d.ts +14 -16
- package/dist/src/collectors/db_pool_collector.js +72 -57
- package/dist/src/collectors/log_collector.d.ts +0 -47
- package/dist/src/collectors/log_collector.js +36 -65
- package/dist/src/collectors/queue_collector.d.ts +0 -20
- package/dist/src/collectors/queue_collector.js +60 -76
- package/dist/src/collectors/redis_collector.d.ts +10 -10
- package/dist/src/collectors/redis_collector.js +69 -66
- package/dist/src/config/deprecation_migration.d.ts +7 -0
- package/dist/src/config/deprecation_migration.js +201 -0
- package/dist/src/controller/debug_controller.d.ts +1 -1
- package/dist/src/controller/debug_controller.js +87 -81
- package/dist/src/dashboard/cache_handlers.d.ts +14 -0
- package/dist/src/dashboard/cache_handlers.js +52 -0
- package/dist/src/dashboard/chart_aggregator.d.ts +0 -7
- package/dist/src/dashboard/chart_aggregator.js +68 -50
- package/dist/src/dashboard/coalesce_cache.d.ts +25 -0
- package/dist/src/dashboard/coalesce_cache.js +47 -0
- package/dist/src/dashboard/dashboard_controller.d.ts +11 -37
- package/dist/src/dashboard/dashboard_controller.js +51 -544
- package/dist/src/dashboard/dashboard_page_assets.d.ts +17 -0
- package/dist/src/dashboard/dashboard_page_assets.js +51 -0
- package/dist/src/dashboard/dashboard_store.d.ts +19 -218
- package/dist/src/dashboard/dashboard_store.js +115 -1116
- package/dist/src/dashboard/dashboard_types.d.ts +83 -0
- package/dist/src/dashboard/dashboard_types.js +4 -0
- package/dist/src/dashboard/detail_queries.d.ts +19 -0
- package/dist/src/dashboard/detail_queries.js +98 -0
- package/dist/src/dashboard/email_event_builder.d.ts +8 -0
- package/dist/src/dashboard/email_event_builder.js +65 -0
- package/dist/src/dashboard/explain_query.d.ts +8 -0
- package/dist/src/dashboard/explain_query.js +22 -0
- package/dist/src/dashboard/filter_handlers.d.ts +23 -0
- package/dist/src/dashboard/filter_handlers.js +56 -0
- package/dist/src/dashboard/filtered_queries.d.ts +15 -0
- package/dist/src/dashboard/filtered_queries.js +155 -0
- package/dist/src/dashboard/flush_manager.d.ts +25 -0
- package/dist/src/dashboard/flush_manager.js +107 -0
- package/dist/src/dashboard/format_helpers.d.ts +126 -0
- package/dist/src/dashboard/format_helpers.js +140 -0
- package/dist/src/dashboard/inspector_manager.d.ts +36 -0
- package/dist/src/dashboard/inspector_manager.js +102 -0
- package/dist/src/dashboard/integrations/config_inspector.js +11 -13
- package/dist/src/dashboard/integrations/queue_inspector.d.ts +3 -3
- package/dist/src/dashboard/integrations/queue_inspector.js +13 -10
- package/dist/src/dashboard/jobs_handlers.d.ts +14 -0
- package/dist/src/dashboard/jobs_handlers.js +61 -0
- package/dist/src/dashboard/knex_factory.d.ts +18 -0
- package/dist/src/dashboard/knex_factory.js +91 -0
- package/dist/src/dashboard/migrator.js +30 -159
- package/dist/src/dashboard/migrator_tables.d.ts +19 -0
- package/dist/src/dashboard/migrator_tables.js +153 -0
- package/dist/src/dashboard/overview_queries.d.ts +66 -0
- package/dist/src/dashboard/overview_queries.js +155 -0
- package/dist/src/dashboard/overview_query_runners.d.ts +25 -0
- package/dist/src/dashboard/overview_query_runners.js +84 -0
- package/dist/src/dashboard/overview_store_queries.d.ts +40 -0
- package/dist/src/dashboard/overview_store_queries.js +69 -0
- package/dist/src/dashboard/paginate_helper.d.ts +12 -0
- package/dist/src/dashboard/paginate_helper.js +33 -0
- package/dist/src/dashboard/query_explain_handler.d.ts +10 -0
- package/dist/src/dashboard/query_explain_handler.js +80 -0
- package/dist/src/dashboard/read_queries.d.ts +32 -0
- package/dist/src/dashboard/read_queries.js +107 -0
- package/dist/src/dashboard/saved_filter_queries.d.ts +10 -0
- package/dist/src/dashboard/saved_filter_queries.js +24 -0
- package/dist/src/dashboard/storage_stats.d.ts +41 -0
- package/dist/src/dashboard/storage_stats.js +81 -0
- package/dist/src/dashboard/write_queue.d.ts +106 -0
- package/dist/src/dashboard/write_queue.js +225 -0
- package/dist/src/data/data_access.d.ts +2 -39
- package/dist/src/data/data_access.js +17 -193
- package/dist/src/data/data_access_helpers.d.ts +130 -0
- package/dist/src/data/data_access_helpers.js +212 -0
- package/dist/src/debug/debug_store.js +37 -32
- package/dist/src/debug/email_collector.d.ts +1 -10
- package/dist/src/debug/email_collector.js +78 -81
- package/dist/src/debug/event_collector.d.ts +0 -9
- package/dist/src/debug/event_collector.js +79 -62
- package/dist/src/debug/query_collector.js +23 -19
- package/dist/src/debug/route_inspector.d.ts +1 -5
- package/dist/src/debug/route_inspector.js +50 -51
- package/dist/src/debug/trace_collector.d.ts +9 -1
- package/dist/src/debug/trace_collector.js +21 -15
- package/dist/src/debug/types.d.ts +1 -1
- package/dist/src/define_config.d.ts +0 -65
- package/dist/src/define_config.js +93 -333
- package/dist/src/edge/client/dashboard.js +2 -2
- package/dist/src/edge/client/debug-panel-deferred.js +1 -1
- package/dist/src/edge/client/stats-bar.js +1 -1
- package/dist/src/edge/client-vue/dashboard.js +5 -5
- package/dist/src/edge/client-vue/debug-panel-deferred.js +4 -4
- package/dist/src/edge/client-vue/stats-bar.js +3 -3
- package/dist/src/edge/plugin.d.ts +0 -16
- package/dist/src/edge/plugin.js +57 -64
- package/dist/src/engine/request_metrics.d.ts +1 -0
- package/dist/src/engine/request_metrics.js +32 -42
- package/dist/src/middleware/request_tracking_middleware.d.ts +2 -8
- package/dist/src/middleware/request_tracking_middleware.js +65 -93
- package/dist/src/provider/auth_middleware_detector.d.ts +16 -0
- package/dist/src/provider/auth_middleware_detector.js +97 -0
- package/dist/src/provider/boot_helpers.d.ts +20 -0
- package/dist/src/provider/boot_helpers.js +91 -0
- package/dist/src/provider/boot_initializer.d.ts +28 -0
- package/dist/src/provider/boot_initializer.js +35 -0
- package/dist/src/provider/dashboard_init.d.ts +30 -0
- package/dist/src/provider/dashboard_init.js +138 -0
- package/dist/src/provider/dashboard_setup.d.ts +25 -0
- package/dist/src/provider/dashboard_setup.js +78 -0
- package/dist/src/provider/diagnostics.d.ts +134 -0
- package/dist/src/provider/diagnostics.js +127 -0
- package/dist/src/provider/email_bridge.d.ts +43 -0
- package/dist/src/provider/email_bridge.js +80 -0
- package/dist/src/provider/email_helpers.d.ts +13 -0
- package/dist/src/provider/email_helpers.js +68 -0
- package/dist/src/provider/pino_hook.d.ts +17 -0
- package/dist/src/provider/pino_hook.js +35 -0
- package/dist/src/provider/provider_helpers_extra.d.ts +47 -0
- package/dist/src/provider/provider_helpers_extra.js +177 -0
- package/dist/src/provider/server_stats_provider.d.ts +39 -85
- package/dist/src/provider/server_stats_provider.js +132 -951
- package/dist/src/provider/shutdown_helpers.d.ts +43 -0
- package/dist/src/provider/shutdown_helpers.js +70 -0
- package/dist/src/provider/toolbar_setup.d.ts +57 -0
- package/dist/src/provider/toolbar_setup.js +141 -0
- package/dist/src/routes/dashboard_routes.d.ts +14 -0
- package/dist/src/routes/dashboard_routes.js +197 -0
- package/dist/src/routes/debug_routes.d.ts +14 -0
- package/dist/src/routes/debug_routes.js +101 -0
- package/dist/src/routes/register_routes.d.ts +0 -78
- package/dist/src/routes/register_routes.js +22 -352
- package/dist/src/routes/stats_routes.d.ts +5 -0
- package/dist/src/routes/stats_routes.js +14 -0
- package/dist/src/styles/components.css +163 -0
- package/dist/src/styles/dashboard.css +13 -105
- package/dist/src/styles/debug-panel.css +2 -53
- package/dist/src/styles/utilities.css +3 -1
- package/dist/src/types.d.ts +305 -14
- package/dist/vue/{CacheSection-oFAJL3mo.js → CacheSection-DT2Mwf_s.js} +1 -1
- package/dist/vue/{ConfigSection-BhfJ4KqL.js → ConfigSection-BwKwS9lh.js} +1 -1
- package/dist/vue/CustomPaneTab-Hr1IBHfz.js +172 -0
- package/dist/vue/{EmailsSection-BcNyhyHs.js → EmailsSection-B65g0FVS.js} +1 -1
- package/dist/vue/{EventsSection-r60Q5Lmu.js → EventsSection-CxqtVF-o.js} +1 -1
- package/dist/vue/{JobsSection-BHL-hkQw.js → JobsSection-rMIyMb-g.js} +1 -1
- package/dist/vue/{LogsSection-DRMGzJmg.js → LogsSection-DmmZVJ7D.js} +9 -3
- package/dist/vue/{LogsTab-Bg3o0Mm6.js → LogsTab-47zEK7jL.js} +4 -1
- package/dist/vue/{OverviewSection-CXh6Ja1B.js → OverviewSection-BMabyqw-.js} +49 -50
- package/dist/vue/{QueriesSection-IodIsCJ-.js → QueriesSection-BfDFwGqH.js} +44 -45
- package/dist/vue/{QueriesTab-C8_7oprC.js → QueriesTab-DuTG7cpC.js} +30 -31
- package/dist/vue/RelatedLogs.vue_vue_type_script_setup_true_lang-Py1iu9GU.js +77 -0
- package/dist/vue/{RequestsSection-BPuMdmMc.js → RequestsSection-CTu4jPZ_.js} +143 -147
- package/dist/vue/{RoutesSection-NKo3Rbq3.js → RoutesSection-zQZDedL7.js} +1 -1
- package/dist/vue/TimelineTab-DHfXsX7t.js +334 -0
- package/dist/vue/components/shared/RelatedLogs.vue.d.ts +1 -4
- package/dist/vue/composables/useDashboardData.d.ts +12 -23
- package/dist/vue/index-CM3yNVUR.js +1232 -0
- package/dist/vue/index.js +1 -1
- package/dist/vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/react/CacheSection-UCMptWyn.js +0 -146
- package/dist/react/CacheTab-CA8LB1J5.js +0 -123
- package/dist/react/CustomPaneTab-Bxtv_8Rw.js +0 -104
- package/dist/react/EmailsSection-CM7stSyh.js +0 -262
- package/dist/react/EmailsTab-BDhEiomM.js +0 -153
- package/dist/react/EventsTab-CMfY98Rl.js +0 -63
- package/dist/react/InternalsSection-t7ihcWO-.js +0 -32
- package/dist/react/InternalsTab-Oij0A2fN.js +0 -30
- package/dist/react/JobsSection-DF3qEv9O.js +0 -187
- package/dist/react/JobsTab-BbrBWIOb.js +0 -141
- package/dist/react/LogsSection-DcFTZY7b.js +0 -227
- package/dist/react/LogsTab-CicucmVk.js +0 -103
- package/dist/react/QueriesSection-PswteoF9.js +0 -461
- package/dist/react/RelatedLogs-DFDOyUMr.js +0 -40
- package/dist/react/RequestsSection-Nag30rEA.js +0 -341
- package/dist/react/RoutesTab-DgVzd2PZ.js +0 -74
- package/dist/react/index-Cflz9Ebj.js +0 -1069
- package/dist/vue/CustomPaneTab-BJxT5Dp7.js +0 -172
- package/dist/vue/RelatedLogs.vue_vue_type_script_setup_true_lang-CB2_TzYW.js +0 -84
- package/dist/vue/TimelineTab-zj5Z5OdT.js +0 -338
- package/dist/vue/index-Dtgysd26.js +0 -1229
package/dist/core/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
class
|
|
1
|
+
class b extends Error {
|
|
2
2
|
status;
|
|
3
3
|
constructor(t = 403) {
|
|
4
4
|
super(`Unauthorized (HTTP ${t})`), this.name = "UnauthorizedError", this.status = t;
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
|
-
class
|
|
7
|
+
class B extends Error {
|
|
8
8
|
status;
|
|
9
9
|
body;
|
|
10
10
|
constructor(t, r) {
|
|
11
11
|
super(`API error (HTTP ${t})`), this.name = "ApiError", this.status = t, this.body = r;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
class
|
|
14
|
+
class v {
|
|
15
15
|
baseUrl;
|
|
16
16
|
authToken;
|
|
17
17
|
constructor(t) {
|
|
@@ -25,7 +25,7 @@ class T {
|
|
|
25
25
|
* @returns Parsed JSON response body typed as `T`.
|
|
26
26
|
*/
|
|
27
27
|
async fetch(t, r) {
|
|
28
|
-
const
|
|
28
|
+
const o = {
|
|
29
29
|
...{
|
|
30
30
|
Accept: "application/json",
|
|
31
31
|
...this.authToken ? { Authorization: `Bearer ${this.authToken}` } : {}
|
|
@@ -33,16 +33,16 @@ class T {
|
|
|
33
33
|
...r?.headers
|
|
34
34
|
}, s = await globalThis.fetch(`${this.baseUrl}${t}`, {
|
|
35
35
|
...r,
|
|
36
|
-
headers:
|
|
36
|
+
headers: o,
|
|
37
37
|
credentials: this.authToken ? "omit" : "include"
|
|
38
38
|
});
|
|
39
39
|
if (r?.signal?.aborted)
|
|
40
40
|
throw new DOMException("The operation was aborted.", "AbortError");
|
|
41
41
|
if (s.status === 401 || s.status === 403)
|
|
42
|
-
throw new
|
|
42
|
+
throw new b(s.status);
|
|
43
43
|
if (!s.ok) {
|
|
44
|
-
const
|
|
45
|
-
throw new
|
|
44
|
+
const i = await s.text().catch(() => "");
|
|
45
|
+
throw new B(s.status, i);
|
|
46
46
|
}
|
|
47
47
|
return s.json();
|
|
48
48
|
}
|
|
@@ -84,7 +84,22 @@ class T {
|
|
|
84
84
|
return this.fetch(t, { method: "DELETE" });
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
|
|
87
|
+
function H(e, t) {
|
|
88
|
+
const r = e || (typeof window < "u" ? window.location.origin : "");
|
|
89
|
+
if (!t)
|
|
90
|
+
return { baseUrl: r };
|
|
91
|
+
const n = { headers: { Authorization: `Bearer ${t}` } };
|
|
92
|
+
return {
|
|
93
|
+
baseUrl: r,
|
|
94
|
+
beforeSubscribe(o) {
|
|
95
|
+
return n;
|
|
96
|
+
},
|
|
97
|
+
beforeUnsubscribe(o) {
|
|
98
|
+
return n;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
async function N() {
|
|
88
103
|
if (typeof window < "u" && window.Transmit && typeof window.Transmit == "function")
|
|
89
104
|
return window.Transmit;
|
|
90
105
|
try {
|
|
@@ -94,51 +109,33 @@ async function B() {
|
|
|
94
109
|
return null;
|
|
95
110
|
}
|
|
96
111
|
}
|
|
97
|
-
function
|
|
112
|
+
function q(e) {
|
|
98
113
|
let t = null, r = null, n = !1;
|
|
99
114
|
return { subscribe: async () => {
|
|
100
115
|
try {
|
|
101
|
-
const
|
|
102
|
-
if (!
|
|
116
|
+
const i = await N();
|
|
117
|
+
if (!i)
|
|
103
118
|
throw new Error(
|
|
104
119
|
"Transmit client not available (neither window.Transmit nor @adonisjs/transmit-client)"
|
|
105
120
|
);
|
|
106
121
|
if (n) return;
|
|
107
|
-
t = new
|
|
108
|
-
|
|
109
|
-
...e.authToken ? {
|
|
110
|
-
beforeSubscribe(l) {
|
|
111
|
-
return {
|
|
112
|
-
headers: {
|
|
113
|
-
Authorization: `Bearer ${e.authToken}`
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
},
|
|
117
|
-
beforeUnsubscribe(l) {
|
|
118
|
-
return {
|
|
119
|
-
headers: {
|
|
120
|
-
Authorization: `Bearer ${e.authToken}`
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
} : {}
|
|
125
|
-
}), r = t.subscription(e.channelName), r.onMessage((l) => {
|
|
126
|
-
n || e.onMessage(l);
|
|
122
|
+
t = new i(H(e.baseUrl, e.authToken)), r = t.subscription(e.channelName), r.onMessage((a) => {
|
|
123
|
+
n || e.onMessage(a);
|
|
127
124
|
}), await r.create();
|
|
128
|
-
} catch (
|
|
129
|
-
e.onError
|
|
125
|
+
} catch (i) {
|
|
126
|
+
e.onError?.(i);
|
|
130
127
|
}
|
|
131
128
|
}, unsubscribe: async () => {
|
|
132
129
|
n = !0;
|
|
133
130
|
try {
|
|
134
|
-
|
|
131
|
+
await r?.delete(), r = null, t = null;
|
|
135
132
|
} catch {
|
|
136
133
|
}
|
|
137
134
|
} };
|
|
138
135
|
}
|
|
139
|
-
function
|
|
136
|
+
function K(e) {
|
|
140
137
|
let t = !1;
|
|
141
|
-
const r =
|
|
138
|
+
const r = q({
|
|
142
139
|
baseUrl: e.baseUrl,
|
|
143
140
|
channelName: e.channelName,
|
|
144
141
|
authToken: e.authToken,
|
|
@@ -158,38 +155,38 @@ function q(e) {
|
|
|
158
155
|
}
|
|
159
156
|
};
|
|
160
157
|
}
|
|
161
|
-
const
|
|
158
|
+
const S = "ss-dash-theme", k = "ss-theme-change";
|
|
162
159
|
function U() {
|
|
163
160
|
if (typeof window > "u") return "light";
|
|
164
|
-
const e = localStorage.getItem(
|
|
161
|
+
const e = localStorage.getItem(S);
|
|
165
162
|
return e === "dark" || e === "light" ? e : window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
166
163
|
}
|
|
167
|
-
function
|
|
168
|
-
typeof window > "u" || (localStorage.setItem(
|
|
164
|
+
function z(e) {
|
|
165
|
+
typeof window > "u" || (localStorage.setItem(S, e), window.dispatchEvent(new CustomEvent(k, { detail: e })));
|
|
169
166
|
}
|
|
170
|
-
function
|
|
167
|
+
function qe() {
|
|
171
168
|
const t = U() === "dark" ? "light" : "dark";
|
|
172
|
-
return
|
|
169
|
+
return z(t), t;
|
|
173
170
|
}
|
|
174
|
-
function
|
|
171
|
+
function Ke(e) {
|
|
175
172
|
if (typeof window > "u") return () => {
|
|
176
173
|
};
|
|
177
174
|
const t = (s) => {
|
|
178
|
-
const
|
|
179
|
-
(
|
|
175
|
+
const i = s.detail;
|
|
176
|
+
(i === "dark" || i === "light") && e(i);
|
|
180
177
|
}, r = (s) => {
|
|
181
|
-
if (s.key ===
|
|
182
|
-
const
|
|
183
|
-
e(
|
|
178
|
+
if (s.key === S) {
|
|
179
|
+
const i = s.newValue;
|
|
180
|
+
e(i === "dark" || i === "light" ? i : U());
|
|
184
181
|
}
|
|
185
|
-
}, n = window.matchMedia("(prefers-color-scheme: dark)"),
|
|
186
|
-
localStorage.getItem(
|
|
182
|
+
}, n = window.matchMedia("(prefers-color-scheme: dark)"), o = (s) => {
|
|
183
|
+
localStorage.getItem(S) || e(s.matches ? "dark" : "light");
|
|
187
184
|
};
|
|
188
|
-
return window.addEventListener(
|
|
189
|
-
window.removeEventListener(
|
|
185
|
+
return window.addEventListener(k, t), window.addEventListener("storage", r), n.addEventListener("change", o), () => {
|
|
186
|
+
window.removeEventListener(k, t), window.removeEventListener("storage", r), n.removeEventListener("change", o);
|
|
190
187
|
};
|
|
191
188
|
}
|
|
192
|
-
const
|
|
189
|
+
const m = {
|
|
193
190
|
color: "#34d399",
|
|
194
191
|
fillOpacityTop: 0.25,
|
|
195
192
|
fillOpacityBottom: 0.02,
|
|
@@ -198,77 +195,94 @@ const y = {
|
|
|
198
195
|
height: 32,
|
|
199
196
|
padding: 2
|
|
200
197
|
};
|
|
201
|
-
function
|
|
202
|
-
return { ...
|
|
198
|
+
function j(e) {
|
|
199
|
+
return { ...m, ...e };
|
|
203
200
|
}
|
|
204
|
-
function
|
|
201
|
+
function ze(e, t = m.width, r = m.height, n = m.padding) {
|
|
205
202
|
if (e.length < 2) return null;
|
|
206
|
-
const
|
|
207
|
-
return e.map((
|
|
208
|
-
const
|
|
209
|
-
return `${
|
|
203
|
+
const o = t - n * 2, s = r - n * 2, i = Math.min(...e), c = Math.max(...e) - i || 1;
|
|
204
|
+
return e.map((p, h) => {
|
|
205
|
+
const d = n + h / (e.length - 1) * o, f = n + s - (p - i) / c * s;
|
|
206
|
+
return `${d.toFixed(1)},${f.toFixed(1)}`;
|
|
210
207
|
}).join(" ");
|
|
211
208
|
}
|
|
212
|
-
function
|
|
209
|
+
function je(e, t = m.width, r = m.height, n = m.padding) {
|
|
213
210
|
if (e.length < 2) return null;
|
|
214
|
-
const
|
|
215
|
-
const u = n +
|
|
211
|
+
const o = t - n * 2, s = r - n * 2, i = Math.min(...e), c = Math.max(...e) - i || 1, l = e.map((f, y) => {
|
|
212
|
+
const u = n + y / (e.length - 1) * o, E = n + s - (f - i) / c * s;
|
|
216
213
|
return `${u.toFixed(1)},${E.toFixed(1)}`;
|
|
217
|
-
}),
|
|
218
|
-
return `M${
|
|
214
|
+
}), p = (n + o).toFixed(1), h = (n + s).toFixed(1), d = n.toFixed(1);
|
|
215
|
+
return `M${l[0]} ` + l.slice(1).map((f) => `L${f}`).join(" ") + ` L${p},${h} L${d},${h} Z`;
|
|
219
216
|
}
|
|
220
|
-
let
|
|
217
|
+
let V = 0;
|
|
221
218
|
function W() {
|
|
222
|
-
return `ss-grad-${
|
|
219
|
+
return `ss-grad-${V++}`;
|
|
223
220
|
}
|
|
224
|
-
function
|
|
221
|
+
function G(e) {
|
|
225
222
|
if (e.length === 0) return null;
|
|
226
223
|
let t = e[0], r = e[0], n = e[0];
|
|
227
|
-
for (let
|
|
228
|
-
const s = e[
|
|
224
|
+
for (let o = 1; o < e.length; o++) {
|
|
225
|
+
const s = e[o];
|
|
229
226
|
s < t && (t = s), s > r && (r = s), n += s;
|
|
230
227
|
}
|
|
231
228
|
return { min: t, max: r, avg: n / e.length };
|
|
232
229
|
}
|
|
233
|
-
function
|
|
230
|
+
function Ve(e, t) {
|
|
234
231
|
if (e.length < 2) return null;
|
|
235
|
-
const r =
|
|
236
|
-
for (let u = 0; u <
|
|
237
|
-
const E =
|
|
238
|
-
|
|
232
|
+
const r = j(t), n = G(e), o = n.max - n.min || 1, s = r.width - r.padding * 2, i = r.height - r.padding * 2, a = r.padding, c = e.length, l = Array.from({ length: c });
|
|
233
|
+
for (let u = 0; u < c; u++) {
|
|
234
|
+
const E = a + u / (c - 1) * s, _ = a + i - (e[u] - n.min) / o * i;
|
|
235
|
+
l[u] = `${E.toFixed(1)},${_.toFixed(1)}`;
|
|
239
236
|
}
|
|
240
|
-
const
|
|
237
|
+
const p = l.join(" "), h = (a + s).toFixed(1), d = (a + i).toFixed(1), f = a.toFixed(1), y = `M${l[0]} ` + l.slice(1).map((u) => `L${u}`).join(" ") + ` L${h},${d} L${f},${d} Z`;
|
|
241
238
|
return {
|
|
242
|
-
points:
|
|
243
|
-
areaPath:
|
|
239
|
+
points: p,
|
|
240
|
+
areaPath: y,
|
|
244
241
|
gradientId: W(),
|
|
245
242
|
options: r,
|
|
246
243
|
stats: n
|
|
247
244
|
};
|
|
248
245
|
}
|
|
249
|
-
const
|
|
250
|
-
function
|
|
246
|
+
const Q = 5e3, J = 1e4, Y = 3e3, X = 100, Z = 500, ee = 60, te = 1e4;
|
|
247
|
+
function re(e) {
|
|
248
|
+
return '"' + (e.length > 40 ? e.slice(0, 40) + "..." : e) + '"';
|
|
249
|
+
}
|
|
250
|
+
function ne(e, t, r) {
|
|
251
|
+
if (e.length === 0) return "[]";
|
|
252
|
+
const n = e.slice(0, 3).map((i) => r(i, 30)), o = e.length > 3 ? ", ..." + e.length + " items" : "", s = "[" + n.join(", ") + o + "]";
|
|
253
|
+
return s.length > t ? "[" + e.length + " items]" : s;
|
|
254
|
+
}
|
|
255
|
+
function se(e, t, r) {
|
|
256
|
+
const n = Object.keys(e);
|
|
257
|
+
if (n.length === 0) return "{}";
|
|
258
|
+
const o = [];
|
|
259
|
+
for (let c = 0; c < Math.min(n.length, 4); c++)
|
|
260
|
+
o.push(n[c] + ": " + r(e[n[c]], 30));
|
|
261
|
+
const s = n.length > 4 ? ", ...+" + (n.length - 4) : "", i = "{ " + o.join(", ") + s + " }";
|
|
262
|
+
return i.length <= t ? i : "{ " + (n.slice(0, 6).join(", ") + (n.length > 6 ? ", ..." : "")) + " }";
|
|
263
|
+
}
|
|
264
|
+
function oe(e) {
|
|
251
265
|
if (!e && e !== 0) return "-";
|
|
252
|
-
const t = Math.floor(e), r = Math.floor(t / 86400), n = Math.floor(t % 86400 / 3600),
|
|
253
|
-
return r > 0 ? `${r}d ${n}h` : n > 0 ? `${n}h ${
|
|
266
|
+
const t = Math.floor(e), r = Math.floor(t / 86400), n = Math.floor(t % 86400 / 3600), o = Math.floor(t % 3600 / 60);
|
|
267
|
+
return r > 0 ? `${r}d ${n}h` : n > 0 ? `${n}h ${o}m` : o > 0 ? `${o}m ${t % 60}s` : `${t}s`;
|
|
254
268
|
}
|
|
255
|
-
function
|
|
269
|
+
function M(e) {
|
|
256
270
|
const t = e / 1048576;
|
|
257
271
|
return t >= 1024 ? `${(t / 1024).toFixed(1)}G` : `${t.toFixed(0)}M`;
|
|
258
272
|
}
|
|
259
|
-
function
|
|
273
|
+
function A(e) {
|
|
260
274
|
return e >= 1024 ? `${(e / 1024).toFixed(1)}G` : `${e.toFixed(1)}M`;
|
|
261
275
|
}
|
|
262
|
-
function
|
|
276
|
+
function ie(e) {
|
|
263
277
|
return e >= 1e6 ? `${(e / 1e6).toFixed(1)}M` : e >= 1e3 ? `${(e / 1e3).toFixed(1)}K` : `${e}`;
|
|
264
278
|
}
|
|
265
|
-
function
|
|
279
|
+
function We(e) {
|
|
266
280
|
return e >= 1e3 ? `${(e / 1e3).toFixed(2)}s` : e >= 1 ? `${e.toFixed(0)}ms` : `${e.toFixed(2)}ms`;
|
|
267
281
|
}
|
|
268
282
|
function D(e) {
|
|
269
283
|
return /([+-]\d{2}:?\d{2}|Z)\s*$/.test(e) ? e : e + "Z";
|
|
270
284
|
}
|
|
271
|
-
function
|
|
285
|
+
function Ge(e) {
|
|
272
286
|
if (!e) return "-";
|
|
273
287
|
const t = typeof e == "string" ? new Date(D(e)) : new Date(e);
|
|
274
288
|
return Number.isNaN(t.getTime()) ? "-" : t.toLocaleTimeString("en-US", {
|
|
@@ -278,12 +292,12 @@ function Ie(e) {
|
|
|
278
292
|
second: "2-digit"
|
|
279
293
|
}) + "." + String(t.getMilliseconds()).padStart(3, "0");
|
|
280
294
|
}
|
|
281
|
-
function
|
|
295
|
+
function Qe(e) {
|
|
282
296
|
if (!e) return "-";
|
|
283
297
|
const t = typeof e == "string" ? new Date(D(e)).getTime() : e, r = Math.floor((Date.now() - t) / 1e3);
|
|
284
298
|
return r < 0 ? "just now" : r < 60 ? `${r}s ago` : r < 3600 ? `${Math.floor(r / 60)}m ago` : r < 86400 ? `${Math.floor(r / 3600)}h ago` : `${Math.floor(r / 86400)}d ago`;
|
|
285
299
|
}
|
|
286
|
-
function
|
|
300
|
+
function Je(e, t) {
|
|
287
301
|
switch (t) {
|
|
288
302
|
case "%":
|
|
289
303
|
return `${e.toFixed(1)}%`;
|
|
@@ -292,7 +306,7 @@ function _e(e, t) {
|
|
|
292
306
|
case "MB":
|
|
293
307
|
return `${e.toFixed(1)}M`;
|
|
294
308
|
case "bytes":
|
|
295
|
-
return
|
|
309
|
+
return M(e);
|
|
296
310
|
case "/s":
|
|
297
311
|
case "/m":
|
|
298
312
|
return e.toFixed(1);
|
|
@@ -300,90 +314,75 @@ function _e(e, t) {
|
|
|
300
314
|
return e.toFixed(1);
|
|
301
315
|
}
|
|
302
316
|
}
|
|
303
|
-
function
|
|
317
|
+
function x(e, t, r) {
|
|
304
318
|
return e > r ? "red" : e > t ? "amber" : "green";
|
|
305
319
|
}
|
|
306
|
-
function
|
|
320
|
+
function ae(e, t, r) {
|
|
307
321
|
return e < r ? "red" : e < t ? "amber" : "green";
|
|
308
322
|
}
|
|
309
|
-
function
|
|
323
|
+
function R(e, t) {
|
|
310
324
|
if (t === 0) return "green";
|
|
311
325
|
const r = e / t;
|
|
312
326
|
return r > 0.8 ? "red" : r > 0.5 ? "amber" : "green";
|
|
313
327
|
}
|
|
314
|
-
const
|
|
328
|
+
const ce = {
|
|
315
329
|
green: "ss-green",
|
|
316
330
|
amber: "ss-amber",
|
|
317
331
|
red: "ss-red"
|
|
318
|
-
},
|
|
332
|
+
}, Ye = {
|
|
319
333
|
green: "#34d399",
|
|
320
334
|
amber: "#fbbf24",
|
|
321
335
|
red: "#f87171"
|
|
322
|
-
},
|
|
336
|
+
}, Xe = {
|
|
323
337
|
green: "--ss-accent",
|
|
324
338
|
amber: "--ss-amber-fg",
|
|
325
339
|
red: "--ss-red-fg"
|
|
326
340
|
};
|
|
327
|
-
function
|
|
341
|
+
function Ze(e) {
|
|
328
342
|
return e >= 500 ? "red" : e >= 400 ? "amber" : "green";
|
|
329
343
|
}
|
|
330
|
-
function
|
|
331
|
-
return e >
|
|
344
|
+
function le(e) {
|
|
345
|
+
return e > Z ? "very-slow" : e > X ? "slow" : "normal";
|
|
332
346
|
}
|
|
333
|
-
function
|
|
347
|
+
function et(e, t = "ss-dash") {
|
|
348
|
+
const r = le(e);
|
|
349
|
+
return r === "very-slow" ? `${t}-very-slow` : r === "slow" ? `${t}-slow` : "";
|
|
350
|
+
}
|
|
351
|
+
function tt(e) {
|
|
334
352
|
return e ? e.length <= 8 ? e : e.slice(0, 8) + "…" : "--";
|
|
335
353
|
}
|
|
336
354
|
function L(e, t = 100) {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
return '"' + (e.length > 40 ? e.slice(0, 40) + "..." : e) + '"';
|
|
341
|
-
if (typeof e == "number" || typeof e == "boolean") return String(e);
|
|
342
|
-
if (Array.isArray(e)) {
|
|
343
|
-
if (e.length === 0) return "[]";
|
|
344
|
-
const n = "[" + e.slice(0, 3).map((i) => L(i, 30)).join(", ") + (e.length > 3 ? ", ..." + e.length + " items" : "") + "]";
|
|
345
|
-
return n.length > t ? "[" + e.length + " items]" : n;
|
|
346
|
-
}
|
|
347
|
-
if (typeof e == "object") {
|
|
348
|
-
const r = Object.keys(e);
|
|
349
|
-
if (r.length === 0) return "{}";
|
|
350
|
-
const n = [];
|
|
351
|
-
for (let s = 0; s < Math.min(r.length, 4); s++)
|
|
352
|
-
n.push(r[s] + ": " + L(e[r[s]], 30));
|
|
353
|
-
const i = "{ " + n.join(", ") + (r.length > 4 ? ", ...+" + (r.length - 4) : "") + " }";
|
|
354
|
-
return i.length > t ? "{ " + r.slice(0, 6).join(", ") + (r.length > 6 ? ", ..." : "") + " }" : i;
|
|
355
|
-
}
|
|
356
|
-
return String(e);
|
|
357
|
-
}
|
|
358
|
-
function ze(e) {
|
|
355
|
+
return e === null ? "null" : e === void 0 ? "-" : typeof e == "string" ? re(e) : typeof e == "number" || typeof e == "boolean" ? String(e) : Array.isArray(e) ? ne(e, t, L) : typeof e == "object" ? se(e, t, L) : String(e);
|
|
356
|
+
}
|
|
357
|
+
function rt(e) {
|
|
359
358
|
return e < 0 ? "no expiry" : e < 60 ? `${e}s` : e < 3600 ? `${Math.floor(e / 60)}m` : e < 86400 ? `${Math.floor(e / 3600)}h` : `${Math.floor(e / 86400)}d`;
|
|
360
359
|
}
|
|
361
|
-
function
|
|
360
|
+
function nt(e) {
|
|
362
361
|
return e < 1024 ? `${e}B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)}KB` : `${(e / (1024 * 1024)).toFixed(1)}MB`;
|
|
363
362
|
}
|
|
364
|
-
const
|
|
365
|
-
function
|
|
363
|
+
const O = 50;
|
|
364
|
+
function st(e, t, r) {
|
|
366
365
|
const n = new URLSearchParams();
|
|
367
366
|
if (n.set("page", String(e.page)), n.set("perPage", String(e.perPage)), t) {
|
|
368
367
|
t.search && n.set("search", t.search);
|
|
369
|
-
for (const [
|
|
370
|
-
s && n.set(
|
|
368
|
+
for (const [o, s] of Object.entries(t.filters))
|
|
369
|
+
s && n.set(o, s);
|
|
371
370
|
}
|
|
372
371
|
return r && (n.set("sort", r.field), n.set("direction", r.direction)), n.toString();
|
|
373
372
|
}
|
|
374
|
-
function
|
|
375
|
-
const r = e.data ?? e.items ?? [], n = e.total ?? 0,
|
|
373
|
+
function ot(e, t = O) {
|
|
374
|
+
const r = e.data ?? e.items ?? [], n = e.total ?? 0, o = e.page ?? 1, s = e.perPage ?? e.limit ?? t, i = e.totalPages ?? (Math.ceil(n / s) || 1);
|
|
376
375
|
return {
|
|
377
376
|
data: r,
|
|
378
377
|
pagination: {
|
|
379
|
-
page:
|
|
378
|
+
page: o,
|
|
380
379
|
perPage: s,
|
|
381
380
|
total: n,
|
|
382
|
-
totalPages:
|
|
381
|
+
totalPages: i
|
|
383
382
|
}
|
|
384
383
|
};
|
|
385
384
|
}
|
|
386
|
-
function
|
|
385
|
+
function it(e = O) {
|
|
387
386
|
return {
|
|
388
387
|
page: 1,
|
|
389
388
|
perPage: e,
|
|
@@ -391,44 +390,97 @@ function Ge(e = F) {
|
|
|
391
390
|
totalPages: 1
|
|
392
391
|
};
|
|
393
392
|
}
|
|
394
|
-
function
|
|
393
|
+
function at() {
|
|
395
394
|
return {
|
|
396
395
|
search: "",
|
|
397
396
|
filters: {}
|
|
398
397
|
};
|
|
399
398
|
}
|
|
400
|
-
function
|
|
399
|
+
function ct(e = "id", t = "desc") {
|
|
401
400
|
return { field: e, direction: t };
|
|
402
401
|
}
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
402
|
+
const ue = [
|
|
403
|
+
{ key: "page", param: "page", isNumeric: !0 },
|
|
404
|
+
{ key: "perPage", param: "perPage", isNumeric: !0 },
|
|
405
|
+
{ key: "search", param: "search" },
|
|
406
|
+
{ key: "sort", param: "sort" },
|
|
407
|
+
{ key: "sortDir", param: "direction" },
|
|
408
|
+
{ key: "timeRange", param: "range" }
|
|
409
|
+
];
|
|
410
|
+
function he(e) {
|
|
411
|
+
const t = new URLSearchParams(), r = e;
|
|
412
|
+
for (const { key: n, param: o, isNumeric: s } of ue) {
|
|
413
|
+
const i = r[n];
|
|
414
|
+
(s ? i != null : i) && t.set(o, String(i));
|
|
415
|
+
}
|
|
416
|
+
if (e.filters)
|
|
417
|
+
for (const [n, o] of Object.entries(e.filters))
|
|
418
|
+
o && t.set(n, o);
|
|
408
419
|
return t.toString();
|
|
409
420
|
}
|
|
410
|
-
function
|
|
411
|
-
const t = Math.max(1, Math.ceil(e.total / e.perPage)), r = Math.min(e.page, t), n = e.total === 0 ? 0 : (r - 1) * e.perPage + 1,
|
|
421
|
+
function lt(e) {
|
|
422
|
+
const t = Math.max(1, Math.ceil(e.total / e.perPage)), r = Math.min(e.page, t), n = e.total === 0 ? 0 : (r - 1) * e.perPage + 1, o = Math.min(r * e.perPage, e.total);
|
|
412
423
|
return {
|
|
413
424
|
page: r,
|
|
414
425
|
perPage: e.perPage,
|
|
415
426
|
total: e.total,
|
|
416
427
|
lastPage: t,
|
|
417
428
|
from: n,
|
|
418
|
-
to:
|
|
429
|
+
to: o,
|
|
419
430
|
hasPrev: r > 1,
|
|
420
431
|
hasNext: r < t
|
|
421
432
|
};
|
|
422
433
|
}
|
|
423
|
-
function
|
|
434
|
+
function ut(e, t, r = 2) {
|
|
424
435
|
if (t <= 1) return [1];
|
|
425
|
-
const n = [],
|
|
426
|
-
n.push(1),
|
|
427
|
-
for (let
|
|
428
|
-
n.push(
|
|
436
|
+
const n = [], o = Math.max(2, e - r), s = Math.min(t - 1, e + r);
|
|
437
|
+
n.push(1), o > 2 && n.push("...");
|
|
438
|
+
for (let i = o; i <= s; i++)
|
|
439
|
+
n.push(i);
|
|
429
440
|
return s < t - 1 && n.push("..."), t > 1 && n.push(t), n;
|
|
430
441
|
}
|
|
431
|
-
const
|
|
442
|
+
const de = [
|
|
443
|
+
"tracing",
|
|
444
|
+
"process",
|
|
445
|
+
"system",
|
|
446
|
+
"http",
|
|
447
|
+
"db",
|
|
448
|
+
"redis",
|
|
449
|
+
"queues",
|
|
450
|
+
"cache",
|
|
451
|
+
"app",
|
|
452
|
+
"log",
|
|
453
|
+
"emails",
|
|
454
|
+
"dashboard"
|
|
455
|
+
], fe = [
|
|
456
|
+
{ flag: "process", group: "process" },
|
|
457
|
+
{ flag: "process", group: "memory" },
|
|
458
|
+
{ flag: "system", group: "memory" },
|
|
459
|
+
{ flag: "http", group: "http" },
|
|
460
|
+
{ flag: "db", group: "db" },
|
|
461
|
+
{ flag: "redis", group: "redis" },
|
|
462
|
+
{ flag: "queues", group: "queue" },
|
|
463
|
+
{ flag: "app", group: "app" },
|
|
464
|
+
{ flag: "log", group: "log" }
|
|
465
|
+
], pe = [
|
|
466
|
+
{ group: "process", fields: ["cpuPercent", "uptime", "nodeVersion"] },
|
|
467
|
+
{
|
|
468
|
+
group: "memory",
|
|
469
|
+
fields: ["memHeapUsed", "memRss", "systemMemoryTotalMb", "systemMemoryFreeMb"]
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
group: "http",
|
|
473
|
+
fields: ["requestsPerSecond", "avgResponseTimeMs", "errorRate", "activeHttpConnections"]
|
|
474
|
+
},
|
|
475
|
+
{ group: "db", fields: ["dbPoolMax", "dbPoolUsed", "dbPoolFree", "dbPoolPending"] },
|
|
476
|
+
{ group: "queue", fields: ["queueActive", "queueWaiting", "queueWorkerCount"] },
|
|
477
|
+
{ group: "app", fields: ["onlineUsers", "pendingWebhooks", "pendingEmails"] },
|
|
478
|
+
{ group: "log", fields: ["logErrorsLast5m", "logEntriesPerMinute"] }
|
|
479
|
+
];
|
|
480
|
+
function T(e) {
|
|
481
|
+
return typeof e == "number" && !Number.isNaN(e);
|
|
482
|
+
}
|
|
483
|
+
const I = "/admin/api/debug", ge = {
|
|
432
484
|
tracing: !1,
|
|
433
485
|
process: !1,
|
|
434
486
|
system: !1,
|
|
@@ -443,54 +495,45 @@ const I = "/admin/api/debug", ne = {
|
|
|
443
495
|
dashboard: !1,
|
|
444
496
|
customPanes: []
|
|
445
497
|
};
|
|
446
|
-
function
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
http: e.features?.http ?? !1,
|
|
452
|
-
db: e.features?.db ?? !1,
|
|
453
|
-
redis: e.features?.redis ?? !1,
|
|
454
|
-
queues: e.features?.queues ?? !1,
|
|
455
|
-
cache: e.features?.cache ?? !1,
|
|
456
|
-
app: e.features?.app ?? !1,
|
|
457
|
-
log: e.features?.log ?? !1,
|
|
458
|
-
emails: e.features?.emails ?? !1,
|
|
459
|
-
dashboard: e.features?.dashboard ?? !1,
|
|
460
|
-
customPanes: e.customPanes ?? []
|
|
461
|
-
};
|
|
498
|
+
function me(e) {
|
|
499
|
+
const t = { customPanes: e.customPanes ?? [] }, r = e.features;
|
|
500
|
+
for (const n of de)
|
|
501
|
+
t[n] = r?.[n] ?? !1;
|
|
502
|
+
return t;
|
|
462
503
|
}
|
|
463
|
-
async function
|
|
504
|
+
async function ye(e, t = I) {
|
|
464
505
|
const r = `${t.replace(/\/+$/, "")}/config`;
|
|
465
506
|
return e.fetch(r);
|
|
466
507
|
}
|
|
467
|
-
async function
|
|
468
|
-
const { baseUrl: t = "", debugEndpoint: r = I, authToken: n } = e,
|
|
508
|
+
async function ht(e) {
|
|
509
|
+
const { baseUrl: t = "", debugEndpoint: r = I, authToken: n } = e, o = new v({ baseUrl: t, authToken: n });
|
|
469
510
|
try {
|
|
470
|
-
const s = await
|
|
471
|
-
return
|
|
511
|
+
const s = await ye(o, r);
|
|
512
|
+
return me(s);
|
|
472
513
|
} catch {
|
|
473
|
-
return
|
|
514
|
+
return ge;
|
|
474
515
|
}
|
|
475
516
|
}
|
|
476
|
-
function
|
|
477
|
-
const t = /* @__PURE__ */ new Set(),
|
|
478
|
-
|
|
517
|
+
function dt(e) {
|
|
518
|
+
const t = /* @__PURE__ */ new Set(), n = "features" in e && typeof e.features == "object" && e.features !== null ? e.features : e;
|
|
519
|
+
for (const { flag: o, group: s } of fe)
|
|
520
|
+
n[o] && t.add(s);
|
|
521
|
+
return t;
|
|
479
522
|
}
|
|
480
|
-
function
|
|
523
|
+
function ft(e) {
|
|
481
524
|
const t = /* @__PURE__ */ new Set();
|
|
482
|
-
|
|
525
|
+
(T(e.cpuPercent) || T(e.uptime) || be(e)) && t.add("process");
|
|
526
|
+
for (const r of pe)
|
|
527
|
+
r.fields.some((n) => T(e[n])) && t.add(r.group);
|
|
528
|
+
return e.redisOk !== void 0 && e.redisOk !== null && t.add("redis"), t;
|
|
483
529
|
}
|
|
484
|
-
function
|
|
485
|
-
return typeof e == "
|
|
486
|
-
}
|
|
487
|
-
function oe(e) {
|
|
488
|
-
return typeof e == "string" && e.length > 0;
|
|
530
|
+
function be(e) {
|
|
531
|
+
return typeof e.nodeVersion == "string" && e.nodeVersion.length > 0;
|
|
489
532
|
}
|
|
490
533
|
function g(e) {
|
|
491
|
-
return
|
|
534
|
+
return ce[e] || "";
|
|
492
535
|
}
|
|
493
|
-
const
|
|
536
|
+
const P = [
|
|
494
537
|
// ── Process group ─────────────────────────────────────────────────────────
|
|
495
538
|
// -- Node version ---------------------------------------------------------
|
|
496
539
|
{
|
|
@@ -511,7 +554,7 @@ const k = [
|
|
|
511
554
|
unit: "",
|
|
512
555
|
group: "process",
|
|
513
556
|
extract: (e) => e.uptime,
|
|
514
|
-
format: (e) =>
|
|
557
|
+
format: (e) => oe(e.uptime),
|
|
515
558
|
color: () => ""
|
|
516
559
|
},
|
|
517
560
|
// -- CPU ------------------------------------------------------------------
|
|
@@ -525,7 +568,7 @@ const k = [
|
|
|
525
568
|
critThreshold: 80,
|
|
526
569
|
extract: (e) => e.cpuPercent,
|
|
527
570
|
format: (e) => `${e.cpuPercent.toFixed(1)}%`,
|
|
528
|
-
color: (e) => g(
|
|
571
|
+
color: (e) => g(x(e.cpuPercent, 50, 80)),
|
|
529
572
|
historyKey: "cpuPercent"
|
|
530
573
|
},
|
|
531
574
|
// -- Event loop -----------------------------------------------------------
|
|
@@ -539,7 +582,7 @@ const k = [
|
|
|
539
582
|
critThreshold: 50,
|
|
540
583
|
extract: (e) => e.eventLoopLag,
|
|
541
584
|
format: (e) => `${e.eventLoopLag.toFixed(1)}ms`,
|
|
542
|
-
color: (e) => g(
|
|
585
|
+
color: (e) => g(x(e.eventLoopLag, 20, 50)),
|
|
543
586
|
historyKey: "eventLoopLag"
|
|
544
587
|
},
|
|
545
588
|
// ── Memory group ──────────────────────────────────────────────────────────
|
|
@@ -551,7 +594,7 @@ const k = [
|
|
|
551
594
|
unit: "bytes",
|
|
552
595
|
group: "memory",
|
|
553
596
|
extract: (e) => e.memHeapUsed,
|
|
554
|
-
format: (e) =>
|
|
597
|
+
format: (e) => M(e.memHeapUsed),
|
|
555
598
|
color: () => "",
|
|
556
599
|
historyKey: "memHeapUsed"
|
|
557
600
|
},
|
|
@@ -563,7 +606,7 @@ const k = [
|
|
|
563
606
|
unit: "bytes",
|
|
564
607
|
group: "memory",
|
|
565
608
|
extract: (e) => e.memRss,
|
|
566
|
-
format: (e) =>
|
|
609
|
+
format: (e) => M(e.memRss),
|
|
567
610
|
color: () => "",
|
|
568
611
|
historyKey: "memRss"
|
|
569
612
|
},
|
|
@@ -575,12 +618,12 @@ const k = [
|
|
|
575
618
|
unit: "MB",
|
|
576
619
|
group: "memory",
|
|
577
620
|
extract: (e) => e.systemMemoryTotalMb - e.systemMemoryFreeMb,
|
|
578
|
-
format: (e) => `${
|
|
621
|
+
format: (e) => `${A(e.systemMemoryTotalMb - e.systemMemoryFreeMb)}/${A(e.systemMemoryTotalMb)}`,
|
|
579
622
|
color: (e) => {
|
|
580
623
|
const t = e.systemMemoryTotalMb;
|
|
581
624
|
if (t === 0) return "";
|
|
582
625
|
const r = t - e.systemMemoryFreeMb;
|
|
583
|
-
return g(
|
|
626
|
+
return g(R(r, t));
|
|
584
627
|
},
|
|
585
628
|
historyKey: "_sysMemUsed",
|
|
586
629
|
show: (e) => e.systemMemoryTotalMb !== null && e.systemMemoryTotalMb !== void 0
|
|
@@ -609,7 +652,7 @@ const k = [
|
|
|
609
652
|
critThreshold: 500,
|
|
610
653
|
extract: (e) => e.avgResponseTimeMs,
|
|
611
654
|
format: (e) => `${e.avgResponseTimeMs.toFixed(0)}ms`,
|
|
612
|
-
color: (e) => g(
|
|
655
|
+
color: (e) => g(x(e.avgResponseTimeMs, 200, 500)),
|
|
613
656
|
historyKey: "avgResponseTimeMs"
|
|
614
657
|
},
|
|
615
658
|
// -- Error rate -----------------------------------------------------------
|
|
@@ -623,7 +666,7 @@ const k = [
|
|
|
623
666
|
critThreshold: 5,
|
|
624
667
|
extract: (e) => e.errorRate,
|
|
625
668
|
format: (e) => `${e.errorRate.toFixed(1)}%`,
|
|
626
|
-
color: (e) => g(
|
|
669
|
+
color: (e) => g(x(e.errorRate, 1, 5)),
|
|
627
670
|
historyKey: "errorRate"
|
|
628
671
|
},
|
|
629
672
|
// -- Active connections ---------------------------------------------------
|
|
@@ -648,7 +691,7 @@ const k = [
|
|
|
648
691
|
group: "db",
|
|
649
692
|
extract: (e) => e.dbPoolUsed,
|
|
650
693
|
format: (e) => `${e.dbPoolUsed}/${e.dbPoolFree}/${e.dbPoolMax}`,
|
|
651
|
-
color: (e) => g(
|
|
694
|
+
color: (e) => g(R(e.dbPoolUsed, e.dbPoolMax)),
|
|
652
695
|
historyKey: "dbPoolUsed"
|
|
653
696
|
},
|
|
654
697
|
// ── Redis group ───────────────────────────────────────────────────────────
|
|
@@ -684,7 +727,7 @@ const k = [
|
|
|
684
727
|
unit: "",
|
|
685
728
|
group: "redis",
|
|
686
729
|
extract: (e) => e.redisKeysCount,
|
|
687
|
-
format: (e) =>
|
|
730
|
+
format: (e) => ie(e.redisKeysCount),
|
|
688
731
|
color: () => "",
|
|
689
732
|
historyKey: "redisKeysCount",
|
|
690
733
|
show: (e) => e.redisOk
|
|
@@ -701,7 +744,7 @@ const k = [
|
|
|
701
744
|
inverseThreshold: !0,
|
|
702
745
|
extract: (e) => e.redisHitRate,
|
|
703
746
|
format: (e) => `${e.redisHitRate.toFixed(0)}%`,
|
|
704
|
-
color: (e) => g(
|
|
747
|
+
color: (e) => g(ae(e.redisHitRate, 90, 70)),
|
|
705
748
|
historyKey: "redisHitRate",
|
|
706
749
|
show: (e) => e.redisOk
|
|
707
750
|
},
|
|
@@ -792,18 +835,18 @@ const k = [
|
|
|
792
835
|
historyKey: "logEntriesPerMinute"
|
|
793
836
|
}
|
|
794
837
|
];
|
|
795
|
-
function
|
|
796
|
-
return
|
|
838
|
+
function pt(e) {
|
|
839
|
+
return P.find((t) => t.id === e);
|
|
797
840
|
}
|
|
798
|
-
function
|
|
841
|
+
function gt() {
|
|
799
842
|
const e = /* @__PURE__ */ new Map();
|
|
800
|
-
for (const t of
|
|
843
|
+
for (const t of P) {
|
|
801
844
|
const r = t.group || "core";
|
|
802
845
|
e.has(r) || e.set(r, []), e.get(r).push(t);
|
|
803
846
|
}
|
|
804
847
|
return e;
|
|
805
848
|
}
|
|
806
|
-
const
|
|
849
|
+
const xe = {
|
|
807
850
|
queries: "/queries",
|
|
808
851
|
events: "/events",
|
|
809
852
|
emails: "/emails",
|
|
@@ -815,10 +858,10 @@ const ae = 60, le = 1e4, ce = {
|
|
|
815
858
|
config: "/config",
|
|
816
859
|
internals: "/diagnostics"
|
|
817
860
|
};
|
|
818
|
-
function
|
|
819
|
-
return
|
|
861
|
+
function Se(e) {
|
|
862
|
+
return xe[e] || `/${e}`;
|
|
820
863
|
}
|
|
821
|
-
const
|
|
864
|
+
const we = {
|
|
822
865
|
overview: "/overview",
|
|
823
866
|
requests: "/requests",
|
|
824
867
|
queries: "/queries",
|
|
@@ -831,45 +874,45 @@ const ue = {
|
|
|
831
874
|
jobs: "/jobs",
|
|
832
875
|
config: "/config"
|
|
833
876
|
};
|
|
834
|
-
function
|
|
835
|
-
return
|
|
877
|
+
function ve(e) {
|
|
878
|
+
return we[e] || `/${e}`;
|
|
836
879
|
}
|
|
837
|
-
function
|
|
880
|
+
function Ee(e = ee) {
|
|
838
881
|
const t = {}, r = {};
|
|
839
882
|
let n = !1;
|
|
840
|
-
function
|
|
883
|
+
function o(s) {
|
|
841
884
|
if (s.count === 0) return [];
|
|
842
|
-
const
|
|
843
|
-
for (let
|
|
844
|
-
|
|
845
|
-
return
|
|
885
|
+
const i = Array.from({ length: s.count }), a = s.count < e ? 0 : s.head;
|
|
886
|
+
for (let c = 0; c < s.count; c++)
|
|
887
|
+
i[c] = s.data[(a + c) % e];
|
|
888
|
+
return i;
|
|
846
889
|
}
|
|
847
890
|
return {
|
|
848
891
|
push(s) {
|
|
849
892
|
n = !1;
|
|
850
|
-
for (const
|
|
851
|
-
const
|
|
852
|
-
if (!
|
|
853
|
-
const
|
|
854
|
-
if (typeof
|
|
855
|
-
t[
|
|
856
|
-
const
|
|
857
|
-
|
|
893
|
+
for (const i of P) {
|
|
894
|
+
const a = i.historyKey;
|
|
895
|
+
if (!a) continue;
|
|
896
|
+
const c = i.extract(s);
|
|
897
|
+
if (typeof c != "number") continue;
|
|
898
|
+
t[a] || (t[a] = { data: Array.from({ length: e }), head: 0, count: 0 });
|
|
899
|
+
const l = t[a];
|
|
900
|
+
l.data[l.head] = c, l.head = (l.head + 1) % e, l.count < e && l.count++;
|
|
858
901
|
}
|
|
859
902
|
},
|
|
860
903
|
get(s) {
|
|
861
|
-
const
|
|
862
|
-
return
|
|
904
|
+
const i = t[s];
|
|
905
|
+
return i ? o(i) : [];
|
|
863
906
|
},
|
|
864
907
|
getAll() {
|
|
865
908
|
if (n) return r;
|
|
866
909
|
for (const s of Object.keys(t))
|
|
867
|
-
r[s] =
|
|
910
|
+
r[s] = o(t[s]);
|
|
868
911
|
return n = !0, r;
|
|
869
912
|
}
|
|
870
913
|
};
|
|
871
914
|
}
|
|
872
|
-
class
|
|
915
|
+
class mt {
|
|
873
916
|
// -- Configuration --------------------------------------------------------
|
|
874
917
|
baseUrl;
|
|
875
918
|
endpoint;
|
|
@@ -898,7 +941,7 @@ class st {
|
|
|
898
941
|
isConnected = !1;
|
|
899
942
|
isStale = !1;
|
|
900
943
|
constructor(t = {}) {
|
|
901
|
-
this.baseUrl = t.baseUrl ?? "", this.endpoint = t.endpoint ?? "/admin/api/server-stats", this.channelName = t.channelName ?? "admin/server-stats", this.authToken = t.authToken, this.pollInterval = t.pollInterval ?? 3e3, this.onStatsUpdate = t.onStatsUpdate, this.onConnectionChange = t.onConnectionChange, this.onStaleChange = t.onStaleChange, this.onError = t.onError, this.onUnauthorizedChange = t.onUnauthorizedChange, this.onHistoryChange = t.onHistoryChange, this.onSseActiveChange = t.onSseActiveChange, this.onPollActiveChange = t.onPollActiveChange, this.historyBuffer =
|
|
944
|
+
this.baseUrl = t.baseUrl ?? "", this.endpoint = t.endpoint ?? "/admin/api/server-stats", this.channelName = t.channelName ?? "admin/server-stats", this.authToken = t.authToken, this.pollInterval = t.pollInterval ?? 3e3, this.onStatsUpdate = t.onStatsUpdate, this.onConnectionChange = t.onConnectionChange, this.onStaleChange = t.onStaleChange, this.onError = t.onError, this.onUnauthorizedChange = t.onUnauthorizedChange, this.onHistoryChange = t.onHistoryChange, this.onSseActiveChange = t.onSseActiveChange, this.onPollActiveChange = t.onPollActiveChange, this.historyBuffer = Ee();
|
|
902
945
|
}
|
|
903
946
|
// -- Public API -----------------------------------------------------------
|
|
904
947
|
/**
|
|
@@ -909,42 +952,8 @@ class st {
|
|
|
909
952
|
start() {
|
|
910
953
|
if (this.unauthorized) return;
|
|
911
954
|
this.stopped = !1;
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
const r = q({
|
|
915
|
-
baseUrl: this.baseUrl,
|
|
916
|
-
channelName: this.channelName,
|
|
917
|
-
authToken: this.authToken,
|
|
918
|
-
onMessage: (n) => {
|
|
919
|
-
n && typeof n == "object" && "timestamp" in n && this.processStats(n);
|
|
920
|
-
},
|
|
921
|
-
onConnect: () => {
|
|
922
|
-
this.setSseActive(!0), this.setConnected(!0), this.stopPolling();
|
|
923
|
-
},
|
|
924
|
-
onDisconnect: () => {
|
|
925
|
-
this.setSseActive(!1), this.setConnected(!1), !this.pollTimer && !this.unauthorized && !this.stopped && this.startPollInterval();
|
|
926
|
-
},
|
|
927
|
-
onError: () => {
|
|
928
|
-
t = !0;
|
|
929
|
-
}
|
|
930
|
-
});
|
|
931
|
-
this.sseHandle = r;
|
|
932
|
-
} catch {
|
|
933
|
-
t = !0;
|
|
934
|
-
}
|
|
935
|
-
if (this.poll(), t || !this.sseHandle)
|
|
936
|
-
this.startPollInterval();
|
|
937
|
-
else {
|
|
938
|
-
const r = setTimeout(() => {
|
|
939
|
-
!this.isConnected && !this.pollTimer && !this.stopped && this.startPollInterval();
|
|
940
|
-
}, 3e3), n = this.sseHandle?.unsubscribe;
|
|
941
|
-
this.sseHandle && (this.sseHandle.unsubscribe = () => {
|
|
942
|
-
clearTimeout(r), n?.();
|
|
943
|
-
});
|
|
944
|
-
}
|
|
945
|
-
this.staleTimer = setInterval(() => {
|
|
946
|
-
this.lastSuccess > 0 && Date.now() - this.lastSuccess > le && this.setStale(!0);
|
|
947
|
-
}, 2e3);
|
|
955
|
+
const t = this.initSseSubscription();
|
|
956
|
+
this.poll(), t || !this.sseHandle ? this.startPollInterval() : this.setupSseFallbackTimer(), this.startStaleDetection();
|
|
948
957
|
}
|
|
949
958
|
/**
|
|
950
959
|
* Stop all timers and subscriptions. Call on unmount.
|
|
@@ -971,6 +980,47 @@ class st {
|
|
|
971
980
|
return this.unauthorized ? "disconnected" : this.sseActive ? "live" : this.pollTimer ? "polling" : "disconnected";
|
|
972
981
|
}
|
|
973
982
|
// -- Internal helpers -----------------------------------------------------
|
|
983
|
+
/** Initialize the SSE subscription. Returns true if SSE failed and polling should be used. */
|
|
984
|
+
initSseSubscription() {
|
|
985
|
+
let t = !1;
|
|
986
|
+
try {
|
|
987
|
+
this.sseHandle = K({
|
|
988
|
+
baseUrl: this.baseUrl,
|
|
989
|
+
channelName: this.channelName,
|
|
990
|
+
authToken: this.authToken,
|
|
991
|
+
onMessage: (r) => {
|
|
992
|
+
r && typeof r == "object" && "timestamp" in r && this.processStats(r);
|
|
993
|
+
},
|
|
994
|
+
onConnect: () => {
|
|
995
|
+
this.setSseActive(!0), this.setConnected(!0), this.stopPolling();
|
|
996
|
+
},
|
|
997
|
+
onDisconnect: () => {
|
|
998
|
+
this.setSseActive(!1), this.setConnected(!1), !this.pollTimer && !this.unauthorized && !this.stopped && this.startPollInterval();
|
|
999
|
+
},
|
|
1000
|
+
onError: () => {
|
|
1001
|
+
t = !0;
|
|
1002
|
+
}
|
|
1003
|
+
});
|
|
1004
|
+
} catch {
|
|
1005
|
+
t = !0;
|
|
1006
|
+
}
|
|
1007
|
+
return t;
|
|
1008
|
+
}
|
|
1009
|
+
/** Set up a 3-second fallback timer to start polling if SSE hasn't connected. */
|
|
1010
|
+
setupSseFallbackTimer() {
|
|
1011
|
+
const t = setTimeout(() => {
|
|
1012
|
+
!this.isConnected && !this.pollTimer && !this.stopped && this.startPollInterval();
|
|
1013
|
+
}, 3e3), r = this.sseHandle?.unsubscribe;
|
|
1014
|
+
this.sseHandle && (this.sseHandle.unsubscribe = () => {
|
|
1015
|
+
clearTimeout(t), r?.();
|
|
1016
|
+
});
|
|
1017
|
+
}
|
|
1018
|
+
/** Start the stale detection interval. */
|
|
1019
|
+
startStaleDetection() {
|
|
1020
|
+
this.staleTimer = setInterval(() => {
|
|
1021
|
+
this.lastSuccess > 0 && Date.now() - this.lastSuccess > te && this.setStale(!0);
|
|
1022
|
+
}, 2e3);
|
|
1023
|
+
}
|
|
974
1024
|
/** Process incoming stats data from either SSE or polling. */
|
|
975
1025
|
processStats(t) {
|
|
976
1026
|
this.onStatsUpdate?.(t), this.onError?.(null), this.lastSuccess = Date.now(), this.setStale(!1), this.historyBuffer.push(t), this.onHistoryChange?.(this.historyBuffer.getAll());
|
|
@@ -978,12 +1028,12 @@ class st {
|
|
|
978
1028
|
/** Poll the HTTP endpoint once. */
|
|
979
1029
|
async poll() {
|
|
980
1030
|
if (!this.unauthorized) {
|
|
981
|
-
this.client || (this.client = new
|
|
1031
|
+
this.client || (this.client = new v({ baseUrl: this.baseUrl, authToken: this.authToken }));
|
|
982
1032
|
try {
|
|
983
1033
|
const t = await this.client.get(this.endpoint);
|
|
984
1034
|
this.processStats(t);
|
|
985
1035
|
} catch (t) {
|
|
986
|
-
t instanceof
|
|
1036
|
+
t instanceof b && (this.unauthorized = !0, this.onUnauthorizedChange?.(!0), this.onError?.(t), this.stopPolling());
|
|
987
1037
|
}
|
|
988
1038
|
}
|
|
989
1039
|
}
|
|
@@ -1008,7 +1058,7 @@ class st {
|
|
|
1008
1058
|
this.isStale !== t && (this.isStale = t, this.onStaleChange?.(t));
|
|
1009
1059
|
}
|
|
1010
1060
|
}
|
|
1011
|
-
class
|
|
1061
|
+
class Te {
|
|
1012
1062
|
constructor(t, r) {
|
|
1013
1063
|
this.client = t, this.basePath = r;
|
|
1014
1064
|
}
|
|
@@ -1020,7 +1070,7 @@ class pe {
|
|
|
1020
1070
|
* @param init - Optional `RequestInit` overrides (e.g. `{ signal }`).
|
|
1021
1071
|
*/
|
|
1022
1072
|
async fetchSection(t, r, n) {
|
|
1023
|
-
const
|
|
1073
|
+
const o = ve(t), s = r ? `${this.basePath}${o}?${r}` : `${this.basePath}${o}`;
|
|
1024
1074
|
return this.client.fetch(s, n);
|
|
1025
1075
|
}
|
|
1026
1076
|
/**
|
|
@@ -1089,7 +1139,15 @@ class pe {
|
|
|
1089
1139
|
return this.client.fetch(`${this.basePath}/emails/${t}/preview`);
|
|
1090
1140
|
}
|
|
1091
1141
|
}
|
|
1092
|
-
|
|
1142
|
+
function Ce(e) {
|
|
1143
|
+
if (!e || typeof e != "object") return !1;
|
|
1144
|
+
const t = e;
|
|
1145
|
+
return t.data !== void 0 && t.meta !== void 0;
|
|
1146
|
+
}
|
|
1147
|
+
function ke(e, t) {
|
|
1148
|
+
return t.aborted ? !0 : e instanceof DOMException && e.name === "AbortError";
|
|
1149
|
+
}
|
|
1150
|
+
class yt {
|
|
1093
1151
|
// -- Dependencies ---------------------------------------------------------
|
|
1094
1152
|
client;
|
|
1095
1153
|
api;
|
|
@@ -1118,7 +1176,7 @@ class it {
|
|
|
1118
1176
|
/** AbortController for the current in-flight fetch. */
|
|
1119
1177
|
abortController = null;
|
|
1120
1178
|
constructor(t) {
|
|
1121
|
-
this.client = new
|
|
1179
|
+
this.client = new v({ baseUrl: t.baseUrl, authToken: t.authToken }), this.api = new Te(this.client, t.endpoint), this.endpoint = t.endpoint, this.section = t.section, this.perPage = t.perPage, this.callbacks = t.callbacks;
|
|
1122
1180
|
}
|
|
1123
1181
|
// -- Public API -----------------------------------------------------------
|
|
1124
1182
|
/**
|
|
@@ -1141,40 +1199,15 @@ class it {
|
|
|
1141
1199
|
* and loading state is not modified.
|
|
1142
1200
|
*/
|
|
1143
1201
|
async fetch(t = !0) {
|
|
1144
|
-
if (
|
|
1145
|
-
this.
|
|
1146
|
-
const r = new AbortController();
|
|
1147
|
-
this.abortController = r;
|
|
1148
|
-
const n = ++this.fetchId, i = this.section;
|
|
1149
|
-
if (!i) return;
|
|
1150
|
-
const s = this.filters, o = this.sort ? this.sort.replace(/[A-Z]/g, (a) => "_" + a.toLowerCase()) : void 0, l = re({
|
|
1151
|
-
page: this.page,
|
|
1152
|
-
perPage: this.perPage,
|
|
1153
|
-
search: this.search,
|
|
1154
|
-
sort: o,
|
|
1155
|
-
sortDir: this.sort ? this.sortDir : void 0,
|
|
1156
|
-
filters: s && Object.keys(s).length > 0 ? s : void 0,
|
|
1157
|
-
timeRange: i.startsWith("overview") ? this.timeRange : void 0
|
|
1158
|
-
});
|
|
1159
|
-
t || (this.callbacks.onLoading(!0), this.explicitFetchPending = !0);
|
|
1202
|
+
if (this.shouldSkipFetch(t)) return;
|
|
1203
|
+
const { controller: r, myFetchId: n } = this.prepareFetch(t);
|
|
1160
1204
|
try {
|
|
1161
|
-
const
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
if (
|
|
1166
|
-
|
|
1167
|
-
this.callbacks.onData(h.data), this.callbacks.onPagination(h.meta);
|
|
1168
|
-
} else
|
|
1169
|
-
this.callbacks.onData(a), this.callbacks.onPagination(null);
|
|
1170
|
-
this.callbacks.onError(null), this.callbacks.onLoading(!1), this.hasFetched = !0;
|
|
1171
|
-
} catch (a) {
|
|
1172
|
-
if (a instanceof DOMException && a.name === "AbortError" || r.signal.aborted || n !== this.fetchId || this.stopped) return;
|
|
1173
|
-
if (a instanceof w) {
|
|
1174
|
-
this.callbacks.onError(a), this.callbacks.onLoading(!1), this.stopRefreshTimer(), this.callbacks.onUnauthorized();
|
|
1175
|
-
return;
|
|
1176
|
-
}
|
|
1177
|
-
t || (this.callbacks.onError(a instanceof Error ? a : new Error(String(a))), this.callbacks.onLoading(!1));
|
|
1205
|
+
const o = await this.executeFetch(r);
|
|
1206
|
+
if (this.isStaleResponse(n)) return;
|
|
1207
|
+
this.applyFetchResult(o);
|
|
1208
|
+
} catch (o) {
|
|
1209
|
+
if (this.shouldIgnoreError(o, r.signal, n)) return;
|
|
1210
|
+
this.handleFetchError(o, t);
|
|
1178
1211
|
} finally {
|
|
1179
1212
|
t || (this.explicitFetchPending = !1);
|
|
1180
1213
|
}
|
|
@@ -1223,9 +1256,9 @@ class it {
|
|
|
1223
1256
|
* then silently refresh the current data.
|
|
1224
1257
|
*/
|
|
1225
1258
|
async mutate(t, r = "post", n) {
|
|
1226
|
-
const
|
|
1259
|
+
const o = `${this.endpoint}/${t}`;
|
|
1227
1260
|
try {
|
|
1228
|
-
const s = r === "post" ? await this.client.post(
|
|
1261
|
+
const s = r === "post" ? await this.client.post(o, n) : await this.client.delete(o);
|
|
1229
1262
|
return await this.fetch(!0), s;
|
|
1230
1263
|
} catch (s) {
|
|
1231
1264
|
throw s instanceof Error ? s : new Error(String(s));
|
|
@@ -1266,17 +1299,70 @@ class it {
|
|
|
1266
1299
|
getClient() {
|
|
1267
1300
|
return this.client;
|
|
1268
1301
|
}
|
|
1302
|
+
// -- Fetch helpers (private) -----------------------------------------------
|
|
1303
|
+
/** Whether this fetch call should be skipped entirely. */
|
|
1304
|
+
shouldSkipFetch(t) {
|
|
1305
|
+
return t && this.explicitFetchPending ? !0 : !this.section;
|
|
1306
|
+
}
|
|
1307
|
+
/** Prepare abort controller, increment fetch ID, set loading state. */
|
|
1308
|
+
prepareFetch(t) {
|
|
1309
|
+
this.abortController?.abort();
|
|
1310
|
+
const r = new AbortController();
|
|
1311
|
+
this.abortController = r;
|
|
1312
|
+
const n = ++this.fetchId;
|
|
1313
|
+
return t || (this.callbacks.onLoading(!0), this.explicitFetchPending = !0), { controller: r, myFetchId: n };
|
|
1314
|
+
}
|
|
1315
|
+
/** Execute the actual API fetch for the current section. */
|
|
1316
|
+
async executeFetch(t) {
|
|
1317
|
+
const r = this.buildCurrentQueryString();
|
|
1318
|
+
return this.api.fetchSection(this.section, r || void 0, {
|
|
1319
|
+
signal: t.signal
|
|
1320
|
+
});
|
|
1321
|
+
}
|
|
1322
|
+
/** Check if a response is stale (fetch ID mismatch or controller stopped). */
|
|
1323
|
+
isStaleResponse(t) {
|
|
1324
|
+
return t !== this.fetchId || this.stopped;
|
|
1325
|
+
}
|
|
1326
|
+
/** Check if an error should be silently ignored (abort or stale). */
|
|
1327
|
+
shouldIgnoreError(t, r, n) {
|
|
1328
|
+
return ke(t, r) ? !0 : this.isStaleResponse(n);
|
|
1329
|
+
}
|
|
1330
|
+
/** Build query string from current controller state. */
|
|
1331
|
+
buildCurrentQueryString() {
|
|
1332
|
+
const t = this.sort ? this.sort.replace(/[A-Z]/g, (n) => "_" + n.toLowerCase()) : void 0, r = this.filters;
|
|
1333
|
+
return he({
|
|
1334
|
+
page: this.page,
|
|
1335
|
+
perPage: this.perPage,
|
|
1336
|
+
search: this.search,
|
|
1337
|
+
sort: t,
|
|
1338
|
+
sortDir: this.sort ? this.sortDir : void 0,
|
|
1339
|
+
filters: r && Object.keys(r).length > 0 ? r : void 0,
|
|
1340
|
+
timeRange: this.section.startsWith("overview") ? this.timeRange : void 0
|
|
1341
|
+
});
|
|
1342
|
+
}
|
|
1343
|
+
/** Apply a successful fetch result to the callbacks. */
|
|
1344
|
+
applyFetchResult(t) {
|
|
1345
|
+
Ce(t) ? (this.callbacks.onData(t.data), this.callbacks.onPagination(t.meta)) : (this.callbacks.onData(t), this.callbacks.onPagination(null)), this.callbacks.onError(null), this.callbacks.onLoading(!1), this.hasFetched = !0;
|
|
1346
|
+
}
|
|
1347
|
+
/** Handle a fetch error (unauthorized, network, etc.). */
|
|
1348
|
+
handleFetchError(t, r) {
|
|
1349
|
+
if (t instanceof b) {
|
|
1350
|
+
this.callbacks.onError(t), this.callbacks.onLoading(!1), this.stopRefreshTimer(), this.callbacks.onUnauthorized();
|
|
1351
|
+
return;
|
|
1352
|
+
}
|
|
1353
|
+
r || (this.callbacks.onError(t instanceof Error ? t : new Error(String(t))), this.callbacks.onLoading(!1));
|
|
1354
|
+
}
|
|
1269
1355
|
// -- Timer management (private) -------------------------------------------
|
|
1270
1356
|
startRefreshTimer() {
|
|
1271
1357
|
this.stopRefreshTimer();
|
|
1272
|
-
const t = this.section === "overview" ?
|
|
1358
|
+
const t = this.section === "overview" ? Q : J;
|
|
1273
1359
|
this.timer = setInterval(() => this.fetch(!0), t);
|
|
1274
1360
|
}
|
|
1275
1361
|
stopRefreshTimer() {
|
|
1276
1362
|
this.timer && (clearInterval(this.timer), this.timer = null);
|
|
1277
1363
|
}
|
|
1278
1364
|
}
|
|
1279
|
-
const
|
|
1365
|
+
const bt = {
|
|
1280
1366
|
// ---------------------------------------------------------------------------
|
|
1281
1367
|
// Debug-panel tabs / Dashboard sidebar sections (shared)
|
|
1282
1368
|
// ---------------------------------------------------------------------------
|
|
@@ -1468,14 +1554,14 @@ const ot = {
|
|
|
1468
1554
|
viewBox: "0 0 16 16",
|
|
1469
1555
|
elements: ['<path d="M6 3H3v10h10v-3M9 1h6v6M7 9L15 1"/>']
|
|
1470
1556
|
}
|
|
1471
|
-
},
|
|
1472
|
-
function
|
|
1557
|
+
}, Me = "ss-col-resize", F = "ss-resizing";
|
|
1558
|
+
function xt(e) {
|
|
1473
1559
|
const t = Array.from(e.querySelectorAll("thead th"));
|
|
1474
1560
|
if (t.length === 0) return () => {
|
|
1475
1561
|
};
|
|
1476
1562
|
const r = [];
|
|
1477
1563
|
let n = !1;
|
|
1478
|
-
function
|
|
1564
|
+
function o() {
|
|
1479
1565
|
if (!n) {
|
|
1480
1566
|
n = !0;
|
|
1481
1567
|
for (const s of t)
|
|
@@ -1484,30 +1570,30 @@ function at(e) {
|
|
|
1484
1570
|
}
|
|
1485
1571
|
}
|
|
1486
1572
|
for (const s of t) {
|
|
1487
|
-
let
|
|
1488
|
-
|
|
1489
|
-
const
|
|
1490
|
-
|
|
1491
|
-
function
|
|
1492
|
-
const
|
|
1573
|
+
let i = function(c) {
|
|
1574
|
+
c.preventDefault(), c.stopPropagation(), o();
|
|
1575
|
+
const l = c.clientX, p = s.offsetWidth;
|
|
1576
|
+
a.classList.add(F), a.setPointerCapture(c.pointerId);
|
|
1577
|
+
function h(f) {
|
|
1578
|
+
const y = f.clientX - l, u = Math.max(30, p + y);
|
|
1493
1579
|
s.style.width = u + "px";
|
|
1494
1580
|
}
|
|
1495
|
-
function
|
|
1496
|
-
|
|
1581
|
+
function d() {
|
|
1582
|
+
a.classList.remove(F), a.removeEventListener("pointermove", h), a.removeEventListener("pointerup", d);
|
|
1497
1583
|
}
|
|
1498
|
-
|
|
1584
|
+
a.addEventListener("pointermove", h), a.addEventListener("pointerup", d);
|
|
1499
1585
|
};
|
|
1500
1586
|
if (!s.textContent?.trim()) continue;
|
|
1501
|
-
const
|
|
1502
|
-
|
|
1503
|
-
|
|
1587
|
+
const a = document.createElement("div");
|
|
1588
|
+
a.className = Me, s.appendChild(a), a.addEventListener("pointerdown", i), r.push(() => {
|
|
1589
|
+
a.removeEventListener("pointerdown", i), a.remove();
|
|
1504
1590
|
});
|
|
1505
1591
|
}
|
|
1506
1592
|
return () => {
|
|
1507
1593
|
for (const s of r) s();
|
|
1508
1594
|
};
|
|
1509
1595
|
}
|
|
1510
|
-
class
|
|
1596
|
+
class St {
|
|
1511
1597
|
client;
|
|
1512
1598
|
endpoint;
|
|
1513
1599
|
refreshInterval;
|
|
@@ -1517,10 +1603,10 @@ class lt {
|
|
|
1517
1603
|
fetchOnceCache = {};
|
|
1518
1604
|
abortController = null;
|
|
1519
1605
|
constructor(t) {
|
|
1520
|
-
this.client = new
|
|
1606
|
+
this.client = new v({
|
|
1521
1607
|
baseUrl: t.baseUrl,
|
|
1522
1608
|
authToken: t.authToken
|
|
1523
|
-
}), this.endpoint = t.endpoint ?? "/admin/api/debug", this.refreshInterval = t.refreshInterval ??
|
|
1609
|
+
}), this.endpoint = t.endpoint ?? "/admin/api/debug", this.refreshInterval = t.refreshInterval ?? Y, this.callbacks = {
|
|
1524
1610
|
onData: t.onData,
|
|
1525
1611
|
onLoading: t.onLoading,
|
|
1526
1612
|
onError: t.onError,
|
|
@@ -1574,7 +1660,7 @@ class lt {
|
|
|
1574
1660
|
const n = await this.client.fetch(t);
|
|
1575
1661
|
this.callbacks.onData(n), this.callbacks.onError(null), r && (this.fetchOnceCache[t] = n);
|
|
1576
1662
|
} catch (n) {
|
|
1577
|
-
if (n instanceof
|
|
1663
|
+
if (n instanceof b) {
|
|
1578
1664
|
this.callbacks.onUnauthorized(n);
|
|
1579
1665
|
return;
|
|
1580
1666
|
}
|
|
@@ -1602,43 +1688,48 @@ class lt {
|
|
|
1602
1688
|
// -------------------------------------------------------------------------
|
|
1603
1689
|
async fetchData() {
|
|
1604
1690
|
const t = this.currentTab;
|
|
1605
|
-
if (!t) return;
|
|
1606
|
-
if (this.fetchOnceCache[t] !== void 0) {
|
|
1607
|
-
this.callbacks.onData(this.fetchOnceCache[t]), this.callbacks.onLoading(!1);
|
|
1608
|
-
return;
|
|
1609
|
-
}
|
|
1691
|
+
if (!t || this.serveFromCache(t)) return;
|
|
1610
1692
|
this.abortController?.abort();
|
|
1611
1693
|
const r = new AbortController();
|
|
1612
1694
|
this.abortController = r;
|
|
1613
1695
|
try {
|
|
1614
|
-
const n = `${this.endpoint}${
|
|
1696
|
+
const n = `${this.endpoint}${Se(t)}`, o = await this.client.fetch(n, { signal: r.signal });
|
|
1615
1697
|
if (r.signal.aborted) return;
|
|
1616
|
-
this.callbacks.onData(
|
|
1698
|
+
this.callbacks.onData(o), this.callbacks.onError(null), this.callbacks.onLoading(!1);
|
|
1617
1699
|
} catch (n) {
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1700
|
+
this.handleFetchError(n, r);
|
|
1701
|
+
}
|
|
1702
|
+
}
|
|
1703
|
+
/** Serve cached data if available. Returns true if cache hit. */
|
|
1704
|
+
serveFromCache(t) {
|
|
1705
|
+
return this.fetchOnceCache[t] === void 0 ? !1 : (this.callbacks.onData(this.fetchOnceCache[t]), this.callbacks.onLoading(!1), !0);
|
|
1706
|
+
}
|
|
1707
|
+
/** Handle errors from fetchData. */
|
|
1708
|
+
handleFetchError(t, r) {
|
|
1709
|
+
if (!(t instanceof DOMException && t.name === "AbortError") && !r.signal.aborted) {
|
|
1710
|
+
if (t instanceof b) {
|
|
1711
|
+
this.callbacks.onError(t), this.callbacks.onLoading(!1), this.stop(), this.callbacks.onUnauthorized(t);
|
|
1621
1712
|
return;
|
|
1622
1713
|
}
|
|
1623
|
-
this.callbacks.onError(
|
|
1714
|
+
this.callbacks.onError(t instanceof Error ? t : new Error(String(t))), this.callbacks.onLoading(!1);
|
|
1624
1715
|
}
|
|
1625
1716
|
}
|
|
1626
1717
|
}
|
|
1627
|
-
const
|
|
1628
|
-
function
|
|
1718
|
+
const wt = ["all", "error", "warn", "info", "debug"];
|
|
1719
|
+
function Pe(e) {
|
|
1629
1720
|
return (e.levelName || e.level_name || (typeof e.level == "string" ? e.level : "") || "info").toLowerCase();
|
|
1630
1721
|
}
|
|
1631
|
-
function
|
|
1722
|
+
function vt(e) {
|
|
1632
1723
|
return e.msg || e.message || JSON.stringify(e);
|
|
1633
1724
|
}
|
|
1634
|
-
function
|
|
1725
|
+
function Et(e) {
|
|
1635
1726
|
return e.createdAt || e.created_at || e.time || e.timestamp || 0;
|
|
1636
1727
|
}
|
|
1637
|
-
function
|
|
1728
|
+
function Tt(e) {
|
|
1638
1729
|
const t = e.data || {};
|
|
1639
1730
|
return e.requestId || e.request_id || e["x-request-id"] || t.requestId || t.request_id || t["x-request-id"] || "";
|
|
1640
1731
|
}
|
|
1641
|
-
function
|
|
1732
|
+
function Ct(e, t = "ss-dbg-log-level") {
|
|
1642
1733
|
switch (e) {
|
|
1643
1734
|
case "error":
|
|
1644
1735
|
case "fatal":
|
|
@@ -1655,30 +1746,30 @@ function ft(e, t = "ss-dbg-log-level") {
|
|
|
1655
1746
|
return `${t}-info`;
|
|
1656
1747
|
}
|
|
1657
1748
|
}
|
|
1658
|
-
function
|
|
1749
|
+
function kt(e, t) {
|
|
1659
1750
|
return t === "all" ? e : e.filter((r) => {
|
|
1660
|
-
const n =
|
|
1751
|
+
const n = Pe(r);
|
|
1661
1752
|
return t === "error" ? n === "error" || n === "fatal" : n === t;
|
|
1662
1753
|
});
|
|
1663
1754
|
}
|
|
1664
|
-
function
|
|
1755
|
+
function Mt(e, t) {
|
|
1665
1756
|
if (!t) return e;
|
|
1666
1757
|
const r = t.toLowerCase();
|
|
1667
1758
|
return e.filter(
|
|
1668
1759
|
(n) => n.sql.toLowerCase().includes(r) || n.model && n.model.toLowerCase().includes(r) || n.method.toLowerCase().includes(r)
|
|
1669
1760
|
);
|
|
1670
1761
|
}
|
|
1671
|
-
function
|
|
1762
|
+
function Pt(e) {
|
|
1672
1763
|
const t = {};
|
|
1673
1764
|
for (const r of e)
|
|
1674
1765
|
t[r.sql] = (t[r.sql] || 0) + 1;
|
|
1675
1766
|
return t;
|
|
1676
1767
|
}
|
|
1677
|
-
function
|
|
1678
|
-
const r = e.filter((s) => s.duration > 100).length, n = Object.values(t).filter((s) => s > 1).length,
|
|
1679
|
-
return { slowCount: r, dupCount: n, avgDuration:
|
|
1768
|
+
function $t(e, t) {
|
|
1769
|
+
const r = e.filter((s) => s.duration > 100).length, n = Object.values(t).filter((s) => s > 1).length, o = e.length > 0 ? e.reduce((s, i) => s + i.duration, 0) / e.length : 0;
|
|
1770
|
+
return { slowCount: r, dupCount: n, avgDuration: o, totalCount: e.length };
|
|
1680
1771
|
}
|
|
1681
|
-
const
|
|
1772
|
+
const At = [
|
|
1682
1773
|
"all",
|
|
1683
1774
|
"active",
|
|
1684
1775
|
"waiting",
|
|
@@ -1686,7 +1777,7 @@ const bt = [
|
|
|
1686
1777
|
"completed",
|
|
1687
1778
|
"failed"
|
|
1688
1779
|
];
|
|
1689
|
-
function
|
|
1780
|
+
function Rt(e, t = "ss-dbg-job-status") {
|
|
1690
1781
|
switch (e) {
|
|
1691
1782
|
case "completed":
|
|
1692
1783
|
case "failed":
|
|
@@ -1698,7 +1789,7 @@ function xt(e, t = "ss-dbg-job-status") {
|
|
|
1698
1789
|
return "ss-dbg-badge-muted";
|
|
1699
1790
|
}
|
|
1700
1791
|
}
|
|
1701
|
-
function
|
|
1792
|
+
function Lt(e) {
|
|
1702
1793
|
switch (e) {
|
|
1703
1794
|
case "active":
|
|
1704
1795
|
return "blue";
|
|
@@ -1714,18 +1805,18 @@ function wt(e) {
|
|
|
1714
1805
|
return "muted";
|
|
1715
1806
|
}
|
|
1716
1807
|
}
|
|
1717
|
-
function
|
|
1808
|
+
function Ft(e) {
|
|
1718
1809
|
if (!e) return [];
|
|
1719
1810
|
if (Array.isArray(e)) return e;
|
|
1720
1811
|
const t = e;
|
|
1721
1812
|
return t.jobs || t.data || [];
|
|
1722
1813
|
}
|
|
1723
|
-
function
|
|
1814
|
+
function Ut(e) {
|
|
1724
1815
|
if (!e || Array.isArray(e)) return null;
|
|
1725
1816
|
const t = e;
|
|
1726
1817
|
return t.stats || t.overview || null;
|
|
1727
1818
|
}
|
|
1728
|
-
function
|
|
1819
|
+
function $e(e) {
|
|
1729
1820
|
if (!e) return [];
|
|
1730
1821
|
if (typeof e == "string")
|
|
1731
1822
|
try {
|
|
@@ -1735,7 +1826,7 @@ function ye(e) {
|
|
|
1735
1826
|
}
|
|
1736
1827
|
return Array.isArray(e) ? e : [];
|
|
1737
1828
|
}
|
|
1738
|
-
function
|
|
1829
|
+
function Ae(e) {
|
|
1739
1830
|
if (!e) return [];
|
|
1740
1831
|
if (typeof e == "string")
|
|
1741
1832
|
try {
|
|
@@ -1748,25 +1839,25 @@ function be(e) {
|
|
|
1748
1839
|
function C(e, t, r, n = 0) {
|
|
1749
1840
|
return e[t] ?? e[r] ?? n;
|
|
1750
1841
|
}
|
|
1751
|
-
function
|
|
1842
|
+
function Dt(e) {
|
|
1752
1843
|
return {
|
|
1753
1844
|
method: e.method || "",
|
|
1754
1845
|
url: e.url || "",
|
|
1755
1846
|
statusCode: C(e, "status_code", "statusCode"),
|
|
1756
1847
|
totalDuration: C(e, "total_duration", "totalDuration") || e.duration || 0,
|
|
1757
1848
|
spanCount: C(e, "span_count", "spanCount"),
|
|
1758
|
-
spans:
|
|
1759
|
-
warnings:
|
|
1849
|
+
spans: $e(e.spans),
|
|
1850
|
+
warnings: Ae(e.warnings),
|
|
1760
1851
|
logs: e.logs || [],
|
|
1761
1852
|
httpRequestId: e.httpRequestId || e.http_request_id || void 0
|
|
1762
1853
|
};
|
|
1763
1854
|
}
|
|
1764
|
-
const
|
|
1765
|
-
function
|
|
1855
|
+
const Re = ["password", "secret", "token", "key", "credential", "auth"];
|
|
1856
|
+
function Le(e) {
|
|
1766
1857
|
const t = e.toLowerCase();
|
|
1767
|
-
return
|
|
1858
|
+
return Re.some((r) => t.includes(r));
|
|
1768
1859
|
}
|
|
1769
|
-
function
|
|
1860
|
+
function Fe(e) {
|
|
1770
1861
|
if (e == null) return "-";
|
|
1771
1862
|
if (typeof e == "string" || typeof e == "number" || typeof e == "boolean")
|
|
1772
1863
|
return String(e);
|
|
@@ -1777,89 +1868,87 @@ function Se(e) {
|
|
|
1777
1868
|
return String(e);
|
|
1778
1869
|
}
|
|
1779
1870
|
}
|
|
1780
|
-
const
|
|
1871
|
+
const Ue = {
|
|
1781
1872
|
collectionInterval: "Stats Collection",
|
|
1782
1873
|
dashboardBroadcast: "Dashboard Broadcast",
|
|
1783
1874
|
debugBroadcast: "Debug Broadcast",
|
|
1784
1875
|
persistFlush: "Persist Flush",
|
|
1785
1876
|
retentionCleanup: "Retention Cleanup"
|
|
1786
1877
|
};
|
|
1787
|
-
function
|
|
1788
|
-
return
|
|
1878
|
+
function Ot(e) {
|
|
1879
|
+
return Ue[e] || e;
|
|
1789
1880
|
}
|
|
1790
|
-
const
|
|
1881
|
+
const De = {
|
|
1791
1882
|
prometheus: "Prometheus",
|
|
1792
1883
|
pinoHook: "Pino Log Hook",
|
|
1793
1884
|
edgePlugin: "Edge Plugin",
|
|
1794
1885
|
cacheInspector: "Cache Inspector",
|
|
1795
1886
|
queueInspector: "Queue Inspector"
|
|
1796
1887
|
};
|
|
1797
|
-
function
|
|
1798
|
-
return
|
|
1888
|
+
function It(e) {
|
|
1889
|
+
return De[e] || e;
|
|
1799
1890
|
}
|
|
1800
|
-
function
|
|
1891
|
+
function _t(e) {
|
|
1801
1892
|
return "active" in e ? e.active ? "active" : "inactive" : "available" in e ? e.available ? "available" : "unavailable" : "unknown";
|
|
1802
1893
|
}
|
|
1803
|
-
function
|
|
1894
|
+
function Bt(e, t) {
|
|
1804
1895
|
return t.mode ? `Mode: ${t.mode}` : e === "edgePlugin" && t.active ? "@serverStats() tag registered" : e === "cacheInspector" ? t.available ? "Redis dependency detected" : "Redis not installed" : e === "queueInspector" ? t.available ? "Queue dependency detected" : "@rlanz/bull-queue not installed" : "-";
|
|
1805
1896
|
}
|
|
1806
|
-
function
|
|
1897
|
+
function Ht(e) {
|
|
1807
1898
|
return Object.entries(e).map(([t, r]) => ({
|
|
1808
1899
|
key: t,
|
|
1809
|
-
value:
|
|
1810
|
-
secret:
|
|
1900
|
+
value: Fe(r),
|
|
1901
|
+
secret: Le(t)
|
|
1811
1902
|
}));
|
|
1812
1903
|
}
|
|
1813
|
-
function
|
|
1904
|
+
function Nt(e, t) {
|
|
1814
1905
|
return t ? Math.min(100, Math.round(e / t * 100)) : 0;
|
|
1815
1906
|
}
|
|
1816
|
-
const
|
|
1817
|
-
function
|
|
1818
|
-
return
|
|
1907
|
+
const Oe = ["healthy", "active", "connected", "available", "ready"], Ie = ["errored", "unavailable"];
|
|
1908
|
+
function qt(e) {
|
|
1909
|
+
return Oe.includes(e) ? "ok" : Ie.includes(e) ? "err" : "";
|
|
1819
1910
|
}
|
|
1820
|
-
function
|
|
1911
|
+
function $(e) {
|
|
1821
1912
|
return e !== null && typeof e == "object" && !Array.isArray(e) && e.__redacted === !0;
|
|
1822
1913
|
}
|
|
1823
|
-
function
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1914
|
+
function w(e) {
|
|
1915
|
+
return e != null && typeof e == "object" && !Array.isArray(e) && !$(e);
|
|
1916
|
+
}
|
|
1917
|
+
function _e(e, t = "") {
|
|
1918
|
+
if (!w(e))
|
|
1827
1919
|
return [{ path: t, value: e }];
|
|
1828
1920
|
const r = [];
|
|
1829
1921
|
for (const n of Object.keys(e)) {
|
|
1830
|
-
const
|
|
1831
|
-
|
|
1922
|
+
const o = t ? `${t}.${n}` : n, s = e[n];
|
|
1923
|
+
w(s) ? r.push(..._e(s, o)) : r.push({ path: o, value: s });
|
|
1832
1924
|
}
|
|
1833
1925
|
return r;
|
|
1834
1926
|
}
|
|
1835
|
-
function
|
|
1927
|
+
function Kt(e) {
|
|
1836
1928
|
return e == null ? { text: "null", color: "var(--ss-dim)" } : typeof e == "boolean" ? {
|
|
1837
1929
|
text: String(e),
|
|
1838
1930
|
color: e ? "var(--ss-green-fg)" : "var(--ss-red-fg)"
|
|
1839
1931
|
} : typeof e == "number" ? { text: String(e), color: "var(--ss-amber-fg)" } : Array.isArray(e) ? { text: `[${e.map((r) => r == null ? "null" : typeof r == "object" ? JSON.stringify(r) : String(r)).join(", ")}]`, color: "var(--ss-purple-fg)" } : typeof e == "object" ? { text: JSON.stringify(e), color: "var(--ss-dim)" } : { text: String(e) };
|
|
1840
1932
|
}
|
|
1841
|
-
function
|
|
1842
|
-
if (e == null || typeof e != "object" || Array.isArray(e) ||
|
|
1933
|
+
function Be(e) {
|
|
1934
|
+
if (e == null || typeof e != "object" || Array.isArray(e) || $(e))
|
|
1843
1935
|
return 1;
|
|
1844
1936
|
let t = 0;
|
|
1845
1937
|
for (const r of Object.keys(e))
|
|
1846
|
-
t +=
|
|
1938
|
+
t += Be(e[r]);
|
|
1847
1939
|
return t;
|
|
1848
1940
|
}
|
|
1849
|
-
function
|
|
1850
|
-
if (
|
|
1851
|
-
return [];
|
|
1941
|
+
function zt(e) {
|
|
1942
|
+
if (!w(e)) return [];
|
|
1852
1943
|
const t = [];
|
|
1853
|
-
for (const r of Object.keys(e))
|
|
1854
|
-
|
|
1855
|
-
n !== null && typeof n == "object" && !Array.isArray(n) && !b(n) && t.push(r);
|
|
1856
|
-
}
|
|
1944
|
+
for (const r of Object.keys(e))
|
|
1945
|
+
w(e[r]) && t.push(r);
|
|
1857
1946
|
return t;
|
|
1858
1947
|
}
|
|
1859
|
-
function
|
|
1860
|
-
return !r || e.toLowerCase().includes(r) ? !0 : (
|
|
1948
|
+
function jt(e, t, r) {
|
|
1949
|
+
return !r || e.toLowerCase().includes(r) ? !0 : ($(t) ? t.display : t == null ? "" : String(t)).toLowerCase().includes(r);
|
|
1861
1950
|
}
|
|
1862
|
-
function
|
|
1951
|
+
function Vt(e, t, r) {
|
|
1863
1952
|
t && navigator.clipboard.writeText(e).then(() => {
|
|
1864
1953
|
const n = t.textContent;
|
|
1865
1954
|
t.textContent = "✓", t.classList.add(`${r}-copy-row-ok`), setTimeout(() => {
|
|
@@ -1868,7 +1957,7 @@ function Dt(e, t, r) {
|
|
|
1868
1957
|
}).catch(() => {
|
|
1869
1958
|
});
|
|
1870
1959
|
}
|
|
1871
|
-
const
|
|
1960
|
+
const He = /* @__PURE__ */ new Set([
|
|
1872
1961
|
"secret",
|
|
1873
1962
|
"key",
|
|
1874
1963
|
"token",
|
|
@@ -1882,128 +1971,129 @@ const ke = /* @__PURE__ */ new Set([
|
|
|
1882
1971
|
"private",
|
|
1883
1972
|
"encryption"
|
|
1884
1973
|
]);
|
|
1885
|
-
function
|
|
1974
|
+
function Ne(e) {
|
|
1886
1975
|
const t = e.split(/[._-]/), r = [];
|
|
1887
1976
|
for (const n of t) {
|
|
1888
|
-
const
|
|
1889
|
-
for (const s of
|
|
1977
|
+
const o = n.split(new RegExp("(?<=[a-z])(?=[A-Z])"));
|
|
1978
|
+
for (const s of o)
|
|
1890
1979
|
s && r.push(s);
|
|
1891
1980
|
}
|
|
1892
1981
|
return r;
|
|
1893
1982
|
}
|
|
1894
|
-
function
|
|
1895
|
-
return
|
|
1983
|
+
function Wt(e) {
|
|
1984
|
+
return Ne(e).some((r) => He.has(r.toLowerCase()));
|
|
1896
1985
|
}
|
|
1897
|
-
const
|
|
1986
|
+
const Gt = new RegExp("secret|password|pass(?:word)?|pwd|token|(?:^|[._-])key(?:[._-]|$)|(?<=[a-z])Key|apikey|api_key|auth|credential|private|encryption", "i");
|
|
1898
1987
|
export {
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1988
|
+
v as ApiClient,
|
|
1989
|
+
B as ApiError,
|
|
1990
|
+
we as DASHBOARD_SECTION_PATHS,
|
|
1991
|
+
Y as DEBUG_REFRESH_MS,
|
|
1992
|
+
xe as DEBUG_TAB_PATHS,
|
|
1993
|
+
ge as DEFAULT_FEATURES,
|
|
1994
|
+
O as DEFAULT_PER_PAGE,
|
|
1995
|
+
Te as DashboardApi,
|
|
1996
|
+
yt as DashboardDataController,
|
|
1997
|
+
St as DebugDataController,
|
|
1998
|
+
Ie as ERROR_STATUSES,
|
|
1999
|
+
De as INTEGRATION_LABELS,
|
|
2000
|
+
At as JOB_STATUS_FILTERS,
|
|
2001
|
+
wt as LOG_LEVELS,
|
|
2002
|
+
ee as MAX_HISTORY,
|
|
2003
|
+
P as METRIC_DEFINITIONS,
|
|
2004
|
+
Oe as OK_STATUSES,
|
|
2005
|
+
Q as OVERVIEW_REFRESH_MS,
|
|
2006
|
+
Gt as REDACT_PATTERN,
|
|
2007
|
+
J as SECTION_REFRESH_MS,
|
|
2008
|
+
X as SLOW_DURATION_MS,
|
|
2009
|
+
te as STALE_MS,
|
|
2010
|
+
mt as ServerStatsController,
|
|
2011
|
+
bt as TAB_ICONS,
|
|
2012
|
+
ce as THRESHOLD_CSS_CLASS,
|
|
2013
|
+
Xe as THRESHOLD_CSS_VAR,
|
|
2014
|
+
Ye as THRESHOLD_HEX_FALLBACK,
|
|
2015
|
+
Ue as TIMER_LABELS,
|
|
2016
|
+
b as UnauthorizedError,
|
|
2017
|
+
Z as VERY_SLOW_DURATION_MS,
|
|
2018
|
+
he as buildQueryParams,
|
|
2019
|
+
st as buildQueryString,
|
|
2020
|
+
Ve as buildSparklineData,
|
|
2021
|
+
qt as classifyStatus,
|
|
2022
|
+
zt as collectTopLevelObjectKeys,
|
|
1934
2023
|
L as compactPreview,
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
2024
|
+
lt as computePagination,
|
|
2025
|
+
$t as computeQuerySummary,
|
|
2026
|
+
G as computeStats,
|
|
2027
|
+
Vt as copyWithFeedback,
|
|
2028
|
+
Pt as countDuplicateQueries,
|
|
2029
|
+
Be as countLeaves,
|
|
2030
|
+
at as createFilterState,
|
|
2031
|
+
Ee as createHistoryBuffer,
|
|
2032
|
+
it as createPaginationState,
|
|
2033
|
+
ct as createSortState,
|
|
2034
|
+
q as createTransmitSubscription,
|
|
2035
|
+
ht as detectFeatures,
|
|
2036
|
+
ft as detectMetricGroupsFromStats,
|
|
2037
|
+
et as durationClassName,
|
|
2038
|
+
le as durationSeverity,
|
|
2039
|
+
Ut as extractJobStats,
|
|
2040
|
+
Ft as extractJobs,
|
|
2041
|
+
ye as fetchFeatures,
|
|
2042
|
+
Nt as fillPercent,
|
|
2043
|
+
kt as filterLogsByLevel,
|
|
2044
|
+
Mt as filterQueries,
|
|
2045
|
+
_e as flattenConfig,
|
|
2046
|
+
M as formatBytes,
|
|
2047
|
+
nt as formatCacheSize,
|
|
2048
|
+
Ht as formatCollectorConfig,
|
|
2049
|
+
Fe as formatConfigVal,
|
|
2050
|
+
ie as formatCount,
|
|
2051
|
+
We as formatDuration,
|
|
2052
|
+
Kt as formatFlatValue,
|
|
2053
|
+
A as formatMb,
|
|
2054
|
+
Je as formatStatNum,
|
|
2055
|
+
Ge as formatTime,
|
|
2056
|
+
rt as formatTtl,
|
|
2057
|
+
oe as formatUptime,
|
|
1968
2058
|
W as generateGradientId,
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
2059
|
+
je as generateSparklinePath,
|
|
2060
|
+
ze as generateSparklinePoints,
|
|
2061
|
+
ve as getDashboardSectionPath,
|
|
2062
|
+
Se as getDebugTabPath,
|
|
2063
|
+
Bt as getIntegrationDetails,
|
|
2064
|
+
It as getIntegrationLabel,
|
|
2065
|
+
_t as getIntegrationStatus,
|
|
2066
|
+
Lt as getJobStatusBadgeColor,
|
|
2067
|
+
Rt as getJobStatusCssClass,
|
|
2068
|
+
Ct as getLogLevelCssClass,
|
|
2069
|
+
pt as getMetricById,
|
|
2070
|
+
gt as getMetricsByGroup,
|
|
2071
|
+
ut as getPageNumbers,
|
|
2072
|
+
R as getRatioColor,
|
|
1983
2073
|
U as getTheme,
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2074
|
+
x as getThresholdColor,
|
|
2075
|
+
ae as getThresholdColorInverse,
|
|
2076
|
+
Ot as getTimerLabel,
|
|
2077
|
+
dt as getVisibleMetricGroups,
|
|
2078
|
+
xt as initResizableColumns,
|
|
2079
|
+
$ as isRedactedValue,
|
|
2080
|
+
Le as isSecretKey,
|
|
2081
|
+
jt as matchesConfigSearch,
|
|
2082
|
+
Dt as normalizeTraceFields,
|
|
2083
|
+
Ke as onThemeChange,
|
|
2084
|
+
ot as parsePaginatedResponse,
|
|
2085
|
+
$e as parseTraceSpans,
|
|
2086
|
+
Ae as parseTraceWarnings,
|
|
2087
|
+
Pe as resolveLogLevel,
|
|
2088
|
+
vt as resolveLogMessage,
|
|
2089
|
+
Tt as resolveLogRequestId,
|
|
2090
|
+
Et as resolveLogTimestamp,
|
|
2001
2091
|
C as resolveTraceField,
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2092
|
+
z as setTheme,
|
|
2093
|
+
tt as shortReqId,
|
|
2094
|
+
Wt as shouldRedact,
|
|
2095
|
+
Ze as statusColor,
|
|
2096
|
+
K as subscribeToChannel,
|
|
2097
|
+
Qe as timeAgo,
|
|
2098
|
+
qe as toggleTheme
|
|
2009
2099
|
};
|