@oneuptime/common 10.0.33 → 10.0.35
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/Models/DatabaseModels/Index.ts +3 -0
- package/Models/DatabaseModels/KubernetesCluster.ts +640 -0
- package/Server/API/IPWhitelistAPI.ts +31 -0
- package/Server/API/Index.ts +2 -0
- package/Server/EnvironmentConfig.ts +2 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1773761409952-MigrationName.ts +137 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1774000000000-MigrationName.ts +80 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +4 -0
- package/Server/Middleware/WhatsAppAuthorization.ts +87 -0
- package/Server/Services/KubernetesClusterService.ts +109 -0
- package/Server/Services/UserService.ts +6 -0
- package/Server/Services/UserSessionService.ts +23 -0
- package/Server/Utils/AnalyticsDatabase/StatementGenerator.ts +12 -0
- package/Server/Utils/Express.ts +0 -6
- package/Server/Utils/StartServer.ts +7 -3
- package/Server/Utils/VM/VMRunner.ts +3 -0
- package/Types/Icon/IconProp.ts +1 -0
- package/Types/Permission.ts +42 -0
- package/UI/Components/Icon/Icon.tsx +51 -0
- package/UI/Components/LogsViewer/LogsViewer.tsx +2 -0
- package/UI/Components/LogsViewer/components/LogsViewerToolbar.tsx +25 -0
- package/UI/Components/Markdown.tsx/MarkdownViewer.tsx +85 -53
- package/UI/Components/Navbar/NavBarMenu.tsx +2 -2
- package/Utils/Traces/CriticalPath.ts +348 -0
- package/build/dist/Models/DatabaseModels/Index.js +2 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/KubernetesCluster.js +661 -0
- package/build/dist/Models/DatabaseModels/KubernetesCluster.js.map +1 -0
- package/build/dist/Server/API/IPWhitelistAPI.js +24 -0
- package/build/dist/Server/API/IPWhitelistAPI.js.map +1 -0
- package/build/dist/Server/API/Index.js +2 -0
- package/build/dist/Server/API/Index.js.map +1 -1
- package/build/dist/Server/EnvironmentConfig.js +1 -0
- package/build/dist/Server/EnvironmentConfig.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1773761409952-MigrationName.js +52 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1773761409952-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774000000000-MigrationName.js +35 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1774000000000-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +4 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Middleware/WhatsAppAuthorization.js +58 -0
- package/build/dist/Server/Middleware/WhatsAppAuthorization.js.map +1 -0
- package/build/dist/Server/Services/KubernetesClusterService.js +117 -0
- package/build/dist/Server/Services/KubernetesClusterService.js.map +1 -0
- package/build/dist/Server/Services/UserService.js +5 -0
- package/build/dist/Server/Services/UserService.js.map +1 -1
- package/build/dist/Server/Services/UserSessionService.js +20 -0
- package/build/dist/Server/Services/UserSessionService.js.map +1 -1
- package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js +9 -0
- package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js.map +1 -1
- package/build/dist/Server/Utils/Express.js +1 -42
- package/build/dist/Server/Utils/Express.js.map +1 -1
- package/build/dist/Server/Utils/StartServer.js +4 -3
- package/build/dist/Server/Utils/StartServer.js.map +1 -1
- package/build/dist/Server/Utils/VM/VMRunner.js +3 -0
- package/build/dist/Server/Utils/VM/VMRunner.js.map +1 -1
- package/build/dist/Types/Icon/IconProp.js +1 -0
- package/build/dist/Types/Icon/IconProp.js.map +1 -1
- package/build/dist/Types/Permission.js +36 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/UI/Components/Icon/Icon.js +27 -0
- package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/LogsViewer.js +1 -1
- package/build/dist/UI/Components/LogsViewer/LogsViewer.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsViewerToolbar.js +4 -0
- package/build/dist/UI/Components/LogsViewer/components/LogsViewerToolbar.js.map +1 -1
- package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js +50 -43
- package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js.map +1 -1
- package/build/dist/UI/Components/Navbar/NavBarMenu.js +2 -2
- package/build/dist/Utils/Traces/CriticalPath.js +240 -0
- package/build/dist/Utils/Traces/CriticalPath.js.map +1 -0
- package/package.json +1 -1
|
@@ -2733,6 +2733,57 @@ const Icon: FunctionComponent<ComponentProps> = ({
|
|
|
2733
2733
|
d="m15 11.25 1.5 1.5.75-.75V8.758l2.276-.61a3 3 0 1 0-3.675-3.675l-.61 2.277H12l-.75.75 1.5 1.5M15 11.25l-8.47 8.47c-.34.34-.8.53-1.28.53s-.94-.19-1.28-.53a1.818 1.818 0 0 1 0-2.56l8.47-8.47M15 11.25 12 8.25"
|
|
2734
2734
|
/>,
|
|
2735
2735
|
);
|
|
2736
|
+
} else if (icon === IconProp.Kubernetes) {
|
|
2737
|
+
// Kubernetes helm wheel — 7-sided shape with 7 spokes, matching the official logo
|
|
2738
|
+
const cx: number = 12;
|
|
2739
|
+
const cy: number = 12;
|
|
2740
|
+
const outerR: number = 9.5;
|
|
2741
|
+
const innerR: number = 2.2;
|
|
2742
|
+
const spokeEnd: number = 8;
|
|
2743
|
+
const sides: number = 7;
|
|
2744
|
+
const offsetAngle: number = -Math.PI / 2; // start from top
|
|
2745
|
+
|
|
2746
|
+
const outerPoints: string[] = [];
|
|
2747
|
+
const spokes: React.ReactElement[] = [];
|
|
2748
|
+
|
|
2749
|
+
for (let i: number = 0; i < sides; i++) {
|
|
2750
|
+
const angle: number = offsetAngle + (2 * Math.PI * i) / sides;
|
|
2751
|
+
const ox: number = cx + outerR * Math.cos(angle);
|
|
2752
|
+
const oy: number = cy + outerR * Math.sin(angle);
|
|
2753
|
+
outerPoints.push(`${ox.toFixed(2)},${oy.toFixed(2)}`);
|
|
2754
|
+
|
|
2755
|
+
const sx: number = cx + innerR * Math.cos(angle);
|
|
2756
|
+
const sy: number = cy + innerR * Math.sin(angle);
|
|
2757
|
+
const ex: number = cx + spokeEnd * Math.cos(angle);
|
|
2758
|
+
const ey: number = cy + spokeEnd * Math.sin(angle);
|
|
2759
|
+
|
|
2760
|
+
spokes.push(
|
|
2761
|
+
<line
|
|
2762
|
+
key={`spoke-${i}`}
|
|
2763
|
+
x1={sx.toFixed(2)}
|
|
2764
|
+
y1={sy.toFixed(2)}
|
|
2765
|
+
x2={ex.toFixed(2)}
|
|
2766
|
+
y2={ey.toFixed(2)}
|
|
2767
|
+
stroke="currentColor"
|
|
2768
|
+
strokeWidth="1.5"
|
|
2769
|
+
strokeLinecap="round"
|
|
2770
|
+
/>,
|
|
2771
|
+
);
|
|
2772
|
+
}
|
|
2773
|
+
|
|
2774
|
+
return getSvgWrapper(
|
|
2775
|
+
<>
|
|
2776
|
+
<polygon
|
|
2777
|
+
points={outerPoints.join(" ")}
|
|
2778
|
+
fill="none"
|
|
2779
|
+
stroke="currentColor"
|
|
2780
|
+
strokeWidth="1.5"
|
|
2781
|
+
strokeLinejoin="round"
|
|
2782
|
+
/>
|
|
2783
|
+
<circle cx={cx} cy={cy} r={innerR} />
|
|
2784
|
+
{spokes}
|
|
2785
|
+
</>,
|
|
2786
|
+
);
|
|
2736
2787
|
}
|
|
2737
2788
|
|
|
2738
2789
|
return <></>;
|
|
@@ -102,6 +102,7 @@ export interface ComponentProps {
|
|
|
102
102
|
onEditSavedView?: ((viewId: string) => void) | undefined;
|
|
103
103
|
onDeleteSavedView?: ((viewId: string) => void) | undefined;
|
|
104
104
|
onUpdateCurrentSavedView?: (() => void) | undefined;
|
|
105
|
+
onShowDocumentation?: (() => void) | undefined;
|
|
105
106
|
viewMode?: LogsViewMode | undefined;
|
|
106
107
|
onViewModeChange?: ((mode: LogsViewMode) => void) | undefined;
|
|
107
108
|
analyticsServiceIds?: Array<string> | undefined;
|
|
@@ -805,6 +806,7 @@ const LogsViewer: FunctionComponent<ComponentProps> = (
|
|
|
805
806
|
return !prev;
|
|
806
807
|
});
|
|
807
808
|
},
|
|
809
|
+
onShowDocumentation: props.onShowDocumentation,
|
|
808
810
|
};
|
|
809
811
|
|
|
810
812
|
const showSidebar: boolean =
|
|
@@ -37,6 +37,7 @@ export interface LogsViewerToolbarProps {
|
|
|
37
37
|
onExportJSON?: (() => void) | undefined;
|
|
38
38
|
showKeyboardShortcuts?: boolean | undefined;
|
|
39
39
|
onToggleKeyboardShortcuts?: (() => void) | undefined;
|
|
40
|
+
onShowDocumentation?: (() => void) | undefined;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
const LogsViewerToolbar: FunctionComponent<LogsViewerToolbarProps> = (
|
|
@@ -155,6 +156,30 @@ const LogsViewerToolbar: FunctionComponent<LogsViewerToolbarProps> = (
|
|
|
155
156
|
/>
|
|
156
157
|
)}
|
|
157
158
|
|
|
159
|
+
{props.onShowDocumentation && (
|
|
160
|
+
<button
|
|
161
|
+
type="button"
|
|
162
|
+
className="inline-flex items-center gap-1.5 rounded-md border border-gray-200 bg-white px-2.5 py-1.5 text-xs font-medium text-gray-700 shadow-sm transition-colors hover:border-gray-300 hover:bg-gray-50"
|
|
163
|
+
onClick={props.onShowDocumentation}
|
|
164
|
+
title="Setup Documentation"
|
|
165
|
+
>
|
|
166
|
+
<svg
|
|
167
|
+
className="h-3.5 w-3.5"
|
|
168
|
+
fill="none"
|
|
169
|
+
viewBox="0 0 24 24"
|
|
170
|
+
strokeWidth={1.5}
|
|
171
|
+
stroke="currentColor"
|
|
172
|
+
>
|
|
173
|
+
<path
|
|
174
|
+
strokeLinecap="round"
|
|
175
|
+
strokeLinejoin="round"
|
|
176
|
+
d="M12 6.042A8.967 8.967 0 0 0 6 3.75c-1.052 0-2.062.18-3 .512v14.25A8.987 8.987 0 0 1 6 18c2.305 0 4.408.867 6 2.292m0-14.25a8.966 8.966 0 0 1 6-2.292c1.052 0 2.062.18 3 .512v14.25A8.987 8.987 0 0 0 18 18a8.967 8.967 0 0 0-6 2.292m0-14.25v14.25"
|
|
177
|
+
/>
|
|
178
|
+
</svg>
|
|
179
|
+
Docs
|
|
180
|
+
</button>
|
|
181
|
+
)}
|
|
182
|
+
|
|
158
183
|
{props.onToggleKeyboardShortcuts && (
|
|
159
184
|
<div className="relative">
|
|
160
185
|
<button
|
|
@@ -208,9 +208,9 @@ const CodeBlock: FunctionComponent<{
|
|
|
208
208
|
(language ? language.charAt(0).toUpperCase() + language.slice(1) : "");
|
|
209
209
|
|
|
210
210
|
return (
|
|
211
|
-
<div className="relative rounded-lg mt-
|
|
211
|
+
<div className="relative rounded-lg mt-3 mb-3 overflow-hidden border border-gray-200 shadow-sm">
|
|
212
212
|
{/* Header bar */}
|
|
213
|
-
<div className="flex items-center justify-between px-3 py-1.5 bg-gray-800
|
|
213
|
+
<div className="flex items-center justify-between px-3 py-1.5 bg-gray-800 border-b border-gray-700">
|
|
214
214
|
<span className="text-[11px] font-medium uppercase tracking-wider text-gray-400 select-none">
|
|
215
215
|
{displayLang}
|
|
216
216
|
</span>
|
|
@@ -261,7 +261,7 @@ const CodeBlock: FunctionComponent<{
|
|
|
261
261
|
children={content}
|
|
262
262
|
language={language}
|
|
263
263
|
style={vscDarkPlus}
|
|
264
|
-
className="!rounded-none !mt-0 !mb-0 !bg-gray-900 !pt-
|
|
264
|
+
className="!rounded-none !mt-0 !mb-0 !bg-gray-900 !pt-3 !pb-3 !px-4 text-sm !border-0"
|
|
265
265
|
codeTagProps={{ className: "font-mono" }}
|
|
266
266
|
/>
|
|
267
267
|
</div>
|
|
@@ -279,7 +279,7 @@ const MarkdownViewer: FunctionComponent<ComponentProps> = (
|
|
|
279
279
|
h1: ({ ...props }: any) => {
|
|
280
280
|
return (
|
|
281
281
|
<h1
|
|
282
|
-
className="text-
|
|
282
|
+
className="text-lg mt-6 mb-3 text-gray-900 font-bold"
|
|
283
283
|
{...props}
|
|
284
284
|
/>
|
|
285
285
|
);
|
|
@@ -287,7 +287,7 @@ const MarkdownViewer: FunctionComponent<ComponentProps> = (
|
|
|
287
287
|
h2: ({ ...props }: any) => {
|
|
288
288
|
return (
|
|
289
289
|
<h2
|
|
290
|
-
className="text-
|
|
290
|
+
className="text-base mt-6 mb-2 text-gray-900 font-semibold"
|
|
291
291
|
{...props}
|
|
292
292
|
/>
|
|
293
293
|
);
|
|
@@ -295,7 +295,7 @@ const MarkdownViewer: FunctionComponent<ComponentProps> = (
|
|
|
295
295
|
h3: ({ ...props }: any) => {
|
|
296
296
|
return (
|
|
297
297
|
<h3
|
|
298
|
-
className="text-
|
|
298
|
+
className="text-base mt-4 mb-2 text-gray-900 font-semibold"
|
|
299
299
|
{...props}
|
|
300
300
|
/>
|
|
301
301
|
);
|
|
@@ -303,7 +303,7 @@ const MarkdownViewer: FunctionComponent<ComponentProps> = (
|
|
|
303
303
|
h4: ({ ...props }: any) => {
|
|
304
304
|
return (
|
|
305
305
|
<h4
|
|
306
|
-
className="text-
|
|
306
|
+
className="text-sm mt-3 mb-2 text-gray-900 font-semibold"
|
|
307
307
|
{...props}
|
|
308
308
|
/>
|
|
309
309
|
);
|
|
@@ -311,7 +311,7 @@ const MarkdownViewer: FunctionComponent<ComponentProps> = (
|
|
|
311
311
|
h5: ({ ...props }: any) => {
|
|
312
312
|
return (
|
|
313
313
|
<h5
|
|
314
|
-
className="text-
|
|
314
|
+
className="text-sm mt-3 mb-1 text-gray-900 font-medium"
|
|
315
315
|
{...props}
|
|
316
316
|
/>
|
|
317
317
|
);
|
|
@@ -319,7 +319,7 @@ const MarkdownViewer: FunctionComponent<ComponentProps> = (
|
|
|
319
319
|
h6: ({ ...props }: any) => {
|
|
320
320
|
return (
|
|
321
321
|
<h6
|
|
322
|
-
className="text-
|
|
322
|
+
className="text-sm mt-2 mb-1 text-gray-700 font-medium"
|
|
323
323
|
{...props}
|
|
324
324
|
/>
|
|
325
325
|
);
|
|
@@ -327,7 +327,7 @@ const MarkdownViewer: FunctionComponent<ComponentProps> = (
|
|
|
327
327
|
p: ({ ...props }: any) => {
|
|
328
328
|
return (
|
|
329
329
|
<p
|
|
330
|
-
className="text-
|
|
330
|
+
className="text-sm mt-2 mb-3 text-gray-700 leading-relaxed"
|
|
331
331
|
{...props}
|
|
332
332
|
/>
|
|
333
333
|
);
|
|
@@ -352,24 +352,24 @@ const MarkdownViewer: FunctionComponent<ComponentProps> = (
|
|
|
352
352
|
return <>{children}</>;
|
|
353
353
|
}
|
|
354
354
|
|
|
355
|
-
|
|
356
|
-
|
|
355
|
+
/*
|
|
356
|
+
* If the child is a custom component (CodeBlock, MermaidDiagram, etc.)
|
|
357
|
+
* rather than a plain HTML element like <code>, skip pre styling.
|
|
358
|
+
* Checking typeof type !== "string" is minification-safe unlike checking type.name.
|
|
359
|
+
*/
|
|
360
|
+
const isCustomComponent: boolean =
|
|
357
361
|
React.isValidElement(children) &&
|
|
358
|
-
|
|
359
|
-
(((children as any).type &&
|
|
360
|
-
((children as any).type.name === "SyntaxHighlighter" ||
|
|
361
|
-
(children as any).type.displayName ===
|
|
362
|
-
"SyntaxHighlighter")) ||
|
|
363
|
-
(children as any).props?.className?.includes(
|
|
364
|
-
"syntax-highlighter",
|
|
365
|
-
));
|
|
362
|
+
typeof (children as any).type !== "string";
|
|
366
363
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
364
|
+
if (isCustomComponent) {
|
|
365
|
+
return <>{children}</>;
|
|
366
|
+
}
|
|
370
367
|
|
|
371
368
|
return (
|
|
372
|
-
<pre
|
|
369
|
+
<pre
|
|
370
|
+
className="bg-gray-900 text-gray-100 mt-3 mb-3 p-3 rounded-md text-sm overflow-x-auto border border-gray-700"
|
|
371
|
+
{...rest}
|
|
372
|
+
>
|
|
373
373
|
{children}
|
|
374
374
|
</pre>
|
|
375
375
|
);
|
|
@@ -377,7 +377,7 @@ const MarkdownViewer: FunctionComponent<ComponentProps> = (
|
|
|
377
377
|
strong: ({ ...props }: any) => {
|
|
378
378
|
return (
|
|
379
379
|
<strong
|
|
380
|
-
className="text-
|
|
380
|
+
className="text-sm font-semibold text-gray-900"
|
|
381
381
|
{...props}
|
|
382
382
|
/>
|
|
383
383
|
);
|
|
@@ -385,56 +385,76 @@ const MarkdownViewer: FunctionComponent<ComponentProps> = (
|
|
|
385
385
|
li: ({ ...props }: any) => {
|
|
386
386
|
return (
|
|
387
387
|
<li
|
|
388
|
-
className="text-
|
|
388
|
+
className="text-sm mt-1 mb-1 text-gray-700 leading-relaxed"
|
|
389
389
|
{...props}
|
|
390
390
|
/>
|
|
391
391
|
);
|
|
392
392
|
},
|
|
393
393
|
ul: ({ ...props }: any) => {
|
|
394
|
-
return <ul className="list-disc pl-
|
|
394
|
+
return <ul className="list-disc pl-6 mt-1 mb-3" {...props} />;
|
|
395
395
|
},
|
|
396
396
|
ol: ({ ...props }: any) => {
|
|
397
|
-
return <ol className="list-decimal pl-
|
|
397
|
+
return <ol className="list-decimal pl-6 mt-1 mb-3" {...props} />;
|
|
398
398
|
},
|
|
399
|
-
blockquote: ({ ...props }: any) => {
|
|
399
|
+
blockquote: ({ children, ...props }: any) => {
|
|
400
400
|
return (
|
|
401
401
|
<blockquote
|
|
402
|
-
className="
|
|
402
|
+
className="rounded-lg border border-amber-200 bg-amber-50/50 my-4 not-italic overflow-hidden"
|
|
403
403
|
{...props}
|
|
404
|
-
|
|
404
|
+
>
|
|
405
|
+
<div className="flex items-start gap-3 px-4 py-3">
|
|
406
|
+
<svg
|
|
407
|
+
className="h-5 w-5 flex-shrink-0 text-amber-500 mt-0.5"
|
|
408
|
+
fill="none"
|
|
409
|
+
stroke="currentColor"
|
|
410
|
+
strokeWidth={2}
|
|
411
|
+
viewBox="0 0 24 24"
|
|
412
|
+
>
|
|
413
|
+
<path
|
|
414
|
+
strokeLinecap="round"
|
|
415
|
+
strokeLinejoin="round"
|
|
416
|
+
d="M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z"
|
|
417
|
+
/>
|
|
418
|
+
</svg>
|
|
419
|
+
<div className="text-sm text-gray-700 leading-relaxed [&>p]:mt-0 [&>p]:mb-0 [&>p>strong:first-child]:text-amber-700 [&>p>strong:first-child]:mr-1">
|
|
420
|
+
{children}
|
|
421
|
+
</div>
|
|
422
|
+
</div>
|
|
423
|
+
</blockquote>
|
|
405
424
|
);
|
|
406
425
|
},
|
|
407
426
|
table: ({ ...props }: any) => {
|
|
408
427
|
return (
|
|
409
|
-
<
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
428
|
+
<div className="overflow-hidden rounded-lg border border-gray-200 mt-4 mb-4 shadow-sm">
|
|
429
|
+
<table
|
|
430
|
+
className="min-w-full table-auto border-collapse text-sm"
|
|
431
|
+
{...props}
|
|
432
|
+
/>
|
|
433
|
+
</div>
|
|
413
434
|
);
|
|
414
435
|
},
|
|
415
436
|
thead: ({ ...props }: any) => {
|
|
416
|
-
return <thead className="bg-gray-
|
|
437
|
+
return <thead className="bg-gray-50" {...props} />;
|
|
417
438
|
},
|
|
418
439
|
tbody: ({ ...props }: any) => {
|
|
419
|
-
return <tbody {...props} />;
|
|
440
|
+
return <tbody className="divide-y divide-gray-100" {...props} />;
|
|
420
441
|
},
|
|
421
442
|
tr: ({ ...props }: any) => {
|
|
422
|
-
return
|
|
443
|
+
return (
|
|
444
|
+
<tr className="hover:bg-gray-50 transition-colors" {...props} />
|
|
445
|
+
);
|
|
423
446
|
},
|
|
424
447
|
th: ({ ...props }: any) => {
|
|
425
448
|
return (
|
|
426
449
|
<th
|
|
427
|
-
className="px-4 py-2 text-left text-
|
|
450
|
+
className="px-4 py-2.5 text-left text-xs font-semibold uppercase tracking-wider text-gray-500 border-b border-gray-200"
|
|
428
451
|
{...props}
|
|
429
452
|
/>
|
|
430
453
|
);
|
|
431
454
|
},
|
|
432
455
|
td: ({ ...props }: any) => {
|
|
433
456
|
return (
|
|
434
|
-
<td
|
|
435
|
-
className="px-4 py-2 text-sm text-gray-700 border border-gray-300"
|
|
436
|
-
{...props}
|
|
437
|
-
/>
|
|
457
|
+
<td className="px-4 py-2.5 text-sm text-gray-700" {...props} />
|
|
438
458
|
);
|
|
439
459
|
},
|
|
440
460
|
hr: ({ ...props }: any) => {
|
|
@@ -457,19 +477,31 @@ const MarkdownViewer: FunctionComponent<ComponentProps> = (
|
|
|
457
477
|
return <MermaidDiagram chart={content} />;
|
|
458
478
|
}
|
|
459
479
|
|
|
460
|
-
const
|
|
461
|
-
|
|
462
|
-
|
|
480
|
+
const isMultiline: boolean = content.includes("\n");
|
|
481
|
+
const hasLanguage: boolean = Boolean(
|
|
482
|
+
match &&
|
|
463
483
|
match?.filter((item: string) => {
|
|
464
484
|
return item.includes("language-");
|
|
465
|
-
}).length > 0
|
|
466
|
-
|
|
467
|
-
: "text-sm px-2 py-1 bg-gray-200 rounded text-gray-900 font-mono";
|
|
485
|
+
}).length > 0,
|
|
486
|
+
);
|
|
468
487
|
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
488
|
+
// Multiline code blocks (with or without language) get the full CodeBlock treatment
|
|
489
|
+
if (hasLanguage || isMultiline) {
|
|
490
|
+
return (
|
|
491
|
+
<CodeBlock
|
|
492
|
+
language={match ? match[1]! : "text"}
|
|
493
|
+
content={content}
|
|
494
|
+
rest={rest}
|
|
495
|
+
/>
|
|
496
|
+
);
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
// Inline code
|
|
500
|
+
return (
|
|
501
|
+
<code
|
|
502
|
+
className="text-xs px-1.5 py-0.5 bg-gray-100 border border-gray-200 rounded text-gray-800 font-mono"
|
|
503
|
+
{...rest}
|
|
504
|
+
>
|
|
473
505
|
{children}
|
|
474
506
|
</code>
|
|
475
507
|
);
|
|
@@ -39,7 +39,7 @@ const NavBarMenu: FunctionComponent<ComponentProps> = (
|
|
|
39
39
|
);
|
|
40
40
|
|
|
41
41
|
return (
|
|
42
|
-
<div className="absolute left-0 z-
|
|
42
|
+
<div className="absolute left-0 z-50 mt-8 w-screen max-w-5xl transform px-2 sm:px-0">
|
|
43
43
|
<div className="overflow-hidden rounded-2xl shadow-xl ring-1 ring-black ring-opacity-5 bg-white">
|
|
44
44
|
{/* Sections */}
|
|
45
45
|
<div className="p-6">
|
|
@@ -127,7 +127,7 @@ const NavBarMenu: FunctionComponent<ComponentProps> = (
|
|
|
127
127
|
|
|
128
128
|
return (
|
|
129
129
|
<div
|
|
130
|
-
className={`absolute left-1/2 z-
|
|
130
|
+
className={`absolute left-1/2 z-50 mt-8 w-screen max-w-md -translate-x-1/2 transform px-2 sm:px-0 ${maxWidthClass}`}
|
|
131
131
|
>
|
|
132
132
|
<div className="overflow-hidden rounded-2xl shadow-xl ring-1 ring-black ring-opacity-5 bg-white">
|
|
133
133
|
{/* Menu Items */}
|