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.
Files changed (69) hide show
  1. package/.cursorrules +1 -1
  2. package/costsBenefits.txt +4 -1
  3. package/package.json +3 -2
  4. package/spec.txt +23 -18
  5. package/src/-0-hooks/hooks.ts +1 -1
  6. package/src/-a-archives/archives.ts +16 -3
  7. package/src/-a-archives/archivesBackBlaze.ts +51 -3
  8. package/src/-a-archives/archivesLimitedCache.ts +175 -0
  9. package/src/-a-archives/archivesPrivateFileSystem.ts +299 -0
  10. package/src/-a-auth/certs.ts +58 -31
  11. package/src/-b-authorities/cdnAuthority.ts +2 -2
  12. package/src/-b-authorities/dnsAuthority.ts +3 -2
  13. package/src/-c-identity/IdentityController.ts +3 -2
  14. package/src/-d-trust/NetworkTrust2.ts +17 -19
  15. package/src/-e-certs/EdgeCertController.ts +3 -4
  16. package/src/-e-certs/certAuthority.ts +1 -2
  17. package/src/-f-node-discovery/NodeDiscovery.ts +9 -7
  18. package/src/-g-core-values/NodeCapabilities.ts +6 -1
  19. package/src/0-path-value-core/NodePathAuthorities.ts +1 -1
  20. package/src/0-path-value-core/PathValueCommitter.ts +3 -3
  21. package/src/0-path-value-core/PathValueController.ts +3 -3
  22. package/src/0-path-value-core/archiveLocks/ArchiveLocks2.ts +15 -37
  23. package/src/0-path-value-core/pathValueCore.ts +4 -3
  24. package/src/3-path-functions/PathFunctionRunner.ts +2 -2
  25. package/src/4-dom/qreact.tsx +4 -3
  26. package/src/4-querysub/Querysub.ts +2 -2
  27. package/src/4-querysub/QuerysubController.ts +2 -2
  28. package/src/5-diagnostics/GenericFormat.tsx +1 -0
  29. package/src/5-diagnostics/Table.tsx +3 -0
  30. package/src/5-diagnostics/diskValueAudit.ts +2 -1
  31. package/src/5-diagnostics/nodeMetadata.ts +0 -1
  32. package/src/deployManager/components/MachineDetailPage.tsx +9 -1
  33. package/src/deployManager/components/ServiceDetailPage.tsx +10 -1
  34. package/src/diagnostics/NodeViewer.tsx +3 -4
  35. package/src/diagnostics/logs/FastArchiveAppendable.ts +748 -0
  36. package/src/diagnostics/logs/FastArchiveController.ts +524 -0
  37. package/src/diagnostics/logs/FastArchiveViewer.tsx +863 -0
  38. package/src/diagnostics/logs/LogViewer2.tsx +349 -0
  39. package/src/diagnostics/logs/TimeRangeSelector.tsx +94 -0
  40. package/src/diagnostics/logs/diskLogger.ts +135 -305
  41. package/src/diagnostics/logs/diskShimConsoleLogs.ts +6 -29
  42. package/src/diagnostics/logs/errorNotifications/ErrorNotificationController.ts +577 -0
  43. package/src/diagnostics/logs/errorNotifications/ErrorSuppressionUI.tsx +225 -0
  44. package/src/diagnostics/logs/errorNotifications/ErrorWarning.tsx +207 -0
  45. package/src/diagnostics/logs/importLogsEntry.ts +38 -0
  46. package/src/diagnostics/logs/injectFileLocationToConsole.ts +7 -17
  47. package/src/diagnostics/logs/lifeCycleAnalysis/lifeCycles.tsx +0 -0
  48. package/src/diagnostics/logs/lifeCycleAnalysis/spec.md +151 -0
  49. package/src/diagnostics/managementPages.tsx +7 -16
  50. package/src/diagnostics/misc-pages/ComponentSyncStats.tsx +0 -1
  51. package/src/diagnostics/periodic.ts +5 -0
  52. package/src/diagnostics/watchdog.ts +2 -2
  53. package/src/functional/SocketChannel.ts +67 -0
  54. package/src/library-components/Input.tsx +1 -1
  55. package/src/library-components/InputLabel.tsx +5 -2
  56. package/src/misc.ts +111 -0
  57. package/src/src.d.ts +34 -1
  58. package/src/user-implementation/userData.ts +4 -3
  59. package/test.ts +13 -0
  60. package/testEntry2.ts +29 -0
  61. package/src/diagnostics/errorLogs/ErrorLogController.ts +0 -535
  62. package/src/diagnostics/errorLogs/ErrorLogCore.ts +0 -274
  63. package/src/diagnostics/errorLogs/LogClassifiers.tsx +0 -308
  64. package/src/diagnostics/errorLogs/LogFilterUI.tsx +0 -84
  65. package/src/diagnostics/errorLogs/LogNotify.tsx +0 -101
  66. package/src/diagnostics/errorLogs/LogTimeSelector.tsx +0 -723
  67. package/src/diagnostics/errorLogs/LogViewer.tsx +0 -757
  68. package/src/diagnostics/errorLogs/logFiltering.tsx +0 -149
  69. package/src/diagnostics/logs/DiskLoggerPage.tsx +0 -613
