querysub 0.312.0 → 0.313.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cursorrules +1 -1
- package/costsBenefits.txt +4 -1
- package/package.json +3 -2
- package/spec.txt +23 -18
- package/src/-0-hooks/hooks.ts +1 -1
- package/src/-a-archives/archives.ts +16 -3
- package/src/-a-archives/archivesBackBlaze.ts +51 -3
- package/src/-a-archives/archivesLimitedCache.ts +175 -0
- package/src/-a-archives/archivesPrivateFileSystem.ts +299 -0
- package/src/-a-auth/certs.ts +58 -31
- package/src/-b-authorities/cdnAuthority.ts +2 -2
- package/src/-b-authorities/dnsAuthority.ts +3 -2
- package/src/-c-identity/IdentityController.ts +3 -2
- package/src/-d-trust/NetworkTrust2.ts +17 -19
- package/src/-e-certs/EdgeCertController.ts +3 -4
- package/src/-e-certs/certAuthority.ts +1 -2
- package/src/-f-node-discovery/NodeDiscovery.ts +9 -7
- package/src/-g-core-values/NodeCapabilities.ts +6 -1
- package/src/0-path-value-core/NodePathAuthorities.ts +1 -1
- package/src/0-path-value-core/PathValueCommitter.ts +3 -3
- package/src/0-path-value-core/PathValueController.ts +3 -3
- package/src/0-path-value-core/archiveLocks/ArchiveLocks2.ts +15 -37
- package/src/0-path-value-core/pathValueCore.ts +4 -3
- package/src/3-path-functions/PathFunctionRunner.ts +2 -2
- package/src/4-dom/qreact.tsx +4 -3
- package/src/4-querysub/Querysub.ts +2 -2
- package/src/4-querysub/QuerysubController.ts +2 -2
- package/src/5-diagnostics/GenericFormat.tsx +1 -0
- package/src/5-diagnostics/Table.tsx +3 -0
- package/src/5-diagnostics/diskValueAudit.ts +2 -1
- package/src/5-diagnostics/nodeMetadata.ts +0 -1
- package/src/deployManager/components/MachineDetailPage.tsx +9 -1
- package/src/deployManager/components/ServiceDetailPage.tsx +10 -1
- package/src/diagnostics/NodeViewer.tsx +3 -4
- package/src/diagnostics/logs/FastArchiveAppendable.ts +748 -0
- package/src/diagnostics/logs/FastArchiveController.ts +524 -0
- package/src/diagnostics/logs/FastArchiveViewer.tsx +863 -0
- package/src/diagnostics/logs/LogViewer2.tsx +349 -0
- package/src/diagnostics/logs/TimeRangeSelector.tsx +94 -0
- package/src/diagnostics/logs/diskLogger.ts +135 -305
- package/src/diagnostics/logs/diskShimConsoleLogs.ts +6 -29
- package/src/diagnostics/logs/errorNotifications/ErrorNotificationController.ts +577 -0
- package/src/diagnostics/logs/errorNotifications/ErrorSuppressionUI.tsx +225 -0
- package/src/diagnostics/logs/errorNotifications/ErrorWarning.tsx +207 -0
- package/src/diagnostics/logs/importLogsEntry.ts +38 -0
- package/src/diagnostics/logs/injectFileLocationToConsole.ts +7 -17
- package/src/diagnostics/logs/lifeCycleAnalysis/lifeCycles.tsx +0 -0
- package/src/diagnostics/logs/lifeCycleAnalysis/spec.md +151 -0
- package/src/diagnostics/managementPages.tsx +7 -16
- package/src/diagnostics/misc-pages/ComponentSyncStats.tsx +0 -1
- package/src/diagnostics/periodic.ts +5 -0
- package/src/diagnostics/watchdog.ts +2 -2
- package/src/functional/SocketChannel.ts +67 -0
- package/src/library-components/Input.tsx +1 -1
- package/src/library-components/InputLabel.tsx +5 -2
- package/src/misc.ts +111 -0
- package/src/src.d.ts +34 -1
- package/src/user-implementation/userData.ts +4 -3
- package/test.ts +13 -0
- package/testEntry2.ts +29 -0
- package/src/diagnostics/errorLogs/ErrorLogController.ts +0 -535
- package/src/diagnostics/errorLogs/ErrorLogCore.ts +0 -274
- package/src/diagnostics/errorLogs/LogClassifiers.tsx +0 -308
- package/src/diagnostics/errorLogs/LogFilterUI.tsx +0 -84
- package/src/diagnostics/errorLogs/LogNotify.tsx +0 -101
- package/src/diagnostics/errorLogs/LogTimeSelector.tsx +0 -723
- package/src/diagnostics/errorLogs/LogViewer.tsx +0 -757
- package/src/diagnostics/errorLogs/logFiltering.tsx +0 -149
- package/src/diagnostics/logs/DiskLoggerPage.tsx +0 -613
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { getBrowserUrlNode } from "../../../src/-f-node-discovery/NodeDiscovery";
|
|
2
|
-
import { LogViewerController, LogViewerSynced, downloadLogsOnceURL } from "./LogViewer";
|
|
3
|
-
import { ErrorLogControllerBase, LogIssueNotify, watchLogIssueNotify } from "../../../src/diagnostics/errorLogs/ErrorLogController";
|
|
4
|
-
import { doAtomicWrites, atomic } from "../../../src/2-proxy/PathValueProxyWatcher";
|
|
5
|
-
import { ExternalRenderClass, qreact } from "../../../src/4-dom/qreact";
|
|
6
|
-
import { Querysub } from "../../../src/4-querysub/Querysub";
|
|
7
|
-
import { isClient } from "../../../src/config2";
|
|
8
|
-
import { logErrors } from "../../../src/errors";
|
|
9
|
-
import { lazy } from "socket-function/src/caching";
|
|
10
|
-
import { SocketFunction } from "socket-function/SocketFunction";
|
|
11
|
-
import { css } from "typesafecss";
|
|
12
|
-
import { formatDate, formatTime } from "socket-function/src/formatting/format";
|
|
13
|
-
import { errorMessage, warnMessage } from "../../../src/5-diagnostics/GenericFormat";
|
|
14
|
-
import { Anchor } from "../../../src/library-components/ATag";
|
|
15
|
-
import { renderIsManagementUser, showingManagementURL, managementPageURL, assertIsManagementUser } from "../managementPages";
|
|
16
|
-
|
|
17
|
-
export class LogNotify extends qreact.Component<{
|
|
18
|
-
class?: string;
|
|
19
|
-
}> {
|
|
20
|
-
public render() {
|
|
21
|
-
if (!renderIsManagementUser()) return undefined;
|
|
22
|
-
let issues = getLogIssues();
|
|
23
|
-
let top = issues?.oldestUnsuppressed || issues?.oldestUngrouped;
|
|
24
|
-
if (!top) return undefined;
|
|
25
|
-
|
|
26
|
-
return <Anchor
|
|
27
|
-
title={`At ${formatDate(top.time)}: ${top.message}`}
|
|
28
|
-
target="_blank"
|
|
29
|
-
class={
|
|
30
|
-
css.ellipsis
|
|
31
|
-
.overflowHidden
|
|
32
|
-
+ (issues?.oldestUngrouped ? errorMessage : warnMessage)
|
|
33
|
-
+ this.props.class
|
|
34
|
-
}
|
|
35
|
-
values={[
|
|
36
|
-
{ param: showingManagementURL, value: true },
|
|
37
|
-
{ param: managementPageURL, value: "LogViewer" },
|
|
38
|
-
{ param: downloadLogsOnceURL, value: true },
|
|
39
|
-
]}
|
|
40
|
-
>
|
|
41
|
-
{/* TODO: Detect a stack format, separate the message from the stack, and display them differently. */}
|
|
42
|
-
({formatTime(Date.now() - top.time)}) {stripANSI(top.message).replaceAll("\n", " \\n ")}
|
|
43
|
-
</Anchor>;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
// `\x1b[38;2;${r};${g};${b}m${text}\x1b[0m` => text
|
|
47
|
-
function stripANSI(text: string) {
|
|
48
|
-
return text.replace(/\x1b\[[0-9;]*m/g, "");
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
let logIssueNotifyState = lazy(() => Querysub.createLocalSchema<{
|
|
52
|
-
notify: LogIssueNotify | undefined;
|
|
53
|
-
}>("logIssueNotify"));
|
|
54
|
-
let watchers = new Set<ExternalRenderClass>();
|
|
55
|
-
function onLogIssueNotify(notify: LogIssueNotify | undefined) {
|
|
56
|
-
Querysub.commit(() => {
|
|
57
|
-
doAtomicWrites(() => {
|
|
58
|
-
logIssueNotifyState()().notify = notify;
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
setImmediate(() => {
|
|
63
|
-
watchLogIssueNotify(onLogIssueNotify);
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
export function getLogIssues(): LogIssueNotify | undefined {
|
|
67
|
-
if (!isClient()) throw new Error(`getLogIssues must be called clientside`);
|
|
68
|
-
const currentComponent = qreact.getRenderingComponent();
|
|
69
|
-
if (!currentComponent) throw new Error(`getLogIssues must be called from a component`);
|
|
70
|
-
|
|
71
|
-
if (watchers.size === 0) {
|
|
72
|
-
logErrors(ErrorLogControllerNotify.nodes[getBrowserUrlNode()].watchLogs(
|
|
73
|
-
ErrorLogControllerNotify
|
|
74
|
-
));
|
|
75
|
-
}
|
|
76
|
-
if (!watchers.has(currentComponent)) {
|
|
77
|
-
watchers.add(currentComponent);
|
|
78
|
-
qreact.watchUnmount(currentComponent, () => {
|
|
79
|
-
watchers.delete(currentComponent);
|
|
80
|
-
if (watchers.size === 0) {
|
|
81
|
-
logErrors(ErrorLogControllerNotify.nodes[getBrowserUrlNode()].unwatchLogs());
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return atomic(logIssueNotifyState()().notify);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
const ErrorLogControllerNotify = SocketFunction.register(
|
|
91
|
-
"ErrorLogControllerNotify-9030f46d-e80d-462a-b78e-549143fe288a",
|
|
92
|
-
new ErrorLogControllerBase(),
|
|
93
|
-
() => ({
|
|
94
|
-
watchLogs: {},
|
|
95
|
-
unwatchLogs: {},
|
|
96
|
-
logsIssueNotifyCallback: {},
|
|
97
|
-
}),
|
|
98
|
-
() => ({
|
|
99
|
-
hooks: [assertIsManagementUser],
|
|
100
|
-
}),
|
|
101
|
-
);
|