@powerhousedao/design-system 6.2.0-rc.8 → 6.2.1-dev.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/dist/{command-tFzjgzge.d.ts → command-CkitDMGP.d.ts} +4 -4
- package/dist/command-CkitDMGP.d.ts.map +1 -0
- package/dist/connect/index.d.ts +26 -2
- package/dist/connect/index.d.ts.map +1 -1
- package/dist/connect/index.js +236 -89
- package/dist/connect/index.js.map +1 -1
- package/dist/{enum-field-CwZVs3Ux.d.ts → enum-field-B1ZGimK6.d.ts} +3 -3
- package/dist/{enum-field-CwZVs3Ux.d.ts.map → enum-field-B1ZGimK6.d.ts.map} +1 -1
- package/dist/{radio-group-field-wlqeiLN3.d.ts → radio-group-field-qOD9_nWy.d.ts} +2 -2
- package/dist/{radio-group-field-wlqeiLN3.d.ts.map → radio-group-field-qOD9_nWy.d.ts.map} +1 -1
- package/dist/ui/components/command/command.d.ts +1 -1
- package/dist/ui/components/enum-field/enum-field.d.ts +1 -1
- package/dist/ui/components/index.d.ts +3 -3
- package/dist/ui/components/radio-group-field/radio-group-field.d.ts +1 -1
- package/dist/ui/index.d.ts +3 -3
- package/package.json +4 -4
- package/dist/command-tFzjgzge.d.ts.map +0 -1
package/dist/connect/index.js
CHANGED
|
@@ -3853,6 +3853,47 @@ function AppFormInput(props) {
|
|
|
3853
3853
|
});
|
|
3854
3854
|
}
|
|
3855
3855
|
//#endregion
|
|
3856
|
+
//#region src/connect/components/toggle/toggle.tsx
|
|
3857
|
+
const Toggle = /* @__PURE__ */ forwardRef(function Toggle(props, ref) {
|
|
3858
|
+
return /* @__PURE__ */ jsxs("label", {
|
|
3859
|
+
className: "relative cursor-pointer items-center",
|
|
3860
|
+
htmlFor: props.id,
|
|
3861
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
3862
|
+
className: "peer sr-only",
|
|
3863
|
+
ref,
|
|
3864
|
+
type: "checkbox",
|
|
3865
|
+
value: "",
|
|
3866
|
+
...props
|
|
3867
|
+
}), /* @__PURE__ */ jsx("div", { className: "peer h-6 w-11 rounded-full bg-muted-foreground peer-checked:bg-info peer-focus:outline-none after:absolute after:inset-s-0.5 after:top-0.5 after:size-5 after:rounded-full after:border after:border-none after:bg-background after:transition-all peer-checked:after:translate-x-full" })]
|
|
3868
|
+
});
|
|
3869
|
+
});
|
|
3870
|
+
//#endregion
|
|
3871
|
+
//#region src/connect/components/form/inputs/available-offline-toggle.tsx
|
|
3872
|
+
const AvailableOfflineToggle = /* @__PURE__ */ forwardRef(function AvailableOfflineToggle(props, ref) {
|
|
3873
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
3874
|
+
className: "flex items-center rounded-md border border-border bg-background p-3 text-foreground",
|
|
3875
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
3876
|
+
className: "flex-1",
|
|
3877
|
+
children: [/* @__PURE__ */ jsx("label", {
|
|
3878
|
+
className: "font-medium text-foreground",
|
|
3879
|
+
htmlFor: "availableOffline",
|
|
3880
|
+
children: "Make available offline"
|
|
3881
|
+
}), /* @__PURE__ */ jsxs("p", {
|
|
3882
|
+
className: "text-xs text-foreground",
|
|
3883
|
+
children: [
|
|
3884
|
+
"Check this options if you keep a local backup",
|
|
3885
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
3886
|
+
"available at all times."
|
|
3887
|
+
]
|
|
3888
|
+
})]
|
|
3889
|
+
}), /* @__PURE__ */ jsx(Toggle, {
|
|
3890
|
+
id: "availableOffline",
|
|
3891
|
+
ref,
|
|
3892
|
+
...props
|
|
3893
|
+
})]
|
|
3894
|
+
});
|
|
3895
|
+
});
|
|
3896
|
+
//#endregion
|
|
3856
3897
|
//#region src/connect/components/form/inputs/label.tsx
|
|
3857
3898
|
function Label(props) {
|
|
3858
3899
|
const { children, className, ...labelProps } = props;
|
|
@@ -3863,6 +3904,21 @@ function Label(props) {
|
|
|
3863
3904
|
});
|
|
3864
3905
|
}
|
|
3865
3906
|
//#endregion
|
|
3907
|
+
//#region src/connect/components/form/inputs/sharing-type-form-input.tsx
|
|
3908
|
+
function SharingTypeFormInput(props) {
|
|
3909
|
+
const { control, ...delegatedProps } = props;
|
|
3910
|
+
return /* @__PURE__ */ jsx(Controller, {
|
|
3911
|
+
control,
|
|
3912
|
+
name: "sharingType",
|
|
3913
|
+
render: ({ field }) => /* @__PURE__ */ jsx(ConnectSelect, {
|
|
3914
|
+
...delegatedProps,
|
|
3915
|
+
...field,
|
|
3916
|
+
id: "sharingType",
|
|
3917
|
+
items: sharingTypeOptions
|
|
3918
|
+
})
|
|
3919
|
+
});
|
|
3920
|
+
}
|
|
3921
|
+
//#endregion
|
|
3866
3922
|
//#region src/connect/components/form/add-local-drive-form.tsx
|
|
3867
3923
|
function AddLocalDriveForm(props) {
|
|
3868
3924
|
const { register, handleSubmit, control, formState: { errors } } = useForm({ defaultValues: {
|
|
@@ -3895,6 +3951,12 @@ function AddLocalDriveForm(props) {
|
|
|
3895
3951
|
control,
|
|
3896
3952
|
appOptions: props.appOptions
|
|
3897
3953
|
})] }),
|
|
3954
|
+
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(Label, {
|
|
3955
|
+
htmlFor: "sharingType",
|
|
3956
|
+
className: "text-sm font-medium text-foreground",
|
|
3957
|
+
children: "Location"
|
|
3958
|
+
}), /* @__PURE__ */ jsx(SharingTypeFormInput, { control })] }),
|
|
3959
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(AvailableOfflineToggle, { ...register("availableOffline") }) }),
|
|
3898
3960
|
/* @__PURE__ */ jsx(PowerhouseButton, {
|
|
3899
3961
|
className: "mt-2 w-full",
|
|
3900
3962
|
type: "submit",
|
|
@@ -3905,47 +3967,6 @@ function AddLocalDriveForm(props) {
|
|
|
3905
3967
|
});
|
|
3906
3968
|
}
|
|
3907
3969
|
//#endregion
|
|
3908
|
-
//#region src/connect/components/toggle/toggle.tsx
|
|
3909
|
-
const Toggle = /* @__PURE__ */ forwardRef(function Toggle(props, ref) {
|
|
3910
|
-
return /* @__PURE__ */ jsxs("label", {
|
|
3911
|
-
className: "relative cursor-pointer items-center",
|
|
3912
|
-
htmlFor: props.id,
|
|
3913
|
-
children: [/* @__PURE__ */ jsx("input", {
|
|
3914
|
-
className: "peer sr-only",
|
|
3915
|
-
ref,
|
|
3916
|
-
type: "checkbox",
|
|
3917
|
-
value: "",
|
|
3918
|
-
...props
|
|
3919
|
-
}), /* @__PURE__ */ jsx("div", { className: "peer h-6 w-11 rounded-full bg-muted-foreground peer-checked:bg-info peer-focus:outline-none after:absolute after:inset-s-0.5 after:top-0.5 after:size-5 after:rounded-full after:border after:border-none after:bg-background after:transition-all peer-checked:after:translate-x-full" })]
|
|
3920
|
-
});
|
|
3921
|
-
});
|
|
3922
|
-
//#endregion
|
|
3923
|
-
//#region src/connect/components/form/inputs/available-offline-toggle.tsx
|
|
3924
|
-
const AvailableOfflineToggle = /* @__PURE__ */ forwardRef(function AvailableOfflineToggle(props, ref) {
|
|
3925
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
3926
|
-
className: "flex items-center rounded-md border border-border bg-background p-3 text-foreground",
|
|
3927
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
3928
|
-
className: "flex-1",
|
|
3929
|
-
children: [/* @__PURE__ */ jsx("label", {
|
|
3930
|
-
className: "font-medium text-foreground",
|
|
3931
|
-
htmlFor: "availableOffline",
|
|
3932
|
-
children: "Make available offline"
|
|
3933
|
-
}), /* @__PURE__ */ jsxs("p", {
|
|
3934
|
-
className: "text-xs text-foreground",
|
|
3935
|
-
children: [
|
|
3936
|
-
"Check this options if you keep a local backup",
|
|
3937
|
-
/* @__PURE__ */ jsx("br", {}),
|
|
3938
|
-
"available at all times."
|
|
3939
|
-
]
|
|
3940
|
-
})]
|
|
3941
|
-
}), /* @__PURE__ */ jsx(Toggle, {
|
|
3942
|
-
id: "availableOffline",
|
|
3943
|
-
ref,
|
|
3944
|
-
...props
|
|
3945
|
-
})]
|
|
3946
|
-
});
|
|
3947
|
-
});
|
|
3948
|
-
//#endregion
|
|
3949
3970
|
//#region src/connect/components/form/inputs/drive-name.tsx
|
|
3950
3971
|
function DriveName(props) {
|
|
3951
3972
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -4815,21 +4836,6 @@ function DeleteDrive(props) {
|
|
|
4815
4836
|
] });
|
|
4816
4837
|
}
|
|
4817
4838
|
//#endregion
|
|
4818
|
-
//#region src/connect/components/form/inputs/sharing-type-form-input.tsx
|
|
4819
|
-
function SharingTypeFormInput(props) {
|
|
4820
|
-
const { control, ...delegatedProps } = props;
|
|
4821
|
-
return /* @__PURE__ */ jsx(Controller, {
|
|
4822
|
-
control,
|
|
4823
|
-
name: "sharingType",
|
|
4824
|
-
render: ({ field }) => /* @__PURE__ */ jsx(ConnectSelect, {
|
|
4825
|
-
...delegatedProps,
|
|
4826
|
-
...field,
|
|
4827
|
-
id: "sharingType",
|
|
4828
|
-
items: sharingTypeOptions
|
|
4829
|
-
})
|
|
4830
|
-
});
|
|
4831
|
-
}
|
|
4832
|
-
//#endregion
|
|
4833
4839
|
//#region src/connect/components/form/drive-settings-form.tsx
|
|
4834
4840
|
function DriveSettingsForm(props) {
|
|
4835
4841
|
const { drive, sharingType, availableOffline, systemInfo, onSubmit, handleDeleteDrive } = props;
|
|
@@ -6439,20 +6445,20 @@ function sortRemotes(remotes, sort) {
|
|
|
6439
6445
|
let bValue;
|
|
6440
6446
|
switch (sort.column) {
|
|
6441
6447
|
case "id":
|
|
6442
|
-
aValue = a.id;
|
|
6443
|
-
bValue = b.id;
|
|
6448
|
+
aValue = a.meta.id;
|
|
6449
|
+
bValue = b.meta.id;
|
|
6444
6450
|
break;
|
|
6445
6451
|
case "name":
|
|
6446
|
-
aValue = a.name;
|
|
6447
|
-
bValue = b.name;
|
|
6452
|
+
aValue = a.meta.name;
|
|
6453
|
+
bValue = b.meta.name;
|
|
6448
6454
|
break;
|
|
6449
6455
|
case "collectionId":
|
|
6450
|
-
aValue = a.collectionId.key;
|
|
6451
|
-
bValue = b.collectionId.key;
|
|
6456
|
+
aValue = a.meta.collectionId.key;
|
|
6457
|
+
bValue = b.meta.collectionId.key;
|
|
6452
6458
|
break;
|
|
6453
6459
|
case "filter":
|
|
6454
|
-
aValue = formatFilter(a.filter);
|
|
6455
|
-
bValue = formatFilter(b.filter);
|
|
6460
|
+
aValue = formatFilter(a.meta.filter);
|
|
6461
|
+
bValue = formatFilter(b.meta.filter);
|
|
6456
6462
|
break;
|
|
6457
6463
|
default: return 0;
|
|
6458
6464
|
}
|
|
@@ -6480,7 +6486,7 @@ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPu
|
|
|
6480
6486
|
}, [loadRemotes]);
|
|
6481
6487
|
const handleRefresh = useCallback(async () => {
|
|
6482
6488
|
await loadRemotes();
|
|
6483
|
-
if (selectedRemote) setSelectedRemote(remotes.find((r) => r.id === selectedRemote.id));
|
|
6489
|
+
if (selectedRemote) setSelectedRemote(remotes.find((r) => r.meta.id === selectedRemote.meta.id));
|
|
6484
6490
|
}, [
|
|
6485
6491
|
loadRemotes,
|
|
6486
6492
|
selectedRemote,
|
|
@@ -6498,9 +6504,9 @@ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPu
|
|
|
6498
6504
|
};
|
|
6499
6505
|
const handleRemove = useCallback(async (remote) => {
|
|
6500
6506
|
if (!removeRemote) return;
|
|
6501
|
-
await removeRemote(remote.name);
|
|
6507
|
+
await removeRemote(remote.meta.name);
|
|
6502
6508
|
await loadRemotes();
|
|
6503
|
-
if (selectedRemote?.id === remote.id) setSelectedRemote(void 0);
|
|
6509
|
+
if (selectedRemote?.meta.id === remote.meta.id) setSelectedRemote(void 0);
|
|
6504
6510
|
}, [
|
|
6505
6511
|
removeRemote,
|
|
6506
6512
|
loadRemotes,
|
|
@@ -6530,14 +6536,14 @@ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPu
|
|
|
6530
6536
|
loadRemotes
|
|
6531
6537
|
]);
|
|
6532
6538
|
const handlePull = useCallback((remote) => {
|
|
6533
|
-
triggerPull?.(remote.name);
|
|
6539
|
+
triggerPull?.(remote.meta.name);
|
|
6534
6540
|
}, [triggerPull]);
|
|
6535
6541
|
if (selectedRemote) return /* @__PURE__ */ jsx(ChannelInspector, {
|
|
6536
6542
|
channel: selectedRemote.channel,
|
|
6537
|
-
connectionState: connectionStates?.get(selectedRemote.name),
|
|
6543
|
+
connectionState: connectionStates?.get(selectedRemote.meta.name),
|
|
6538
6544
|
onBack: handleBack,
|
|
6539
6545
|
onRefresh: () => void handleRefresh(),
|
|
6540
|
-
remoteName: selectedRemote.name
|
|
6546
|
+
remoteName: selectedRemote.meta.name
|
|
6541
6547
|
});
|
|
6542
6548
|
const sortedRemotes = sortRemotes(remotes, sort);
|
|
6543
6549
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -6627,23 +6633,23 @@ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPu
|
|
|
6627
6633
|
className: "px-3 py-2 text-xs text-foreground",
|
|
6628
6634
|
children: /* @__PURE__ */ jsx("span", {
|
|
6629
6635
|
className: "block truncate",
|
|
6630
|
-
title: remote.id,
|
|
6631
|
-
children: truncateId(remote.id)
|
|
6636
|
+
title: remote.meta.id,
|
|
6637
|
+
children: truncateId(remote.meta.id)
|
|
6632
6638
|
})
|
|
6633
6639
|
}),
|
|
6634
6640
|
/* @__PURE__ */ jsx("td", {
|
|
6635
6641
|
className: "border-l border-border px-3 py-2 text-xs text-foreground",
|
|
6636
6642
|
children: /* @__PURE__ */ jsx("span", {
|
|
6637
6643
|
className: "block truncate",
|
|
6638
|
-
title: remote.name,
|
|
6639
|
-
children: remote.name
|
|
6644
|
+
title: remote.meta.name,
|
|
6645
|
+
children: remote.meta.name
|
|
6640
6646
|
})
|
|
6641
6647
|
}),
|
|
6642
6648
|
/* @__PURE__ */ jsx("td", {
|
|
6643
6649
|
className: "border-l border-border px-3 py-2",
|
|
6644
|
-
children: connectionStates?.get(remote.name) ? /* @__PURE__ */ jsx(ConnectionStateBadge, {
|
|
6645
|
-
failureCount: connectionStates.get(remote.name).failureCount,
|
|
6646
|
-
state: connectionStates.get(remote.name).state
|
|
6650
|
+
children: connectionStates?.get(remote.meta.name) ? /* @__PURE__ */ jsx(ConnectionStateBadge, {
|
|
6651
|
+
failureCount: connectionStates.get(remote.meta.name).failureCount,
|
|
6652
|
+
state: connectionStates.get(remote.meta.name).state
|
|
6647
6653
|
}) : /* @__PURE__ */ jsx("span", {
|
|
6648
6654
|
className: "text-xs text-muted-foreground",
|
|
6649
6655
|
children: "-"
|
|
@@ -6653,16 +6659,16 @@ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPu
|
|
|
6653
6659
|
className: "border-l border-border px-3 py-2 text-xs text-foreground",
|
|
6654
6660
|
children: /* @__PURE__ */ jsx("span", {
|
|
6655
6661
|
className: "block truncate",
|
|
6656
|
-
title: remote.collectionId.key,
|
|
6657
|
-
children: remote.collectionId.key
|
|
6662
|
+
title: remote.meta.collectionId.key,
|
|
6663
|
+
children: remote.meta.collectionId.key
|
|
6658
6664
|
})
|
|
6659
6665
|
}),
|
|
6660
6666
|
/* @__PURE__ */ jsx("td", {
|
|
6661
6667
|
className: "border-l border-border px-3 py-2 text-xs text-foreground",
|
|
6662
6668
|
children: /* @__PURE__ */ jsx("span", {
|
|
6663
6669
|
className: "block truncate",
|
|
6664
|
-
title: formatFilter(remote.filter),
|
|
6665
|
-
children: formatFilter(remote.filter)
|
|
6670
|
+
title: formatFilter(remote.meta.filter),
|
|
6671
|
+
children: formatFilter(remote.meta.filter)
|
|
6666
6672
|
})
|
|
6667
6673
|
}),
|
|
6668
6674
|
/* @__PURE__ */ jsx("td", {
|
|
@@ -6696,7 +6702,7 @@ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPu
|
|
|
6696
6702
|
})
|
|
6697
6703
|
})
|
|
6698
6704
|
]
|
|
6699
|
-
}, remote.id)) })]
|
|
6705
|
+
}, remote.meta.id)) })]
|
|
6700
6706
|
})
|
|
6701
6707
|
}),
|
|
6702
6708
|
/* @__PURE__ */ jsxs("div", {
|
|
@@ -6711,8 +6717,129 @@ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPu
|
|
|
6711
6717
|
});
|
|
6712
6718
|
}
|
|
6713
6719
|
//#endregion
|
|
6720
|
+
//#region src/connect/components/worker-inspector/worker-inspector.tsx
|
|
6721
|
+
function formatUptime(ms) {
|
|
6722
|
+
const totalSeconds = Math.max(0, Math.floor(ms / 1e3));
|
|
6723
|
+
const hours = Math.floor(totalSeconds / 3600);
|
|
6724
|
+
const minutes = Math.floor(totalSeconds % 3600 / 60);
|
|
6725
|
+
const seconds = totalSeconds % 60;
|
|
6726
|
+
const parts = [];
|
|
6727
|
+
if (hours > 0) parts.push(`${hours}h`);
|
|
6728
|
+
if (hours > 0 || minutes > 0) parts.push(`${minutes}m`);
|
|
6729
|
+
parts.push(`${seconds}s`);
|
|
6730
|
+
return parts.join(" ");
|
|
6731
|
+
}
|
|
6732
|
+
function Field({ label, value }) {
|
|
6733
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
6734
|
+
className: "flex flex-col gap-0.5",
|
|
6735
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
6736
|
+
className: "text-xs font-medium text-muted-foreground",
|
|
6737
|
+
children: label
|
|
6738
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
6739
|
+
className: "font-mono text-sm break-all text-foreground",
|
|
6740
|
+
children: value
|
|
6741
|
+
})]
|
|
6742
|
+
});
|
|
6743
|
+
}
|
|
6744
|
+
function WorkerInspector({ getInfo, onRestart }) {
|
|
6745
|
+
const [info, setInfo] = useState(null);
|
|
6746
|
+
const [error, setError] = useState(null);
|
|
6747
|
+
const [now, setNow] = useState(() => Date.now());
|
|
6748
|
+
const [restarting, setRestarting] = useState(false);
|
|
6749
|
+
const loadInfo = useCallback(async () => {
|
|
6750
|
+
try {
|
|
6751
|
+
setInfo(await getInfo());
|
|
6752
|
+
setError(null);
|
|
6753
|
+
} catch (e) {
|
|
6754
|
+
setError(e instanceof Error ? e.message : String(e));
|
|
6755
|
+
}
|
|
6756
|
+
}, [getInfo]);
|
|
6757
|
+
useEffect(() => {
|
|
6758
|
+
loadInfo();
|
|
6759
|
+
const interval = setInterval(() => {
|
|
6760
|
+
loadInfo();
|
|
6761
|
+
setNow(Date.now());
|
|
6762
|
+
}, 1e3);
|
|
6763
|
+
return () => clearInterval(interval);
|
|
6764
|
+
}, [loadInfo]);
|
|
6765
|
+
const handleRestart = useCallback(async () => {
|
|
6766
|
+
if (!window.confirm("Restart the reactor worker? All tabs sharing it will reload.")) return;
|
|
6767
|
+
setRestarting(true);
|
|
6768
|
+
try {
|
|
6769
|
+
await onRestart();
|
|
6770
|
+
} finally {
|
|
6771
|
+
setRestarting(false);
|
|
6772
|
+
}
|
|
6773
|
+
}, [onRestart]);
|
|
6774
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
6775
|
+
className: "flex h-full flex-col gap-3",
|
|
6776
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
6777
|
+
className: "flex shrink-0 items-center justify-between",
|
|
6778
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
6779
|
+
className: "text-lg font-semibold text-foreground",
|
|
6780
|
+
children: "Worker Inspector"
|
|
6781
|
+
}), /* @__PURE__ */ jsxs("button", {
|
|
6782
|
+
className: twMerge("flex items-center gap-1 rounded-sm border px-3 py-1.5 text-sm", "border-warning bg-warning/10 text-warning hover:hover-effect disabled:disabled-effect"),
|
|
6783
|
+
disabled: restarting || !info,
|
|
6784
|
+
onClick: () => void handleRestart(),
|
|
6785
|
+
type: "button",
|
|
6786
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
6787
|
+
name: "Reload",
|
|
6788
|
+
size: 14
|
|
6789
|
+
}), restarting ? "Restarting..." : "Restart Worker"]
|
|
6790
|
+
})]
|
|
6791
|
+
}), error ? /* @__PURE__ */ jsx("div", {
|
|
6792
|
+
className: "rounded-lg bg-destructive/10 px-4 py-3 text-sm text-destructive",
|
|
6793
|
+
children: error
|
|
6794
|
+
}) : !info ? /* @__PURE__ */ jsx("div", {
|
|
6795
|
+
className: "rounded-lg bg-muted px-4 py-8 text-center text-sm text-muted-foreground",
|
|
6796
|
+
children: "Loading worker info..."
|
|
6797
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
6798
|
+
className: "grid grid-cols-2 gap-4 rounded-lg border border-border p-4",
|
|
6799
|
+
children: [
|
|
6800
|
+
/* @__PURE__ */ jsx(Field, {
|
|
6801
|
+
label: "Worker name",
|
|
6802
|
+
value: info.namespace
|
|
6803
|
+
}),
|
|
6804
|
+
/* @__PURE__ */ jsx(Field, {
|
|
6805
|
+
label: "Owner ID (boot)",
|
|
6806
|
+
value: info.ownerId
|
|
6807
|
+
}),
|
|
6808
|
+
/* @__PURE__ */ jsx(Field, {
|
|
6809
|
+
label: "Uptime",
|
|
6810
|
+
value: formatUptime(now - info.bootedAtMs)
|
|
6811
|
+
}),
|
|
6812
|
+
/* @__PURE__ */ jsx(Field, {
|
|
6813
|
+
label: "Connected tabs",
|
|
6814
|
+
value: String(info.connectedClients)
|
|
6815
|
+
}),
|
|
6816
|
+
/* @__PURE__ */ jsx(Field, {
|
|
6817
|
+
label: "App build",
|
|
6818
|
+
value: info.appBuildId
|
|
6819
|
+
}),
|
|
6820
|
+
/* @__PURE__ */ jsx(Field, {
|
|
6821
|
+
label: "RPC protocol",
|
|
6822
|
+
value: String(info.rpcProtocolVersion)
|
|
6823
|
+
})
|
|
6824
|
+
]
|
|
6825
|
+
})]
|
|
6826
|
+
});
|
|
6827
|
+
}
|
|
6828
|
+
//#endregion
|
|
6714
6829
|
//#region src/connect/components/modal/inspector-modal/inspector-modal.tsx
|
|
6715
|
-
function
|
|
6830
|
+
function InspectorUnavailable({ message }) {
|
|
6831
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
6832
|
+
className: "flex h-full flex-col items-center justify-center gap-2 p-6 text-center",
|
|
6833
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
6834
|
+
className: "text-sm font-semibold text-muted-foreground",
|
|
6835
|
+
children: "Not available here"
|
|
6836
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
6837
|
+
className: "max-w-md text-sm text-muted-foreground",
|
|
6838
|
+
children: message
|
|
6839
|
+
})]
|
|
6840
|
+
});
|
|
6841
|
+
}
|
|
6842
|
+
function InspectorModal({ open, onOpenChange, modalProps, containerProps, dbExplorerProps, remotesInspectorProps, queueInspectorProps, processorsInspectorProps, integrityInspectorProps, workerInspectorProps, unavailableTabs, defaultTab = "Database" }) {
|
|
6716
6843
|
return /* @__PURE__ */ jsx(Modal, {
|
|
6717
6844
|
...modalProps,
|
|
6718
6845
|
contentProps: {
|
|
@@ -6761,29 +6888,49 @@ function InspectorModal({ open, onOpenChange, modalProps, containerProps, dbExpl
|
|
|
6761
6888
|
children: /* @__PURE__ */ jsx(RemotesInspector, { ...remotesInspectorProps })
|
|
6762
6889
|
})
|
|
6763
6890
|
}),
|
|
6764
|
-
queueInspectorProps
|
|
6891
|
+
queueInspectorProps ? /* @__PURE__ */ jsx(TabContent, {
|
|
6765
6892
|
description: "Queue inspector",
|
|
6766
6893
|
label: "Queue",
|
|
6767
6894
|
children: /* @__PURE__ */ jsx("div", {
|
|
6768
6895
|
className: "h-full",
|
|
6769
6896
|
children: /* @__PURE__ */ jsx(QueueInspector, { ...queueInspectorProps })
|
|
6770
6897
|
})
|
|
6771
|
-
}),
|
|
6772
|
-
|
|
6898
|
+
}) : unavailableTabs?.Queue ? /* @__PURE__ */ jsx(TabContent, {
|
|
6899
|
+
description: "Queue inspector",
|
|
6900
|
+
label: "Queue",
|
|
6901
|
+
children: /* @__PURE__ */ jsx(InspectorUnavailable, { message: unavailableTabs.Queue })
|
|
6902
|
+
}) : null,
|
|
6903
|
+
processorsInspectorProps ? /* @__PURE__ */ jsx(TabContent, {
|
|
6773
6904
|
description: "Processors inspector",
|
|
6774
6905
|
label: "Processors",
|
|
6775
6906
|
children: /* @__PURE__ */ jsx("div", {
|
|
6776
6907
|
className: "h-full",
|
|
6777
6908
|
children: /* @__PURE__ */ jsx(ProcessorsInspector, { ...processorsInspectorProps })
|
|
6778
6909
|
})
|
|
6779
|
-
}),
|
|
6780
|
-
|
|
6910
|
+
}) : unavailableTabs?.Processors ? /* @__PURE__ */ jsx(TabContent, {
|
|
6911
|
+
description: "Processors inspector",
|
|
6912
|
+
label: "Processors",
|
|
6913
|
+
children: /* @__PURE__ */ jsx(InspectorUnavailable, { message: unavailableTabs.Processors })
|
|
6914
|
+
}) : null,
|
|
6915
|
+
integrityInspectorProps ? /* @__PURE__ */ jsx(TabContent, {
|
|
6781
6916
|
description: "Integrity inspector",
|
|
6782
6917
|
label: "Integrity",
|
|
6783
6918
|
children: /* @__PURE__ */ jsx("div", {
|
|
6784
6919
|
className: "h-full",
|
|
6785
6920
|
children: /* @__PURE__ */ jsx(IntegrityInspector, { ...integrityInspectorProps })
|
|
6786
6921
|
})
|
|
6922
|
+
}) : unavailableTabs?.Integrity ? /* @__PURE__ */ jsx(TabContent, {
|
|
6923
|
+
description: "Integrity inspector",
|
|
6924
|
+
label: "Integrity",
|
|
6925
|
+
children: /* @__PURE__ */ jsx(InspectorUnavailable, { message: unavailableTabs.Integrity })
|
|
6926
|
+
}) : null,
|
|
6927
|
+
workerInspectorProps && /* @__PURE__ */ jsx(TabContent, {
|
|
6928
|
+
description: "Worker inspector",
|
|
6929
|
+
label: "Worker",
|
|
6930
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
6931
|
+
className: "h-full",
|
|
6932
|
+
children: /* @__PURE__ */ jsx(WorkerInspector, { ...workerInspectorProps })
|
|
6933
|
+
})
|
|
6787
6934
|
})
|
|
6788
6935
|
]
|
|
6789
6936
|
})
|
|
@@ -8998,6 +9145,6 @@ const removeSuccessFiles = (files) => {
|
|
|
8998
9145
|
return files.filter((file) => file.status !== "SUCCESS");
|
|
8999
9146
|
};
|
|
9000
9147
|
//#endregion
|
|
9001
|
-
export { About, AccountPopover, AddDriveModal, AddLocalDriveForm, AddRemoteDriveForm, AnimatedLoader, Breadcrumb, Breadcrumbs, CONFLICT, ChannelInspector, Combobox, ConnectConfirmationModal, ConnectDeleteDriveModal, ConnectDeleteItemModal, ConnectDropdownMenu, ConnectReplaceDuplicateModal, ConnectSearchBar, ConnectSelect, ConnectSidebar, ConnectSidebarFooter, ConnectSidebarHeader, ConnectTooltip, ConnectTooltipProvider, ConnectUpgradeDriveModal, ConnectionStateBadge, CookieBanner, CreateDocumentModal, DBExplorer, DangerZone, DebugInspector, DefaultEditor, DefaultEditorLoader, DefaultEditorSelect, DependencyVersions, Disclosure, Divider, DocumentStateViewer, DocumentTimeline, DocumentToolbar, DriveAuthGate, DriveSettingsModal, DropZone, DropZoneWrapper, ENSAvatar, ERROR, EditorActionButtons, EditorUndoRedoButtons, FileItem, FolderItem, Footer, FooterLink, FormInput, FormattedJsonViewer, HomeBackgroundImage, HomeScreen, HomeScreenAddDriveItem, HomeScreenItem, INITIAL_SYNC, InspectorModal, IntegrityInspector, LoadingScreen, LogoAnimation, MISSING, NodeInput, ObjectInspectorModal, PackageInstallModal, PackageManager, PackageManagerInput, PackageManagerList, PackageManagerListItem, ProcessorsInspector, QueueInspector, ReadRequiredModal, RemotesInspector, RevisionHistory, SUCCESS, SYNCING, SettingsModal, SidebarAddDriveItem, SidebarItem, SidebarLogin, SidebarUser, SyncStatusIcon, TabContent, Tabs, ThemeSwitch, Toggle, ToolbarButton, ToolbarCloseButton, ToolbarContainer, ToolbarControlsContainer, ToolbarDownloadButton, ToolbarHistoryButton, ToolbarInput, ToolbarName, ToolbarRedoButton, ToolbarSwitchboardButton, ToolbarUndoButton, UploadFileItem, UploadFileList, UploadFileListContainer, debugNodeOptions, debugNodeOptionsMap, defaultDriveOptions, defaultNodeOptions, fileNodeDropdownOptions, folderNodeDropdownOptions, formatEthAddress, getFolderStatus, locationInfoByLocation, nodeOptions, normalNodeOptions, removeSuccessFiles, sharingTypeOptions, sortFilesByStatus, syncStatuses, useEns, verifyPackageJsonFields };
|
|
9148
|
+
export { About, AccountPopover, AddDriveModal, AddLocalDriveForm, AddRemoteDriveForm, AnimatedLoader, Breadcrumb, Breadcrumbs, CONFLICT, ChannelInspector, Combobox, ConnectConfirmationModal, ConnectDeleteDriveModal, ConnectDeleteItemModal, ConnectDropdownMenu, ConnectReplaceDuplicateModal, ConnectSearchBar, ConnectSelect, ConnectSidebar, ConnectSidebarFooter, ConnectSidebarHeader, ConnectTooltip, ConnectTooltipProvider, ConnectUpgradeDriveModal, ConnectionStateBadge, CookieBanner, CreateDocumentModal, DBExplorer, DangerZone, DebugInspector, DefaultEditor, DefaultEditorLoader, DefaultEditorSelect, DependencyVersions, Disclosure, Divider, DocumentStateViewer, DocumentTimeline, DocumentToolbar, DriveAuthGate, DriveSettingsModal, DropZone, DropZoneWrapper, ENSAvatar, ERROR, EditorActionButtons, EditorUndoRedoButtons, FileItem, FolderItem, Footer, FooterLink, FormInput, FormattedJsonViewer, HomeBackgroundImage, HomeScreen, HomeScreenAddDriveItem, HomeScreenItem, INITIAL_SYNC, InspectorModal, IntegrityInspector, LoadingScreen, LogoAnimation, MISSING, NodeInput, ObjectInspectorModal, PackageInstallModal, PackageManager, PackageManagerInput, PackageManagerList, PackageManagerListItem, ProcessorsInspector, QueueInspector, ReadRequiredModal, RemotesInspector, RevisionHistory, SUCCESS, SYNCING, SettingsModal, SidebarAddDriveItem, SidebarItem, SidebarLogin, SidebarUser, SyncStatusIcon, TabContent, Tabs, ThemeSwitch, Toggle, ToolbarButton, ToolbarCloseButton, ToolbarContainer, ToolbarControlsContainer, ToolbarDownloadButton, ToolbarHistoryButton, ToolbarInput, ToolbarName, ToolbarRedoButton, ToolbarSwitchboardButton, ToolbarUndoButton, UploadFileItem, UploadFileList, UploadFileListContainer, WorkerInspector, debugNodeOptions, debugNodeOptionsMap, defaultDriveOptions, defaultNodeOptions, fileNodeDropdownOptions, folderNodeDropdownOptions, formatEthAddress, getFolderStatus, locationInfoByLocation, nodeOptions, normalNodeOptions, removeSuccessFiles, sharingTypeOptions, sortFilesByStatus, syncStatuses, useEns, verifyPackageJsonFields };
|
|
9002
9149
|
|
|
9003
9150
|
//# sourceMappingURL=index.js.map
|