nestlens 0.13.0 → 0.14.1
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/dist/api/api.controller.d.ts +17 -2
- package/dist/api/api.controller.js +23 -5
- package/dist/api/dashboard-server.js +60 -6
- package/dist/api/dto/clear-entries.dto.d.ts +12 -0
- package/dist/api/dto/clear-entries.dto.js +32 -0
- package/dist/api/dto/entry-types.d.ts +9 -0
- package/dist/api/dto/entry-types.js +11 -21
- package/dist/api/dto/index.d.ts +1 -0
- package/dist/api/dto/index.js +1 -0
- package/dist/core/storage/memory.storage.d.ts +1 -1
- package/dist/core/storage/memory.storage.js +15 -1
- package/dist/core/storage/redis.storage.d.ts +1 -1
- package/dist/core/storage/redis.storage.js +12 -1
- package/dist/core/storage/sqlite.storage.d.ts +1 -1
- package/dist/core/storage/sqlite.storage.js +13 -1
- package/dist/core/storage/storage.interface.d.ts +11 -3
- package/dist/dashboard/public/assets/{BatchDetailView-DZr7YDwl.js → BatchDetailView-CsLvuhNc.js} +1 -1
- package/dist/dashboard/public/assets/BatchesPage-BqE8r2Oq.js +1 -0
- package/dist/dashboard/public/assets/{CacheDetailView-DGXqcx8-.js → CacheDetailView-ZtX5fd6i.js} +1 -1
- package/dist/dashboard/public/assets/CachePage-DhCEXv9A.js +1 -0
- package/dist/dashboard/public/assets/{CommandDetailView-li2tXFC7.js → CommandDetailView-B7LgkUsq.js} +1 -1
- package/dist/dashboard/public/assets/CommandsPage-C0ZNbcnU.js +1 -0
- package/dist/dashboard/public/assets/{CopyButton-DzToeJlr.js → CopyButton--2uxsJNy.js} +1 -1
- package/dist/dashboard/public/assets/{DashboardPage-fYcPzXMR.js → DashboardPage-BBwAa16h.js} +1 -1
- package/dist/dashboard/public/assets/{DataTable-B_I--NVC.js → DataTable-CZnZRo7n.js} +1 -1
- package/dist/dashboard/public/assets/{DetailRow-Dc2FzrKz.js → DetailRow-9fsW1FDz.js} +1 -1
- package/dist/dashboard/public/assets/{DumpDetailView-BaW5Zi1h.js → DumpDetailView-DNyxXt8J.js} +1 -1
- package/dist/dashboard/public/assets/DumpsPage-aM-0trb2.js +1 -0
- package/dist/dashboard/public/assets/{EntryDetailPage-CiECQkN4.js → EntryDetailPage-CJeL8LqS.js} +3 -3
- package/dist/dashboard/public/assets/{EntrySearchInput-Cq-Ji-C2.js → EntrySearchInput-89F0XpHE.js} +1 -1
- package/dist/dashboard/public/assets/{EventDetailView-BPeTgmqk.js → EventDetailView-Dvam0bRY.js} +1 -1
- package/dist/dashboard/public/assets/EventsPage-DZminwPM.js +1 -0
- package/dist/dashboard/public/assets/{ExceptionDetailView-B-V0O6G_.js → ExceptionDetailView-D61T4mzK.js} +1 -1
- package/dist/dashboard/public/assets/ExceptionsPage-DJajRVrY.js +6 -0
- package/dist/dashboard/public/assets/{GateDetailView-Kn1IPKwS.js → GateDetailView-vxGIuQrF.js} +1 -1
- package/dist/dashboard/public/assets/GatesPage-C1n4Uga7.js +1 -0
- package/dist/dashboard/public/assets/{GraphQLDetailView-uAonhJH8.js → GraphQLDetailView-C6fBdHB-.js} +1 -1
- package/dist/dashboard/public/assets/GraphQLPage-DC9mELAH.js +6 -0
- package/dist/dashboard/public/assets/{HttpClientDetailView-CsBP-NRW.js → HttpClientDetailView-DvaRIxtu.js} +1 -1
- package/dist/dashboard/public/assets/{HttpClientPage-u1ZUWsG_.js → HttpClientPage-PNnk8Ebx.js} +1 -1
- package/dist/dashboard/public/assets/{JobDetailView-BjtxrqrA.js → JobDetailView-3aMUIg4I.js} +1 -1
- package/dist/dashboard/public/assets/JobsPage-CievYsDV.js +1 -0
- package/dist/dashboard/public/assets/{LogDetailView-C8q-I_AQ.js → LogDetailView-BMsEyuru.js} +1 -1
- package/dist/dashboard/public/assets/LogsPage-CkjyxVBP.js +1 -0
- package/dist/dashboard/public/assets/{MailDetailView-CQra2Fen.js → MailDetailView-TrJaweNs.js} +1 -1
- package/dist/dashboard/public/assets/MailPage-Cvi582a8.js +1 -0
- package/dist/dashboard/public/assets/{ModelDetailView-CqXFOspt.js → ModelDetailView-BmdW5pox.js} +1 -1
- package/dist/dashboard/public/assets/ModelsPage-DzrtYTRS.js +1 -0
- package/dist/dashboard/public/assets/{NotificationDetailView-c_SH4SBf.js → NotificationDetailView-Dge015ly.js} +1 -1
- package/dist/dashboard/public/assets/NotificationsPage-D3j9pz-O.js +1 -0
- package/dist/dashboard/public/assets/PageHeader-CYqfOHuc.js +1 -0
- package/dist/dashboard/public/assets/QueriesPage-5GC2fkwR.js +1 -0
- package/dist/dashboard/public/assets/{QueryDetailView-D-evIo6B.js → QueryDetailView-ByuDTcRE.js} +1 -1
- package/dist/dashboard/public/assets/{RedisDetailView-uM9LOGK-.js → RedisDetailView-BShmjWR9.js} +1 -1
- package/dist/dashboard/public/assets/RedisPage-DoDm3r2Z.js +1 -0
- package/dist/dashboard/public/assets/{RequestDetailView-Bsr5V8FV.js → RequestDetailView-Cu6q9Xjl.js} +1 -1
- package/dist/dashboard/public/assets/RequestsPage-D39vhkYR.js +1 -0
- package/dist/dashboard/public/assets/{ScheduleDetailView-D1oDL2wj.js → ScheduleDetailView-BI9isZm0.js} +1 -1
- package/dist/dashboard/public/assets/SchedulePage-uN1Wgnf3.js +1 -0
- package/dist/dashboard/public/assets/{UserCard-DCiq53By.js → UserCard-BD9apOqs.js} +1 -1
- package/dist/dashboard/public/assets/{ViewDetailView-CGYGCNEr.js → ViewDetailView-BlhqMC8Y.js} +1 -1
- package/dist/dashboard/public/assets/ViewsPage-DS91KuzM.js +1 -0
- package/dist/dashboard/public/assets/{calendar-Cy_qncyr.js → calendar-mffR88jS.js} +1 -1
- package/dist/dashboard/public/assets/{circle-alert-BCQHt4U6.js → circle-alert-B8wEbjsy.js} +1 -1
- package/dist/dashboard/public/assets/{circle-check-big-CyDf-yDO.js → circle-check-big-DQqWHlKx.js} +1 -1
- package/dist/dashboard/public/assets/{circle-x-D3OiizLY.js → circle-x-DaYqPyWY.js} +1 -1
- package/dist/dashboard/public/assets/{eye-CCRjHtzP.js → eye-Bz8w_8de.js} +1 -1
- package/dist/dashboard/public/assets/index-D-q2Btp7.js +361 -0
- package/dist/dashboard/public/assets/index-ReuerEhs.css +1 -0
- package/dist/dashboard/public/assets/{search-C83cbagr.js → search-GQneQM9W.js} +1 -1
- package/dist/dashboard/public/assets/{send-BsoLJbNI.js → send-BYRTRQYb.js} +1 -1
- package/dist/dashboard/public/assets/{timer-DP5XgATT.js → timer-DX42dv2R.js} +1 -1
- package/dist/dashboard/public/assets/{types-DOZkJpXV.js → types-KV6H5D46.js} +1 -1
- package/dist/dashboard/public/assets/{users-lOn2MScD.js → users-CuT_xHqN.js} +1 -1
- package/dist/dashboard/public/assets/{zap-CXCUXb-_.js → zap-BM7YA56F.js} +1 -1
- package/dist/dashboard/public/index.html +2 -2
- package/dist/types/graphql.types.d.ts +18 -2
- package/dist/watchers/cache.watcher.js +33 -60
- package/dist/watchers/graphql/adapters/apollo.adapter.d.ts +23 -1
- package/dist/watchers/graphql/adapters/apollo.adapter.js +55 -20
- package/package.json +1 -1
- package/dist/dashboard/public/assets/BatchesPage-2Hv2zWa4.js +0 -1
- package/dist/dashboard/public/assets/CachePage-BU15yBss.js +0 -1
- package/dist/dashboard/public/assets/CommandsPage-DaKvbjLB.js +0 -1
- package/dist/dashboard/public/assets/DumpsPage-DmCtyQ1Q.js +0 -1
- package/dist/dashboard/public/assets/EventsPage-DW1hhOrJ.js +0 -1
- package/dist/dashboard/public/assets/ExceptionsPage-BuAt8VvQ.js +0 -6
- package/dist/dashboard/public/assets/GatesPage-B3eMpohX.js +0 -1
- package/dist/dashboard/public/assets/GraphQLPage-Dv-1T6j_.js +0 -6
- package/dist/dashboard/public/assets/JobsPage-DSBpskNC.js +0 -1
- package/dist/dashboard/public/assets/LogsPage-CG-7wDcm.js +0 -1
- package/dist/dashboard/public/assets/MailPage-IJnGG2Dj.js +0 -1
- package/dist/dashboard/public/assets/ModelsPage-BRNDZcOZ.js +0 -1
- package/dist/dashboard/public/assets/NotificationsPage-DTpaCZD5.js +0 -1
- package/dist/dashboard/public/assets/PageHeader-BLRAvkWc.js +0 -1
- package/dist/dashboard/public/assets/QueriesPage-CObP-nH5.js +0 -1
- package/dist/dashboard/public/assets/RedisPage-BkBILFAA.js +0 -1
- package/dist/dashboard/public/assets/RequestsPage-C0ZycYjW.js +0 -1
- package/dist/dashboard/public/assets/SchedulePage-DQzehEF6.js +0 -1
- package/dist/dashboard/public/assets/ViewsPage-tEd0XxCD.js +0 -1
- package/dist/dashboard/public/assets/index-C256oDAK.css +0 -1
- package/dist/dashboard/public/assets/index-Db_zkULa.js +0 -361
|
@@ -3,7 +3,7 @@ import { PruningService } from '../core';
|
|
|
3
3
|
import { CollectorService } from '../core';
|
|
4
4
|
import { NestLensConfig } from '../nestlens.config';
|
|
5
5
|
import { CursorPaginatedResponse, Entry } from '../types';
|
|
6
|
-
import { CheckNewQueryDto, CursorQueryDto, EntriesQueryDto, LatestSequenceQueryDto, LogsQueryDto, PauseRecordingDto, QueriesQueryDto } from './dto';
|
|
6
|
+
import { CheckNewQueryDto, CursorQueryDto, EntriesQueryDto, LatestSequenceQueryDto, ClearEntriesQueryDto, LogsQueryDto, PauseRecordingDto, QueriesQueryDto } from './dto';
|
|
7
7
|
/**
|
|
8
8
|
* Every handler here takes an unused `@Res() _res` parameter. It is not a
|
|
9
9
|
* mistake and the value is never touched: its presence is how a handler tells
|
|
@@ -162,8 +162,23 @@ export declare class NestLensApiController {
|
|
|
162
162
|
nextRun: string | null;
|
|
163
163
|
};
|
|
164
164
|
}>;
|
|
165
|
-
|
|
165
|
+
/**
|
|
166
|
+
* Deletes entries — all of them, or all of one type.
|
|
167
|
+
*
|
|
168
|
+
* Different from pruning, which deletes by age and leaves a monitored tag's
|
|
169
|
+
* entries alone. This is somebody pressing delete: age is not consulted and
|
|
170
|
+
* a monitored tag does not stand in the way, because monitoring says *do not
|
|
171
|
+
* let pruning take these*, which is a different sentence.
|
|
172
|
+
*
|
|
173
|
+
* Answers with how many went, so the page that asked can say so rather than
|
|
174
|
+
* assume.
|
|
175
|
+
*/
|
|
176
|
+
clearEntries(query: ClearEntriesQueryDto, _res?: unknown): Promise<{
|
|
166
177
|
success: boolean;
|
|
178
|
+
data: {
|
|
179
|
+
deleted: number;
|
|
180
|
+
type: "query" | "request" | "exception" | "log" | "cache" | "event" | "job" | "schedule" | "mail" | "http-client" | "redis" | "model" | "notification" | "view" | "command" | "gate" | "batch" | "dump" | "graphql" | null;
|
|
181
|
+
};
|
|
167
182
|
message: string;
|
|
168
183
|
}>;
|
|
169
184
|
/**
|
|
@@ -211,9 +211,26 @@ let NestLensApiController = class NestLensApiController {
|
|
|
211
211
|
},
|
|
212
212
|
};
|
|
213
213
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
214
|
+
/**
|
|
215
|
+
* Deletes entries — all of them, or all of one type.
|
|
216
|
+
*
|
|
217
|
+
* Different from pruning, which deletes by age and leaves a monitored tag's
|
|
218
|
+
* entries alone. This is somebody pressing delete: age is not consulted and
|
|
219
|
+
* a monitored tag does not stand in the way, because monitoring says *do not
|
|
220
|
+
* let pruning take these*, which is a different sentence.
|
|
221
|
+
*
|
|
222
|
+
* Answers with how many went, so the page that asked can say so rather than
|
|
223
|
+
* assume.
|
|
224
|
+
*/
|
|
225
|
+
async clearEntries(query, _res) {
|
|
226
|
+
const deleted = await this.storage.clear(query.type);
|
|
227
|
+
return {
|
|
228
|
+
success: true,
|
|
229
|
+
data: { deleted, type: query.type ?? null },
|
|
230
|
+
message: query.type
|
|
231
|
+
? `Cleared ${deleted} ${query.type} ${deleted === 1 ? 'entry' : 'entries'}`
|
|
232
|
+
: `Cleared ${deleted} ${deleted === 1 ? 'entry' : 'entries'}`,
|
|
233
|
+
};
|
|
217
234
|
}
|
|
218
235
|
// ==================== Resolution Endpoints ====================
|
|
219
236
|
/**
|
|
@@ -397,9 +414,10 @@ __decorate([
|
|
|
397
414
|
], NestLensApiController.prototype, "runPruning", null);
|
|
398
415
|
__decorate([
|
|
399
416
|
(0, common_1.Delete)('entries'),
|
|
400
|
-
__param(0, (0, common_1.
|
|
417
|
+
__param(0, (0, common_1.Query)()),
|
|
418
|
+
__param(1, (0, common_1.Res)()),
|
|
401
419
|
__metadata("design:type", Function),
|
|
402
|
-
__metadata("design:paramtypes", [Object]),
|
|
420
|
+
__metadata("design:paramtypes", [dto_1.ClearEntriesQueryDto, Object]),
|
|
403
421
|
__metadata("design:returntype", Promise)
|
|
404
422
|
], NestLensApiController.prototype, "clearEntries", null);
|
|
405
423
|
__decorate([
|
|
@@ -50,6 +50,39 @@ const LIFECYCLE_HOOKS = new Set([
|
|
|
50
50
|
'onApplicationShutdown',
|
|
51
51
|
'beforeApplicationShutdown',
|
|
52
52
|
]);
|
|
53
|
+
/**
|
|
54
|
+
* The host application's logger, put back once the dashboard's own is silent.
|
|
55
|
+
*
|
|
56
|
+
* `NestFactory.create` applies its `logger` option through
|
|
57
|
+
* `Logger.overrideLogger`, which is static and therefore process-wide: passing
|
|
58
|
+
* `logger: false` to a second application silences the first one as well, for
|
|
59
|
+
* the rest of its life. Measured on a deployment before this existed — the
|
|
60
|
+
* host logged normally through startup, reached this hook inside
|
|
61
|
+
* `app.listen()`, and never logged again. Not its guards, not its errors, not
|
|
62
|
+
* even the message below explaining a dashboard that could not bind. A
|
|
63
|
+
* debugging tool that blinds the application it reports on is worse than no
|
|
64
|
+
* debugging tool.
|
|
65
|
+
*
|
|
66
|
+
* `staticInstanceRef` is `protected static`, so a subclass is the typed way to
|
|
67
|
+
* read it and hand it back; nothing here reaches around the type system.
|
|
68
|
+
*/
|
|
69
|
+
class HostLogger extends common_1.Logger {
|
|
70
|
+
static capture() {
|
|
71
|
+
return HostLogger.staticInstanceRef;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Assigning `HostLogger.staticInstanceRef` would not do this: a write to a
|
|
75
|
+
* static through a subclass creates an own property on the subclass, and the
|
|
76
|
+
* base class — the one every `Logger` call reads — keeps the value it had.
|
|
77
|
+
* The test that pins this failed on exactly that first.
|
|
78
|
+
*
|
|
79
|
+
* `false` is how `overrideLogger` spells "no instance", which is the state a
|
|
80
|
+
* host that never installed a logger of its own is in.
|
|
81
|
+
*/
|
|
82
|
+
static restore(instance) {
|
|
83
|
+
common_1.Logger.overrideLogger(instance ?? false);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
53
86
|
/**
|
|
54
87
|
* The same object, minus its lifecycle hooks.
|
|
55
88
|
*
|
|
@@ -167,15 +200,36 @@ let NestLensDashboardServer = class NestLensDashboardServer {
|
|
|
167
200
|
* reachable before the thing it reports on is ready.
|
|
168
201
|
*/
|
|
169
202
|
async onApplicationBootstrap() {
|
|
170
|
-
const application = await core_1.NestFactory.create(NestLensDashboardModule.forRoot(this.sharedProviders()), createAdapter(this.hostAdapterType()),
|
|
171
203
|
// Its own bootstrap log — route mappings for controllers the application
|
|
172
|
-
// already described — would read as a second application starting up.
|
|
173
|
-
|
|
204
|
+
// already described — would read as a second application starting up. The
|
|
205
|
+
// silence is scoped to that: whatever the host was logging with is taken
|
|
206
|
+
// first and handed back in `finally`, so a failure on either line below
|
|
207
|
+
// still leaves the application able to speak. See `HostLogger`.
|
|
208
|
+
//
|
|
209
|
+
// The host is silent for the width of these two calls, which is
|
|
210
|
+
// unavoidable: Nest applies a `logger` option through a static, so there is
|
|
211
|
+
// no way to quieten one application without quietening the process. It is
|
|
212
|
+
// a few milliseconds inside `listen()`, against a dashboard that would
|
|
213
|
+
// otherwise announce itself as a second application every boot.
|
|
214
|
+
const hostLogger = HostLogger.capture();
|
|
215
|
+
common_1.Logger.overrideLogger(false);
|
|
216
|
+
let application;
|
|
217
|
+
let bindError;
|
|
174
218
|
try {
|
|
175
|
-
await
|
|
219
|
+
application = await core_1.NestFactory.create(NestLensDashboardModule.forRoot(this.sharedProviders()), createAdapter(this.hostAdapterType()));
|
|
220
|
+
try {
|
|
221
|
+
await application.listen(this.server.port, this.server.host);
|
|
222
|
+
}
|
|
223
|
+
catch (error) {
|
|
224
|
+
bindError = error;
|
|
225
|
+
await application.close().catch(() => undefined);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
finally {
|
|
229
|
+
HostLogger.restore(hostLogger);
|
|
176
230
|
}
|
|
177
|
-
|
|
178
|
-
|
|
231
|
+
if (bindError) {
|
|
232
|
+
const error = bindError;
|
|
179
233
|
// Reported, not thrown. A port already taken or an address the host does
|
|
180
234
|
// not hold is a deployment's condition rather than a mistake in its
|
|
181
235
|
// code, and this used to end the application's startup over it — a
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EntryType } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Query of `DELETE entries`.
|
|
4
|
+
*
|
|
5
|
+
* Without a type it deletes everything, which is what the button in the
|
|
6
|
+
* sidebar has always done. With one it deletes that type and leaves the rest —
|
|
7
|
+
* `pruneByType` existed on every storage and on the interface, and nothing
|
|
8
|
+
* called it: the capability was there and had no door.
|
|
9
|
+
*/
|
|
10
|
+
export declare class ClearEntriesQueryDto {
|
|
11
|
+
type?: EntryType;
|
|
12
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ClearEntriesQueryDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const entry_types_1 = require("./entry-types");
|
|
15
|
+
/**
|
|
16
|
+
* Query of `DELETE entries`.
|
|
17
|
+
*
|
|
18
|
+
* Without a type it deletes everything, which is what the button in the
|
|
19
|
+
* sidebar has always done. With one it deletes that type and leaves the rest —
|
|
20
|
+
* `pruneByType` existed on every storage and on the interface, and nothing
|
|
21
|
+
* called it: the capability was there and had no door.
|
|
22
|
+
*/
|
|
23
|
+
class ClearEntriesQueryDto {
|
|
24
|
+
}
|
|
25
|
+
exports.ClearEntriesQueryDto = ClearEntriesQueryDto;
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, class_validator_1.IsOptional)(),
|
|
28
|
+
(0, class_validator_1.IsIn)(entry_types_1.ENTRY_TYPES, {
|
|
29
|
+
message: `type must be one of: ${entry_types_1.ENTRY_TYPES.join(', ')}`,
|
|
30
|
+
}),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], ClearEntriesQueryDto.prototype, "type", void 0);
|
|
@@ -6,4 +6,13 @@ import { EntryType } from '../../types';
|
|
|
6
6
|
* does not record, or rejects one it does, is a filter that silently returns
|
|
7
7
|
* nothing.
|
|
8
8
|
*/
|
|
9
|
+
/**
|
|
10
|
+
* Every type an entry can have, from the one list that defines them.
|
|
11
|
+
*
|
|
12
|
+
* Written out here as well until the Redis driver's copy of the same list fell
|
|
13
|
+
* one type behind and made `graphql` entries invisible to stats. A DTO that
|
|
14
|
+
* accepts a type the storage does not record, or rejects one it does, is a
|
|
15
|
+
* filter that silently returns nothing — so this is the same list, not another
|
|
16
|
+
* one.
|
|
17
|
+
*/
|
|
9
18
|
export declare const ENTRY_TYPES: EntryType[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ENTRY_TYPES = void 0;
|
|
4
|
+
const types_1 = require("../../types");
|
|
4
5
|
/**
|
|
5
6
|
* Every type an entry can have.
|
|
6
7
|
*
|
|
@@ -8,24 +9,13 @@ exports.ENTRY_TYPES = void 0;
|
|
|
8
9
|
* does not record, or rejects one it does, is a filter that silently returns
|
|
9
10
|
* nothing.
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
'http-client',
|
|
22
|
-
'redis',
|
|
23
|
-
'model',
|
|
24
|
-
'notification',
|
|
25
|
-
'view',
|
|
26
|
-
'command',
|
|
27
|
-
'gate',
|
|
28
|
-
'batch',
|
|
29
|
-
'dump',
|
|
30
|
-
'graphql',
|
|
31
|
-
];
|
|
12
|
+
/**
|
|
13
|
+
* Every type an entry can have, from the one list that defines them.
|
|
14
|
+
*
|
|
15
|
+
* Written out here as well until the Redis driver's copy of the same list fell
|
|
16
|
+
* one type behind and made `graphql` entries invisible to stats. A DTO that
|
|
17
|
+
* accepts a type the storage does not record, or rejects one it does, is a
|
|
18
|
+
* filter that silently returns nothing — so this is the same list, not another
|
|
19
|
+
* one.
|
|
20
|
+
*/
|
|
21
|
+
exports.ENTRY_TYPES = [...types_1.ENTRY_TYPES];
|
package/dist/api/dto/index.d.ts
CHANGED
package/dist/api/dto/index.js
CHANGED
|
@@ -26,7 +26,7 @@ export declare class MemoryStorage implements StorageInterface, OnModuleDestroy
|
|
|
26
26
|
findWithCursor(type: EntryType | undefined, params: CursorPaginationParams): Promise<CursorPaginatedResponse<Entry>>;
|
|
27
27
|
findById(id: number): Promise<Entry | null>;
|
|
28
28
|
count(type?: EntryType): Promise<number>;
|
|
29
|
-
clear(): Promise<
|
|
29
|
+
clear(type?: EntryType): Promise<number>;
|
|
30
30
|
close(): Promise<void>;
|
|
31
31
|
getLatestSequence(type?: EntryType): Promise<number | null>;
|
|
32
32
|
hasEntriesAfter(sequence: number, type?: EntryType): Promise<number>;
|
|
@@ -184,13 +184,27 @@ let MemoryStorage = MemoryStorage_1 = class MemoryStorage {
|
|
|
184
184
|
}
|
|
185
185
|
return results.length;
|
|
186
186
|
}
|
|
187
|
-
async clear() {
|
|
187
|
+
async clear(type) {
|
|
188
|
+
if (type) {
|
|
189
|
+
let deleted = 0;
|
|
190
|
+
for (const [id, entry] of this.entries) {
|
|
191
|
+
if (entry.type !== type)
|
|
192
|
+
continue;
|
|
193
|
+
this.entries.delete(id);
|
|
194
|
+
this.removeEntryTagsInternal(id);
|
|
195
|
+
deleted += 1;
|
|
196
|
+
}
|
|
197
|
+
this.logger.log(`Cleared ${deleted} ${type} entries`);
|
|
198
|
+
return deleted;
|
|
199
|
+
}
|
|
200
|
+
const deleted = this.entries.size;
|
|
188
201
|
this.entries.clear();
|
|
189
202
|
this.entryTags.clear();
|
|
190
203
|
this.tagIndex.clear();
|
|
191
204
|
this.nextId = 1;
|
|
192
205
|
this.oldestId = 1;
|
|
193
206
|
this.logger.log('Storage cleared');
|
|
207
|
+
return deleted;
|
|
194
208
|
}
|
|
195
209
|
async close() {
|
|
196
210
|
this.logger.log('In-memory storage closed');
|
|
@@ -145,7 +145,7 @@ export declare class RedisStorage implements StorageInterface, OnModuleDestroy {
|
|
|
145
145
|
* batches, and the deletes go out in pipelines rather than as one `DEL` with
|
|
146
146
|
* a million arguments.
|
|
147
147
|
*/
|
|
148
|
-
clear(): Promise<
|
|
148
|
+
clear(type?: EntryType): Promise<number>;
|
|
149
149
|
/**
|
|
150
150
|
* Closes the connection, whether or not there ever was one.
|
|
151
151
|
*
|
|
@@ -607,10 +607,20 @@ let RedisStorage = RedisStorage_1 = class RedisStorage {
|
|
|
607
607
|
* batches, and the deletes go out in pipelines rather than as one `DEL` with
|
|
608
608
|
* a million arguments.
|
|
609
609
|
*/
|
|
610
|
-
async clear() {
|
|
610
|
+
async clear(type) {
|
|
611
|
+
if (type) {
|
|
612
|
+
// Every id of that type, whatever its age and whether or not a monitored
|
|
613
|
+
// tag protects it from *pruning*: this is somebody deleting, not the
|
|
614
|
+
// timer tidying.
|
|
615
|
+
const ids = await this.getClient().zrange(this.key('entries', 'type', type), 0, -1);
|
|
616
|
+
await this.deleteEntries(ids);
|
|
617
|
+
this.logger.log(`Cleared ${ids.length} ${type} entries`);
|
|
618
|
+
return ids.length;
|
|
619
|
+
}
|
|
611
620
|
const client = this.getClient();
|
|
612
621
|
let cursor = '0';
|
|
613
622
|
let removed = 0;
|
|
623
|
+
const total = await client.zcard(this.key('entries', 'all'));
|
|
614
624
|
do {
|
|
615
625
|
const [next, keys] = await client.scan(cursor, 'MATCH', `${this.keyPrefix}*`, 'COUNT', 500);
|
|
616
626
|
cursor = next;
|
|
@@ -624,6 +634,7 @@ let RedisStorage = RedisStorage_1 = class RedisStorage {
|
|
|
624
634
|
}
|
|
625
635
|
} while (cursor !== '0');
|
|
626
636
|
this.logger.log(`Storage cleared (${removed} keys)`);
|
|
637
|
+
return total;
|
|
627
638
|
}
|
|
628
639
|
/**
|
|
629
640
|
* Closes the connection, whether or not there ever was one.
|
|
@@ -166,7 +166,7 @@ export declare class SqliteStorage implements StorageInterface, OnModuleInit, On
|
|
|
166
166
|
getLatestSequence(type?: EntryType): Promise<number | null>;
|
|
167
167
|
hasEntriesAfter(sequence: number, type?: EntryType): Promise<number>;
|
|
168
168
|
getStorageStats(): Promise<StorageStats>;
|
|
169
|
-
clear(): Promise<
|
|
169
|
+
clear(type?: EntryType): Promise<number>;
|
|
170
170
|
close(): Promise<void>;
|
|
171
171
|
addTags(entryId: number, tags: string[]): Promise<void>;
|
|
172
172
|
removeTags(entryId: number, tags: string[]): Promise<void>;
|
|
@@ -1115,9 +1115,21 @@ let SqliteStorage = SqliteStorage_1 = class SqliteStorage {
|
|
|
1115
1115
|
databaseSize,
|
|
1116
1116
|
};
|
|
1117
1117
|
}
|
|
1118
|
-
async clear() {
|
|
1118
|
+
async clear(type) {
|
|
1119
|
+
if (type) {
|
|
1120
|
+
// The tags go with their entries; `ON DELETE CASCADE` is not relied on
|
|
1121
|
+
// because the tag table is written to by a separate path.
|
|
1122
|
+
this.db
|
|
1123
|
+
.prepare(`DELETE FROM nestlens_tags WHERE entry_id IN
|
|
1124
|
+
(SELECT id FROM nestlens_entries WHERE type = ?)`)
|
|
1125
|
+
.run(type);
|
|
1126
|
+
const { changes } = this.db.prepare('DELETE FROM nestlens_entries WHERE type = ?').run(type);
|
|
1127
|
+
return Number(changes);
|
|
1128
|
+
}
|
|
1129
|
+
const { total } = this.db.prepare('SELECT COUNT(*) as total FROM nestlens_entries').get();
|
|
1119
1130
|
this.db.exec('DELETE FROM nestlens_tags');
|
|
1120
1131
|
this.db.exec('DELETE FROM nestlens_entries');
|
|
1132
|
+
return Number(total);
|
|
1121
1133
|
}
|
|
1122
1134
|
async close() {
|
|
1123
1135
|
this.db.close();
|
|
@@ -54,9 +54,17 @@ export interface StorageInterface {
|
|
|
54
54
|
*/
|
|
55
55
|
pruneByType(type: EntryType, before: Date): Promise<number>;
|
|
56
56
|
/**
|
|
57
|
-
* Delete all
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
* Delete entries — all of them, or all of one type.
|
|
58
|
+
*
|
|
59
|
+
* Different from pruning in two ways, both deliberate: age is not consulted,
|
|
60
|
+
* and an entry carrying a monitored tag goes with the rest. Monitoring says
|
|
61
|
+
* *do not let pruning take these*; somebody pressing a button that says
|
|
62
|
+
* delete has said something else.
|
|
63
|
+
*
|
|
64
|
+
* Returns how many were deleted, because a reader who pressed it deserves to
|
|
65
|
+
* be told what happened.
|
|
66
|
+
*/
|
|
67
|
+
clear(type?: EntryType): Promise<number>;
|
|
60
68
|
/**
|
|
61
69
|
* Close the storage connection
|
|
62
70
|
*/
|
package/dist/dashboard/public/assets/{BatchDetailView-DZr7YDwl.js → BatchDetailView-CsLvuhNc.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,L as o,A as y,C as u}from"./index-
|
|
1
|
+
import{j as e,L as o,A as y,C as u}from"./index-D-q2Btp7.js";import{p as n,f as v}from"./date-Dwgqy666.js";import{D as r,f as k}from"./DetailRow-9fsW1FDz.js";import{C as m}from"./types-KV6H5D46.js";import{C as w}from"./CopyButton--2uxsJNy.js";import{C as g}from"./circle-x-DaYqPyWY.js";import{C as j}from"./circle-alert-B8wEbjsy.js";import{C}from"./circle-check-big-DQqWHlKx.js";import"./vendor-DBTT3jXp.js";import"./EntryDetailPage-CJeL8LqS.js";import"./search-GQneQM9W.js";const p={completed:{icon:C,color:"text-green-500",bg:"bg-green-100 dark:bg-green-900/30"},partial:{icon:j,color:"text-yellow-500",bg:"bg-yellow-100 dark:bg-yellow-900/30"},failed:{icon:g,color:"text-red-500",bg:"bg-red-100 dark:bg-red-900/30"}};function h(a){return a?a<1024?`${a}B`:a<1024*1024?`${(a/1024).toFixed(1)}KB`:a<1024*1024*1024?`${(a/(1024*1024)).toFixed(1)}MB`:`${(a/(1024*1024*1024)).toFixed(1)}GB`:"-"}function E({entry:a}){const{payload:s,createdAt:c}=a,t=p[s.status]||p.completed,f=t.icon,{processedItems:x,totalItems:d,failedItems:l}=s,i=d>0?Math.round(x/d*100):0;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:`p-2 ${t.bg} rounded-lg`,children:e.jsx(o,{className:`h-5 w-5 ${t.color}`})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white font-mono",children:s.name}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Batch Operation"})]})]}),e.jsx(w,{text:s.name,label:"Copy batch name"})]})}),e.jsxs("div",{className:`grid ${s.memory!==void 0?"grid-cols-2 md:grid-cols-5":"grid-cols-2 md:grid-cols-4"} divide-x divide-gray-200 dark:divide-gray-700`,children:[e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(f,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Status"})]}),e.jsx("p",{className:`text-lg font-bold ${t.color}`,children:s.status.toUpperCase()})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(y,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Progress"})]}),e.jsxs("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:[i,e.jsx("span",{className:"text-sm font-normal text-gray-500 dark:text-gray-400",children:"%"})]})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(u,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Duration"})]}),e.jsxs("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:[s.duration,e.jsx("span",{className:"text-sm font-normal text-gray-500 dark:text-gray-400",children:"ms"})]})]}),l>0&&e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(g,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Failed"})]}),e.jsx("p",{className:"text-lg font-bold text-red-600 dark:text-red-400",children:l})]}),s.memory!==void 0&&e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(o,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Memory"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:h(s.memory)})]})]})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Details"})}),e.jsx("div",{className:"p-4",children:e.jsxs("dl",{className:"divide-y-0",children:[e.jsx(r,{label:"Time",value:e.jsxs("span",{children:[k(n(c),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",v(n(c),{addSuffix:!0}),")"]})]})}),e.jsx(r,{label:"Name",value:e.jsx("code",{className:"text-sm font-mono text-gray-900 dark:text-white",children:s.name})}),s.operation&&e.jsx(r,{label:"Operation",value:e.jsx(m,{listType:"batches",filterType:"operations",filterValue:s.operation,children:s.operation})}),e.jsx(r,{label:"Status",value:e.jsx(m,{listType:"batches",filterType:"statuses",filterValue:s.status,children:s.status.toUpperCase()})}),e.jsx(r,{label:"Progress",value:e.jsxs("div",{children:[e.jsxs("div",{className:"text-sm font-mono",children:[x," / ",d," (",i,"%)"]}),e.jsx("div",{className:"mt-2 w-full bg-gray-200 dark:bg-gray-700 rounded-full h-2",children:e.jsx("div",{className:"bg-blue-600 dark:bg-blue-500 h-2 rounded-full transition-all",style:{width:`${i}%`}})})]})}),l>0&&e.jsx(r,{label:"Failed Items",value:e.jsx("span",{className:"text-red-600 dark:text-red-400 font-mono",children:l})}),e.jsx(r,{label:"Duration",value:`${s.duration}ms`}),s.batchSize&&e.jsx(r,{label:"Batch Size",value:s.batchSize}),s.memory!==void 0&&e.jsx(r,{label:"Memory",value:h(s.memory)})]})})]}),s.errors&&s.errors.length>0&&e.jsxs("div",{className:"card border-red-200 dark:border-red-800",children:[e.jsx("div",{className:"px-4 py-3 border-b border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900/20",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(j,{className:"h-5 w-5 text-red-500"}),e.jsxs("h2",{className:"text-lg font-semibold text-red-700 dark:text-red-400",children:["Errors (",s.errors.length,")"]})]})}),e.jsx("div",{className:"divide-y divide-red-200 dark:divide-red-800",children:s.errors.map((N,b)=>e.jsx("div",{className:"p-4 bg-red-50/50 dark:bg-red-900/10",children:e.jsx("pre",{className:"text-sm text-red-600 dark:text-red-400 font-mono whitespace-pre-wrap overflow-x-auto",children:N})},b))})]})]})}export{E as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t,L as c}from"./index-D-q2Btp7.js";import{e as B,b as D}from"./vendor-DBTT3jXp.js";import{f as T,p as A}from"./date-Dwgqy666.js";import{u as L,a as I,P as $,R as H,N as S,L as W}from"./PageHeader-CYqfOHuc.js";import{u as q,q as O,C as h}from"./types-KV6H5D46.js";import{T as s,D as U,b as z}from"./DataTable-CZnZRo7n.js";import"./timer-DX42dv2R.js";function Z(){const u=B(),{addFilter:o,clearAll:p,serverFilters:x,headerFilters:m}=q("batches"),{rangeFilters:g,windowMinutes:y}=L(),{entries:f,loading:j,refreshing:i,error:b,refresh:d,newEntriesCount:C,hasMore:k,loadMore:w,loadNew:N,autoRefreshEnabled:E,live:v,setAutoRefresh:R,meta:n,isHighlighted:F}=I({type:"batch",limit:50,filters:{...x,...g},windowMinutes:y}),l=f.filter(e=>O(e)),M=D.useMemo(()=>[{key:"name",header:"Name",minWidth:"200px",render:e=>t.jsx(s,{mono:!0,truncate:!0,maxWidth:"250px",children:e.payload.name})},{key:"operation",header:"Operation",width:"150px",render:e=>{const a=e.payload.operation;return a?t.jsx(h,{onClick:r=>{r.stopPropagation(),o("operations",a)},children:a}):t.jsx(s,{secondary:!0,children:"-"})}},{key:"progress",header:"Progress",width:"150px",render:e=>{const{processedItems:a,totalItems:r}=e.payload,P=r>0?Math.round(a/r*100):0;return t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx(s,{children:`${a}/${r}`}),t.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["(",P,"%)"]})]})}},{key:"status",header:"Status",width:"120px",render:e=>t.jsx(h,{onClick:a=>{a.stopPropagation(),o("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>e.payload.duration?t.jsx(U,{ms:e.payload.duration}):t.jsx(s,{secondary:!0,children:"-"})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(s,{secondary:!0,className:"text-xs",children:T(A(e.createdAt),{addSuffix:!0})})}],[o]);return j&&l.length===0?t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):t.jsxs("div",{children:[t.jsx($,{title:"Batches",icon:c,iconColor:"text-blue-600 dark:text-blue-400",count:l.length,totalCount:n==null?void 0:n.total,clearable:{type:"batch",label:"batches",onCleared:d},refreshing:i,autoRefreshEnabled:E,live:v,onAutoRefreshToggle:R,filters:m,filterControls:t.jsx(H,{route:"batches"}),onClearAllFilters:p}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(S,{count:C,onClick:N,loading:i}),t.jsx(z,{columns:M,data:l,keyExtractor:e=>e.id,onRowClick:e=>u(`/batches/${e.id}`),rowClassName:e=>F(e.id)?"highlight-new":"",emptyMessage:"No batch operations recorded yet",error:b,onRetry:d,emptyIcon:t.jsx(c,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(W,{hasMore:k,onClick:w,loading:i})]})]})}export{Z as default};
|
package/dist/dashboard/public/assets/{CacheDetailView-DGXqcx8-.js → CacheDetailView-ZtX5fd6i.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as h,j as e,D as d,C as g}from"./index-
|
|
1
|
+
import{c as h,j as e,D as d,C as g}from"./index-D-q2Btp7.js";import{p as o,f as p}from"./date-Dwgqy666.js";import{D as t,f as b}from"./DetailRow-9fsW1FDz.js";import{C as x}from"./types-KV6H5D46.js";import{u as j,C as y,T as f}from"./EntryDetailPage-CJeL8LqS.js";import{C as u}from"./CopyButton--2uxsJNy.js";import{C as N}from"./circle-check-big-DQqWHlKx.js";import{C as v}from"./circle-x-DaYqPyWY.js";import{T as k}from"./timer-DX42dv2R.js";import"./vendor-DBTT3jXp.js";import"./search-GQneQM9W.js";/**
|
|
2
2
|
* @license lucide-react v0.468.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as a,H as l}from"./index-D-q2Btp7.js";import{e as R,b as v}from"./vendor-DBTT3jXp.js";import{f as D,p as F}from"./date-Dwgqy666.js";import{u as M,a as A,P as H,R as P,N as B,L as I}from"./PageHeader-CYqfOHuc.js";import{u as L,f as S,C as n}from"./types-KV6H5D46.js";import{T as i,D as W,b as K}from"./DataTable-CZnZRo7n.js";import"./timer-DX42dv2R.js";function Q(){const d=R(),{clearAll:c,serverFilters:h,headerFilters:u}=L("cache"),{rangeFilters:p,windowMinutes:x}=M(),{entries:m,loading:y,refreshing:t,error:g,refresh:o,newEntriesCount:f,hasMore:j,loadMore:C,loadNew:k,autoRefreshEnabled:w,live:b,setAutoRefresh:N,meta:r,isHighlighted:T}=A({type:"cache",limit:50,filters:{...h,...p},windowMinutes:x}),s=m.filter(e=>S(e)),E=v.useMemo(()=>[{key:"operation",header:"Operation",width:"100px",render:e=>a.jsx(n,{listType:"cache",filterType:"operations",children:e.payload.operation})},{key:"key",header:"Key",minWidth:"200px",render:e=>a.jsx(i,{mono:!0,truncate:!0,maxWidth:"400px",children:e.payload.key.length>50?e.payload.key.substring(0,50)+"...":e.payload.key})},{key:"result",header:"Result",width:"80px",align:"center",render:e=>e.payload.operation==="get"?a.jsx(n,{listType:"cache",filterType:"tags",filterValue:e.payload.hit?"hit":"miss",children:e.payload.hit?"HIT":"MISS"}):a.jsx(i,{secondary:!0,children:"—"})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>a.jsx(W,{ms:e.payload.duration||0})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(i,{secondary:!0,className:"text-xs",children:D(F(e.createdAt),{addSuffix:!0})})}],[]);return y&&s.length===0?a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):a.jsxs("div",{children:[a.jsx(H,{title:"Cache",icon:l,iconColor:"text-cyan-600 dark:text-cyan-400",count:s.length,totalCount:r==null?void 0:r.total,clearable:{type:"cache",label:"cache",onCleared:o},refreshing:t,autoRefreshEnabled:w,live:b,onAutoRefreshToggle:N,filters:u,filterControls:a.jsx(P,{route:"cache"}),onClearAllFilters:c}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(B,{count:f,onClick:k,loading:t}),a.jsx(K,{columns:E,data:s,keyExtractor:e=>e.id,onRowClick:e=>d(`/cache/${e.id}`),rowClassName:e=>T(e.id)?"highlight-new":"",emptyMessage:"No cache operations recorded yet",error:g,onRetry:o,emptyIcon:a.jsx(l,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(I,{hasMore:j,onClick:C,loading:t})]})]})}export{Q as default};
|
package/dist/dashboard/public/assets/{CommandDetailView-li2tXFC7.js → CommandDetailView-B7LgkUsq.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,b as m,C as p}from"./index-
|
|
1
|
+
import{j as e,b as m,C as p}from"./index-D-q2Btp7.js";import{b as v}from"./vendor-DBTT3jXp.js";import{p as h,f as N}from"./date-Dwgqy666.js";import{D as t,f as k}from"./DetailRow-9fsW1FDz.js";import{C as b}from"./types-KV6H5D46.js";import{u as c,C as n,T as C}from"./EntryDetailPage-CJeL8LqS.js";import{C as T}from"./CopyButton--2uxsJNy.js";import{C as w}from"./circle-check-big-DQqWHlKx.js";import{C as g}from"./circle-x-DaYqPyWY.js";import"./search-GQneQM9W.js";function I({entry:u}){const{payload:a,createdAt:x}=u,d=c(),l=c(),o=c(),[i,j]=v.useState("payload"),r=a.status==="completed"?{icon:w,color:"text-green-500",bg:"bg-green-100 dark:bg-green-900/30"}:a.status==="executing"?{icon:p,color:"text-blue-500",bg:"bg-blue-100 dark:bg-blue-900/30"}:{icon:g,color:"text-red-500",bg:"bg-red-100 dark:bg-red-900/30"},y=r.icon,s=[];a.payload!==void 0&&s.push({id:"payload",label:"Payload",content:e.jsx(n,{data:a.payload,toolbarState:d.state,searchBar:d.SearchBar,maxHeight:400})}),a.result!==void 0&&s.push({id:"result",label:"Result",content:e.jsx(n,{data:a.result,toolbarState:l.state,searchBar:l.SearchBar,maxHeight:400})}),a.metadata!==void 0&&s.push({id:"metadata",label:"Metadata",content:e.jsx(n,{data:a.metadata,toolbarState:o.state,searchBar:o.SearchBar,maxHeight:400})});const f=()=>{if(i==="payload"&&a.payload!==void 0)return e.jsx(d.Toolbar,{data:a.payload});if(i==="result"&&a.result!==void 0)return e.jsx(l.Toolbar,{data:a.result});if(i==="metadata"&&a.metadata!==void 0)return e.jsx(o.Toolbar,{data:a.metadata})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:`p-2 ${r.bg} rounded-lg`,children:e.jsx(m,{className:`h-5 w-5 ${r.color}`})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white font-mono",children:a.name}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Command Execution"})]})]}),e.jsx(T,{text:a.name,label:"Copy command"})]})}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 divide-x divide-gray-200 dark:divide-gray-700",children:[e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(m,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Command"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white font-mono truncate",title:a.name,children:a.name})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(y,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Status"})]}),e.jsx("p",{className:`text-lg font-bold ${r.color}`,children:a.status.toUpperCase()})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(p,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Duration"})]}),e.jsxs("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:[a.duration,e.jsx("span",{className:"text-sm font-normal text-gray-500 dark:text-gray-400",children:"ms"})]})]})]})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Details"})}),e.jsx("div",{className:"p-4",children:e.jsxs("dl",{className:"divide-y-0",children:[e.jsx(t,{label:"Time",value:e.jsxs("span",{children:[k(h(x),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",N(h(x),{addSuffix:!0}),")"]})]})}),e.jsx(t,{label:"Command",value:e.jsx(b,{listType:"commands",filterType:"names",filterValue:a.name,children:a.name})}),a.handler&&e.jsx(t,{label:"Handler",value:e.jsx("code",{className:"text-sm font-mono text-gray-900 dark:text-white",children:a.handler})}),e.jsx(t,{label:"Status",value:e.jsx(b,{listType:"commands",filterType:"statuses",filterValue:a.status,children:a.status.toUpperCase()})}),e.jsx(t,{label:"Duration",value:a.duration!==void 0?`${a.duration}ms`:"-"})]})})]}),a.error&&e.jsxs("div",{className:"card border-red-200 dark:border-red-800",children:[e.jsx("div",{className:"px-4 py-3 border-b border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900/20",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(g,{className:"h-5 w-5 text-red-500"}),e.jsx("h2",{className:"text-lg font-semibold text-red-700 dark:text-red-400",children:"Error"})]})}),e.jsx("div",{className:"p-4 bg-red-50/50 dark:bg-red-900/10",children:e.jsx("pre",{className:"text-sm text-red-600 dark:text-red-400 font-mono whitespace-pre-wrap overflow-x-auto",children:a.error})})]}),s.length>0&&e.jsx(C,{tabs:s,defaultTab:"payload",hashKey:"command",headerRight:f(),onTabChange:j})]})}export{I as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as a,b as d}from"./index-D-q2Btp7.js";import{e as T,b as D}from"./vendor-DBTT3jXp.js";import{f as M,p as P}from"./date-Dwgqy666.js";import{u as A,a as B,P as H,R as L,N as W,L as S}from"./PageHeader-CYqfOHuc.js";import{u as I,o as U,C as m}from"./types-KV6H5D46.js";import{T as i,D as $,b as q}from"./DataTable-CZnZRo7n.js";import"./timer-DX42dv2R.js";function X(){const c=T(),{addFilter:t,clearAll:u,serverFilters:h,headerFilters:p}=I("commands"),{rangeFilters:x,windowMinutes:g}=A(),{entries:f,loading:y,refreshing:r,error:C,refresh:l,newEntriesCount:j,hasMore:k,loadMore:w,loadNew:b,autoRefreshEnabled:N,live:E,setAutoRefresh:R,meta:s,isHighlighted:v}=B({type:"command",limit:50,filters:{...h,...x},windowMinutes:g}),o=f.filter(e=>U(e)),F=D.useMemo(()=>[{key:"name",header:"Command",minWidth:"250px",render:e=>a.jsx(m,{onClick:n=>{n.stopPropagation(),t("names",e.payload.name)},className:"font-mono",children:e.payload.name})},{key:"handler",header:"Handler",minWidth:"200px",render:e=>e.payload.handler?a.jsx(i,{mono:!0,truncate:!0,maxWidth:"250px",children:e.payload.handler}):a.jsx(i,{secondary:!0,children:"-"})},{key:"status",header:"Status",width:"100px",render:e=>a.jsx(m,{onClick:n=>{n.stopPropagation(),t("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>a.jsx($,{ms:e.payload.duration??0})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(i,{secondary:!0,className:"text-xs",children:M(P(e.createdAt),{addSuffix:!0})})}],[t]);return y&&o.length===0?a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):a.jsxs("div",{children:[a.jsx(H,{title:"Commands",icon:d,iconColor:"text-green-600 dark:text-green-400",count:o.length,totalCount:s==null?void 0:s.total,clearable:{type:"command",label:"commands",onCleared:l},refreshing:r,autoRefreshEnabled:N,live:E,onAutoRefreshToggle:R,filters:p,filterControls:a.jsx(L,{route:"commands"}),onClearAllFilters:u}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(W,{count:j,onClick:b,loading:r}),a.jsx(q,{columns:F,data:o,keyExtractor:e=>e.id,onRowClick:e=>c(`/commands/${e.id}`),rowClassName:e=>v(e.id)?"highlight-new":"",emptyMessage:"No commands recorded yet",error:C,onRetry:l,emptyIcon:a.jsx(d,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(S,{hasMore:k,onClick:w,loading:r})]})]})}export{X as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{j as e,z as n}from"./index-
|
|
1
|
+
import{j as e,z as n}from"./index-D-q2Btp7.js";import{b as p}from"./vendor-DBTT3jXp.js";import{a as i,b as c}from"./EntryDetailPage-CJeL8LqS.js";function y({text:l,label:r="Copy",successMessage:x="Copied to clipboard!",className:t="",iconOnly:d=!1}){const[s,a]=p.useState(!1),o=async()=>{try{await navigator.clipboard.writeText(l),a(!0),n.success(x),setTimeout(()=>a(!1),2e3)}catch{n.error("Failed to copy")}};return d?e.jsx("button",{onClick:o,className:`p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors ${t}`,title:r,children:s?e.jsx(i,{className:"h-4 w-4 text-green-500"}):e.jsx(c,{className:"h-4 w-4 text-gray-500"})}):e.jsx("button",{onClick:o,className:`inline-flex items-center space-x-2 px-3 py-1.5 text-sm font-medium rounded-lg
|
|
2
2
|
bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600
|
|
3
3
|
text-gray-700 dark:text-gray-300 transition-colors ${t}`,children:s?e.jsxs(e.Fragment,{children:[e.jsx(i,{className:"h-4 w-4 text-green-500"}),e.jsx("span",{children:"Copied!"})]}):e.jsxs(e.Fragment,{children:[e.jsx(c,{className:"h-4 w-4"}),e.jsx("span",{children:r})]})})}export{y as C};
|
package/dist/dashboard/public/assets/{DashboardPage-fYcPzXMR.js → DashboardPage-BBwAa16h.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as $,g as pe,j as e,X as he,a as be,z as j,r as fe,u as ke,T as v,D as oe,C as I,A as G,G as ve,F as je,B as Ne,P as we,b as Ee,H,d as Ce,L as Se,e as Te,M as $e,f as qe,R as Pe,h as Me,S as Le,i as X,k as Y,l as Re,m as ee,n as te,o as Ae,p as ae}from"./index-
|
|
1
|
+
import{c as $,g as pe,j as e,X as he,a as be,z as j,r as fe,u as ke,T as v,D as oe,C as I,A as G,G as ve,F as je,B as Ne,P as we,b as Ee,H,d as Ce,L as Se,e as Te,M as $e,f as qe,R as Pe,h as Me,S as Le,i as X,k as Y,l as Re,m as ee,n as te,o as Ae,p as ae}from"./index-D-q2Btp7.js";import{b as d,e as De,L as Be}from"./vendor-DBTT3jXp.js";import{g as ie,f as C,p as S}from"./date-Dwgqy666.js";import{E as Ie}from"./eye-Bz8w_8de.js";import{Z as Fe}from"./zap-BM7YA56F.js";import{C as Ge}from"./calendar-mffR88jS.js";/**
|
|
2
2
|
* @license lucide-react v0.468.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as F,j as e,i as z,T as R}from"./index-
|
|
1
|
+
import{c as F,j as e,i as z,T as R}from"./index-D-q2Btp7.js";import{b as c}from"./vendor-DBTT3jXp.js";import{g as m}from"./date-Dwgqy666.js";/**
|
|
2
2
|
* @license lucide-react v0.468.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|