rigscope 0.1.5 → 0.1.7
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/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +4 -4
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +6 -6
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +2 -2
- package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/administration/page.js +1 -1
- package/.next/server/app/administration/page.js.nft.json +1 -1
- package/.next/server/app/administration/page_client-reference-manifest.js +1 -1
- package/.next/server/app/administration.html +1 -1
- package/.next/server/app/administration.rsc +6 -6
- package/.next/server/app/administration.segments/_full.segment.rsc +6 -6
- package/.next/server/app/administration.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/administration.segments/administration/__PAGE__.segment.rsc +6 -6
- package/.next/server/app/alerts/page.js +1 -1
- package/.next/server/app/alerts/page.js.nft.json +1 -1
- package/.next/server/app/alerts/page_client-reference-manifest.js +1 -1
- package/.next/server/app/alerts.html +1 -1
- package/.next/server/app/alerts.rsc +6 -6
- package/.next/server/app/alerts.segments/_full.segment.rsc +6 -6
- package/.next/server/app/alerts.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/alerts.segments/alerts/__PAGE__.segment.rsc +6 -6
- package/.next/server/app/connections/page.js +1 -1
- package/.next/server/app/connections/page.js.nft.json +1 -1
- package/.next/server/app/connections/page_client-reference-manifest.js +1 -1
- package/.next/server/app/connections.html +1 -1
- package/.next/server/app/connections.rsc +6 -6
- package/.next/server/app/connections.segments/_full.segment.rsc +6 -6
- package/.next/server/app/connections.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/connections.segments/connections/__PAGE__.segment.rsc +6 -6
- package/.next/server/app/history/page.js +2 -2
- package/.next/server/app/history/page.js.nft.json +1 -1
- package/.next/server/app/history/page_client-reference-manifest.js +1 -1
- package/.next/server/app/history.html +1 -1
- package/.next/server/app/history.rsc +26 -22
- package/.next/server/app/history.segments/_full.segment.rsc +26 -22
- package/.next/server/app/history.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/history.segments/history/__PAGE__.segment.rsc +23 -20
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +6 -6
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +6 -6
- package/.next/server/app/index.segments/_full.segment.rsc +6 -6
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login.html +1 -1
- package/.next/server/app/login.rsc +2 -2
- package/.next/server/app/login.segments/_full.segment.rsc +2 -2
- package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/machines/[machineId]/page.js +1 -1
- package/.next/server/app/machines/[machineId]/page.js.nft.json +1 -1
- package/.next/server/app/machines/[machineId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js +1 -1
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/processes/page.js +2 -2
- package/.next/server/app/processes/page.js.nft.json +1 -1
- package/.next/server/app/processes/page_client-reference-manifest.js +1 -1
- package/.next/server/app/processes.html +1 -1
- package/.next/server/app/processes.rsc +21 -19
- package/.next/server/app/processes.segments/_full.segment.rsc +21 -19
- package/.next/server/app/processes.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/processes.segments/processes/__PAGE__.segment.rsc +21 -19
- package/.next/server/app-paths-manifest.json +4 -4
- package/.next/server/chunks/168.js +1 -1
- package/.next/server/chunks/350.js +1 -0
- package/.next/server/chunks/751.js +1 -1
- package/.next/server/chunks/894.js +2 -2
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/static/chunks/103-976549d31902404e.js +1 -0
- package/.next/static/chunks/408-9fdba9e4e956ef08.js +1 -0
- package/.next/static/chunks/944-a7fe1d96f1d20531.js +1 -0
- package/.next/static/chunks/app/administration/page-b62f6610cda5381f.js +1 -0
- package/.next/static/chunks/app/alerts/{page-2548b2ab0c057953.js → page-3445bc100ee03d4e.js} +1 -1
- package/.next/static/chunks/app/connections/{page-07113bf16cb352e7.js → page-75abd16fc495fcbd.js} +1 -1
- package/.next/static/chunks/app/history/page-a25ba8fab7bd7cb9.js +3 -0
- package/.next/static/chunks/app/machines/[machineId]/{page-0b89e4393a137c4d.js → page-89143e71c34b542b.js} +1 -1
- package/.next/static/chunks/app/{page-c68554c93016dd13.js → page-9c9c89166eee4c92.js} +1 -1
- package/.next/static/chunks/app/processes/page-3fdebd2f98b52044.js +3 -0
- package/.next/static/css/f5d3162842dcac31.css +1 -0
- package/CHANGELOG.md +21 -0
- package/dist/collector.cjs +1 -1
- package/dist/hub.cjs +45 -15
- package/dist/ops.cjs +44 -14
- package/docs/installation.md +3 -3
- package/docs/releasing.md +12 -12
- package/package.json +1 -1
- package/.next/server/chunks/721.js +0 -1
- package/.next/static/chunks/103-13ec30dcc059b9d3.js +0 -1
- package/.next/static/chunks/157-0d36ebf66af048ac.js +0 -1
- package/.next/static/chunks/408-29f55984738967db.js +0 -1
- package/.next/static/chunks/app/administration/page-4b16b19bb6a39c36.js +0 -1
- package/.next/static/chunks/app/history/page-69ea64476ee5db85.js +0 -3
- package/.next/static/chunks/app/processes/page-b6d97d119f10e2a1.js +0 -3
- package/.next/static/css/fb3ad9534f4681e6.css +0 -1
- /package/.next/static/{oxwySrJXqXq8O6_7AzZGe → 9SHY6v87ulfunqR2e84n9}/_buildManifest.js +0 -0
- /package/.next/static/{oxwySrJXqXq8O6_7AzZGe → 9SHY6v87ulfunqR2e84n9}/_ssgManifest.js +0 -0
package/dist/hub.cjs
CHANGED
|
@@ -1741,7 +1741,7 @@ function describeError(error) {
|
|
|
1741
1741
|
// package.json
|
|
1742
1742
|
var package_default = {
|
|
1743
1743
|
name: "rigscope",
|
|
1744
|
-
version: "0.1.
|
|
1744
|
+
version: "0.1.7",
|
|
1745
1745
|
private: false,
|
|
1746
1746
|
engines: {
|
|
1747
1747
|
node: ">=26.0.0"
|
|
@@ -1888,6 +1888,11 @@ function resolveRetentionPolicy(partial) {
|
|
|
1888
1888
|
gapsMs: checkedMs(partial?.gapsMs, gapsDefault, "gapsMs")
|
|
1889
1889
|
};
|
|
1890
1890
|
}
|
|
1891
|
+
var RETENTION_DELETE_SQL = {
|
|
1892
|
+
raw: "DELETE FROM points_raw WHERE (series_id, ts_ms) IN (SELECT series_id, ts_ms FROM points_raw WHERE series_id = ? AND ts_ms < ? LIMIT ?)",
|
|
1893
|
+
oneMinute: "DELETE FROM points_1m WHERE (series_id, bucket_ms) IN (SELECT series_id, bucket_ms FROM points_1m WHERE series_id = ? AND bucket_ms < ? LIMIT ?)",
|
|
1894
|
+
oneHour: "DELETE FROM points_1h WHERE (series_id, bucket_ms) IN (SELECT series_id, bucket_ms FROM points_1h WHERE series_id = ? AND bucket_ms < ? LIMIT ?)"
|
|
1895
|
+
};
|
|
1891
1896
|
var RetentionManager = class {
|
|
1892
1897
|
policy;
|
|
1893
1898
|
db;
|
|
@@ -1915,6 +1920,7 @@ var RetentionManager = class {
|
|
|
1915
1920
|
delete1h;
|
|
1916
1921
|
deleteReceipts;
|
|
1917
1922
|
deleteGaps;
|
|
1923
|
+
selectSeriesIds;
|
|
1918
1924
|
constructor(database, options = {}) {
|
|
1919
1925
|
this.db = database;
|
|
1920
1926
|
this.policy = resolveRetentionPolicy(options.policy);
|
|
@@ -1937,21 +1943,16 @@ var RetentionManager = class {
|
|
|
1937
1943
|
this.intervalMs = positiveInt(options.intervalMs, 6e4, "intervalMs");
|
|
1938
1944
|
this.chunkSize = positiveInt(options.chunkSize, 5e3, "chunkSize");
|
|
1939
1945
|
this.maxChunksPerPass = positiveInt(options.maxChunksPerPass, 1e4, "maxChunksPerPass");
|
|
1940
|
-
this.deleteRaw = database.db.prepare(
|
|
1941
|
-
|
|
1942
|
-
);
|
|
1943
|
-
this.delete1m = database.db.prepare(
|
|
1944
|
-
"DELETE FROM points_1m WHERE (series_id, bucket_ms) IN (SELECT series_id, bucket_ms FROM points_1m WHERE bucket_ms < ? LIMIT ?)"
|
|
1945
|
-
);
|
|
1946
|
-
this.delete1h = database.db.prepare(
|
|
1947
|
-
"DELETE FROM points_1h WHERE (series_id, bucket_ms) IN (SELECT series_id, bucket_ms FROM points_1h WHERE bucket_ms < ? LIMIT ?)"
|
|
1948
|
-
);
|
|
1946
|
+
this.deleteRaw = database.db.prepare(RETENTION_DELETE_SQL.raw);
|
|
1947
|
+
this.delete1m = database.db.prepare(RETENTION_DELETE_SQL.oneMinute);
|
|
1948
|
+
this.delete1h = database.db.prepare(RETENTION_DELETE_SQL.oneHour);
|
|
1949
1949
|
this.deleteReceipts = database.db.prepare(
|
|
1950
1950
|
"DELETE FROM sample_receipts WHERE (collector_id, run_id, seq) IN (SELECT collector_id, run_id, seq FROM sample_receipts WHERE captured_at_ms < ? LIMIT ?)"
|
|
1951
1951
|
);
|
|
1952
1952
|
this.deleteGaps = database.db.prepare(
|
|
1953
1953
|
"DELETE FROM gaps WHERE (collector_id, run_id, seq) IN (SELECT collector_id, run_id, seq FROM gaps WHERE to_ms < ? LIMIT ?)"
|
|
1954
1954
|
);
|
|
1955
|
+
this.selectSeriesIds = database.db.prepare("SELECT series_id FROM series");
|
|
1955
1956
|
this.refreshPhysicalState();
|
|
1956
1957
|
}
|
|
1957
1958
|
start() {
|
|
@@ -1999,20 +2000,29 @@ var RetentionManager = class {
|
|
|
1999
2000
|
return deleted;
|
|
2000
2001
|
}
|
|
2001
2002
|
/**
|
|
2002
|
-
* One bounded DELETE statement (or a cheap probe when nothing is
|
|
2003
|
-
* Returns the number of rows deleted, at most `chunkSize`.
|
|
2003
|
+
* One bounded DELETE statement per tier (or a cheap probe when nothing is
|
|
2004
|
+
* expired). Returns the number of rows deleted, at most `chunkSize`.
|
|
2004
2005
|
*/
|
|
2005
2006
|
runChunk() {
|
|
2006
2007
|
const started = performance.now();
|
|
2007
2008
|
const nowMs = this.now();
|
|
2008
2009
|
const rawCutoff = nowMs - this.policy.rawMs;
|
|
2009
|
-
|
|
2010
|
+
const seriesIds = this.seriesIds();
|
|
2011
|
+
let deleted = this.deleteTierChunk(this.deleteRaw, seriesIds, rawCutoff);
|
|
2012
|
+
if (deleted === 0) {
|
|
2013
|
+
deleted = this.deleteTierChunk(this.delete1m, seriesIds, nowMs - this.policy.oneMinuteMs);
|
|
2014
|
+
}
|
|
2015
|
+
if (deleted === 0) {
|
|
2016
|
+
deleted = this.deleteTierChunk(this.delete1h, seriesIds, nowMs - this.policy.oneHourMs);
|
|
2017
|
+
}
|
|
2018
|
+
if (deleted === 0) deleted = this.deleteUpTo(this.deleteReceipts, nowMs - this.policy.receiptsMs);
|
|
2019
|
+
if (deleted === 0) deleted = this.deleteUpTo(this.deleteGaps, nowMs - this.policy.gapsMs);
|
|
2010
2020
|
let effectiveRawCutoff = rawCutoff;
|
|
2011
2021
|
if (deleted === 0 && this.overBudget()) {
|
|
2012
2022
|
const floorCutoff = nowMs - HOUR_MS;
|
|
2013
2023
|
effectiveRawCutoff = Math.max(rawCutoff, floorCutoff);
|
|
2014
|
-
deleted = this.
|
|
2015
|
-
if (deleted === 0) deleted = this.
|
|
2024
|
+
deleted = this.deleteTierChunk(this.deleteRaw, seriesIds, effectiveRawCutoff);
|
|
2025
|
+
if (deleted === 0) deleted = this.deleteTierChunk(this.delete1m, seriesIds, floorCutoff);
|
|
2016
2026
|
if (deleted > 0) {
|
|
2017
2027
|
this.db.reclaimPages(64);
|
|
2018
2028
|
try {
|
|
@@ -2041,6 +2051,26 @@ var RetentionManager = class {
|
|
|
2041
2051
|
await yieldToEventLoop();
|
|
2042
2052
|
}
|
|
2043
2053
|
}
|
|
2054
|
+
/**
|
|
2055
|
+
* Deletes up to `chunkSize` rows older than `cutoffMs`, one series at a
|
|
2056
|
+
* time. Each statement is a primary-key range seek bounded by the remaining
|
|
2057
|
+
* row budget, so a series with no expired rows costs one seek rather than a
|
|
2058
|
+
* table scan. The series catalog is append-only and ingestion is its only
|
|
2059
|
+
* writer, so every stored point has a catalog row.
|
|
2060
|
+
*/
|
|
2061
|
+
deleteTierChunk(statement, seriesIds, cutoffMs) {
|
|
2062
|
+
let deleted = 0;
|
|
2063
|
+
for (const seriesId of seriesIds) {
|
|
2064
|
+
const remaining = this.chunkSize - deleted;
|
|
2065
|
+
if (remaining <= 0) break;
|
|
2066
|
+
deleted += Number(statement.run(seriesId, cutoffMs, remaining).changes);
|
|
2067
|
+
}
|
|
2068
|
+
return deleted;
|
|
2069
|
+
}
|
|
2070
|
+
seriesIds() {
|
|
2071
|
+
const rows = this.selectSeriesIds.all();
|
|
2072
|
+
return rows.map((row) => Number(row.series_id));
|
|
2073
|
+
}
|
|
2044
2074
|
deleteUpTo(statement, cutoffMs) {
|
|
2045
2075
|
const result = statement.run(cutoffMs, this.chunkSize);
|
|
2046
2076
|
return Number(result.changes);
|
package/dist/ops.cjs
CHANGED
|
@@ -3070,6 +3070,11 @@ function resolveRetentionPolicy(partial) {
|
|
|
3070
3070
|
gapsMs: checkedMs(partial?.gapsMs, gapsDefault, "gapsMs")
|
|
3071
3071
|
};
|
|
3072
3072
|
}
|
|
3073
|
+
var RETENTION_DELETE_SQL = {
|
|
3074
|
+
raw: "DELETE FROM points_raw WHERE (series_id, ts_ms) IN (SELECT series_id, ts_ms FROM points_raw WHERE series_id = ? AND ts_ms < ? LIMIT ?)",
|
|
3075
|
+
oneMinute: "DELETE FROM points_1m WHERE (series_id, bucket_ms) IN (SELECT series_id, bucket_ms FROM points_1m WHERE series_id = ? AND bucket_ms < ? LIMIT ?)",
|
|
3076
|
+
oneHour: "DELETE FROM points_1h WHERE (series_id, bucket_ms) IN (SELECT series_id, bucket_ms FROM points_1h WHERE series_id = ? AND bucket_ms < ? LIMIT ?)"
|
|
3077
|
+
};
|
|
3073
3078
|
var RetentionManager = class {
|
|
3074
3079
|
policy;
|
|
3075
3080
|
db;
|
|
@@ -3097,6 +3102,7 @@ var RetentionManager = class {
|
|
|
3097
3102
|
delete1h;
|
|
3098
3103
|
deleteReceipts;
|
|
3099
3104
|
deleteGaps;
|
|
3105
|
+
selectSeriesIds;
|
|
3100
3106
|
constructor(database, options = {}) {
|
|
3101
3107
|
this.db = database;
|
|
3102
3108
|
this.policy = resolveRetentionPolicy(options.policy);
|
|
@@ -3119,21 +3125,16 @@ var RetentionManager = class {
|
|
|
3119
3125
|
this.intervalMs = positiveInt(options.intervalMs, 6e4, "intervalMs");
|
|
3120
3126
|
this.chunkSize = positiveInt(options.chunkSize, 5e3, "chunkSize");
|
|
3121
3127
|
this.maxChunksPerPass = positiveInt(options.maxChunksPerPass, 1e4, "maxChunksPerPass");
|
|
3122
|
-
this.deleteRaw = database.db.prepare(
|
|
3123
|
-
|
|
3124
|
-
);
|
|
3125
|
-
this.delete1m = database.db.prepare(
|
|
3126
|
-
"DELETE FROM points_1m WHERE (series_id, bucket_ms) IN (SELECT series_id, bucket_ms FROM points_1m WHERE bucket_ms < ? LIMIT ?)"
|
|
3127
|
-
);
|
|
3128
|
-
this.delete1h = database.db.prepare(
|
|
3129
|
-
"DELETE FROM points_1h WHERE (series_id, bucket_ms) IN (SELECT series_id, bucket_ms FROM points_1h WHERE bucket_ms < ? LIMIT ?)"
|
|
3130
|
-
);
|
|
3128
|
+
this.deleteRaw = database.db.prepare(RETENTION_DELETE_SQL.raw);
|
|
3129
|
+
this.delete1m = database.db.prepare(RETENTION_DELETE_SQL.oneMinute);
|
|
3130
|
+
this.delete1h = database.db.prepare(RETENTION_DELETE_SQL.oneHour);
|
|
3131
3131
|
this.deleteReceipts = database.db.prepare(
|
|
3132
3132
|
"DELETE FROM sample_receipts WHERE (collector_id, run_id, seq) IN (SELECT collector_id, run_id, seq FROM sample_receipts WHERE captured_at_ms < ? LIMIT ?)"
|
|
3133
3133
|
);
|
|
3134
3134
|
this.deleteGaps = database.db.prepare(
|
|
3135
3135
|
"DELETE FROM gaps WHERE (collector_id, run_id, seq) IN (SELECT collector_id, run_id, seq FROM gaps WHERE to_ms < ? LIMIT ?)"
|
|
3136
3136
|
);
|
|
3137
|
+
this.selectSeriesIds = database.db.prepare("SELECT series_id FROM series");
|
|
3137
3138
|
this.refreshPhysicalState();
|
|
3138
3139
|
}
|
|
3139
3140
|
start() {
|
|
@@ -3181,20 +3182,29 @@ var RetentionManager = class {
|
|
|
3181
3182
|
return deleted;
|
|
3182
3183
|
}
|
|
3183
3184
|
/**
|
|
3184
|
-
* One bounded DELETE statement (or a cheap probe when nothing is
|
|
3185
|
-
* Returns the number of rows deleted, at most `chunkSize`.
|
|
3185
|
+
* One bounded DELETE statement per tier (or a cheap probe when nothing is
|
|
3186
|
+
* expired). Returns the number of rows deleted, at most `chunkSize`.
|
|
3186
3187
|
*/
|
|
3187
3188
|
runChunk() {
|
|
3188
3189
|
const started = performance.now();
|
|
3189
3190
|
const nowMs = this.now();
|
|
3190
3191
|
const rawCutoff = nowMs - this.policy.rawMs;
|
|
3191
|
-
|
|
3192
|
+
const seriesIds = this.seriesIds();
|
|
3193
|
+
let deleted = this.deleteTierChunk(this.deleteRaw, seriesIds, rawCutoff);
|
|
3194
|
+
if (deleted === 0) {
|
|
3195
|
+
deleted = this.deleteTierChunk(this.delete1m, seriesIds, nowMs - this.policy.oneMinuteMs);
|
|
3196
|
+
}
|
|
3197
|
+
if (deleted === 0) {
|
|
3198
|
+
deleted = this.deleteTierChunk(this.delete1h, seriesIds, nowMs - this.policy.oneHourMs);
|
|
3199
|
+
}
|
|
3200
|
+
if (deleted === 0) deleted = this.deleteUpTo(this.deleteReceipts, nowMs - this.policy.receiptsMs);
|
|
3201
|
+
if (deleted === 0) deleted = this.deleteUpTo(this.deleteGaps, nowMs - this.policy.gapsMs);
|
|
3192
3202
|
let effectiveRawCutoff = rawCutoff;
|
|
3193
3203
|
if (deleted === 0 && this.overBudget()) {
|
|
3194
3204
|
const floorCutoff = nowMs - HOUR_MS;
|
|
3195
3205
|
effectiveRawCutoff = Math.max(rawCutoff, floorCutoff);
|
|
3196
|
-
deleted = this.
|
|
3197
|
-
if (deleted === 0) deleted = this.
|
|
3206
|
+
deleted = this.deleteTierChunk(this.deleteRaw, seriesIds, effectiveRawCutoff);
|
|
3207
|
+
if (deleted === 0) deleted = this.deleteTierChunk(this.delete1m, seriesIds, floorCutoff);
|
|
3198
3208
|
if (deleted > 0) {
|
|
3199
3209
|
this.db.reclaimPages(64);
|
|
3200
3210
|
try {
|
|
@@ -3223,6 +3233,26 @@ var RetentionManager = class {
|
|
|
3223
3233
|
await yieldToEventLoop();
|
|
3224
3234
|
}
|
|
3225
3235
|
}
|
|
3236
|
+
/**
|
|
3237
|
+
* Deletes up to `chunkSize` rows older than `cutoffMs`, one series at a
|
|
3238
|
+
* time. Each statement is a primary-key range seek bounded by the remaining
|
|
3239
|
+
* row budget, so a series with no expired rows costs one seek rather than a
|
|
3240
|
+
* table scan. The series catalog is append-only and ingestion is its only
|
|
3241
|
+
* writer, so every stored point has a catalog row.
|
|
3242
|
+
*/
|
|
3243
|
+
deleteTierChunk(statement, seriesIds, cutoffMs) {
|
|
3244
|
+
let deleted = 0;
|
|
3245
|
+
for (const seriesId of seriesIds) {
|
|
3246
|
+
const remaining = this.chunkSize - deleted;
|
|
3247
|
+
if (remaining <= 0) break;
|
|
3248
|
+
deleted += Number(statement.run(seriesId, cutoffMs, remaining).changes);
|
|
3249
|
+
}
|
|
3250
|
+
return deleted;
|
|
3251
|
+
}
|
|
3252
|
+
seriesIds() {
|
|
3253
|
+
const rows = this.selectSeriesIds.all();
|
|
3254
|
+
return rows.map((row) => Number(row.series_id));
|
|
3255
|
+
}
|
|
3226
3256
|
deleteUpTo(statement, cutoffMs) {
|
|
3227
3257
|
const result = statement.run(cutoffMs, this.chunkSize);
|
|
3228
3258
|
return Number(result.changes);
|
package/docs/installation.md
CHANGED
|
@@ -27,7 +27,7 @@ install or source checkout is needed. The launcher and services use the installe
|
|
|
27
27
|
runtime, so removing the npx cache does not break them.
|
|
28
28
|
|
|
29
29
|
Releases are on [npm](https://www.npmjs.com/package/rigscope). `@latest` selects
|
|
30
|
-
the current stable release; replace it with `@0.1.
|
|
30
|
+
the current stable release; replace it with `@0.1.7` to select that exact version.
|
|
31
31
|
|
|
32
32
|
### Installation options
|
|
33
33
|
|
|
@@ -53,7 +53,7 @@ For a downloaded package or one built from source, run from the directory
|
|
|
53
53
|
containing the archive, or give its absolute path:
|
|
54
54
|
|
|
55
55
|
```sh
|
|
56
|
-
npx --yes --package ./rigscope-0.1.
|
|
56
|
+
npx --yes --package ./rigscope-0.1.7.tgz rigscope install --boot
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
The same installation options apply. npm still needs registry access or cached
|
|
@@ -295,7 +295,7 @@ settings and collector identities.
|
|
|
295
295
|
|
|
296
296
|
| Alternative | Command |
|
|
297
297
|
| --- | --- |
|
|
298
|
-
| Select an exact published version | `rigscope upgrade --from rigscope@0.1.
|
|
298
|
+
| Select an exact published version | `rigscope upgrade --from rigscope@0.1.7` |
|
|
299
299
|
| Install a local archive | `rigscope upgrade --from ./rigscope-VERSION.tgz` |
|
|
300
300
|
| Return to the retained previous runtime | `rigscope rollback` |
|
|
301
301
|
|
package/docs/releasing.md
CHANGED
|
@@ -5,7 +5,7 @@ The first public version, `0.1.0`, is published on
|
|
|
5
5
|
[GitHub](https://github.com/Triet1402/rigscope). The package includes MIT licensing,
|
|
6
6
|
dependency notices, the security policy and [release notes](../CHANGELOG.md).
|
|
7
7
|
|
|
8
|
-
The commands below use `0.1.
|
|
8
|
+
The commands below use `0.1.7` as an example. For a new release, substitute its
|
|
9
9
|
new version everywhere; do not attempt to republish an already published version.
|
|
10
10
|
Documentation edits can be committed and pushed to GitHub independently. The published archive and
|
|
11
11
|
its bundled documentation stay unchanged; ship updated package documentation
|
|
@@ -21,7 +21,7 @@ with the next version. Keep each release tag on the revision used to build it.
|
|
|
21
21
|
4. Run the publish dry run, check the npm account, and publish the verified archive.
|
|
22
22
|
5. Verify the registry version and install it into a disposable test installation.
|
|
23
23
|
Check sign-in, fresh telemetry and the installed command.
|
|
24
|
-
6. Tag the exact source revision as `v0.1.
|
|
24
|
+
6. Tag the exact source revision as `v0.1.7`, push the tag, and create a GitHub
|
|
25
25
|
Release with the release notes, verified archive and checksum. Announce it
|
|
26
26
|
after the registry installation works.
|
|
27
27
|
|
|
@@ -45,14 +45,14 @@ npm pack --pack-destination out/release
|
|
|
45
45
|
`npm pack` runs `prepack`, which regenerates dependency notices, builds fresh
|
|
46
46
|
runtime/UI artifacts and verifies them. If notice generation changes a tracked
|
|
47
47
|
file, include that change in the release commit before producing the final
|
|
48
|
-
archive. Reuse the archive for every check below. Replace `0.1.
|
|
48
|
+
archive. Reuse the archive for every check below. Replace `0.1.7` in these
|
|
49
49
|
commands when releasing another version.
|
|
50
50
|
|
|
51
51
|
## Verify the exact archive
|
|
52
52
|
|
|
53
53
|
```sh
|
|
54
|
-
node scripts/verify-package.cjs ./out/release/rigscope-0.1.
|
|
55
|
-
npm run verify:installed -- --archive ./out/release/rigscope-0.1.
|
|
54
|
+
node scripts/verify-package.cjs ./out/release/rigscope-0.1.7.tgz
|
|
55
|
+
npm run verify:installed -- --archive ./out/release/rigscope-0.1.7.tgz
|
|
56
56
|
npm test
|
|
57
57
|
node scripts/test-runtime.cjs
|
|
58
58
|
node scripts/test.cjs --suite development
|
|
@@ -69,9 +69,9 @@ create disposable installations with separate state, launchers, ports and unit
|
|
|
69
69
|
names, then remove their services. They do not select an existing installation.
|
|
70
70
|
|
|
71
71
|
```sh
|
|
72
|
-
RIGSCOPE_TEST_ARCHIVE="$PWD/out/release/rigscope-0.1.
|
|
72
|
+
RIGSCOPE_TEST_ARCHIVE="$PWD/out/release/rigscope-0.1.7.tgz" \
|
|
73
73
|
node --import tsx --test tests/cli-install.integration.ts tests/cli-reset.integration.ts
|
|
74
|
-
node scripts/verify-operations.cjs ./out/release/rigscope-0.1.
|
|
74
|
+
node scripts/verify-operations.cjs ./out/release/rigscope-0.1.7.tgz
|
|
75
75
|
```
|
|
76
76
|
|
|
77
77
|
These cover installation, pairing, independent component controls, bootstrap
|
|
@@ -93,7 +93,7 @@ Record the final checksum after verification:
|
|
|
93
93
|
|
|
94
94
|
```sh
|
|
95
95
|
cd out/release
|
|
96
|
-
sha256sum rigscope-0.1.
|
|
96
|
+
sha256sum rigscope-0.1.7.tgz > SHA256SUMS
|
|
97
97
|
sha256sum --check SHA256SUMS
|
|
98
98
|
```
|
|
99
99
|
|
|
@@ -110,7 +110,7 @@ then verify the account and preview the exact archive:
|
|
|
110
110
|
```sh
|
|
111
111
|
npm login --registry=https://registry.npmjs.org
|
|
112
112
|
npm whoami --registry=https://registry.npmjs.org
|
|
113
|
-
npm publish ./out/release/rigscope-0.1.
|
|
113
|
+
npm publish ./out/release/rigscope-0.1.7.tgz --access public --tag latest \
|
|
114
114
|
--registry=https://registry.npmjs.org --dry-run
|
|
115
115
|
```
|
|
116
116
|
|
|
@@ -120,12 +120,12 @@ to publish or complete two-factor authentication.
|
|
|
120
120
|
When releasing, this command actually publishes the verified archive publicly:
|
|
121
121
|
|
|
122
122
|
```sh
|
|
123
|
-
npm publish ./out/release/rigscope-0.1.
|
|
123
|
+
npm publish ./out/release/rigscope-0.1.7.tgz --access public --tag latest \
|
|
124
124
|
--registry=https://registry.npmjs.org
|
|
125
|
-
npm view rigscope@0.1.
|
|
125
|
+
npm view rigscope@0.1.7 version dist.integrity --registry=https://registry.npmjs.org
|
|
126
126
|
```
|
|
127
127
|
|
|
128
|
-
Then use `npx --yes rigscope@0.1.
|
|
128
|
+
Then use `npx --yes rigscope@0.1.7 install` with a disposable `--state-dir`, an
|
|
129
129
|
unused `--port` and an isolated `XDG_BIN_HOME` for the registry installation
|
|
130
130
|
check. Uninstall that test installation afterward. Use the same isolation
|
|
131
131
|
settings for all test commands so the check does not select a real installation.
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=721,exports.ids=[721],exports.modules={2116:(a,b,c)=>{Object.defineProperty(b,"__esModule",{value:!0});var d={default:function(){return p},useLinkStatus:function(){return r}};for(var e in d)Object.defineProperty(b,e,{enumerable:!0,get:d[e]});let f=c(24814),g=c(48249),h=f._(c(67484)),i=c(79925),j=c(30836),k=c(57272),l=c(30167),m=c(75729);c(52204);let n=c(78756);c(52836);let o=c(10881);function p(a){var b;let c,d,e,[f,p]=(0,h.useOptimistic)(n.IDLE_LINK_STATUS),r=(0,h.useRef)(null),{href:s,as:t,children:u,prefetch:v=null,passHref:w,replace:x,shallow:y,scroll:z,onClick:A,onMouseEnter:B,onTouchStart:C,legacyBehavior:D=!1,onNavigate:E,transitionTypes:F,ref:G,unstable_dynamicOnHover:H,...I}=a;c=u,D&&("string"==typeof c||"number"==typeof c)&&(c=(0,g.jsx)("a",{children:c}));let J=h.default.useContext(j.AppRouterContext),K=!1!==v,L=!1===v?"none":!0===v?"full":"auto",M="none"!==L?"auto"===L?o.FetchStrategy.PPR:o.FetchStrategy.Full:o.FetchStrategy.PPR,N="string"==typeof(b=t||s)?b:(0,i.formatUrl)(b);if(D){if(c?.$$typeof===Symbol.for("react.lazy"))throw Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag.");d=h.default.Children.only(c)}let O=D?d&&"object"==typeof d&&d.ref:G,P,Q=h.default.useCallback(a=>(null!==J&&(r.current=(0,n.mountLinkInstance)(a,N,J,M,K,p,P)),()=>{r.current&&((0,n.unmountLinkForCurrentNavigation)(r.current),r.current=null),(0,n.unmountPrefetchableInstance)(a)}),[K,N,J,M,p,P]),R={ref:(0,k.useMergedRef)(Q,O),onClick(a){D||"function"!=typeof A||A(a),D&&d.props&&"function"==typeof d.props.onClick&&d.props.onClick(a),!J||a.defaultPrevented||function(a="none"){}(L)},onMouseEnter(a){D||"function"!=typeof B||B(a),D&&d.props&&"function"==typeof d.props.onMouseEnter&&d.props.onMouseEnter(a),J&&K&&(0,n.onNavigationIntent)(a.currentTarget,!0===H)},onTouchStart:function(a){D||"function"!=typeof C||C(a),D&&d.props&&"function"==typeof d.props.onTouchStart&&d.props.onTouchStart(a),J&&K&&(0,n.onNavigationIntent)(a.currentTarget,!0===H)}};return(0,l.isAbsoluteUrl)(N)?R.href=N:D&&!w&&("a"!==d.type||"href"in d.props)||(R.href=(0,m.addBasePath)(N)),e=D?h.default.cloneElement(d,R):(0,g.jsx)("a",{...I,...R,children:c}),(0,g.jsx)(q.Provider,{value:f,children:e})}let q=(0,h.createContext)(n.IDLE_LINK_STATUS),r=()=>(0,h.useContext)(q);("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},8696:(a,b,c)=>{c.d(b,{D:()=>j,N:()=>k});var d=c(67484),e=(a,b,c,d,e,f,g,h)=>{let i=document.documentElement,j=["light","dark"];function k(b){var c;(Array.isArray(a)?a:[a]).forEach(a=>{let c="class"===a,d=c&&f?e.map(a=>f[a]||a):e;c?(i.classList.remove(...d),i.classList.add(f&&f[b]?f[b]:b)):i.setAttribute(a,b)}),c=b,h&&j.includes(c)&&(i.style.colorScheme=c)}if(d)k(d);else try{let a=localStorage.getItem(b)||c,d=g&&"system"===a?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a;k(d)}catch(a){}},f=["light","dark"],g="(prefers-color-scheme: dark)",h=d.createContext(void 0),i={setTheme:a=>{},themes:[]},j=()=>{var a;return null!=(a=d.useContext(h))?a:i},k=a=>d.useContext(h)?d.createElement(d.Fragment,null,a.children):d.createElement(m,{...a}),l=["light","dark"],m=({forcedTheme:a,disableTransitionOnChange:b=!1,enableSystem:c=!0,enableColorScheme:e=!0,storageKey:i="theme",themes:j=l,defaultTheme:k=c?"system":"light",attribute:m="data-theme",value:r,children:s,nonce:t,scriptProps:u})=>{let[v,w]=d.useState(()=>o(i,k)),[x,y]=d.useState(()=>"system"===v?q():v),z=r?Object.values(r):j,A=d.useCallback(a=>{let d=a;if(!d)return;"system"===a&&c&&(d=q());let g=r?r[d]:d,h=b?p(t):null,i=document.documentElement,j=a=>{"class"===a?(i.classList.remove(...z),g&&i.classList.add(g)):a.startsWith("data-")&&(g?i.setAttribute(a,g):i.removeAttribute(a))};if(Array.isArray(m)?m.forEach(j):j(m),e){let a=f.includes(k)?k:null,b=f.includes(d)?d:a;i.style.colorScheme=b}null==h||h()},[t]),B=d.useCallback(a=>{let b="function"==typeof a?a(v):a;w(b);try{localStorage.setItem(i,b)}catch(a){}},[v]),C=d.useCallback(b=>{y(q(b)),"system"===v&&c&&!a&&A("system")},[v,a]);d.useEffect(()=>{let a=window.matchMedia(g);return a.addListener(C),C(a),()=>a.removeListener(C)},[C]),d.useEffect(()=>{let a=a=>{a.key===i&&(a.newValue?w(a.newValue):B(k))};return window.addEventListener("storage",a),()=>window.removeEventListener("storage",a)},[B]),d.useEffect(()=>{A(null!=a?a:v)},[a,v]);let D=d.useMemo(()=>({theme:v,setTheme:B,forcedTheme:a,resolvedTheme:"system"===v?x:v,themes:c?[...j,"system"]:j,systemTheme:c?x:void 0}),[v,B,a,x,c,j]);return d.createElement(h.Provider,{value:D},d.createElement(n,{forcedTheme:a,storageKey:i,attribute:m,enableSystem:c,enableColorScheme:e,defaultTheme:k,value:r,themes:j,nonce:t,scriptProps:u}),s)},n=d.memo(({forcedTheme:a,storageKey:b,attribute:c,enableSystem:f,enableColorScheme:g,defaultTheme:h,value:i,themes:j,nonce:k,scriptProps:l})=>{let m=JSON.stringify([c,b,h,a,j,i,f,g]).slice(1,-1);return d.createElement("script",{...l,suppressHydrationWarning:!0,nonce:k,dangerouslySetInnerHTML:{__html:`(${e.toString()})(${m})`}})}),o=(a,b)=>{},p=a=>{let b=document.createElement("style");return a&&b.setAttribute("nonce",a),b.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(b),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(b)},1)}},q=a=>(a||(a=window.matchMedia(g)),a.matches?"dark":"light")},12421:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},19099:(a,b,c)=>{var d=c(54839);c.o(d,"usePathname")&&c.d(b,{usePathname:function(){return d.usePathname}}),c.o(d,"useRouter")&&c.d(b,{useRouter:function(){return d.useRouter}}),c.o(d,"useSearchParams")&&c.d(b,{useSearchParams:function(){return d.useSearchParams}})},27346:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]])},31742:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},44999:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]])},49187:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},50132:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]])},51589:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]])},51872:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]])},52836:(a,b,c)=>{Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"isLocalURL",{enumerable:!0,get:function(){return f}});let d=c(30167),e=c(71742);function f(a){if(!(0,d.isAbsoluteUrl)(a))return!0;try{let b=(0,d.getLocationOrigin)(),c=new URL(a,b);return c.origin===b&&(0,e.hasBasePath)(c.pathname)}catch(a){return!1}}},55091:(a,b,c)=>{Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"default",{enumerable:!0,get:function(){return f}});let d=c(5735),e=c(22675);function f(){return(0,d.jsx)(e.HTTPAccessErrorFallback,{status:404,message:"This page could not be found."})}("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},57272:(a,b,c)=>{Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"useMergedRef",{enumerable:!0,get:function(){return e}});let d=c(67484);function e(a,b){let c=(0,d.useRef)(null),e=(0,d.useRef)(null);return(0,d.useCallback)(d=>{if(null===d){let a=c.current;a&&(c.current=null,a());let b=e.current;b&&(e.current=null,b())}else a&&(c.current=f(a,d)),b&&(e.current=f(b,d))},[a,b])}function f(a,b){if("function"!=typeof a)return a.current=b,()=>{a.current=null};{let c=a(b);return"function"==typeof c?c:()=>a(null)}}("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},65366:(a,b,c)=>{c.d(b,{A:()=>h});var d=c(67484);let e=(...a)=>a.filter((a,b,c)=>!!a&&""!==a.trim()&&c.indexOf(a)===b).join(" ").trim();var f={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let g=(0,d.forwardRef)(({color:a="currentColor",size:b=24,strokeWidth:c=2,absoluteStrokeWidth:g,className:h="",children:i,iconNode:j,...k},l)=>(0,d.createElement)("svg",{ref:l,...f,width:b,height:b,stroke:a,strokeWidth:g?24*Number(c)/Number(b):c,className:e("lucide",h),...k},[...j.map(([a,b])=>(0,d.createElement)(a,b)),...Array.isArray(i)?i:[i]])),h=(a,b)=>{let c=(0,d.forwardRef)(({className:c,...f},h)=>(0,d.createElement)(g,{ref:h,iconNode:b,className:e(`lucide-${a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,c),...f}));return c.displayName=`${a}`,c}},71e3:(a,b,c)=>{Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"addPathPrefix",{enumerable:!0,get:function(){return e}});let d=c(10571);function e(a,b){if(!a.startsWith("/")||!b)return a;let{pathname:c,query:e,hash:f}=(0,d.parsePath)(a);return`${b}${c}${e}${f}`}},71327:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},75729:(a,b,c)=>{Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"addBasePath",{enumerable:!0,get:function(){return f}});let d=c(71e3),e=c(34956);function f(a,b){return(0,e.normalizePathTrailingSlash)((0,d.addPathPrefix)(a,""))}("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},78607:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("Bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]])},79925:(a,b,c)=>{Object.defineProperty(b,"__esModule",{value:!0});var d={formatUrl:function(){return h},formatWithValidation:function(){return j},urlObjectKeys:function(){return i}};for(var e in d)Object.defineProperty(b,e,{enumerable:!0,get:d[e]});let f=c(24814)._(c(90485)),g=/https?|ftp|gopher|file/;function h(a){let{auth:b,hostname:c}=a,d=a.protocol||"",e=a.pathname||"",h=a.hash||"",i=a.query||"",j=!1;b=b?encodeURIComponent(b).replace(/%3A/i,":")+"@":"",a.host?j=b+a.host:c&&(j=b+(~c.indexOf(":")?`[${c}]`:c),a.port&&(j+=":"+a.port)),i&&"object"==typeof i&&(i=String(f.urlQueryToSearchParams(i)));let k=a.search||i&&`?${i}`||"";return d&&!d.endsWith(":")&&(d+=":"),a.slashes||(!d||g.test(d))&&!1!==j?(j="//"+(j||""),e&&"/"!==e[0]&&(e="/"+e)):j||(j=""),h&&"#"!==h[0]&&(h="#"+h),k&&"?"!==k[0]&&(k="?"+k),e=e.replace(/[?#]/g,encodeURIComponent),k=k.replace("#","%23"),`${d}${j}${e}${k}${h}`}let i=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function j(a){return h(a)}},82437:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("Cable",[["path",{d:"M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1",key:"10bnsj"}],["path",{d:"M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9",key:"1eqmu1"}],["path",{d:"M21 21v-2h-4",key:"14zm7j"}],["path",{d:"M3 5h4V3",key:"z442eg"}],["path",{d:"M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3",key:"ebdjd7"}]])},89313:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]])},90162:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]])},93484:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(65366).A)("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]])}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[103],{802:(e,n,t)=>{t.d(n,{B:()=>l});var r=t(5155),a=t(8500),i=t.n(a),s=t(9939);function l(){let{session:e,phase:n,signOut:t}=(0,s.M)();return"signed-in"===e.kind?(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"hidden max-w-[12rem] truncate text-xs text-muted-foreground sm:inline",children:e.user.username}),(0,r.jsx)("button",{type:"button",onClick:()=>void t(),className:"rounded-md px-2.5 py-1.5 text-xs text-muted-foreground transition-colors hover:bg-card-strong hover:text-foreground",children:"Sign out"})]}):"restoring"===e.kind||"auth-unavailable"===e.kind?null:(0,r.jsx)("div",{className:"flex items-center gap-1",children:(0,r.jsx)(i(),{href:"/login",className:"rounded-md border border-border px-2.5 py-1.5 text-xs text-foreground transition-colors hover:bg-card-strong",children:"Sign in"})})}},940:(e,n,t)=>{t.d(n,{$E:()=>d,TK:()=>o});var r=t(5155),a=t(9939);let i={ok:"bg-ok",warn:"bg-warn",crit:"bg-crit",muted:"bg-muted-foreground/50"};function s(e,n){switch(e.kind){case"restoring":return{label:"Checking session…",tone:"muted"};case"restore-failed":return{label:"Hub unreachable",tone:"crit"};case"signed-out":return{label:"Signed out",tone:"muted"};case"auth-unavailable":return{label:"Sign-in unavailable",tone:"warn"}}switch(n){case"idle":return{label:"Not connected",tone:"muted"};case"connecting":return{label:"Connecting…",tone:"warn"};case"live":return{label:"Live",tone:"ok"};case"reconnecting":return{label:"Reconnecting…",tone:"warn"};case"disconnected":return{label:"Disconnected",tone:"crit"};case"expired":return{label:"Session ended",tone:"crit"};case"no-permission":return{label:"No permission",tone:"warn"}}}function l({tone:e}){return(0,r.jsx)("span",{className:`inline-block h-2 w-2 shrink-0 rounded-full ${i[e]}`,"aria-hidden":!0})}function d(){let{session:e,phase:n,lastEventKind:t,notice:i,dismissNotice:d}=(0,a.M)(),o=s(e,n),c="reset"===t&&"live"===n?"Stream resynchronized with a fresh snapshot.":null;return(0,r.jsxs)("div",{role:"status","aria-label":`Live feed status: ${o.label}`,className:"flex min-w-0 items-center gap-2",children:[(0,r.jsx)(l,{tone:o.tone}),(0,r.jsx)("span",{className:"tnum truncate text-xs text-muted-foreground",children:o.label}),c?(0,r.jsxs)("span",{className:"tnum hidden truncate text-xs text-muted-foreground lg:inline",title:c,children:["\xb7 ",c]}):null,i?(0,r.jsxs)("button",{type:"button",onClick:d,className:"max-w-[16rem] truncate rounded-md border border-border px-2 py-0.5 text-xs text-foreground transition-colors hover:bg-card-strong",title:`${i} Click to dismiss.`,children:[i,(0,r.jsx)("span",{"aria-hidden":!0,children:" ✕"})]}):null]})}function o(){let{session:e,phase:n}=(0,a.M)(),t=s(e,n);return(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3 text-xs",children:[(0,r.jsx)(l,{tone:t.tone}),(0,r.jsx)("span",{className:"truncate",role:"status","aria-label":`Live feed status: ${t.label}`,children:t.label})]})}},1721:(e,n,t)=>{t.d(n,{MachineBreadcrumb:()=>d});var r=t(5155),a=t(8500),i=t.n(a),s=t(9939),l=t(8664);function d({machineId:e,title:n,view:t}){let{machines:a}=(0,s.M)(),o=(0,l.FM)(),c=a.find(n=>n.machineId===e),m=c?.displayName||c?.hostname||"Machine";return(0,r.jsxs)("nav",{"aria-label":"Breadcrumb",className:"flex min-w-0 items-center gap-2 text-sm",children:[(0,r.jsx)(i(),{href:"/",className:"hidden text-muted-foreground hover:text-foreground sm:inline",children:"Fleet"}),(0,r.jsx)("span",{"aria-hidden":!0,className:"hidden text-muted-foreground sm:inline",children:"/"}),(0,r.jsx)(i(),{href:(0,l.Y2)(e,"overview"),className:"hidden max-w-48 truncate text-muted-foreground hover:text-foreground md:inline",children:m}),(0,r.jsx)("select",{"aria-label":"Machine",value:e,onChange:e=>o(e.target.value,t),className:"h-8 min-w-0 max-w-32 rounded-md border border-border bg-card px-1.5 text-sm md:hidden",children:a.map(e=>(0,r.jsx)("option",{value:e.machineId,children:e.displayName||e.hostname||e.machineId},e.machineId))}),(0,r.jsx)("span",{"aria-hidden":!0,className:"text-muted-foreground",children:"/"}),(0,r.jsx)("h1",{className:"truncate text-lg font-semibold tracking-tight",children:n})]})}},2394:(e,n,t)=>{t.d(n,{ThemeToggle:()=>l});var r=t(5155),a=t(1134),i=t(9145),s=t(460);function l(){let{resolvedTheme:e,setTheme:n}=(0,s.D)();return(0,r.jsxs)("button",{type:"button",onClick:()=>n("dark"===e?"light":"dark"),"aria-label":"Toggle theme",className:"flex h-9 w-9 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-selected hover:text-foreground",children:[(0,r.jsx)(a.A,{className:"h-4.5 w-4.5 dark:hidden"}),(0,r.jsx)(i.A,{className:"hidden h-4.5 w-4.5 dark:block"})]})}},2701:(e,n,t)=>{t.d(n,{Sidebar:()=>k});var r=t(5155),a=t(8500),i=t.n(a),s=t(3321),l=t(257),d=t(7233),o=t(2955),c=t(3896),m=t(9764),u=t(4201),h=t(8731),x=t(8664),f=t(8773),b=t(940),g=t(9939),p=t(7586),v=t(7348);let w=[{href:"/alerts",label:"Alerts",icon:l.A},{href:"/connections",label:"Connections",icon:d.A}],j=[{view:"overview",label:"Overview",icon:o.A},{view:"history",label:"History",icon:c.A},{view:"processes",label:"Processes",icon:m.A}],N=e=>["flex min-h-9 min-w-0 items-center gap-3 rounded-md border px-2 text-sm transition-colors md:px-3",e?"border-accent/60 bg-selected font-medium text-foreground":"border-transparent text-muted-foreground hover:bg-card-strong hover:text-foreground"].join(" ");function k({machineId:e,machineView:n}){let t=(0,s.usePathname)(),{session:a,machines:l,phase:d}=(0,g.M)(),o=(0,v.c)(),{machine:c,view:m,selectMachine:y}=(0,x.PY)(e,n),I="signed-in"===a.kind&&!0===a.user.admin?[...w,{href:"/administration",label:"Administration",icon:u.A}]:w;return(0,r.jsxs)("aside",{className:"flex w-14 shrink-0 flex-col border-r border-border bg-background md:w-56",children:[(0,r.jsxs)(i(),{href:"/","aria-label":"Rigscope",className:"flex h-14 shrink-0 items-center gap-2.5 border-b border-border px-3 md:px-5",children:[(0,r.jsx)(f.R,{className:"h-5 w-5 shrink-0 text-accent","aria-hidden":!0}),(0,r.jsx)("span",{className:"hidden text-sm font-semibold tracking-tight text-foreground md:inline",children:"Rigscope"})]}),(0,r.jsxs)("nav",{"aria-label":"Primary",className:"flex min-h-0 flex-1 flex-col overflow-y-auto p-2 md:p-3",children:[(0,r.jsxs)(i(),{href:"/","aria-current":"/"===t?"page":void 0,title:"Fleet","aria-label":"Fleet",className:N("/"===t),children:[(0,r.jsx)(h.A,{className:"h-4 w-4 shrink-0","aria-hidden":!0}),(0,r.jsx)("span",{className:"hidden md:inline",children:"Fleet"})]}),l.length>0?(0,r.jsx)("div",{role:"group","aria-label":"Select a machine",className:"my-3 flex max-h-[min(30dvh,20rem)] shrink-0 flex-col gap-1 overflow-y-auto",children:l.map(e=>{let n=e.displayName||e.hostname||e.machineId,t=e.tags?.join(", "),a=c?.machineId===e.machineId,i=(0,p.vj)(e,o),s=e.connected?"live"!==d?"Feed unavailable":"stale"===i?"Stale":"unknown"===i?"No sample yet":"Live":"Disconnected",l="Live"===s?"bg-ok":"Disconnected"===s?"bg-crit":"No sample yet"===s?"bg-muted-foreground":"bg-warn",m=e.inventory?.cpu.model||t;return(0,r.jsxs)("button",{type:"button","aria-pressed":a,"aria-label":`${n}: ${s}${m?`, ${m}`:""}`,title:[n,s,m,t].filter(Boolean).join(" \xb7 "),onClick:()=>y(e.machineId),className:`${N(a)} w-full shrink-0 py-2 text-left focus-visible:outline-offset-[-2px] max-md:justify-center max-md:px-0`,children:[(0,r.jsxs)("span",{"aria-hidden":!0,className:"relative flex h-5 w-6 shrink-0 items-center justify-center md:w-4",children:[(0,r.jsx)("span",{className:"text-xs font-medium md:hidden",children:n.slice(0,2).toUpperCase()}),(0,r.jsx)("span",{className:`h-2 w-2 shrink-0 rounded-full max-md:absolute max-md:-right-1 max-md:-bottom-0.5 ${l}`})]}),(0,r.jsxs)("span",{className:"hidden min-w-0 flex-1 md:block",children:[(0,r.jsx)("span",{className:"block break-words font-medium leading-5",children:n}),m?(0,r.jsx)("span",{className:`mt-0.5 block break-words text-xs leading-4 ${a?"text-foreground/80":"text-muted-foreground"}`,children:m}):null]})]},e.machineId)})}):null,c?(0,r.jsx)("div",{role:"group","aria-label":"Selected machine views",className:"mb-3 flex shrink-0 flex-col gap-1 border-t border-border pt-3",children:j.map(({view:e,label:n,icon:t})=>(0,r.jsxs)(i(),{href:(0,x.Y2)(c.machineId,e),"aria-current":m===e?"page":void 0,"aria-label":`${c.displayName||c.hostname||c.machineId}: ${n}`,title:`${c.displayName||c.hostname||c.machineId}: ${n}`,className:N(m===e),children:[(0,r.jsx)(t,{className:"h-4 w-4 shrink-0","aria-hidden":!0}),(0,r.jsx)("span",{className:"hidden md:inline",children:n})]},e))}):null,(0,r.jsx)("div",{className:"flex shrink-0 flex-col gap-1 border-t border-border pt-3",children:I.map(({href:e,label:n,icon:a})=>(0,r.jsxs)(i(),{href:e,"aria-current":t===e?"page":void 0,title:n,"aria-label":n,className:N(t===e),children:[(0,r.jsx)(a,{className:"h-4 w-4 shrink-0","aria-hidden":!0}),(0,r.jsx)("span",{className:"hidden md:inline",children:n})]},e))})]}),(0,r.jsx)("footer",{className:"hidden shrink-0 border-t border-border p-3 md:block",children:(0,r.jsx)(b.TK,{})})]})}},3440:(e,n,t)=>{t.d(n,{Z:()=>a,p:()=>i});var r=t(5155);function a({title:e,action:n,className:t,children:i}){return(0,r.jsxs)("section",{className:["flex min-w-0 flex-col rounded-xl border border-border bg-card p-5",t].filter(Boolean).join(" "),children:[(0,r.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-4",children:[(0,r.jsx)("h2",{className:"text-sm font-medium tracking-tight",children:e}),n?(0,r.jsx)("div",{className:"text-xs tabular-nums",children:n}):null]}),(0,r.jsx)("div",{className:"mt-4 flex min-h-0 flex-1 flex-col",children:i})]})}function i({icon:e,note:n,className:t}){return(0,r.jsxs)("div",{className:["flex flex-1 flex-col items-center justify-center gap-2.5 rounded-lg border border-dashed border-border px-6 py-10 text-center",t].filter(Boolean).join(" "),children:[(0,r.jsx)(e,{className:"h-5 w-5 text-muted-foreground","aria-hidden":!0}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:n})]})}},4173:(e,n,t)=>{t.d(n,{G:()=>l});var r=t(5155),a=t(1721),i=t(2701),s=t(2394);function l({title:e,headerRight:n,children:t,workspace:d=!1,machineId:o,machineView:c}){return(0,r.jsxs)("div",{className:"relative flex h-dvh overflow-hidden bg-background text-foreground",children:[(0,r.jsx)("a",{href:"#main-content",className:"sr-only z-50 rounded-md bg-card px-4 py-2 text-foreground focus:not-sr-only focus:absolute focus:start-2 focus:top-2 focus:outline-2 focus:outline-accent",children:"Skip to content"}),(0,r.jsx)(i.Sidebar,{machineId:o,machineView:c}),(0,r.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,r.jsxs)("header",{className:"flex min-h-14 shrink-0 flex-wrap items-center justify-between gap-2 border-b border-border px-4 py-2 md:px-6",children:[o&&c?(0,r.jsx)(a.MachineBreadcrumb,{machineId:o,title:e,view:c}):(0,r.jsx)("h1",{className:"truncate text-lg font-semibold tracking-tight",children:e}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[n?(0,r.jsx)("div",{className:"flex min-w-0 items-center gap-3",children:n}):null,(0,r.jsx)(s.ThemeToggle,{})]})]}),(0,r.jsx)("main",{id:"main-content",tabIndex:-1,className:`relative min-h-0 min-w-0 flex-1 overflow-x-hidden overscroll-contain p-4 outline-offset-[-2px] md:p-6 ${d?"flex flex-col overflow-y-hidden":"overflow-y-auto"}`,children:(0,r.jsx)("div",{className:d?"mx-auto flex h-full w-full min-h-0 min-w-0 max-w-[1500px] flex-1 flex-col":"mx-auto flex w-full min-w-0 max-w-[1500px] flex-col",children:t})})]})]})}},6114:(e,n,t)=>{t.d(n,{u:()=>u});var r=t(2115);let a="rigscope:",i=new Map,s=new Map,l=new Map,d=!1;function o(e){try{return"local"===e?window.localStorage:window.sessionStorage}catch{return null}}function c(e,n){return`${e}:${n}`}function m(e,n,t,r){let s=c(e,n);if(i.has(s))return i.get(s);let l=t,d=o(e);if(null!==d)try{let e=d.getItem(a+n);if(null!==e){let n=r(JSON.parse(e));null!==n&&(l=n)}}catch{}return i.set(s,l),l}function u(e,n,t,h="local"){let x=c(h,e);return[(0,r.useSyncExternalStore)((0,r.useCallback)(e=>{let n;return void 0===(n=s.get(x))&&(n=new Set,s.set(x,n)),n.add(e),()=>{n.delete(e)}},[x]),()=>m(h,e,n,t),()=>n),(0,r.useCallback)(r=>{let u=m(h,e,n,t),f="function"==typeof r?r(u):r;if(!Object.is(f,u)){i.set(x,f);let n=c(h,e),t=l.get(n);void 0!==t&&clearTimeout(t.timer);let r=()=>{let t=l.get(n);t&&clearTimeout(t.timer),l.delete(n);let r=o(h);if(null!==r)try{r.setItem(a+e,JSON.stringify(i.get(n)))}catch{}};if(l.set(n,{timer:setTimeout(r,250),flush:r}),!d){d=!0;let e=()=>l.forEach(e=>e.flush());window.addEventListener("pagehide",e),document.addEventListener("visibilitychange",()=>{document.hidden&&e()})}s.get(x)?.forEach(e=>e())}},[n,x,e,h,t])]}},7348:(e,n,t)=>{t.d(n,{c:()=>a});var r=t(2115);function a(e=1e3){let[n,t]=(0,r.useState)(()=>Date.now());return(0,r.useEffect)(()=>{t(Date.now());let n=setInterval(()=>t(Date.now()),e);return()=>clearInterval(n)},[e]),n}},8664:(e,n,t)=>{t.d(n,{FM:()=>f,JG:()=>x,PY:()=>b,Y2:()=>l});var r=t(2115),a=t(3321),i=t(6114),s=t(9939);function l(e,n){let t=encodeURIComponent(e);return"overview"===n?`/machines/${t}`:`/${n}?machineId=${t}`}function d(e){let n=e.inventory?.capabilities?.processes;return void 0===n||"supported"===n.status}let o={overview:e=>e[0],history:e=>e[0],processes:e=>e.find(d)??e[0]};function c({view:e,requestedMachineId:n,rememberedMachineId:t,machines:r}){if(0===r.length)return{kind:"fleet-empty"};if(n){let e=r.find(e=>e.machineId===n);return e?{kind:"resolved",machine:e,via:"requested"}:{kind:"missing",requestedMachineId:n}}if(t){let e=r.find(e=>e.machineId===t);if(e)return{kind:"resolved",machine:e,via:"remembered"}}let a=o[e](r);return a?{kind:"resolved",machine:a,via:"fallback"}:{kind:"fleet-empty"}}let m=e=>"string"==typeof e?e:null;function u(){return(0,i.u)("machine.selected","",m,"session")}let h=new Set(["history"]);function x(e,n){let{session:t,machines:i}=(0,s.M)(),l=(0,a.useRouter)(),d=(0,a.usePathname)()||`/${e}`,o=(0,a.useSearchParams)(),[m,x]=u(),f="overview"===e?n??"":o.get("machineId")||null,b=(0,r.useMemo)(()=>c({view:e,requestedMachineId:f,rememberedMachineId:m,machines:i}),[e,f,m,i]),g="resolved"===b.kind?b.machine:void 0,p=g?.machineId??"",v="overview"===e?f??"":"processes"===e?g?.machineId??f??"":p;(0,r.useEffect)(()=>{p&&x(p)},[p,x]);let w=h.has(e);return(0,r.useEffect)(()=>{if(!w||"signed-in"!==t.kind||0===i.length||null!==f||""===p)return;let e=function(e,n,t){if(n.get("machineId"))return null;let r=new URLSearchParams(n.toString());return r.set("machineId",t),`${e}?${r.toString()}`}(d,o,p);e&&l.replace(e,{scroll:!1})},[w,t.kind,i,f,p,o,l,d]),{resolution:b,machine:g,machineId:p,navMachineId:v,requestedMachineId:f}}function f(){let e=(0,a.useRouter)(),[,n]=u();return(0,r.useCallback)((t,r)=>{n(t),e.push(l(t,r))},[n,e])}function b(e,n){let t=(0,a.usePathname)()||"/",{machines:r}=(0,s.M)(),[i]=u(),l=f(),d=n??(t.startsWith("/machines/")?"overview":"/history"===t?"history":"/processes"===t?"processes":null),o=c({view:d??"overview",requestedMachineId:r.some(n=>n.machineId===e)?e:null,rememberedMachineId:i,machines:r});return{view:d,machine:"resolved"===o.kind?o.machine:void 0,selectMachine:e=>l(e,d??"overview")}}},8773:(e,n,t)=>{t.d(n,{R:()=>a});var r=t(5155);function a(e){return(0,r.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",...e,children:[(0,r.jsx)("path",{d:"M8 3H4v18h4M16 3h4v18h-4"}),(0,r.jsx)("path",{d:"m8 15 4-6 4 3M8 8h.01M16 17h.01"})]})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[157],{91:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});var n={formatUrl:function(){return u},formatWithValidation:function(){return s},urlObjectKeys:function(){return i}};for(var a in n)Object.defineProperty(t,a,{enumerable:!0,get:n[a]});let o=r(6388)._(r(1393)),l=/https?|ftp|gopher|file/;function u(e){let{auth:t,hostname:r}=e,n=e.protocol||"",a=e.pathname||"",u=e.hash||"",i=e.query||"",s=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?s=t+e.host:r&&(s=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(s+=":"+e.port)),i&&"object"==typeof i&&(i=String(o.urlQueryToSearchParams(i)));let c=e.search||i&&`?${i}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||l.test(n))&&!1!==s?(s="//"+(s||""),a&&"/"!==a[0]&&(a="/"+a)):s||(s=""),u&&"#"!==u[0]&&(u="#"+u),c&&"?"!==c[0]&&(c="?"+c),a=a.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${s}${a}${c}${u}`}let i=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function s(e){return u(e)}},257:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("Bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]])},460:(e,t,r)=>{r.d(t,{D:()=>s,N:()=>c});var n=r(2115),a=(e,t,r,n,a,o,l,u)=>{let i=document.documentElement,s=["light","dark"];function c(t){var r;(Array.isArray(e)?e:[e]).forEach(e=>{let r="class"===e,n=r&&o?a.map(e=>o[e]||e):a;r?(i.classList.remove(...n),i.classList.add(o&&o[t]?o[t]:t)):i.setAttribute(e,t)}),r=t,u&&s.includes(r)&&(i.style.colorScheme=r)}if(n)c(n);else try{let e=localStorage.getItem(t)||r,n=l&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;c(n)}catch(e){}},o=["light","dark"],l="(prefers-color-scheme: dark)",u=n.createContext(void 0),i={setTheme:e=>{},themes:[]},s=()=>{var e;return null!=(e=n.useContext(u))?e:i},c=e=>n.useContext(u)?n.createElement(n.Fragment,null,e.children):n.createElement(h,{...e}),d=["light","dark"],h=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:r=!0,enableColorScheme:a=!0,storageKey:i="theme",themes:s=d,defaultTheme:c=r?"system":"light",attribute:h="data-theme",value:g,children:k,nonce:v,scriptProps:b})=>{let[M,A]=n.useState(()=>p(i,c)),[w,S]=n.useState(()=>"system"===M?m():M),x=g?Object.values(g):s,C=n.useCallback(e=>{let n=e;if(!n)return;"system"===e&&r&&(n=m());let l=g?g[n]:n,u=t?y(v):null,i=document.documentElement,s=e=>{"class"===e?(i.classList.remove(...x),l&&i.classList.add(l)):e.startsWith("data-")&&(l?i.setAttribute(e,l):i.removeAttribute(e))};if(Array.isArray(h)?h.forEach(s):s(h),a){let e=o.includes(c)?c:null,t=o.includes(n)?n:e;i.style.colorScheme=t}null==u||u()},[v]),E=n.useCallback(e=>{let t="function"==typeof e?e(M):e;A(t);try{localStorage.setItem(i,t)}catch(e){}},[M]),P=n.useCallback(t=>{S(m(t)),"system"===M&&r&&!e&&C("system")},[M,e]);n.useEffect(()=>{let e=window.matchMedia(l);return e.addListener(P),P(e),()=>e.removeListener(P)},[P]),n.useEffect(()=>{let e=e=>{e.key===i&&(e.newValue?A(e.newValue):E(c))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[E]),n.useEffect(()=>{C(null!=e?e:M)},[e,M]);let j=n.useMemo(()=>({theme:M,setTheme:E,forcedTheme:e,resolvedTheme:"system"===M?w:M,themes:r?[...s,"system"]:s,systemTheme:r?w:void 0}),[M,E,e,w,r,s]);return n.createElement(u.Provider,{value:j},n.createElement(f,{forcedTheme:e,storageKey:i,attribute:h,enableSystem:r,enableColorScheme:a,defaultTheme:c,value:g,themes:s,nonce:v,scriptProps:b}),k)},f=n.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:o,enableColorScheme:l,defaultTheme:u,value:i,themes:s,nonce:c,scriptProps:d})=>{let h=JSON.stringify([r,t,u,e,s,i,o,l]).slice(1,-1);return n.createElement("script",{...d,suppressHydrationWarning:!0,nonce:"",dangerouslySetInnerHTML:{__html:`(${a.toString()})(${h})`}})}),p=(e,t)=>{let r;try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t},y=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},m=e=>(e||(e=window.matchMedia(l)),e.matches?"dark":"light")},828:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},857:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var r={DecodeError:function(){return m},MiddlewareNotFoundError:function(){return b},MissingStaticPage:function(){return v},NormalizeError:function(){return g},PageNotFoundError:function(){return k},SP:function(){return p},ST:function(){return y},WEB_VITALS:function(){return a},execOnce:function(){return o},getDisplayName:function(){return c},getLocationOrigin:function(){return i},getURL:function(){return s},isAbsoluteUrl:function(){return u},isResSent:function(){return d},loadGetInitialProps:function(){return f},normalizeRepeatedSlashes:function(){return h},stringifyError:function(){return M}};for(var n in r)Object.defineProperty(t,n,{enumerable:!0,get:r[n]});let a=["CLS","FCP","INP","LCP","TTFB"];function o(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let l=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,u=e=>{let t=e.charCodeAt(0);return!!(t>=65&&t<=90||t>=97&&t<=122)&&l.test(e)};function i(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function s(){let{href:e}=window.location,t=i();return e.substring(t.length)}function c(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function d(e){return e.finished||e.headersSent}function h(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function f(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await f(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&d(r))return n;if(!n)throw Error(`"${c(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`);return n}let p="u">typeof performance,y=p&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class m extends Error{}class g extends Error{}class k extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class v extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class b extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function M(e){return JSON.stringify({message:e.message,stack:e.stack})}},1134:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]])},1172:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useMergedRef",{enumerable:!0,get:function(){return a}});let n=r(2115);function a(e,t){let r=(0,n.useRef)(null),a=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=a.current;t&&(a.current=null,t())}else e&&(r.current=o(e,n)),t&&(a.current=o(t,n))},[e,t])}function o(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1735:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},2955:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]])},3321:(e,t,r)=>{var n=r(4645);r.o(n,"usePathname")&&r.d(t,{usePathname:function(){return n.usePathname}}),r.o(n,"useRouter")&&r.d(t,{useRouter:function(){return n.useRouter}}),r.o(n,"useSearchParams")&&r.d(t,{useSearchParams:function(){return n.useSearchParams}})},3896:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]])},4201:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},6914:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]])},7029:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},7233:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("Cable",[["path",{d:"M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1",key:"10bnsj"}],["path",{d:"M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9",key:"1eqmu1"}],["path",{d:"M21 21v-2h-4",key:"14zm7j"}],["path",{d:"M3 5h4V3",key:"z442eg"}],["path",{d:"M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3",key:"ebdjd7"}]])},7422:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]])},8500:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});var n={default:function(){return g},useLinkStatus:function(){return v}};for(var a in n)Object.defineProperty(t,a,{enumerable:!0,get:n[a]});let o=r(6388),l=r(5155),u=o._(r(2115)),i=r(91),s=r(2909),c=r(1172),d=r(857),h=r(127),f=r(4616),p=r(4972),y=r(9470),m=r(7565);function g(e){var t;let n,a,o,[g,v]=(0,u.useOptimistic)(p.IDLE_LINK_STATUS),b=(0,u.useRef)(null),{href:M,as:A,children:w,prefetch:S=null,passHref:x,replace:C,shallow:E,scroll:P,onClick:j,onMouseEnter:L,onTouchStart:T,legacyBehavior:_=!1,onNavigate:N,transitionTypes:O,ref:z,unstable_dynamicOnHover:R,...$}=e;n=w,_&&("string"==typeof n||"number"==typeof n)&&(n=(0,l.jsx)("a",{children:n}));let I=u.default.useContext(s.AppRouterContext),U=!1!==S,B=!1===S?"none":!0===S?"full":"auto",F="none"!==B?"auto"===B?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,V="string"==typeof(t=A||M)?t:(0,i.formatUrl)(t);if(_){if(n?.$$typeof===Symbol.for("react.lazy"))throw Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag.");a=u.default.Children.only(n)}let q=_?a&&"object"==typeof a&&a.ref:z,D,K=u.default.useCallback(e=>(null!==I&&(b.current=(0,p.mountLinkInstance)(e,V,I,F,U,v,D)),()=>{b.current&&((0,p.unmountLinkForCurrentNavigation)(b.current),b.current=null),(0,p.unmountPrefetchableInstance)(e)}),[U,V,I,F,v,D]),W={ref:(0,c.useMergedRef)(K,q),onClick(e){_||"function"!=typeof j||j(e),_&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(e),!I||e.defaultPrevented||function(e,t,n,a,o,l,u,i="none"){{let s,{nodeName:c}=e.currentTarget;if("A"===c.toUpperCase()&&((s=e.currentTarget.getAttribute("target"))&&"_self"!==s||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which)||e.currentTarget.hasAttribute("download"))return;if(!(0,y.isLocalURL)(t)){a&&(e.preventDefault(),location.replace(t));return}if(e.preventDefault(),l){let e=!1;if(l({preventDefault:()=>{e=!0}}),e)return}let{navigate:d}=r(5287);d(t,a?"replace":"push",!1===o?f.ScrollBehavior.NoScroll:f.ScrollBehavior.Default,n.current,u,i)}}(e,V,b,C,P,N,O,B)},onMouseEnter(e){_||"function"!=typeof L||L(e),_&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),I&&U&&(0,p.onNavigationIntent)(e.currentTarget,!0===R)},onTouchStart:function(e){_||"function"!=typeof T||T(e),_&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),I&&U&&(0,p.onNavigationIntent)(e.currentTarget,!0===R)}};return(0,d.isAbsoluteUrl)(V)?W.href=V:_&&!x&&("a"!==a.type||"href"in a.props)||(W.href=(0,h.addBasePath)(V)),o=_?u.default.cloneElement(a,W):(0,l.jsx)("a",{...$,...W,children:n}),(0,l.jsx)(k.Provider,{value:g,children:o})}let k=(0,u.createContext)(p.IDLE_LINK_STATUS),v=()=>(0,u.useContext)(k);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},8698:(e,t,r)=>{r.d(t,{A:()=>u});var n=r(2115);let a=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim();var o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let l=(0,n.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:l,className:u="",children:i,iconNode:s,...c},d)=>(0,n.createElement)("svg",{ref:d,...o,width:t,height:t,stroke:e,strokeWidth:l?24*Number(r)/Number(t):r,className:a("lucide",u),...c},[...s.map(([e,t])=>(0,n.createElement)(e,t)),...Array.isArray(i)?i:[i]])),u=(e,t)=>{let r=(0,n.forwardRef)(({className:r,...o},u)=>(0,n.createElement)(l,{ref:u,iconNode:t,className:a(`lucide-${e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,r),...o}));return r.displayName=`${e}`,r}},8731:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]])},9145:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]])},9470:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isLocalURL",{enumerable:!0,get:function(){return o}});let n=r(857),a=r(8512);function o(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,a.hasBasePath)(r.pathname)}catch(e){return!1}}},9764:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(8698).A)("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]])}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[408],{4150:(e,t,r)=>{r.d(t,{Au:()=>u,_C:()=>a,eg:()=>c});var s=r(5155),n=r(2115),i=r(6304),l=r(5078);let o=(0,n.createContext)(null);function a({children:e}){let[t,r]=(0,n.useState)(null),i=(0,n.useCallback)(e=>r(t=>t?.timeMs===e?.timeMs&&t?.source===e?.source?t:e),[]),l=(0,n.useMemo)(()=>({cursor:t,setCursor:i}),[t,i]);return(0,s.jsx)(o.Provider,{value:l,children:e})}function u({series:e,fromMs:t,toMs:r,stepMs:s,gaps:l}){let a=(0,n.useId)(),[c,d]=(0,n.useState)(null),m=(0,n.useContext)(o),f=m?m.cursor:c,p=m?m.setCursor:d,h=(0,n.useRef)(null),g=(0,n.useRef)(null),y=(0,n.useCallback)(()=>{null!==h.current&&cancelAnimationFrame(h.current),h.current=null,g.current=null},[]);(0,n.useEffect)(()=>y,[y]);let x=(0,n.useMemo)(()=>(0,i.X)(e).filter(e=>e.t<=r&&e.t+s/2>=t),[e,t,r,s]),b=f&&f.timeMs>=t-s/2&&f.timeMs<=r?f.timeMs:null,v=null!==b&&f?.source===a;(0,n.useEffect)(()=>{if(!v)return;let e=e=>{"Escape"===e.key&&(y(),p(null))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[v,p,y]);let M=()=>{y(),f?.source===a&&p(null)};return{id:a,timeMs:b,active:v,inspect:e=>{let n=Math.max(t,Math.min(r,e)),o=(0,i.bO)(x,n,s,l);g.current={timeMs:o?.t??n,source:a},null===h.current&&(h.current=requestAnimationFrame(()=>{h.current=null,p(g.current),g.current=null}))},clear:M,onKeyDown:e=>{if(y(),"Escape"===e.key)e.preventDefault(),M();else if(["ArrowLeft","ArrowRight","Home","End"].includes(e.key)){e.preventDefault();let t=(0,i.o7)(x,b,e.key);null!==t&&p({timeMs:t,source:a})}},onFocus:()=>{y(),p({timeMs:x.at(-1)?.t??r,source:a})}}}function c({id:e,timeMs:t,fraction:r,unit:i,readings:o}){let[a]=(0,n.useState)(()=>r>.5?"left":"right");return(0,s.jsxs)("div",{id:e,role:"tooltip",className:`absolute top-2 z-10 max-h-56 w-56 max-w-[calc(100%-1rem)] overflow-y-auto rounded-md border border-border bg-card p-3 text-xs text-foreground ${"left"===a?"left-2":"right-2"}`,children:[(0,s.jsx)("p",{className:"tnum font-medium",children:(0,l.r6)(t)}),(0,s.jsx)("p",{className:"mb-2 text-muted-foreground",children:"Recorded bucket average"}),(0,s.jsx)("dl",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-baseline gap-x-4 gap-y-1.5",children:o.map(({key:e,label:r,color:n,point:o})=>(0,s.jsxs)("div",{className:"contents",children:[(0,s.jsxs)("dt",{className:"flex min-w-0 items-center gap-1.5",children:[(0,s.jsx)("span",{"aria-hidden":!0,className:"h-2 w-2 shrink-0 rounded-full",style:{backgroundColor:n}}),(0,s.jsx)("span",{className:"break-words",children:r})]}),(0,s.jsxs)("dd",{className:"tnum text-right",children:[o?.avg==null?"No reading":(0,l.dd)(o.avg,i),o&&o.t!==t?(0,s.jsx)("span",{className:"block text-muted-foreground",children:(0,l.ei)(o.t)}):null]})]},e))})]})}},4567:(e,t,r)=>{r.d(t,{Cv:()=>n,H9:()=>s,Lf:()=>u,P$:()=>i,RL:()=>g,bP:()=>h,er:()=>m,oB:()=>a,ue:()=>p,yv:()=>d});let s=[{metric:"cpu.usage",label:"CPU usage",shortLabel:"CPU",unit:"percent",family:"cpu",colorSlot:0,description:"Total processor utilization"},{metric:"cpu.core",label:"Per-core CPU",shortLabel:"Per-core",unit:"percent",family:"cpu",colorSlot:0,description:"Logical-core utilization; heatmap for large selections"},{metric:"cpu.temperature",label:"CPU temperature",shortLabel:"Temperature",unit:"celsius",family:"cpu",colorSlot:3,description:"Identifiable CPU hwmon sensor temperature"},{metric:"cpu.power",label:"CPU package power",shortLabel:"Power",unit:"watts",family:"cpu",colorSlot:4,description:"Top-level RAPL package power draw"},{metric:"cpu.iowait",label:"CPU I/O wait",shortLabel:"I/O wait",unit:"percent",family:"cpu",colorSlot:2,description:"Processor time waiting on I/O"},{metric:"cpu.pressure",label:"CPU pressure",shortLabel:"Pressure",unit:"percent",family:"cpu",colorSlot:4,description:"Linux PSI CPU stall pressure (avg10)"},{metric:"memory.used",label:"Memory used",shortLabel:"Memory",unit:"bytes",family:"memory",colorSlot:1,description:"Physical memory in use"},{metric:"memory.usage",label:"Memory usage",shortLabel:"Memory %",unit:"percent",family:"memory",colorSlot:1,description:"Physical memory used as a share of total"},{metric:"memory.pressure.some",label:"Memory pressure (some)",shortLabel:"Pressure some",unit:"percent",family:"memory",colorSlot:2,description:"Linux PSI memory stall pressure, some tasks (avg10)"},{metric:"memory.pressure.full",label:"Memory pressure (full)",shortLabel:"Pressure full",unit:"percent",family:"memory",colorSlot:4,description:"Linux PSI memory stall pressure, all tasks (avg10)"},{metric:"swap.used",label:"Swap used",shortLabel:"Swap",unit:"bytes",family:"swap",colorSlot:2,description:"Swap space in use"},{metric:"gpu.utilization",label:"GPU utilization",shortLabel:"Utilization",unit:"percent",family:"gpus",colorSlot:0,description:"Per-card graphics processor utilization"},{metric:"gpu.memory.used",label:"GPU memory used",shortLabel:"VRAM",unit:"bytes",family:"gpus",colorSlot:1,description:"Per-card video memory in use"},{metric:"gpu.temperature",label:"GPU temperature",shortLabel:"Temperature",unit:"celsius",family:"gpus",colorSlot:3,description:"Per-card temperature"},{metric:"gpu.power",label:"GPU power",shortLabel:"Power",unit:"watts",family:"gpus",colorSlot:4,description:"Per-card power draw"},{metric:"fs.used",label:"Filesystem used",shortLabel:"Filesystem",unit:"bytes",family:"disks",colorSlot:1,description:"Used space per mounted filesystem"},{metric:"fs.usage",label:"Filesystem usage",shortLabel:"Filesystem %",unit:"percent",family:"disks",colorSlot:1,description:"Used capacity per mounted filesystem, derived from a positive total"},{metric:"fs.inodes.usage",label:"Inode usage",shortLabel:"Inodes %",unit:"percent",family:"disks",colorSlot:2,description:"Used inodes per filesystem where the collector can read them"},{metric:"disk.read",label:"Disk read",shortLabel:"Read",unit:"bytes_per_second",family:"disks",colorSlot:0,description:"Device read throughput"},{metric:"disk.write",label:"Disk write",shortLabel:"Write",unit:"bytes_per_second",family:"disks",colorSlot:2,description:"Device write throughput"},{metric:"disk.read.latency",label:"Disk read latency",shortLabel:"Read latency",unit:"milliseconds",family:"disks",colorSlot:0,description:"Average device read latency"},{metric:"disk.write.latency",label:"Disk write latency",shortLabel:"Write latency",unit:"milliseconds",family:"disks",colorSlot:2,description:"Average device write latency"},{metric:"disk.utilization",label:"Disk utilization",shortLabel:"Utilization",unit:"percent",family:"disks",colorSlot:3,description:"Share of time the device had I/O in flight"},{metric:"io.pressure.some",label:"I/O pressure (some)",shortLabel:"I/O some",unit:"percent",family:"disks",colorSlot:3,description:"Linux PSI I/O stall pressure, some tasks (avg10)"},{metric:"io.pressure.full",label:"I/O pressure (full)",shortLabel:"I/O full",unit:"percent",family:"disks",colorSlot:4,description:"Linux PSI I/O stall pressure, all tasks (avg10)"},{metric:"net.rx",label:"Network received",shortLabel:"Received",unit:"bytes_per_second",family:"network",colorSlot:0,description:"Interface receive rate"},{metric:"net.tx",label:"Network sent",shortLabel:"Sent",unit:"bytes_per_second",family:"network",colorSlot:2,description:"Interface transmit rate"}];function n(e,t){return e.filter(r=>{for(let[s,n,i]of[["memory","memory.used","memory.usage"],["filesystem","fs.used","fs.usage"]])if(e.includes(n)&&e.includes(i)&&(r===n||r===i))return r===("percent"===t[s]?i:n);return!0})}let i=[{id:"cpu",label:"CPU",metrics:["cpu.usage","cpu.core","cpu.iowait","cpu.pressure","cpu.temperature","cpu.power"]},{id:"memory",label:"Memory",metrics:["memory.used","memory.usage","swap.used","memory.pressure.some","memory.pressure.full"]},{id:"gpu",label:"GPU",metrics:["gpu.utilization","gpu.memory.used","gpu.temperature","gpu.power"]},{id:"disk",label:"Storage",metrics:["fs.used","fs.usage","fs.inodes.usage","disk.read","disk.write","disk.read.latency","disk.write.latency","disk.utilization","io.pressure.some","io.pressure.full"]},{id:"network",label:"Network",metrics:["net.rx","net.tx"]}],l=["var(--cpu)","var(--mem)","color-mix(in oklab, var(--swap) 75%, var(--foreground))","var(--warn)","var(--crit)","var(--accent)"],o=[void 0,"7 4","2 3","10 3 2 3","4 4","1 3"];function a(e){return s.find(t=>t.metric===e)??null}function u(e,t){let r=Math.max(0,t),s=e.colorSlot+r,n=(r+Math.floor(s/l.length))%o.length;return{color:l[s%l.length],dash:o[n]}}let c={cpu:"CPU",memory:"Memory",swap:"Swap",gpus:"GPU metrics",disks:"Disk metrics",network:"Network metrics"};function d(e,t){let r=a(t);if(null===r||void 0===e)return{available:!0,reason:null};let s=e.inventory?.capabilities?.[r.family];if(!s||"supported"===s.status)return{available:!0,reason:null};let n=s.reason?.trim();return{available:!1,reason:n?`${c[r.family]}: ${s.status} — ${n}`:`${c[r.family]} are ${s.status} on this machine.`}}function m(e){if(void 0===e)return[];let t=[],r=r=>{!(t.length>=16)&&d(e,r).available&&t.push(r)};r("cpu.usage"),r("memory.used");let s=function(e){let t=e.inventory?.memory.swapTotalBytes;if("number"==typeof t)return t;let r=e.metrics?.payload.swap;return r?.status==="ok"?r.totalBytes:null}(e);return null!==s&&s>0&&r("swap.used"),p(e,[]).length>0&&(r("gpu.utilization"),r("gpu.memory.used")),t}function f(e){let t=e.includes(":")?e.slice(e.indexOf(":")+1):e;return t.length<=18?t:`${t.slice(0,10)}…${t.slice(-4)}`}function p(e,t){let r=new Set(t.filter(e=>e.metric.startsWith("gpu.")&&""!==e.resourceId&&e.points.some(e=>null!==e.avg||null!==e.min||null!==e.max)).map(e=>e.resourceId)),s=[],n=new Set;(e?.inventory?.gpus??[]).forEach(e=>{let t="supported"===e.telemetry;(t||r.has(e.id))&&(n.add(e.id),s.push({id:e.id,label:e.name.trim()||f(e.id),index:s.length,totalBytes:e.memoryTotalBytes,supported:t,hasHistory:r.has(e.id)}))});let i=e?.metrics?.payload.gpus;if(i?.status==="ok")for(let e of i.devices)n.has(e.id)||"ok"!==e.status||(n.add(e.id),s.push({id:e.id,label:f(e.id),index:s.length,totalBytes:e.memoryTotalBytes,supported:!0,hasHistory:r.has(e.id)}));for(let e of[...r].sort())n.has(e)||s.push({id:e,label:e.startsWith("pci:")?`Previously detected GPU (${f(e)})`:f(e),index:s.length,totalBytes:null,supported:!0,hasHistory:!0});return s}function h(e,t,r){if(""===r)return a(t)?.shortLabel??"Total";let s=a(t);if(null===s)return f(r);switch(s.family){case"gpus":{let t=e?.inventory?.gpus.find(e=>e.id===r);return t?.name.trim()||f(r)}case"disks":{if(t.startsWith("fs.")){let t=e?.inventory?.filesystems.find(e=>e.id===r);return t?.mountPoint||f(r)}let s=e?.inventory?.disks.find(e=>e.id===r);return s?.name||f(r)}case"network":{let t=e?.inventory?.network.find(e=>e.id===r);return t?.name||f(r)}case"cpu":{let e=/^core:(\d+)$/.exec(r);return e?`Core ${e[1]}`:f(r)}default:return f(r)}}function g(e){switch(e){case"percent":return"%";case"bytes":return"bytes";case"bytes_per_second":return"bytes/s";case"celsius":return"\xb0C";case"watts":return"W";case"milliseconds":return"ms";default:return e}}},5078:(e,t,r)=>{r.d(t,{Ah:()=>d,I_:()=>h,O5:()=>p,Vw:()=>M,bf:()=>v,dd:()=>c,ei:()=>m,fH:()=>g,ly:()=>n,pI:()=>s,r6:()=>f,zp:()=>i});let s=[{id:"10m",shortLabel:"10m",label:"Last 10 minutes",ms:6e5,refreshMs:1e3},{id:"1h",shortLabel:"1h",label:"Last hour",ms:36e5,refreshMs:1e3},{id:"6h",shortLabel:"6h",label:"Last 6 hours",ms:216e5,refreshMs:1e3},{id:"24h",shortLabel:"24h",label:"Last 24 hours",ms:864e5,refreshMs:1e3},{id:"7d",shortLabel:"7d",label:"Last 7 days",ms:6048e5,refreshMs:1e3}];function n(e){return s.find(t=>t.id===e)??s[0]}function i(e){return n(e).refreshMs}let l=["B","KiB","MiB","GiB","TiB","PiB"];function o(e){let t=Math.abs(e),r=0;for(;t>=1024&&r<l.length-1;)t/=1024,r+=1;return{value:e<0?-t:t,unit:l[r]}}function a(e,t){return String(Number(e.toFixed(t)))}function u(e,t=""){let{value:r,unit:s}=o(e),n=Math.abs(r)>=100?0:1;return`${a(r,n)} ${s}${t}`}function c(e,t){if(null==e||!Number.isFinite(e))return"—";switch(t){case"percent":return`${a(e,1)}%`;case"bytes":return u(e);case"bytes_per_second":return u(e,"/s");case"celsius":return`${a(e,1)}\xb0C`;case"watts":return`${a(e,1)} W`;case"milliseconds":return`${a(e,10>Math.abs(e)?2:1)} ms`;default:return a(e,2)}}function d(e,t){if(!Number.isFinite(e))return"—";switch(t){case"percent":return`${a(e,0)}%`;case"bytes":case"bytes_per_second":{let{value:r,unit:s}=o(e),n=Math.abs(r)>=10||0===r?0:1;return`${a(r,n)} ${s}${"bytes_per_second"===t?"/s":""}`}case"celsius":return`${a(e,0)}\xb0C`;case"watts":return`${a(e,0)} W`;case"milliseconds":return`${a(e,+(10>Math.abs(e)))} ms`;default:return a(e,1)}}function m(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function f(e){return new Date(e).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"medium"})}function p(e,t){let r=new Date(e);return t>=1728e5?r.toLocaleDateString(void 0,{month:"short",day:"numeric"}):t>=864e5?r.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}):r.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1})}function h(e){let t=Math.max(0,e);return t>=36e5?`${a(t/36e5,1)} h`:t>=6e4?`${a(t/6e4,1)} min`:`${a(t/1e3,1)} s`}function g(e,t,r){let s=e.filter(e=>e.toMs>=t&&e.fromMs<=r);if(0===s.length)return"No recorded gaps in this range.";let n=s.filter(e=>"dropped"===e.kind).length,i=s.length-n,l=[];i>0&&l.push(`${i} missed interval${1===i?"":"s"}`),n>0&&l.push(`${n} dropped report${1===n?"":"s"}`);let o=[...new Set(s.map(e=>e.reason).filter(e=>"string"==typeof e&&e.length>0))],a=o.length>0?` (${o.slice(0,3).join("; ")})`:"";return`${l.join(" and ")}${a}.`}function y(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function x(e){return"number"==typeof e&&Number.isFinite(e)}function b(e){return null===e||x(e)}function v(e){if(!y(e)||"string"!=typeof e.machineId||0===e.machineId.length||!x(e.fromMs)||!x(e.toMs)||e.toMs<=e.fromMs||!x(e.stepMs)||e.stepMs<=0||"raw"!==e.tier&&"1m"!==e.tier&&"1h"!==e.tier||"boolean"!=typeof e.truncated||!x(e.elapsedMs)||!Array.isArray(e.series)||!Array.isArray(e.gaps))return null;let t=[];for(let r of e.series){if(!y(r)||"string"!=typeof r.metric||"string"!=typeof r.resourceId||"string"!=typeof r.unit||!Array.isArray(r.points))return null;let e=[];for(let t of r.points){if(!y(t)||!x(t.t)||!b(t.min)||!b(t.max)||!b(t.avg))return null;e.push({t:t.t,min:t.min,max:t.max,avg:t.avg})}t.push({metric:r.metric,resourceId:r.resourceId,unit:r.unit,points:e})}let r=[];for(let t of e.gaps){if(!y(t)||!x(t.fromMs)||!x(t.toMs)||"missing"!==t.kind&&"dropped"!==t.kind)return null;let e={fromMs:t.fromMs,toMs:t.toMs,kind:t.kind};"string"==typeof t.reason&&(e.reason=t.reason),x(t.droppedRecords)&&(e.droppedRecords=t.droppedRecords),r.push(e)}return{machineId:e.machineId,fromMs:e.fromMs,toMs:e.toMs,stepMs:e.stepMs,tier:e.tier,series:t,gaps:r,truncated:e.truncated,elapsedMs:e.elapsedMs}}function M(e,t,r,s,i=600,l){let{fromMs:o,toMs:a}={fromMs:s-n(r).ms,toMs:s},u=new URLSearchParams({machineId:e,metrics:t.join(","),from:String(Math.floor(o)),to:String(Math.floor(a)),maxPoints:String(i)});return void 0!==l&&u.set("coreIds",l.join(",")),`/api/history?${u.toString()}`}},6304:(e,t,r)=>{function s(e,t,r,s){if(s.some(e=>t>e.fromMs&&t<e.toMs))return null;let n=0,i=e.length;for(;n<i;){let r=n+i>>>1;e[r].t<t?n=r+1:i=r}let l=e[n-1],o=e[n],a=l&&(!o||t-l.t<=o.t-t)?l:o;return!a||Math.abs(a.t-t)>r/2||s.some(e=>e.toMs>Math.min(t,a.t)&&e.fromMs<Math.max(t,a.t))?null:a}function n(e){return[...new Set(e.flatMap(e=>e.points.map(e=>e.t)))].sort((e,t)=>e-t).map(e=>({t:e,min:null,max:null,avg:null}))}function i(e,t,r,s,n,l=0){return Math.round(s+Math.max(0,Math.min(1,((r>0?(e-t)/r:0)-l)/(1-2*l)))*(n-s))}function l(e,t,r){return 0===e.length?null:"Home"===r?e[0].t:"End"===r||null===t?e.at(-1).t:"ArrowLeft"===r?[...e].reverse().find(e=>e.t<t)?.t??e[0].t:"ArrowRight"===r?e.find(e=>e.t>t)?.t??e.at(-1).t:t}r.d(t,{X:()=>n,bO:()=>s,o7:()=>l,yk:()=>i})},7284:(e,t,r)=>{r.d(t,{t:()=>c});var s=r(5155),n=r(2115),i=r(7726),l=r(5078),o=r(4567),a=r(6304),u=r(4150);function c(e){let{title:t,unit:r,series:c,fromMs:d,toMs:m,stepMs:f,gaps:p,hiddenKeys:h,onToggleSeries:g,emptyMessage:y,note:x}=e,b=(0,n.useMemo)(()=>c.filter(e=>!h.has(e.key)),[c,h]),v=(0,u.Au)({series:b,fromMs:d,toMs:m,stepMs:f,gaps:p}),M=(0,n.useRef)(null),k=(0,n.useMemo)(()=>b.flatMap(e=>e.points),[b]),w=k.some(e=>null!==e.avg||null!==e.min||null!==e.max),$=Math.max(1,m-d),j=(0,n.useMemo)(()=>(0,i.$z)(p,d,m,k),[p,d,m,k]),S=(0,n.useMemo)(()=>(0,i.kk)(r,k.flatMap(e=>[e.min,e.max,e.avg]).filter(e=>null!==e)),[r,k]),L=Math.max(1e-9,S.max-S.min),N=(0,n.useCallback)(e=>6+(Math.min(m,Math.max(d,e))-d)/$*788,[d,m,$]),P=(0,n.useCallback)(e=>6+(1-(e-S.min)/L)*148,[S.min,L]),I=(0,n.useMemo)(()=>b.map(t=>{let r=(0,i.o)(t.points,{stepMs:f,gaps:j,fromMs:d,toMs:m}).map(t=>(0,i.SG)(t,e.maxDrawPoints??601,f));return{...t,segments:r,envelope:r.filter(e=>e.length>1).map(e=>{let t=e.map(e=>`${N(e.t).toFixed(2)},${P(e.max??e.avg).toFixed(2)}`),r=[...e].reverse().map(e=>`${N(e.t).toFixed(2)},${P(e.min??e.avg).toFixed(2)}`);return`M${t.join("L")}L${r.join("L")}Z`}).join(" "),path:r.filter(e=>e.length>1).map(e=>e.map((e,t)=>`${0===t?"M":"L"}${N(e.t).toFixed(2)},${P(e.avg).toFixed(2)}`).join(" ")).join(" ")}}),[b,e.maxDrawPoints,f,j,d,m,N,P]),C=(0,n.useMemo)(()=>(function(e,t,r,s,n,o){if(0===r.length)return`${e} chart: no series selected.`;let a=r.map(e=>{let r=(0,i.T6)(e.points);return`${e.label}: ${function(e,t){let r=[];if(null!==e.latest){let s=null!==e.latestT?(0,l.ei)(e.latestT):null;r.push(`latest ${(0,l.dd)(e.latest,t)}${s?` at ${s}`:""}`)}return r.push(`average ${(0,l.dd)(e.avg,t)}`),null!==e.min&&null!==e.max&&r.push(`recorded range ${(0,l.dd)(e.min,t)} to ${(0,l.dd)(e.max,t)}`),r.join(", ")}(r,t)}`}),u=o>0?`${o} shaded interval${1===o?"":"s"} without stored data.`:"";return`${e} time-series chart. ${a.join(". ")}. ${u} Time range ${(0,l.ei)(s)} to ${(0,l.ei)(n)}.`})(t,r,b,d,m,j.length),[t,r,b,d,m,j.length]),A=(0,n.useMemo)(()=>new Map(c.map(e=>[e.key,(0,i.T6)(e.points)])),[c]),F=null===v.timeMs?[]:b.map(e=>({...e,point:(0,a.bO)(e.points,v.timeMs,f,p)})),D=null===v.timeMs?null:N(v.timeMs),R=`${v.id}-tooltip`,U=`${v.id}-instructions`,E=(0,n.useMemo)(()=>(0,s.jsxs)(s.Fragment,{children:[S.ticks.map(e=>(0,s.jsx)("line",{x1:6,x2:794,y1:P(e),y2:P(e),stroke:"var(--border)",strokeWidth:"1",vectorEffect:"non-scaling-stroke"},`grid-${e}`)),j.map(e=>(0,s.jsx)("rect",{x:N(e.fromMs),y:6,width:Math.max(1,N(e.toMs)-N(e.fromMs)),height:148,fill:"var(--muted-foreground)",opacity:"0.09"},`gap-${e.fromMs}-${e.toMs}-${e.kind}`)),I.map(e=>{let t=e.envelope;return""===t?null:(0,s.jsx)("path",{d:t,fill:e.color,opacity:"0.14",stroke:"none"},`band-${e.key}`)}),I.map(e=>{let t=e.path;return""===t?null:(0,s.jsx)("path",{d:t,fill:"none",stroke:e.color,strokeWidth:"2",strokeDasharray:e.dash,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"},`line-${e.key}`)}),I.flatMap(e=>e.segments.filter(e=>1===e.length).map(t=>{let r=t[0],n=N(r.t),i=P(r.avg);return(0,s.jsx)("line",{x1:n-2.5,x2:n+2.5,y1:i,y2:i,stroke:e.color,strokeWidth:"2.5",strokeLinecap:"round",vectorEffect:"non-scaling-stroke"},`dot-${e.key}-${r.t}`)}))]}),[S,N,P,j,I]);return(0,s.jsxs)("figure",{className:`flex min-w-0 flex-col gap-2 ${e.className??""}`,children:[(0,s.jsxs)("div",{className:"flex min-h-8 flex-wrap items-center justify-between gap-2",children:[(0,s.jsx)("h3",{className:"text-xs font-medium tracking-tight text-foreground",children:t}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("span",{className:"tnum shrink-0 text-xs text-muted-foreground",children:x??(0,o.RL)(r)}),e.action]})]}),w?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex min-w-0 gap-2",children:[(0,s.jsx)("div",{"aria-hidden":!0,className:"flex h-40 w-14 shrink-0 flex-col justify-between py-0.5 text-right text-xs leading-none tnum text-muted-foreground",children:[...S.ticks].reverse().map(e=>(0,s.jsx)("span",{children:(0,l.Ah)(e,r)},e))}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"relative",onPointerLeave:v.clear,onPointerMove:e=>{let t=M.current?.getBoundingClientRect();t&&v.inspect((0,a.yk)(e.clientX,t.left,t.width,d,m,.0075))},children:[(0,s.jsx)("p",{id:U,className:"sr-only",children:"Use Left and Right arrows to inspect recorded readings, Home or End to jump, and Escape to dismiss."}),(0,s.jsxs)("svg",{ref:M,viewBox:"0 0 800 160",preserveAspectRatio:"none",role:"img","aria-label":C,tabIndex:0,"aria-describedby":`${U}${v.active?` ${R}`:""}`,onFocus:v.onFocus,onBlur:v.clear,onKeyDown:v.onKeyDown,className:"block h-40 w-full cursor-crosshair rounded-sm focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent",children:[(0,s.jsx)("title",{children:t}),E,null!==D?(0,s.jsxs)("g",{"aria-hidden":!0,pointerEvents:"none",children:[(0,s.jsx)("line",{x1:D,x2:D,y1:6,y2:154,stroke:"var(--muted-foreground)",strokeWidth:"1",strokeDasharray:"3 3",vectorEffect:"non-scaling-stroke"}),F.map(({key:e,color:t,point:r})=>r?.avg==null?null:(0,s.jsx)("circle",{cx:N(r.t),cy:P(r.avg),r:"3.5",fill:t,stroke:"var(--card)",strokeWidth:"1.5",vectorEffect:"non-scaling-stroke"},e))]}):null]}),v.active&&null!==v.timeMs&&null!==D?(0,s.jsx)(u.eg,{id:R,timeMs:v.timeMs,fraction:D/800,unit:r,readings:F}):null]}),(0,s.jsx)("div",{"aria-hidden":!0,className:"mt-1 flex justify-between gap-2 text-xs leading-tight tnum text-muted-foreground",children:(0,i.Cf)(d,m).map((e,t,r)=>(0,s.jsx)("span",{className:`${0===t?"text-left":t===r.length-1?"text-right":"hidden text-center sm:inline"}`,children:(0,l.O5)(e,$)},e))})]})]}),(0,s.jsx)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs",children:c.map(e=>{let t=!h.has(e.key),n=A.get(e.key);return(0,s.jsxs)("label",{className:"inline-flex min-h-7 cursor-pointer items-center gap-1.5",title:t?`Hide ${e.label}`:`Show ${e.label}`,children:[(0,s.jsx)("input",{type:"checkbox",checked:t,onChange:()=>g(e.key),className:"peer sr-only"}),(0,s.jsx)("span",{"aria-hidden":!0,className:"flex h-4 w-5 shrink-0 items-center justify-center rounded-sm peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:[outline-color:var(--focus)]",children:(0,s.jsx)("svg",{viewBox:"0 0 20 8",className:"h-2 w-5","aria-hidden":!0,children:(0,s.jsx)("line",{x1:"1",y1:"4",x2:"19",y2:"4",stroke:e.color,strokeWidth:"2.5",strokeDasharray:e.dash,strokeLinecap:"round"})})}),(0,s.jsx)("span",{className:t?"text-foreground":"text-muted-foreground line-through",children:e.label}),(0,s.jsx)("span",{className:"tnum text-muted-foreground",children:(0,l.dd)(n.latest,r)})]},`legend-${e.key}`)})})]}):(0,s.jsx)("div",{className:"flex min-h-32 items-center justify-center rounded-lg border border-dashed border-border px-4 py-6 text-center text-xs text-muted-foreground",children:0===c.length?y:0===b.length?"All series are hidden. Re-enable one in the legend below.":y}),!w&&c.length>0?(0,s.jsx)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs",children:c.map(e=>{let t=!h.has(e.key);return(0,s.jsxs)("label",{className:"inline-flex min-h-7 cursor-pointer items-center gap-1.5",children:[(0,s.jsx)("input",{type:"checkbox",checked:t,onChange:()=>g(e.key),className:"peer sr-only"}),(0,s.jsx)("span",{"aria-hidden":!0,className:"flex h-4 w-5 shrink-0 items-center justify-center peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:[outline-color:var(--focus)]",children:(0,s.jsx)("svg",{viewBox:"0 0 20 8",className:"h-2 w-5","aria-hidden":!0,children:(0,s.jsx)("line",{x1:"1",y1:"4",x2:"19",y2:"4",stroke:e.color,strokeWidth:"2.5",strokeDasharray:e.dash,strokeLinecap:"round"})})}),(0,s.jsx)("span",{className:t?"text-foreground":"text-muted-foreground line-through",children:e.label})]},`legend-empty-${e.key}`)})}):null]})}},7726:(e,t,r)=>{function s(e){return null!==e.avg&&Number.isFinite(e.avg)}function n(e){return null!==e&&Number.isFinite(e)?e:null}function i(e){let t=[];for(let r of e){let e=t.at(-1);if(void 0!==e&&r.fromMs<=e.toMs){e.toMs=Math.max(e.toMs,r.toMs),"missing"===e.kind&&"dropped"===r.kind&&(e.kind="dropped"),void 0===e.reason&&void 0!==r.reason&&(e.reason=r.reason),void 0===e.droppedRecords&&void 0!==r.droppedRecords&&(e.droppedRecords=r.droppedRecords);continue}t.push({...r})}return t}function l(e,t,r,n){let l=i(e.map(e=>({...e,fromMs:Math.max(t,e.fromMs),toMs:Math.min(r,e.toMs)})).filter(e=>e.toMs>e.fromMs).sort((e,t)=>e.fromMs-t.fromMs||e.toMs-t.toMs));return void 0===n?l:function(e,t,r,n){if(0===e.length)return[];let l=[...new Set(t.filter(s).map(e=>e.t).filter(e=>Number.isFinite(e)))].sort((e,t)=>e-t),o=[];for(let t of e){let e=Math.max(r,Math.min(n,t.fromMs)),s=Math.max(r,Math.min(n,t.toMs));if(s<=e)continue;let i=Math.max(r,function(e,t){let r=0,s=e.length;for(;r<s;){let n=r+s>>>1;e[n]<=t?r=n+1:s=n}return r>0?e[r-1]:null}(l,e)??e),a=Math.min(n,function(e,t){let r=0,s=e.length;for(;r<s;){let n=r+s>>>1;e[n]<t?r=n+1:s=n}return r<e.length?e[r]:null}(l,s)??s);a<=i||o.push({...t,fromMs:i,toMs:a})}return o.sort((e,t)=>e.fromMs-t.fromMs||e.toMs-t.toMs),i(o)}(l,n,t,r)}function o(e,t,r){return Math.max(e,"1h"===t?36e5:"1m"===t?6e4:100,r??0)}function a(e,t){let r=[...e].sort((e,t)=>e.t-t.t),n=l(t.gaps,t.fromMs,t.toMs),i=Math.max(1,t.stepMs),o=[],a=[],u=()=>{a.length>0&&o.push(a),a=[]};for(let e of r){if(!s(e)){u();continue}let t=a.at(-1);if(void 0!==t){let r=!e.merged&&!t.merged&&(e.t<t.t||e.t-t.t>1.5*i),s=!0===e.gapBefore||function(e,t,r){return r.some(r=>r.toMs>e&&r.fromMs<t)}(t.t,e.t,n);(r||s)&&u()}a.push(e)}return u(),o}function u(e,t,r){if(t<=0)return[];let i=[...e].sort((e,t)=>e.t-t.t);if(i.length<=t)return i.map(e=>({...e}));let l=Math.max(2,Math.ceil(i.length/t)),o=Math.max(1,r),a=[],u=[],c=!1,d=null,m=()=>{if(0===u.length)return;let e=null,t=null,r=0,s=0;for(let i of u){let l=n(i.min),o=n(i.max);null!==l&&(null===e||l<e)&&(e=l),null!==o&&(null===t||o>t)&&(t=o);let a=n(i.avg);null!==a&&(r+=a,s+=1)}a.push({t:u[0].t,min:e,max:t,avg:s>0?r/s:null,...u.length>1?{merged:!0}:{},...c?{gapBefore:!0}:{}}),u=[],c=!1};for(let e of i){if(!s(e)){m(),a.push({...e}),d=null;continue}let t=null!==d&&e.t>=d.t&&e.t-d.t<=1.5*o;u.length>0&&(!t||u.length>=l)&&m(),0===u.length&&(c=null!==d&&!t),u.push(e),d=e}return m(),a}function c(e){let t=null,r=null,s=0,i=0,l=null,o=null,a=null,u=null;for(let c of e){if(null===c.avg)continue;(null===a||c.t<a)&&(a=c.t),(null===u||c.t>u)&&(u=c.t);let e=n(c.min),d=n(c.max);null!==e&&(null===t||e<t)&&(t=e),null!==d&&(null===r||d>r)&&(r=d),null!==c.avg&&Number.isFinite(c.avg)&&(s+=c.avg,i+=1,l=c.avg,o=c.t)}return{count:i,min:t,max:r,avg:i>0?s/i:null,latest:l,latestT:o,firstT:a,lastT:u}}function d(e){if(!Number.isFinite(e)||e<=0)return 1;let t=Math.pow(10,Math.floor(Math.log10(e))),r=e/t;return(r<=1?1:r<=2?2:r<=5?5:10)*t}function m(e,t){if("percent"===e)return{min:0,max:100,ticks:[0,25,50,75,100]};let r=t.filter(e=>null!==e&&Number.isFinite(e));if(0===r.length)return{min:0,max:1,ticks:[0,1]};let s=Math.min(...r),n=Math.max(...r);if("celsius"===e){let e=Math.max(1,(n-s)*.1);s=5*Math.floor((s-e)/5),n=5*Math.ceil((n+e)/5)}else s=0,n=n>0?n:1;n<=s&&(n=s+1);let i=d((n-s)/4),l=Math.floor(s/i)*i,o=Math.ceil(n/i)*i,a=function(e,t,r=4){if(!Number.isFinite(e)||!Number.isFinite(t))return[0,1];if(t<=e)return[e];let s=d((t-e)/Math.max(1,r)),n=Math.ceil(e/s)*s,i=[];for(let e=n;e<=t+.001*s&&i.length<20;e+=s)i.push(Number(e.toPrecision(12)));return i.length>0?i:[e,t]}(l,o,4);return{min:l,max:o,ticks:a}}function f(e,t,r=4){let s=Math.max(2,Math.floor(r)),n=Math.max(0,t-e);return Array.from({length:s},(t,r)=>e+n*r/(s-1))}r.d(t,{$z:()=>l,Cf:()=>f,SG:()=>u,T6:()=>c,jl:()=>o,kk:()=>m,o:()=>a})},9429:(e,t,r)=>{r.d(t,{n:()=>l});var s=r(2115),n=r(5078);async function i(e){let t=null;try{let r=await e.json();if(null!==r&&"object"==typeof r&&"error"in r){let e=r.error;"string"==typeof e&&(t=e)}}catch{}switch(e.status){case 401:return{kind:"unauthorized",message:"Your session is no longer accepted."};case 403:return{kind:"denied",message:t??"You do not have access to this machine's history."};case 404:return{kind:"missing",message:t??"This machine is not available to the hub."};case 429:return{kind:"rate-limited",message:t??"The hub is limiting history requests."};case 503:return{kind:"unavailable",message:t??"History is temporarily unavailable."};default:return{kind:"invalid",message:t??`The hub could not answer this history query (${e.status}).`}}}function l({machineId:e,metricsKey:t,coreIdsKey:r,range:o,enabled:a=!0,autoRefresh:u=!0,refreshNonce:c=0}){let[d,m]=(0,s.useState)({machineId:e,metricsKey:t,coreIdsKey:r,range:o}),f=d.machineId===e&&d.range===o;(0,s.useEffect)(()=>{if(!f)return void m({machineId:e,metricsKey:t,coreIdsKey:r,range:o});let s=window.setTimeout(()=>m({machineId:e,metricsKey:t,coreIdsKey:r,range:o}),300);return()=>window.clearTimeout(s)},[e,t,r,o,f]);let p=f?d:{machineId:e,metricsKey:t,coreIdsKey:r,range:o},h=p.metricsKey,g=p.coreIdsKey,y=`${e}|${h}|${o}|${g??"all"}`,[x,b]=(0,s.useState)(null),[v,M]=(0,s.useState)(null),[k,w]=(0,s.useState)(null),$=(0,s.useRef)(c);return(0,s.useEffect)(()=>{let t=$.current!==c;if($.current=c,!a||!e||!h)return;let r=!0,s=!1,l=!1,d=-1/0,m=new AbortController,f=(0,n.zp)(o),p=async(t=!1)=>{if(r&&!s&&!l){s=!0,d=Date.now(),w({key:y,manual:t});try{let t=await fetch((0,n.Vw)(e,h.split(","),o,Date.now(),600,void 0===g?void 0:g.split(",").filter(Boolean)),{signal:"function"!=typeof AbortSignal.any||"function"!=typeof AbortSignal.timeout?m.signal:AbortSignal.any([m.signal,AbortSignal.timeout(2e4)]),cache:"no-store",headers:{Accept:"application/json"}});if(!t.ok)throw await i(t);let s=(0,n.bf)(await t.json());if(null===s||s.machineId!==e)throw{kind:"invalid",message:"Unexpected history response."};if(!r)return;b({key:y,range:o,result:s,loadedAt:Date.now()}),M(null)}catch(t){if(!r||m.signal.aborted)return;let e=null!==t&&"object"==typeof t&&"kind"in t&&"message"in t&&"string"==typeof t.message?t:{kind:"network",message:"Could not reach the hub. Try again."};l="rate-limited"===e.kind,["unauthorized","denied","missing"].includes(e.kind)&&b(null),M({key:y,error:e})}finally{s=!1,r&&w(null)}}},x=()=>{"visible"!==document.visibilityState||Date.now()-d<f||p()};p(t);let v=u?window.setInterval(x,f):null;return u&&document.addEventListener("visibilitychange",x),()=>{r=!1,m.abort(),null!==v&&window.clearInterval(v),document.removeEventListener("visibilitychange",x)}},[a,e,h,g,o,y,u,c]),{data:a&&x?.result.machineId===e&&x.range===o?x:null,error:a&&v?.key===y?v.error:null,loading:a&&k?.key===y,manualRefreshing:a&&k?.key===y&&k.manual}}}}]);
|