@silvery/examples 0.17.4 → 0.17.5
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/_banner-A70_y2Vi.mjs +43 -0
- package/dist/{ansi-CCE2pVS0.mjs → ansi-0VXlUmNn.mjs} +7 -7
- package/dist/apng-B0gRaDVT.mjs +3 -0
- package/dist/{apng-HhhBjRGt.mjs → apng-BTRDTfDW.mjs} +2 -2
- package/dist/apps/aichat/index.mjs +69 -70
- package/dist/apps/app-todo.mjs +19 -20
- package/dist/apps/async-data.mjs +40 -41
- package/dist/apps/cli-wizard.mjs +51 -52
- package/dist/apps/clipboard.mjs +26 -27
- package/dist/apps/components.mjs +189 -190
- package/dist/apps/data-explorer.mjs +52 -53
- package/dist/apps/dev-tools.mjs +39 -40
- package/dist/apps/explorer.mjs +73 -74
- package/dist/apps/gallery.mjs +61 -62
- package/dist/apps/inline-bench.mjs +1 -1
- package/dist/apps/kanban.mjs +22 -23
- package/dist/apps/layout-ref.mjs +27 -28
- package/dist/apps/outline.mjs +35 -36
- package/dist/apps/paste-demo.mjs +33 -34
- package/dist/apps/scroll.mjs +11 -12
- package/dist/apps/search-filter.mjs +23 -24
- package/dist/apps/selection.mjs +30 -31
- package/dist/apps/spatial-focus-demo.mjs +32 -33
- package/dist/apps/task-list.mjs +25 -26
- package/dist/apps/terminal-caps-demo.mjs +30 -31
- package/dist/apps/terminal.mjs +157 -158
- package/dist/apps/text-selection-demo.mjs +62 -63
- package/dist/apps/textarea.mjs +21 -22
- package/dist/apps/theme.mjs +142 -143
- package/dist/apps/transform.mjs +25 -26
- package/dist/apps/virtual-10k.mjs +52 -53
- package/dist/{backends-Bahh9mKN.mjs → backends-Dj-11kZF.mjs} +1 -1
- package/dist/backends-U3QwStfO.mjs +3 -0
- package/dist/components/counter.mjs +6 -7
- package/dist/components/hello.mjs +5 -6
- package/dist/components/progress-bar.mjs +10 -11
- package/dist/components/select-list.mjs +8 -9
- package/dist/components/spinner.mjs +10 -11
- package/dist/components/text-input.mjs +8 -9
- package/dist/components/virtual-list.mjs +7 -8
- package/dist/{flexily-zero-adapter-UB-ra8fR.mjs → flexily-zero-adapter-ByVzLTFP.mjs} +1 -1
- package/dist/gif-B6NGH5gs.mjs +3 -0
- package/dist/{gif-BtnXuxLF.mjs → gif-CfkOF-iG.mjs} +2 -2
- package/dist/layout/dashboard.mjs +197 -198
- package/dist/layout/live-resize.mjs +44 -45
- package/dist/layout/overflow.mjs +16 -17
- package/dist/layout/text-layout.mjs +67 -68
- package/dist/{plugins-D1KtkT4a.mjs → plugins-CT0DdV_E.mjs} +12 -13
- package/dist/{src-BTEVGpd9.mjs → src-jO3Zuzjj.mjs} +3 -3
- package/dist/{yoga-adapter-BVtQ5OJR.mjs → yoga-adapter-BSQHuMV9.mjs} +1 -1
- package/package.json +4 -2
- package/dist/_banner-DLPxCqVy.mjs +0 -44
- package/dist/apng-mwUQbTTF.mjs +0 -3
- package/dist/backends-CCtCDQ94.mjs +0 -3
- package/dist/gif-BZaqPPVX.mjs +0 -3
- package/dist/jsx-runtime-dMs_8fNu.mjs +0 -241
- /package/dist/{UPNG-Cy7ViL8f.mjs → UPNG-ShUlaTDh.mjs} +0 -0
- /package/dist/{__vite-browser-external-2447137e-BML7CYau.mjs → __vite-browser-external-2447137e-Bopa5BFR.mjs} +0 -0
- /package/dist/{gifenc-CLRW41dk.mjs → gifenc-BI4ihP_T.mjs} +0 -0
- /package/dist/{node-NuJ94BWl.mjs → node-nsrAOjH4.mjs} +0 -0
- /package/dist/{resvg-js-C_8Wps1F.mjs → resvg-js-Cnk2o49d.mjs} +0 -0
- /package/dist/{src-CzfRafCQ.mjs → src-9ZhfQyzD.mjs} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as _usingCtx } from "../usingCtx-CsEf0xO3.mjs";
|
|
2
|
-
import { t as
|
|
3
|
-
import { t as ExampleBanner } from "../_banner-DLPxCqVy.mjs";
|
|
2
|
+
import { t as ExampleBanner } from "../_banner-A70_y2Vi.mjs";
|
|
4
3
|
import { useState } from "react";
|
|
5
4
|
import { Box, Muted, Tab, TabList, TabPanel, Tabs, Text, createTerm, render, useApp, useBoxRect, useInput, useInterval } from "silvery";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
//#region layout/dashboard.tsx
|
|
7
7
|
/**
|
|
8
8
|
* Dashboard Example
|
|
@@ -14,7 +14,6 @@ import { Box, Muted, Tab, TabList, TabPanel, Tabs, Text, createTerm, render, use
|
|
|
14
14
|
* - Semantic theme colors with severity-based color coding
|
|
15
15
|
* - Process table with sorting
|
|
16
16
|
*/
|
|
17
|
-
var import_jsx_runtime = require_jsx_runtime();
|
|
18
17
|
const meta = {
|
|
19
18
|
name: "Dashboard",
|
|
20
19
|
description: "Responsive multi-pane dashboard with live metrics and charts",
|
|
@@ -501,10 +500,10 @@ function tickState(prev) {
|
|
|
501
500
|
};
|
|
502
501
|
}
|
|
503
502
|
function Sep() {
|
|
504
|
-
return /* @__PURE__ */
|
|
503
|
+
return /* @__PURE__ */ jsx(Muted, { children: "┄".repeat(50) });
|
|
505
504
|
}
|
|
506
505
|
function LR({ children }) {
|
|
507
|
-
return /* @__PURE__ */
|
|
506
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
508
507
|
justifyContent: "space-between",
|
|
509
508
|
wrap: "truncate",
|
|
510
509
|
children
|
|
@@ -512,80 +511,80 @@ function LR({ children }) {
|
|
|
512
511
|
}
|
|
513
512
|
/** Label-value pair: `Label value` with muted label */
|
|
514
513
|
function LV({ label, value, color }) {
|
|
515
|
-
return /* @__PURE__ */
|
|
514
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
516
515
|
gap: 1,
|
|
517
|
-
children: [/* @__PURE__ */
|
|
516
|
+
children: [/* @__PURE__ */ jsx(Muted, { children: label }), /* @__PURE__ */ jsx(Text, {
|
|
518
517
|
color,
|
|
519
518
|
children: `${value}`
|
|
520
519
|
})]
|
|
521
520
|
});
|
|
522
521
|
}
|
|
523
522
|
function CpuSummary({ state }) {
|
|
524
|
-
return /* @__PURE__ */
|
|
523
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(LR, { children: [/* @__PURE__ */ jsxs(Box, {
|
|
525
524
|
gap: 1,
|
|
526
525
|
wrap: "truncate",
|
|
527
526
|
children: [
|
|
528
|
-
/* @__PURE__ */
|
|
529
|
-
/* @__PURE__ */
|
|
527
|
+
/* @__PURE__ */ jsx(Muted, { children: "Total" }),
|
|
528
|
+
/* @__PURE__ */ jsx(Text, {
|
|
530
529
|
color: severityColor(state.totalCpu),
|
|
531
530
|
children: `${state.totalCpu}%`
|
|
532
531
|
}),
|
|
533
|
-
/* @__PURE__ */
|
|
532
|
+
/* @__PURE__ */ jsx(Text, {
|
|
534
533
|
color: severityColor(state.totalCpu),
|
|
535
534
|
children: miniBar(state.totalCpu, 24)
|
|
536
535
|
})
|
|
537
536
|
]
|
|
538
|
-
}), /* @__PURE__ */
|
|
537
|
+
}), /* @__PURE__ */ jsxs(Box, {
|
|
539
538
|
gap: 2,
|
|
540
539
|
wrap: "truncate",
|
|
541
540
|
children: [
|
|
542
|
-
/* @__PURE__ */
|
|
541
|
+
/* @__PURE__ */ jsx(LV, {
|
|
543
542
|
label: "Load",
|
|
544
543
|
value: `${state.load[0].toFixed(2)} ${state.load[1].toFixed(2)} ${state.load[2].toFixed(2)}`
|
|
545
544
|
}),
|
|
546
|
-
/* @__PURE__ */
|
|
545
|
+
/* @__PURE__ */ jsx(LV, {
|
|
547
546
|
label: "Temp",
|
|
548
547
|
value: `${state.avgTemp}\u00B0C`,
|
|
549
548
|
color: heatColor(state.avgTemp)
|
|
550
549
|
}),
|
|
551
|
-
/* @__PURE__ */
|
|
550
|
+
/* @__PURE__ */ jsx(LV, {
|
|
552
551
|
label: "Tasks",
|
|
553
552
|
value: state.tasks
|
|
554
553
|
})
|
|
555
554
|
]
|
|
556
|
-
})] }), /* @__PURE__ */
|
|
555
|
+
})] }), /* @__PURE__ */ jsxs(LR, { children: [/* @__PURE__ */ jsxs(Box, {
|
|
557
556
|
gap: 2,
|
|
558
557
|
wrap: "truncate",
|
|
559
558
|
children: [
|
|
560
|
-
/* @__PURE__ */
|
|
559
|
+
/* @__PURE__ */ jsx(LV, {
|
|
561
560
|
label: "User",
|
|
562
561
|
value: `${state.userCpu}%`,
|
|
563
562
|
color: severityColor(state.userCpu)
|
|
564
563
|
}),
|
|
565
|
-
/* @__PURE__ */
|
|
564
|
+
/* @__PURE__ */ jsx(LV, {
|
|
566
565
|
label: "Sys",
|
|
567
566
|
value: `${state.sysCpu}%`,
|
|
568
567
|
color: severityColor(state.sysCpu)
|
|
569
568
|
}),
|
|
570
|
-
/* @__PURE__ */
|
|
569
|
+
/* @__PURE__ */ jsx(LV, {
|
|
571
570
|
label: "Wait",
|
|
572
571
|
value: `${state.waitCpu}%`,
|
|
573
572
|
color: severityColor(state.waitCpu)
|
|
574
573
|
})
|
|
575
574
|
]
|
|
576
|
-
}), /* @__PURE__ */
|
|
575
|
+
}), /* @__PURE__ */ jsxs(Box, {
|
|
577
576
|
gap: 2,
|
|
578
577
|
wrap: "truncate",
|
|
579
578
|
children: [
|
|
580
|
-
/* @__PURE__ */
|
|
579
|
+
/* @__PURE__ */ jsx(LV, {
|
|
581
580
|
label: "Avg",
|
|
582
581
|
value: `${state.avgFreq}GHz`
|
|
583
582
|
}),
|
|
584
|
-
/* @__PURE__ */
|
|
583
|
+
/* @__PURE__ */ jsx(LV, {
|
|
585
584
|
label: "Ctx/s",
|
|
586
585
|
value: state.ctxPerSec
|
|
587
586
|
}),
|
|
588
|
-
/* @__PURE__ */
|
|
587
|
+
/* @__PURE__ */ jsx(LV, {
|
|
589
588
|
label: "Uptime",
|
|
590
589
|
value: state.uptime
|
|
591
590
|
})
|
|
@@ -593,88 +592,88 @@ function CpuSummary({ state }) {
|
|
|
593
592
|
})] })] });
|
|
594
593
|
}
|
|
595
594
|
function CpuCore({ core }) {
|
|
596
|
-
return /* @__PURE__ */
|
|
595
|
+
return /* @__PURE__ */ jsxs(LR, { children: [/* @__PURE__ */ jsxs(Box, {
|
|
597
596
|
gap: 1,
|
|
598
597
|
wrap: "truncate",
|
|
599
598
|
children: [
|
|
600
|
-
/* @__PURE__ */
|
|
601
|
-
/* @__PURE__ */
|
|
599
|
+
/* @__PURE__ */ jsx(Muted, { children: core.label }),
|
|
600
|
+
/* @__PURE__ */ jsx(Text, {
|
|
602
601
|
color: severityColor(core.pct),
|
|
603
602
|
children: `${core.pct}%`.padStart(4)
|
|
604
603
|
}),
|
|
605
|
-
/* @__PURE__ */
|
|
604
|
+
/* @__PURE__ */ jsx(Text, {
|
|
606
605
|
color: severityColor(core.pct),
|
|
607
606
|
children: miniBar(core.pct, 24)
|
|
608
607
|
}),
|
|
609
|
-
/* @__PURE__ */
|
|
608
|
+
/* @__PURE__ */ jsx(Muted, { children: `${core.freq}GHz` })
|
|
610
609
|
]
|
|
611
|
-
}), /* @__PURE__ */
|
|
610
|
+
}), /* @__PURE__ */ jsxs(Box, {
|
|
612
611
|
gap: 2,
|
|
613
612
|
wrap: "truncate",
|
|
614
|
-
children: [/* @__PURE__ */
|
|
613
|
+
children: [/* @__PURE__ */ jsxs(Box, {
|
|
615
614
|
gap: 1,
|
|
616
|
-
children: [/* @__PURE__ */
|
|
615
|
+
children: [/* @__PURE__ */ jsx(Muted, { children: "temp" }), /* @__PURE__ */ jsx(Text, {
|
|
617
616
|
color: heatColor(core.temp),
|
|
618
617
|
children: `${core.temp}\u00B0C`
|
|
619
618
|
})]
|
|
620
|
-
}), /* @__PURE__ */
|
|
619
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
621
620
|
color: severityColor(core.pct),
|
|
622
621
|
children: core.mode
|
|
623
622
|
})]
|
|
624
623
|
})] });
|
|
625
624
|
}
|
|
626
625
|
function CpuFooter({ state }) {
|
|
627
|
-
return /* @__PURE__ */
|
|
626
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(LR, { children: [/* @__PURE__ */ jsxs(Box, {
|
|
628
627
|
gap: 1,
|
|
629
628
|
wrap: "truncate",
|
|
630
629
|
children: [
|
|
631
|
-
/* @__PURE__ */
|
|
632
|
-
/* @__PURE__ */
|
|
630
|
+
/* @__PURE__ */ jsx(Muted, { children: "Pkg" }),
|
|
631
|
+
/* @__PURE__ */ jsx(Text, {
|
|
633
632
|
color: severityColor(state.pkgPct),
|
|
634
633
|
children: `${state.pkgPct}%`
|
|
635
634
|
}),
|
|
636
|
-
/* @__PURE__ */
|
|
635
|
+
/* @__PURE__ */ jsx(Text, {
|
|
637
636
|
color: severityColor(state.pkgPct),
|
|
638
637
|
children: miniBar(state.pkgPct, 24)
|
|
639
638
|
})
|
|
640
639
|
]
|
|
641
|
-
}), /* @__PURE__ */
|
|
640
|
+
}), /* @__PURE__ */ jsxs(Box, {
|
|
642
641
|
gap: 2,
|
|
643
642
|
wrap: "truncate",
|
|
644
643
|
children: [
|
|
645
|
-
/* @__PURE__ */
|
|
644
|
+
/* @__PURE__ */ jsx(LV, {
|
|
646
645
|
label: "Power",
|
|
647
646
|
value: `${state.power}W`
|
|
648
647
|
}),
|
|
649
|
-
/* @__PURE__ */
|
|
648
|
+
/* @__PURE__ */ jsx(LV, {
|
|
650
649
|
label: "Fan",
|
|
651
650
|
value: `${state.fan}RPM`
|
|
652
651
|
}),
|
|
653
|
-
/* @__PURE__ */
|
|
652
|
+
/* @__PURE__ */ jsx(LV, {
|
|
654
653
|
label: "Boost",
|
|
655
654
|
value: "on",
|
|
656
655
|
color: "$success"
|
|
657
656
|
})
|
|
658
657
|
]
|
|
659
|
-
})] }), /* @__PURE__ */
|
|
658
|
+
})] }), /* @__PURE__ */ jsxs(LR, { children: [/* @__PURE__ */ jsxs(Box, {
|
|
660
659
|
gap: 1,
|
|
661
660
|
wrap: "truncate",
|
|
662
|
-
children: [/* @__PURE__ */
|
|
661
|
+
children: [/* @__PURE__ */ jsx(Muted, { children: "History" }), /* @__PURE__ */ jsx(Text, {
|
|
663
662
|
color: "$primary",
|
|
664
663
|
children: sparkline(state.cpuHistory)
|
|
665
664
|
})]
|
|
666
|
-
}), /* @__PURE__ */
|
|
665
|
+
}), /* @__PURE__ */ jsx(Muted, { children: "60s" })] })] });
|
|
667
666
|
}
|
|
668
667
|
function CpuPanel({ state }) {
|
|
669
|
-
return /* @__PURE__ */
|
|
668
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
670
669
|
flexDirection: "column",
|
|
671
670
|
flexGrow: 1,
|
|
672
671
|
children: [
|
|
673
|
-
/* @__PURE__ */
|
|
674
|
-
/* @__PURE__ */
|
|
675
|
-
state.cores.map((core) => /* @__PURE__ */
|
|
676
|
-
/* @__PURE__ */
|
|
677
|
-
/* @__PURE__ */
|
|
672
|
+
/* @__PURE__ */ jsx(CpuSummary, { state }),
|
|
673
|
+
/* @__PURE__ */ jsx(Sep, {}),
|
|
674
|
+
state.cores.map((core) => /* @__PURE__ */ jsx(CpuCore, { core }, core.label)),
|
|
675
|
+
/* @__PURE__ */ jsx(Sep, {}),
|
|
676
|
+
/* @__PURE__ */ jsx(CpuFooter, { state })
|
|
678
677
|
]
|
|
679
678
|
});
|
|
680
679
|
}
|
|
@@ -682,216 +681,216 @@ function MemoryPanel({ memory }) {
|
|
|
682
681
|
const ramPct = Math.round(memory.ramUsed / memory.ramTotal * 100);
|
|
683
682
|
const swapPct = Math.round(memory.swapUsed / memory.swapTotal * 100);
|
|
684
683
|
const avail = (memory.ramTotal - memory.ramUsed).toFixed(1);
|
|
685
|
-
return /* @__PURE__ */
|
|
684
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
686
685
|
flexDirection: "column",
|
|
687
686
|
flexGrow: 1,
|
|
688
687
|
children: [
|
|
689
|
-
/* @__PURE__ */
|
|
688
|
+
/* @__PURE__ */ jsxs(LR, { children: [/* @__PURE__ */ jsxs(Box, {
|
|
690
689
|
wrap: "truncate",
|
|
691
690
|
children: [
|
|
692
|
-
/* @__PURE__ */
|
|
693
|
-
/* @__PURE__ */
|
|
694
|
-
/* @__PURE__ */
|
|
691
|
+
/* @__PURE__ */ jsx(Muted, { children: "RAM " }),
|
|
692
|
+
/* @__PURE__ */ jsx(Text, { children: `${memory.ramUsed.toFixed(1)} / ${memory.ramTotal.toFixed(1)} GiB ` }),
|
|
693
|
+
/* @__PURE__ */ jsx(Text, {
|
|
695
694
|
color: severityColor(ramPct),
|
|
696
695
|
children: `${ramPct}% `
|
|
697
696
|
}),
|
|
698
|
-
/* @__PURE__ */
|
|
697
|
+
/* @__PURE__ */ jsx(Text, {
|
|
699
698
|
color: severityColor(ramPct),
|
|
700
699
|
children: miniBar(ramPct, 12)
|
|
701
700
|
})
|
|
702
701
|
]
|
|
703
|
-
}), /* @__PURE__ */
|
|
702
|
+
}), /* @__PURE__ */ jsxs(Box, {
|
|
704
703
|
gap: 1,
|
|
705
704
|
wrap: "truncate",
|
|
706
|
-
children: [/* @__PURE__ */
|
|
705
|
+
children: [/* @__PURE__ */ jsx(Muted, { children: "avail" }), /* @__PURE__ */ jsx(Text, { children: `${avail}G` })]
|
|
707
706
|
})] }),
|
|
708
|
-
/* @__PURE__ */
|
|
707
|
+
/* @__PURE__ */ jsxs(LR, { children: [/* @__PURE__ */ jsxs(Box, {
|
|
709
708
|
gap: 2,
|
|
710
709
|
wrap: "truncate",
|
|
711
|
-
children: [/* @__PURE__ */
|
|
710
|
+
children: [/* @__PURE__ */ jsx(LV, {
|
|
712
711
|
label: "Used",
|
|
713
712
|
value: `${memory.ramUsed.toFixed(1)}G`
|
|
714
|
-
}), /* @__PURE__ */
|
|
713
|
+
}), /* @__PURE__ */ jsx(LV, {
|
|
715
714
|
label: "Cache",
|
|
716
715
|
value: `${memory.cached.toFixed(1)}G`
|
|
717
716
|
})]
|
|
718
|
-
}), /* @__PURE__ */
|
|
717
|
+
}), /* @__PURE__ */ jsxs(Box, {
|
|
719
718
|
gap: 2,
|
|
720
719
|
wrap: "truncate",
|
|
721
|
-
children: [/* @__PURE__ */
|
|
720
|
+
children: [/* @__PURE__ */ jsx(LV, {
|
|
722
721
|
label: "Free",
|
|
723
722
|
value: `${memory.free.toFixed(1)}G`
|
|
724
|
-
}), /* @__PURE__ */
|
|
723
|
+
}), /* @__PURE__ */ jsx(LV, {
|
|
725
724
|
label: "Slab",
|
|
726
725
|
value: `${memory.slab.toFixed(1)}G`
|
|
727
726
|
})]
|
|
728
727
|
})] }),
|
|
729
|
-
/* @__PURE__ */
|
|
728
|
+
/* @__PURE__ */ jsxs(LR, { children: [/* @__PURE__ */ jsxs(Box, {
|
|
730
729
|
wrap: "truncate",
|
|
731
730
|
children: [
|
|
732
|
-
/* @__PURE__ */
|
|
733
|
-
/* @__PURE__ */
|
|
734
|
-
/* @__PURE__ */
|
|
731
|
+
/* @__PURE__ */ jsx(Muted, { children: "Swap " }),
|
|
732
|
+
/* @__PURE__ */ jsx(Text, { children: `${memory.swapUsed.toFixed(1)} / ${memory.swapTotal.toFixed(1)} GiB ` }),
|
|
733
|
+
/* @__PURE__ */ jsx(Text, {
|
|
735
734
|
color: severityColor(swapPct),
|
|
736
735
|
children: `${swapPct}% `
|
|
737
736
|
}),
|
|
738
|
-
/* @__PURE__ */
|
|
737
|
+
/* @__PURE__ */ jsx(Text, {
|
|
739
738
|
color: severityColor(swapPct),
|
|
740
739
|
children: miniBar(swapPct, 12)
|
|
741
740
|
})
|
|
742
741
|
]
|
|
743
|
-
}), /* @__PURE__ */
|
|
742
|
+
}), /* @__PURE__ */ jsxs(Box, {
|
|
744
743
|
gap: 1,
|
|
745
744
|
wrap: "truncate",
|
|
746
|
-
children: [/* @__PURE__ */
|
|
745
|
+
children: [/* @__PURE__ */ jsx(Muted, { children: "zram" }), /* @__PURE__ */ jsx(Text, { children: "off" })]
|
|
747
746
|
})] }),
|
|
748
|
-
/* @__PURE__ */
|
|
749
|
-
/* @__PURE__ */
|
|
747
|
+
/* @__PURE__ */ jsx(Sep, {}),
|
|
748
|
+
/* @__PURE__ */ jsxs(LR, { children: [/* @__PURE__ */ jsxs(Box, {
|
|
750
749
|
gap: 2,
|
|
751
750
|
wrap: "truncate",
|
|
752
|
-
children: [/* @__PURE__ */
|
|
751
|
+
children: [/* @__PURE__ */ jsx(LV, {
|
|
753
752
|
label: "Apps",
|
|
754
753
|
value: `${memory.apps.toFixed(1)}G`
|
|
755
|
-
}), /* @__PURE__ */
|
|
754
|
+
}), /* @__PURE__ */ jsx(LV, {
|
|
756
755
|
label: "Wired",
|
|
757
756
|
value: `${memory.wired.toFixed(1)}G`
|
|
758
757
|
})]
|
|
759
|
-
}), /* @__PURE__ */
|
|
758
|
+
}), /* @__PURE__ */ jsx(LV, {
|
|
760
759
|
label: "Buffers",
|
|
761
760
|
value: "612M"
|
|
762
761
|
})] }),
|
|
763
|
-
/* @__PURE__ */
|
|
762
|
+
/* @__PURE__ */ jsxs(LR, { children: [/* @__PURE__ */ jsxs(Box, {
|
|
764
763
|
gap: 2,
|
|
765
764
|
wrap: "truncate",
|
|
766
|
-
children: [/* @__PURE__ */
|
|
765
|
+
children: [/* @__PURE__ */ jsx(LV, {
|
|
767
766
|
label: "Dirty",
|
|
768
767
|
value: "212M"
|
|
769
|
-
}), /* @__PURE__ */
|
|
768
|
+
}), /* @__PURE__ */ jsx(LV, {
|
|
770
769
|
label: "Shared",
|
|
771
770
|
value: `${memory.shared.toFixed(1)}G`
|
|
772
771
|
})]
|
|
773
|
-
}), /* @__PURE__ */
|
|
772
|
+
}), /* @__PURE__ */ jsx(LV, {
|
|
774
773
|
label: "Reclaim",
|
|
775
774
|
value: `${memory.reclaim.toFixed(1)}G`
|
|
776
775
|
})] }),
|
|
777
|
-
/* @__PURE__ */
|
|
776
|
+
/* @__PURE__ */ jsxs(LR, { children: [/* @__PURE__ */ jsxs(Box, {
|
|
778
777
|
gap: 1,
|
|
779
778
|
wrap: "truncate",
|
|
780
|
-
children: [/* @__PURE__ */
|
|
779
|
+
children: [/* @__PURE__ */ jsx(Muted, { children: "Trend" }), /* @__PURE__ */ jsx(Text, {
|
|
781
780
|
color: "$primary",
|
|
782
781
|
children: sparkline(memory.history)
|
|
783
782
|
})]
|
|
784
|
-
}), /* @__PURE__ */
|
|
783
|
+
}), /* @__PURE__ */ jsx(Muted, { children: "30m" })] })
|
|
785
784
|
]
|
|
786
785
|
});
|
|
787
786
|
}
|
|
788
787
|
function NetworkPanel({ network }) {
|
|
789
788
|
const dlPct = Math.round(network.dlRate / 630 * 100);
|
|
790
789
|
const ulPct = Math.round(network.ulRate / 400 * 100);
|
|
791
|
-
return /* @__PURE__ */
|
|
790
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
792
791
|
flexDirection: "column",
|
|
793
792
|
flexGrow: 1,
|
|
794
793
|
children: [
|
|
795
|
-
/* @__PURE__ */
|
|
794
|
+
/* @__PURE__ */ jsxs(LR, { children: [/* @__PURE__ */ jsxs(Box, {
|
|
796
795
|
wrap: "truncate",
|
|
797
796
|
children: [
|
|
798
|
-
/* @__PURE__ */
|
|
799
|
-
/* @__PURE__ */
|
|
800
|
-
/* @__PURE__ */
|
|
797
|
+
/* @__PURE__ */ jsx(Muted, { children: "DL " }),
|
|
798
|
+
/* @__PURE__ */ jsx(Text, { children: `${network.dlRate} Mb/s ` }),
|
|
799
|
+
/* @__PURE__ */ jsx(Text, {
|
|
801
800
|
color: severityColor(dlPct),
|
|
802
801
|
children: `${dlPct}% `
|
|
803
802
|
}),
|
|
804
|
-
/* @__PURE__ */
|
|
803
|
+
/* @__PURE__ */ jsx(Text, {
|
|
805
804
|
color: severityColor(dlPct),
|
|
806
805
|
children: miniBar(dlPct, 12)
|
|
807
806
|
})
|
|
808
807
|
]
|
|
809
|
-
}), /* @__PURE__ */
|
|
808
|
+
}), /* @__PURE__ */ jsxs(Box, {
|
|
810
809
|
gap: 1,
|
|
811
810
|
wrap: "truncate",
|
|
812
|
-
children: [/* @__PURE__ */
|
|
811
|
+
children: [/* @__PURE__ */ jsx(Muted, { children: "peak" }), /* @__PURE__ */ jsx(Text, { children: `${network.dlPeak}` })]
|
|
813
812
|
})] }),
|
|
814
|
-
/* @__PURE__ */
|
|
813
|
+
/* @__PURE__ */ jsxs(LR, { children: [/* @__PURE__ */ jsxs(Box, {
|
|
815
814
|
wrap: "truncate",
|
|
816
815
|
children: [
|
|
817
|
-
/* @__PURE__ */
|
|
818
|
-
/* @__PURE__ */
|
|
816
|
+
/* @__PURE__ */ jsx(Muted, { children: "UL " }),
|
|
817
|
+
/* @__PURE__ */ jsx(Text, {
|
|
819
818
|
color: "$info",
|
|
820
819
|
children: `${network.ulRate} Mb/s `
|
|
821
820
|
}),
|
|
822
|
-
/* @__PURE__ */
|
|
821
|
+
/* @__PURE__ */ jsx(Text, {
|
|
823
822
|
color: "$info",
|
|
824
823
|
children: `${ulPct}% `
|
|
825
824
|
}),
|
|
826
|
-
/* @__PURE__ */
|
|
825
|
+
/* @__PURE__ */ jsx(Text, {
|
|
827
826
|
color: "$info",
|
|
828
827
|
children: miniBar(ulPct, 12)
|
|
829
828
|
})
|
|
830
829
|
]
|
|
831
|
-
}), /* @__PURE__ */
|
|
830
|
+
}), /* @__PURE__ */ jsxs(Box, {
|
|
832
831
|
gap: 1,
|
|
833
832
|
wrap: "truncate",
|
|
834
|
-
children: [/* @__PURE__ */
|
|
833
|
+
children: [/* @__PURE__ */ jsx(Muted, { children: "peak" }), /* @__PURE__ */ jsx(Text, { children: `${network.ulPeak}` })]
|
|
835
834
|
})] }),
|
|
836
|
-
/* @__PURE__ */
|
|
837
|
-
/* @__PURE__ */
|
|
835
|
+
/* @__PURE__ */ jsx(Sep, {}),
|
|
836
|
+
/* @__PURE__ */ jsxs(LR, { children: [/* @__PURE__ */ jsxs(Box, {
|
|
838
837
|
gap: 2,
|
|
839
838
|
wrap: "truncate",
|
|
840
|
-
children: [/* @__PURE__ */
|
|
839
|
+
children: [/* @__PURE__ */ jsx(LV, {
|
|
841
840
|
label: "Conn",
|
|
842
841
|
value: `${network.connEst} est`
|
|
843
|
-
}), /* @__PURE__ */
|
|
842
|
+
}), /* @__PURE__ */ jsx(LV, {
|
|
844
843
|
label: "Listen",
|
|
845
844
|
value: network.listen
|
|
846
845
|
})]
|
|
847
|
-
}), /* @__PURE__ */
|
|
846
|
+
}), /* @__PURE__ */ jsxs(Box, {
|
|
848
847
|
gap: 2,
|
|
849
848
|
wrap: "truncate",
|
|
850
|
-
children: [/* @__PURE__ */
|
|
849
|
+
children: [/* @__PURE__ */ jsx(LV, {
|
|
851
850
|
label: "SYN",
|
|
852
851
|
value: network.syn
|
|
853
|
-
}), /* @__PURE__ */
|
|
852
|
+
}), /* @__PURE__ */ jsx(LV, {
|
|
854
853
|
label: "Drops",
|
|
855
854
|
value: network.drops
|
|
856
855
|
})]
|
|
857
856
|
})] }),
|
|
858
|
-
/* @__PURE__ */
|
|
857
|
+
/* @__PURE__ */ jsxs(LR, { children: [/* @__PURE__ */ jsxs(Box, {
|
|
859
858
|
gap: 2,
|
|
860
859
|
wrap: "truncate",
|
|
861
|
-
children: [/* @__PURE__ */
|
|
860
|
+
children: [/* @__PURE__ */ jsx(LV, {
|
|
862
861
|
label: "Rx",
|
|
863
862
|
value: network.rxPps
|
|
864
|
-
}), /* @__PURE__ */
|
|
863
|
+
}), /* @__PURE__ */ jsx(LV, {
|
|
865
864
|
label: "Tx",
|
|
866
865
|
value: network.txPps
|
|
867
866
|
})]
|
|
868
|
-
}), /* @__PURE__ */
|
|
867
|
+
}), /* @__PURE__ */ jsxs(Box, {
|
|
869
868
|
gap: 2,
|
|
870
869
|
wrap: "truncate",
|
|
871
|
-
children: [/* @__PURE__ */
|
|
870
|
+
children: [/* @__PURE__ */ jsx(LV, {
|
|
872
871
|
label: "Retrans",
|
|
873
872
|
value: network.retrans
|
|
874
|
-
}), /* @__PURE__ */
|
|
873
|
+
}), /* @__PURE__ */ jsx(LV, {
|
|
875
874
|
label: "RTT",
|
|
876
875
|
value: network.rtt
|
|
877
876
|
})]
|
|
878
877
|
})] }),
|
|
879
|
-
/* @__PURE__ */
|
|
878
|
+
/* @__PURE__ */ jsxs(LR, { children: [/* @__PURE__ */ jsxs(Box, {
|
|
880
879
|
gap: 1,
|
|
881
880
|
wrap: "truncate",
|
|
882
|
-
children: [/* @__PURE__ */
|
|
881
|
+
children: [/* @__PURE__ */ jsx(Muted, { children: "DL" }), /* @__PURE__ */ jsx(Text, {
|
|
883
882
|
color: "$primary",
|
|
884
883
|
children: sparkline(network.dlHistory)
|
|
885
884
|
})]
|
|
886
|
-
}), /* @__PURE__ */
|
|
887
|
-
/* @__PURE__ */
|
|
885
|
+
}), /* @__PURE__ */ jsx(Muted, { children: "60s" })] }),
|
|
886
|
+
/* @__PURE__ */ jsxs(LR, { children: [/* @__PURE__ */ jsxs(Box, {
|
|
888
887
|
gap: 1,
|
|
889
888
|
wrap: "truncate",
|
|
890
|
-
children: [/* @__PURE__ */
|
|
889
|
+
children: [/* @__PURE__ */ jsx(Muted, { children: "UL" }), /* @__PURE__ */ jsx(Text, {
|
|
891
890
|
color: "$info",
|
|
892
891
|
children: sparkline(network.ulHistory)
|
|
893
892
|
})]
|
|
894
|
-
}), /* @__PURE__ */
|
|
893
|
+
}), /* @__PURE__ */ jsx(Muted, { children: "60s" })] })
|
|
895
894
|
]
|
|
896
895
|
});
|
|
897
896
|
}
|
|
@@ -914,56 +913,56 @@ function statusColor(status) {
|
|
|
914
913
|
}
|
|
915
914
|
}
|
|
916
915
|
function ProcessHeader() {
|
|
917
|
-
return /* @__PURE__ */
|
|
916
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
918
917
|
wrap: "clip",
|
|
919
918
|
children: [
|
|
920
|
-
/* @__PURE__ */
|
|
921
|
-
/* @__PURE__ */
|
|
922
|
-
/* @__PURE__ */
|
|
919
|
+
/* @__PURE__ */ jsx(Muted, { children: `${"PID".padStart(COL.pid)} ` }),
|
|
920
|
+
/* @__PURE__ */ jsx(Muted, { children: `${"NAME".padEnd(COL.name)} ` }),
|
|
921
|
+
/* @__PURE__ */ jsx(Text, {
|
|
923
922
|
bold: true,
|
|
924
923
|
color: "$primary",
|
|
925
924
|
children: `${"CPU%↓".padStart(COL.cpu)} `
|
|
926
925
|
}),
|
|
927
|
-
/* @__PURE__ */
|
|
928
|
-
/* @__PURE__ */
|
|
929
|
-
/* @__PURE__ */
|
|
930
|
-
/* @__PURE__ */
|
|
931
|
-
/* @__PURE__ */
|
|
932
|
-
/* @__PURE__ */
|
|
926
|
+
/* @__PURE__ */ jsx(Muted, { children: `${"MEM%".padStart(COL.memp)} ` }),
|
|
927
|
+
/* @__PURE__ */ jsx(Muted, { children: `${"MEM".padStart(COL.mem)} ` }),
|
|
928
|
+
/* @__PURE__ */ jsx(Muted, { children: `${"STATUS".padEnd(COL.status)} ` }),
|
|
929
|
+
/* @__PURE__ */ jsx(Muted, { children: `${"TIME".padStart(COL.time)} ` }),
|
|
930
|
+
/* @__PURE__ */ jsx(Muted, { children: `${"IO".padStart(COL.io)} ` }),
|
|
931
|
+
/* @__PURE__ */ jsx(Muted, { children: `${"THR".padStart(COL.thr)}` })
|
|
933
932
|
]
|
|
934
933
|
});
|
|
935
934
|
}
|
|
936
935
|
function ProcessRow({ proc, isTop }) {
|
|
937
936
|
const cpuColor = severityColor(proc.cpu);
|
|
938
937
|
const ioColor = proc.io === "0" ? "$muted" : "$primary";
|
|
939
|
-
return /* @__PURE__ */
|
|
938
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
940
939
|
wrap: "clip",
|
|
941
940
|
children: [
|
|
942
|
-
/* @__PURE__ */
|
|
943
|
-
/* @__PURE__ */
|
|
941
|
+
/* @__PURE__ */ jsx(Text, { children: `${String(proc.pid).padStart(COL.pid)} ` }),
|
|
942
|
+
/* @__PURE__ */ jsx(Text, {
|
|
944
943
|
bold: isTop,
|
|
945
944
|
children: `${proc.name.padEnd(COL.name).slice(0, COL.name)} `
|
|
946
945
|
}),
|
|
947
|
-
/* @__PURE__ */
|
|
946
|
+
/* @__PURE__ */ jsx(Text, {
|
|
948
947
|
bold: isTop,
|
|
949
948
|
color: cpuColor,
|
|
950
949
|
children: `${proc.cpu.toFixed(1).padStart(5)}% `
|
|
951
950
|
}),
|
|
952
|
-
/* @__PURE__ */
|
|
951
|
+
/* @__PURE__ */ jsx(Text, {
|
|
953
952
|
color: severityColor(proc.memp * 10),
|
|
954
953
|
children: `${proc.memp.toFixed(1).padStart(5)}% `
|
|
955
954
|
}),
|
|
956
|
-
/* @__PURE__ */
|
|
957
|
-
/* @__PURE__ */
|
|
955
|
+
/* @__PURE__ */ jsx(Text, { children: `${proc.mem.padStart(COL.mem)} ` }),
|
|
956
|
+
/* @__PURE__ */ jsx(Text, {
|
|
958
957
|
color: statusColor(proc.status),
|
|
959
958
|
children: `${proc.status.padEnd(COL.status)} `
|
|
960
959
|
}),
|
|
961
|
-
/* @__PURE__ */
|
|
962
|
-
/* @__PURE__ */
|
|
960
|
+
/* @__PURE__ */ jsx(Text, { children: `${proc.time.padStart(COL.time)} ` }),
|
|
961
|
+
/* @__PURE__ */ jsx(Text, {
|
|
963
962
|
color: ioColor,
|
|
964
963
|
children: `${proc.io.padStart(COL.io)} `
|
|
965
964
|
}),
|
|
966
|
-
/* @__PURE__ */
|
|
965
|
+
/* @__PURE__ */ jsx(Text, { children: `${String(proc.thr).padStart(COL.thr)}` })
|
|
967
966
|
]
|
|
968
967
|
});
|
|
969
968
|
}
|
|
@@ -972,44 +971,44 @@ function ProcessFooter({ processes, state }) {
|
|
|
972
971
|
const iowait = processes.filter((p) => p.status === "I/O wait").length;
|
|
973
972
|
const sleeping = 184 - running - iowait;
|
|
974
973
|
const ramPct = Math.round(state.memory.ramUsed / state.memory.ramTotal * 100);
|
|
975
|
-
return /* @__PURE__ */
|
|
974
|
+
return /* @__PURE__ */ jsxs(LR, { children: [/* @__PURE__ */ jsxs(Box, {
|
|
976
975
|
gap: 2,
|
|
977
976
|
wrap: "truncate",
|
|
978
977
|
children: [
|
|
979
|
-
/* @__PURE__ */
|
|
980
|
-
/* @__PURE__ */
|
|
978
|
+
/* @__PURE__ */ jsx(Muted, { children: "184 processes" }),
|
|
979
|
+
/* @__PURE__ */ jsx(Text, {
|
|
981
980
|
color: "$success",
|
|
982
981
|
children: `${running} running`
|
|
983
982
|
}),
|
|
984
|
-
/* @__PURE__ */
|
|
985
|
-
/* @__PURE__ */
|
|
983
|
+
/* @__PURE__ */ jsx(Muted, { children: `${sleeping} sleeping` }),
|
|
984
|
+
/* @__PURE__ */ jsx(Text, {
|
|
986
985
|
color: "$warning",
|
|
987
986
|
children: `${iowait} iowait`
|
|
988
987
|
})
|
|
989
988
|
]
|
|
990
|
-
}), /* @__PURE__ */
|
|
989
|
+
}), /* @__PURE__ */ jsxs(Box, {
|
|
991
990
|
gap: 2,
|
|
992
991
|
wrap: "truncate",
|
|
993
992
|
children: [
|
|
994
|
-
/* @__PURE__ */
|
|
993
|
+
/* @__PURE__ */ jsx(LV, {
|
|
995
994
|
label: "Threads",
|
|
996
995
|
value: "1,942"
|
|
997
996
|
}),
|
|
998
|
-
/* @__PURE__ */
|
|
997
|
+
/* @__PURE__ */ jsx(LV, {
|
|
999
998
|
label: "CPU",
|
|
1000
999
|
value: `${state.totalCpu}%`,
|
|
1001
1000
|
color: severityColor(state.totalCpu)
|
|
1002
1001
|
}),
|
|
1003
|
-
/* @__PURE__ */
|
|
1002
|
+
/* @__PURE__ */ jsx(LV, {
|
|
1004
1003
|
label: "MEM",
|
|
1005
1004
|
value: `${ramPct}%`,
|
|
1006
1005
|
color: severityColor(ramPct)
|
|
1007
1006
|
}),
|
|
1008
|
-
/* @__PURE__ */
|
|
1007
|
+
/* @__PURE__ */ jsx(Text, {
|
|
1009
1008
|
color: "$primary",
|
|
1010
1009
|
children: `428\u2193`
|
|
1011
1010
|
}),
|
|
1012
|
-
/* @__PURE__ */
|
|
1011
|
+
/* @__PURE__ */ jsx(Text, {
|
|
1013
1012
|
color: "$info",
|
|
1014
1013
|
children: `86\u2191`
|
|
1015
1014
|
})
|
|
@@ -1018,18 +1017,18 @@ function ProcessFooter({ processes, state }) {
|
|
|
1018
1017
|
}
|
|
1019
1018
|
function ProcessPanel({ state }) {
|
|
1020
1019
|
const sorted = [...state.processes].sort((a, b) => b.cpu - a.cpu);
|
|
1021
|
-
return /* @__PURE__ */
|
|
1020
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
1022
1021
|
flexDirection: "column",
|
|
1023
1022
|
flexGrow: 1,
|
|
1024
1023
|
children: [
|
|
1025
|
-
/* @__PURE__ */
|
|
1026
|
-
/* @__PURE__ */
|
|
1027
|
-
sorted.map((proc, i) => /* @__PURE__ */
|
|
1024
|
+
/* @__PURE__ */ jsx(ProcessHeader, {}),
|
|
1025
|
+
/* @__PURE__ */ jsx(Sep, {}),
|
|
1026
|
+
sorted.map((proc, i) => /* @__PURE__ */ jsx(ProcessRow, {
|
|
1028
1027
|
proc,
|
|
1029
1028
|
isTop: i === 0
|
|
1030
1029
|
}, proc.pid)),
|
|
1031
|
-
/* @__PURE__ */
|
|
1032
|
-
/* @__PURE__ */
|
|
1030
|
+
/* @__PURE__ */ jsx(Sep, {}),
|
|
1031
|
+
/* @__PURE__ */ jsx(ProcessFooter, {
|
|
1033
1032
|
processes: state.processes,
|
|
1034
1033
|
state
|
|
1035
1034
|
})
|
|
@@ -1038,113 +1037,113 @@ function ProcessPanel({ state }) {
|
|
|
1038
1037
|
}
|
|
1039
1038
|
/** Panel with titled first row inside standard border */
|
|
1040
1039
|
function Panel({ title, subtitle, children, flexGrow, flexBasis }) {
|
|
1041
|
-
return /* @__PURE__ */
|
|
1040
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
1042
1041
|
borderStyle: "round",
|
|
1043
1042
|
borderColor: "$primary",
|
|
1044
1043
|
paddingX: 1,
|
|
1045
1044
|
flexDirection: "column",
|
|
1046
1045
|
flexGrow,
|
|
1047
1046
|
flexBasis,
|
|
1048
|
-
children: [/* @__PURE__ */
|
|
1047
|
+
children: [/* @__PURE__ */ jsxs(LR, { children: [/* @__PURE__ */ jsx(Text, {
|
|
1049
1048
|
bold: true,
|
|
1050
1049
|
color: "$primary",
|
|
1051
1050
|
children: ` ${title} `
|
|
1052
|
-
}), subtitle && /* @__PURE__ */
|
|
1051
|
+
}), subtitle && /* @__PURE__ */ jsx(Muted, { children: ` ${subtitle} ` })] }), children]
|
|
1053
1052
|
});
|
|
1054
1053
|
}
|
|
1055
1054
|
function WideLayout({ state }) {
|
|
1056
|
-
return /* @__PURE__ */
|
|
1055
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
1057
1056
|
flexDirection: "column",
|
|
1058
1057
|
flexGrow: 1,
|
|
1059
|
-
children: [/* @__PURE__ */
|
|
1058
|
+
children: [/* @__PURE__ */ jsxs(Box, {
|
|
1060
1059
|
flexDirection: "row",
|
|
1061
1060
|
gap: 1,
|
|
1062
|
-
children: [/* @__PURE__ */
|
|
1061
|
+
children: [/* @__PURE__ */ jsx(Panel, {
|
|
1063
1062
|
title: "CPU / Compute",
|
|
1064
1063
|
subtitle: "10 logical",
|
|
1065
1064
|
flexGrow: 3,
|
|
1066
1065
|
flexBasis: 0,
|
|
1067
|
-
children: /* @__PURE__ */
|
|
1068
|
-
}), /* @__PURE__ */
|
|
1066
|
+
children: /* @__PURE__ */ jsx(CpuPanel, { state })
|
|
1067
|
+
}), /* @__PURE__ */ jsxs(Box, {
|
|
1069
1068
|
flexDirection: "column",
|
|
1070
1069
|
flexGrow: 2,
|
|
1071
1070
|
flexBasis: 0,
|
|
1072
|
-
children: [/* @__PURE__ */
|
|
1071
|
+
children: [/* @__PURE__ */ jsx(Panel, {
|
|
1073
1072
|
title: "Memory",
|
|
1074
1073
|
subtitle: `${state.memory.ramTotal.toFixed(0)} GiB`,
|
|
1075
|
-
children: /* @__PURE__ */
|
|
1076
|
-
}), /* @__PURE__ */
|
|
1074
|
+
children: /* @__PURE__ */ jsx(MemoryPanel, { memory: state.memory })
|
|
1075
|
+
}), /* @__PURE__ */ jsx(Panel, {
|
|
1077
1076
|
title: "Network",
|
|
1078
1077
|
subtitle: "en0 • wifi6",
|
|
1079
|
-
children: /* @__PURE__ */
|
|
1078
|
+
children: /* @__PURE__ */ jsx(NetworkPanel, { network: state.network })
|
|
1080
1079
|
})]
|
|
1081
1080
|
})]
|
|
1082
|
-
}), /* @__PURE__ */
|
|
1081
|
+
}), /* @__PURE__ */ jsx(Panel, {
|
|
1083
1082
|
title: "Processes",
|
|
1084
1083
|
subtitle: "sorted by CPU%",
|
|
1085
|
-
children: /* @__PURE__ */
|
|
1084
|
+
children: /* @__PURE__ */ jsx(ProcessPanel, { state })
|
|
1086
1085
|
})]
|
|
1087
1086
|
});
|
|
1088
1087
|
}
|
|
1089
1088
|
function NarrowLayout({ state }) {
|
|
1090
|
-
return /* @__PURE__ */
|
|
1089
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
1091
1090
|
flexDirection: "column",
|
|
1092
1091
|
flexGrow: 1,
|
|
1093
|
-
children: /* @__PURE__ */
|
|
1092
|
+
children: /* @__PURE__ */ jsxs(Tabs, {
|
|
1094
1093
|
defaultValue: "cpu",
|
|
1095
1094
|
children: [
|
|
1096
|
-
/* @__PURE__ */
|
|
1095
|
+
/* @__PURE__ */ jsx(Box, {
|
|
1097
1096
|
justifyContent: "space-between",
|
|
1098
1097
|
paddingX: 1,
|
|
1099
|
-
children: /* @__PURE__ */
|
|
1100
|
-
/* @__PURE__ */
|
|
1098
|
+
children: /* @__PURE__ */ jsxs(TabList, { children: [
|
|
1099
|
+
/* @__PURE__ */ jsx(Tab, {
|
|
1101
1100
|
value: "cpu",
|
|
1102
1101
|
children: "CPU"
|
|
1103
1102
|
}),
|
|
1104
|
-
/* @__PURE__ */
|
|
1103
|
+
/* @__PURE__ */ jsx(Tab, {
|
|
1105
1104
|
value: "memory",
|
|
1106
1105
|
children: "Memory"
|
|
1107
1106
|
}),
|
|
1108
|
-
/* @__PURE__ */
|
|
1107
|
+
/* @__PURE__ */ jsx(Tab, {
|
|
1109
1108
|
value: "network",
|
|
1110
1109
|
children: "Network"
|
|
1111
1110
|
}),
|
|
1112
|
-
/* @__PURE__ */
|
|
1111
|
+
/* @__PURE__ */ jsx(Tab, {
|
|
1113
1112
|
value: "processes",
|
|
1114
1113
|
children: "Processes"
|
|
1115
1114
|
})
|
|
1116
1115
|
] })
|
|
1117
1116
|
}),
|
|
1118
|
-
/* @__PURE__ */
|
|
1117
|
+
/* @__PURE__ */ jsx(TabPanel, {
|
|
1119
1118
|
value: "cpu",
|
|
1120
|
-
children: /* @__PURE__ */
|
|
1119
|
+
children: /* @__PURE__ */ jsx(Panel, {
|
|
1121
1120
|
title: "CPU / Compute",
|
|
1122
1121
|
subtitle: "10 logical",
|
|
1123
|
-
children: /* @__PURE__ */
|
|
1122
|
+
children: /* @__PURE__ */ jsx(CpuPanel, { state })
|
|
1124
1123
|
})
|
|
1125
1124
|
}),
|
|
1126
|
-
/* @__PURE__ */
|
|
1125
|
+
/* @__PURE__ */ jsx(TabPanel, {
|
|
1127
1126
|
value: "memory",
|
|
1128
|
-
children: /* @__PURE__ */
|
|
1127
|
+
children: /* @__PURE__ */ jsx(Panel, {
|
|
1129
1128
|
title: "Memory",
|
|
1130
1129
|
subtitle: `${state.memory.ramTotal.toFixed(0)} GiB`,
|
|
1131
|
-
children: /* @__PURE__ */
|
|
1130
|
+
children: /* @__PURE__ */ jsx(MemoryPanel, { memory: state.memory })
|
|
1132
1131
|
})
|
|
1133
1132
|
}),
|
|
1134
|
-
/* @__PURE__ */
|
|
1133
|
+
/* @__PURE__ */ jsx(TabPanel, {
|
|
1135
1134
|
value: "network",
|
|
1136
|
-
children: /* @__PURE__ */
|
|
1135
|
+
children: /* @__PURE__ */ jsx(Panel, {
|
|
1137
1136
|
title: "Network",
|
|
1138
1137
|
subtitle: "en0 • wifi6",
|
|
1139
|
-
children: /* @__PURE__ */
|
|
1138
|
+
children: /* @__PURE__ */ jsx(NetworkPanel, { network: state.network })
|
|
1140
1139
|
})
|
|
1141
1140
|
}),
|
|
1142
|
-
/* @__PURE__ */
|
|
1141
|
+
/* @__PURE__ */ jsx(TabPanel, {
|
|
1143
1142
|
value: "processes",
|
|
1144
|
-
children: /* @__PURE__ */
|
|
1143
|
+
children: /* @__PURE__ */ jsx(Panel, {
|
|
1145
1144
|
title: "Processes",
|
|
1146
1145
|
subtitle: "sorted by CPU%",
|
|
1147
|
-
children: /* @__PURE__ */
|
|
1146
|
+
children: /* @__PURE__ */ jsx(ProcessPanel, { state })
|
|
1148
1147
|
})
|
|
1149
1148
|
})
|
|
1150
1149
|
]
|
|
@@ -1160,37 +1159,37 @@ function Dashboard({ static: isStatic } = {}) {
|
|
|
1160
1159
|
useInput((input, key) => {
|
|
1161
1160
|
if (input === "q" || key.escape) exit();
|
|
1162
1161
|
});
|
|
1163
|
-
if (isNarrow) return /* @__PURE__ */
|
|
1164
|
-
return /* @__PURE__ */
|
|
1162
|
+
if (isNarrow) return /* @__PURE__ */ jsx(NarrowLayout, { state });
|
|
1163
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
1165
1164
|
flexDirection: "column",
|
|
1166
1165
|
flexGrow: 1,
|
|
1167
|
-
children: [/* @__PURE__ */
|
|
1166
|
+
children: [/* @__PURE__ */ jsxs(Box, {
|
|
1168
1167
|
wrap: "truncate",
|
|
1169
1168
|
children: [
|
|
1170
|
-
/* @__PURE__ */
|
|
1169
|
+
/* @__PURE__ */ jsx(Text, {
|
|
1171
1170
|
bold: true,
|
|
1172
1171
|
color: "$primary",
|
|
1173
1172
|
children: "Silvery TUI"
|
|
1174
1173
|
}),
|
|
1175
|
-
/* @__PURE__ */
|
|
1176
|
-
/* @__PURE__ */
|
|
1174
|
+
/* @__PURE__ */ jsx(Muted, { children: " system monitor showcase " }),
|
|
1175
|
+
/* @__PURE__ */ jsx(Text, {
|
|
1177
1176
|
color: "$primary",
|
|
1178
1177
|
children: "devbox-01"
|
|
1179
1178
|
}),
|
|
1180
|
-
/* @__PURE__ */
|
|
1181
|
-
/* @__PURE__ */
|
|
1179
|
+
/* @__PURE__ */ jsx(Muted, { children: "┄".repeat(19) }),
|
|
1180
|
+
/* @__PURE__ */ jsx(Muted, { children: "14:27 UTC [h]help [1]cpu [2]mem [3]net [p]proc [/]filter [q]quit" })
|
|
1182
1181
|
]
|
|
1183
|
-
}), /* @__PURE__ */
|
|
1182
|
+
}), /* @__PURE__ */ jsx(WideLayout, { state })]
|
|
1184
1183
|
});
|
|
1185
1184
|
}
|
|
1186
1185
|
async function main() {
|
|
1187
1186
|
try {
|
|
1188
1187
|
var _usingCtx$1 = _usingCtx();
|
|
1189
1188
|
const term = _usingCtx$1.u(createTerm());
|
|
1190
|
-
const { waitUntilExit } = await render(/* @__PURE__ */
|
|
1189
|
+
const { waitUntilExit } = await render(/* @__PURE__ */ jsx(ExampleBanner, {
|
|
1191
1190
|
meta,
|
|
1192
1191
|
controls: "h/l tabs Esc/q quit",
|
|
1193
|
-
children: /* @__PURE__ */
|
|
1192
|
+
children: /* @__PURE__ */ jsx(Dashboard, {})
|
|
1194
1193
|
}), term);
|
|
1195
1194
|
await waitUntilExit();
|
|
1196
1195
|
} catch (_) {
|