@@ -1,149 +0,0 @@
1
- import { URLParam, createURLSync } from "../../../src/library-components/URLParam";
2
- import preact from "preact"; import { qreact } from "../../../src/4-dom/qreact";
3
- import { Button } from "../../../src/library-components/Button";
4
- import { css } from "typesafecss";
5
- import { LogBlockInfo } from "../../../src/diagnostics/errorLogs/ErrorLogCore";
6
- import { cache } from "socket-function/src/caching";
7
- import { formatNumber } from "socket-function/src/formatting/format";
8
- import { TimelineInfo } from "./LogTimeSelector";
9
- import { getPathFromStr, getPathStr } from "../../../src/path";
10
-
11
- // NOTE: You visit the page to see errors, so that's what we mostly show.
12
- // - We show all values inside the top UI AND the "last" UI
13
- // - The "top" UI helps the user discover what they can see
14
- // - The "last" UI results in being able to see if the warning fraction is increasing
15
- // - Also, because of the minimum size, it SHOULD allow seeing if there are any fatals
16
- // or infos (the fraction will almost always be crushed by warnings though).
17
- // - The rest of the UI is just based on showing when things happened, and then
18
- // resolving recent issues.
19
-
20
- export const showFatalURL = new URLParam("showLogs", true);
21
- export const showErrorURL = new URLParam("showErrors", true);
22
- export const showWarningURL = new URLParam("showWarnings", false);
23
- export const showInfoURL = new URLParam("showInfos", false);
24
-
25
- export const showOldestLogsFirstURL = new URLParam("logOldestFirst", false);
26
- export const showLiveLogsURL = new URLParam("showLiveLogs", true);
27
-
28
- // getPathStr(ids)
29
- export const filterToClassesURL = new URLParam("filterToClasses", "");
30
- export const filterMachineIdsURL = new URLParam("filterMachineIds", "");
31
- export const filterThreadIdsURL = new URLParam("filterThreadIds", "");
32
-
33
- export function getPathArrayLax(str: string) {
34
- if (!str) return [];
35
- let array = getPathFromStr(str);
36
- if (!array.length) return [str];
37
- return array;
38
- }
39
- export function getLogFilterClasses() {
40
- return getPathArrayLax(filterToClassesURL.value);
41
- }
42
- export function getLogFilterMachineIds() {
43
- return getPathArrayLax(filterMachineIdsURL.value);
44
- }
45
- export function getLogFilterThreadIds() {
46
- return getPathArrayLax(filterThreadIdsURL.value);
47
- }
48
-
49
- export const fatalColor = { h: -5, s: 75, l: 75 };
50
- export const errorColor = { h: 0, s: 50, l: 50 };
51
- export const warnColor = { h: 50, s: 50, l: 50 };
52
- export const infoColor = { h: 200, s: 50, l: 50 };
53
-
54
- export const countColors = {
55
- fatal: fatalColor,
56
- error: errorColor,
57
- warn: warnColor,
58
- info: infoColor,
59
- };
60
-
61
- export type Counts = {
62
- total: number;
63
- fatal: number;
64
- error: number;
65
- warn: number;
66
- info: number;
67
- };
68
- export let countTypes = ["fatal", "error", "warn", "info"] as const;
69
-
70
-
71
- export class PickLogType extends qreact.Component<{
72
- infos: TimelineInfo[] | undefined;
73
- }> {
74
- render() {
75
- let counts = countTypesCache(this.props.infos);
76
- function renderShowButton(config: {
77
- url: URLParam<boolean>;
78
- title: string;
79
- color: { h: number; s: number; l: number; };
80
- count: number;
81
- }) {
82
- let { url, title, color, count } = config;
83
- color = { ...color };
84
- if (!url.value) {
85
- color.s -= 30;
86
- }
87
- return (
88
- <Button
89
- class={css
90
- .hsla(color.h, color.s, color.l, 1)
91
- .button
92
- .color("white")
93
- .border("1px solid hsl(0, 0%, 10%)")
94
- .boldStyle
95
- .pad2(30, 16)
96
- + (!url.value ? css.opacity(0.5) : "")
97
- }
98
- onClick={() => url.value = !url.value}
99
- >
100
- {url.value ? "Hide " : "Show "} {formatNumber(count)} {title}s
101
- </Button>
102
- );
103
- }
104
- return (
105
- <div class={css.hbox(2).center}>
106
- {renderShowButton({
107
- url: showFatalURL,
108
- title: "Fatal",
109
- color: fatalColor,
110
- count: counts.fatalCount,
111
- })}
112
- {renderShowButton({
113
- url: showErrorURL,
114
- title: "Error",
115
- color: errorColor,
116
- count: counts.errorCount,
117
- })}
118
- {renderShowButton({
119
- url: showWarningURL,
120
- title: "Warning",
121
- color: warnColor,
122
- count: counts.warnCount,
123
- })}
124
- {renderShowButton({
125
- url: showInfoURL,
126
- title: "Info",
127
- color: infoColor,
128
- count: counts.infoCount,
129
- })}
130
- </div>
131
- );
132
- }
133
- }
134
-
135
- const countTypesCache = cache((infos: TimelineInfo[] | undefined) => {
136
- let fatalCount = 0;
137
- let errorCount = 0;
138
- let warnCount = 0;
139
- let infoCount = 0;
140
- if (infos) {
141
- for (let info of infos) {
142
- fatalCount += info.fatalCount;
143
- errorCount += info.errorCount;
144
- warnCount += info.warnCount;
145
- infoCount += info.infoCount;
146
- }
147
- }
148
- return { fatalCount, errorCount, warnCount, infoCount };
149
- });