@powerhousedao/design-system 6.2.0 → 6.2.1-dev.1
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-B5BuEBfZ.d.ts → command-tFzjgzge.d.ts} +14 -14
- package/dist/{command-B5BuEBfZ.d.ts.map → command-tFzjgzge.d.ts.map} +1 -1
- package/dist/connect/index.d.ts +26 -2
- package/dist/connect/index.d.ts.map +1 -1
- package/dist/connect/index.js +230 -95
- package/dist/connect/index.js.map +1 -1
- package/dist/{enum-field-Cct-i2Uz.d.ts → enum-field-CwZVs3Ux.d.ts} +3 -3
- package/dist/{enum-field-Cct-i2Uz.d.ts.map → enum-field-CwZVs3Ux.d.ts.map} +1 -1
- package/dist/{radio-group-field-BN654-SO.d.ts → radio-group-field-wlqeiLN3.d.ts} +2 -2
- package/dist/{radio-group-field-BN654-SO.d.ts.map → radio-group-field-wlqeiLN3.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/components/sidebar/subcomponents/status-icon.d.ts +1 -1
- package/dist/ui/components/sidebar/subcomponents/status-icon.d.ts.map +1 -1
- package/dist/ui/index.d.ts +3 -3
- package/package.json +4 -4
package/dist/connect/index.js
CHANGED
|
@@ -3853,47 +3853,6 @@ 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
|
|
3897
3856
|
//#region src/connect/components/form/inputs/label.tsx
|
|
3898
3857
|
function Label(props) {
|
|
3899
3858
|
const { children, className, ...labelProps } = props;
|
|
@@ -3904,21 +3863,6 @@ function Label(props) {
|
|
|
3904
3863
|
});
|
|
3905
3864
|
}
|
|
3906
3865
|
//#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
|
|
3922
3866
|
//#region src/connect/components/form/add-local-drive-form.tsx
|
|
3923
3867
|
function AddLocalDriveForm(props) {
|
|
3924
3868
|
const { register, handleSubmit, control, formState: { errors } } = useForm({ defaultValues: {
|
|
@@ -3951,12 +3895,6 @@ function AddLocalDriveForm(props) {
|
|
|
3951
3895
|
control,
|
|
3952
3896
|
appOptions: props.appOptions
|
|
3953
3897
|
})] }),
|
|
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") }) }),
|
|
3960
3898
|
/* @__PURE__ */ jsx(PowerhouseButton, {
|
|
3961
3899
|
className: "mt-2 w-full",
|
|
3962
3900
|
type: "submit",
|
|
@@ -3967,6 +3905,47 @@ function AddLocalDriveForm(props) {
|
|
|
3967
3905
|
});
|
|
3968
3906
|
}
|
|
3969
3907
|
//#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
|
|
3970
3949
|
//#region src/connect/components/form/inputs/drive-name.tsx
|
|
3971
3950
|
function DriveName(props) {
|
|
3972
3951
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -4836,6 +4815,21 @@ function DeleteDrive(props) {
|
|
|
4836
4815
|
] });
|
|
4837
4816
|
}
|
|
4838
4817
|
//#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
|
|
4839
4833
|
//#region src/connect/components/form/drive-settings-form.tsx
|
|
4840
4834
|
function DriveSettingsForm(props) {
|
|
4841
4835
|
const { drive, sharingType, availableOffline, systemInfo, onSubmit, handleDeleteDrive } = props;
|
|
@@ -6445,20 +6439,20 @@ function sortRemotes(remotes, sort) {
|
|
|
6445
6439
|
let bValue;
|
|
6446
6440
|
switch (sort.column) {
|
|
6447
6441
|
case "id":
|
|
6448
|
-
aValue = a.id;
|
|
6449
|
-
bValue = b.id;
|
|
6442
|
+
aValue = a.meta.id;
|
|
6443
|
+
bValue = b.meta.id;
|
|
6450
6444
|
break;
|
|
6451
6445
|
case "name":
|
|
6452
|
-
aValue = a.name;
|
|
6453
|
-
bValue = b.name;
|
|
6446
|
+
aValue = a.meta.name;
|
|
6447
|
+
bValue = b.meta.name;
|
|
6454
6448
|
break;
|
|
6455
6449
|
case "collectionId":
|
|
6456
|
-
aValue = a.collectionId.key;
|
|
6457
|
-
bValue = b.collectionId.key;
|
|
6450
|
+
aValue = a.meta.collectionId.key;
|
|
6451
|
+
bValue = b.meta.collectionId.key;
|
|
6458
6452
|
break;
|
|
6459
6453
|
case "filter":
|
|
6460
|
-
aValue = formatFilter(a.filter);
|
|
6461
|
-
bValue = formatFilter(b.filter);
|
|
6454
|
+
aValue = formatFilter(a.meta.filter);
|
|
6455
|
+
bValue = formatFilter(b.meta.filter);
|
|
6462
6456
|
break;
|
|
6463
6457
|
default: return 0;
|
|
6464
6458
|
}
|
|
@@ -6486,7 +6480,7 @@ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPu
|
|
|
6486
6480
|
}, [loadRemotes]);
|
|
6487
6481
|
const handleRefresh = useCallback(async () => {
|
|
6488
6482
|
await loadRemotes();
|
|
6489
|
-
if (selectedRemote) setSelectedRemote(remotes.find((r) => r.id === selectedRemote.id));
|
|
6483
|
+
if (selectedRemote) setSelectedRemote(remotes.find((r) => r.meta.id === selectedRemote.meta.id));
|
|
6490
6484
|
}, [
|
|
6491
6485
|
loadRemotes,
|
|
6492
6486
|
selectedRemote,
|
|
@@ -6504,9 +6498,9 @@ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPu
|
|
|
6504
6498
|
};
|
|
6505
6499
|
const handleRemove = useCallback(async (remote) => {
|
|
6506
6500
|
if (!removeRemote) return;
|
|
6507
|
-
await removeRemote(remote.name);
|
|
6501
|
+
await removeRemote(remote.meta.name);
|
|
6508
6502
|
await loadRemotes();
|
|
6509
|
-
if (selectedRemote?.id === remote.id) setSelectedRemote(void 0);
|
|
6503
|
+
if (selectedRemote?.meta.id === remote.meta.id) setSelectedRemote(void 0);
|
|
6510
6504
|
}, [
|
|
6511
6505
|
removeRemote,
|
|
6512
6506
|
loadRemotes,
|
|
@@ -6536,14 +6530,14 @@ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPu
|
|
|
6536
6530
|
loadRemotes
|
|
6537
6531
|
]);
|
|
6538
6532
|
const handlePull = useCallback((remote) => {
|
|
6539
|
-
triggerPull?.(remote.name);
|
|
6533
|
+
triggerPull?.(remote.meta.name);
|
|
6540
6534
|
}, [triggerPull]);
|
|
6541
6535
|
if (selectedRemote) return /* @__PURE__ */ jsx(ChannelInspector, {
|
|
6542
6536
|
channel: selectedRemote.channel,
|
|
6543
|
-
connectionState: connectionStates?.get(selectedRemote.name),
|
|
6537
|
+
connectionState: connectionStates?.get(selectedRemote.meta.name),
|
|
6544
6538
|
onBack: handleBack,
|
|
6545
6539
|
onRefresh: () => void handleRefresh(),
|
|
6546
|
-
remoteName: selectedRemote.name
|
|
6540
|
+
remoteName: selectedRemote.meta.name
|
|
6547
6541
|
});
|
|
6548
6542
|
const sortedRemotes = sortRemotes(remotes, sort);
|
|
6549
6543
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -6633,23 +6627,23 @@ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPu
|
|
|
6633
6627
|
className: "px-3 py-2 text-xs text-foreground",
|
|
6634
6628
|
children: /* @__PURE__ */ jsx("span", {
|
|
6635
6629
|
className: "block truncate",
|
|
6636
|
-
title: remote.id,
|
|
6637
|
-
children: truncateId(remote.id)
|
|
6630
|
+
title: remote.meta.id,
|
|
6631
|
+
children: truncateId(remote.meta.id)
|
|
6638
6632
|
})
|
|
6639
6633
|
}),
|
|
6640
6634
|
/* @__PURE__ */ jsx("td", {
|
|
6641
6635
|
className: "border-l border-border px-3 py-2 text-xs text-foreground",
|
|
6642
6636
|
children: /* @__PURE__ */ jsx("span", {
|
|
6643
6637
|
className: "block truncate",
|
|
6644
|
-
title: remote.name,
|
|
6645
|
-
children: remote.name
|
|
6638
|
+
title: remote.meta.name,
|
|
6639
|
+
children: remote.meta.name
|
|
6646
6640
|
})
|
|
6647
6641
|
}),
|
|
6648
6642
|
/* @__PURE__ */ jsx("td", {
|
|
6649
6643
|
className: "border-l border-border px-3 py-2",
|
|
6650
|
-
children: connectionStates?.get(remote.name) ? /* @__PURE__ */ jsx(ConnectionStateBadge, {
|
|
6651
|
-
failureCount: connectionStates.get(remote.name).failureCount,
|
|
6652
|
-
state: connectionStates.get(remote.name).state
|
|
6644
|
+
children: connectionStates?.get(remote.meta.name) ? /* @__PURE__ */ jsx(ConnectionStateBadge, {
|
|
6645
|
+
failureCount: connectionStates.get(remote.meta.name).failureCount,
|
|
6646
|
+
state: connectionStates.get(remote.meta.name).state
|
|
6653
6647
|
}) : /* @__PURE__ */ jsx("span", {
|
|
6654
6648
|
className: "text-xs text-muted-foreground",
|
|
6655
6649
|
children: "-"
|
|
@@ -6659,16 +6653,16 @@ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPu
|
|
|
6659
6653
|
className: "border-l border-border px-3 py-2 text-xs text-foreground",
|
|
6660
6654
|
children: /* @__PURE__ */ jsx("span", {
|
|
6661
6655
|
className: "block truncate",
|
|
6662
|
-
title: remote.collectionId.key,
|
|
6663
|
-
children: remote.collectionId.key
|
|
6656
|
+
title: remote.meta.collectionId.key,
|
|
6657
|
+
children: remote.meta.collectionId.key
|
|
6664
6658
|
})
|
|
6665
6659
|
}),
|
|
6666
6660
|
/* @__PURE__ */ jsx("td", {
|
|
6667
6661
|
className: "border-l border-border px-3 py-2 text-xs text-foreground",
|
|
6668
6662
|
children: /* @__PURE__ */ jsx("span", {
|
|
6669
6663
|
className: "block truncate",
|
|
6670
|
-
title: formatFilter(remote.filter),
|
|
6671
|
-
children: formatFilter(remote.filter)
|
|
6664
|
+
title: formatFilter(remote.meta.filter),
|
|
6665
|
+
children: formatFilter(remote.meta.filter)
|
|
6672
6666
|
})
|
|
6673
6667
|
}),
|
|
6674
6668
|
/* @__PURE__ */ jsx("td", {
|
|
@@ -6702,7 +6696,7 @@ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPu
|
|
|
6702
6696
|
})
|
|
6703
6697
|
})
|
|
6704
6698
|
]
|
|
6705
|
-
}, remote.id)) })]
|
|
6699
|
+
}, remote.meta.id)) })]
|
|
6706
6700
|
})
|
|
6707
6701
|
}),
|
|
6708
6702
|
/* @__PURE__ */ jsxs("div", {
|
|
@@ -6717,8 +6711,129 @@ function RemotesInspector({ getRemotes, removeRemote, addRemoteManual, triggerPu
|
|
|
6717
6711
|
});
|
|
6718
6712
|
}
|
|
6719
6713
|
//#endregion
|
|
6714
|
+
//#region src/connect/components/worker-inspector/worker-inspector.tsx
|
|
6715
|
+
function formatUptime(ms) {
|
|
6716
|
+
const totalSeconds = Math.max(0, Math.floor(ms / 1e3));
|
|
6717
|
+
const hours = Math.floor(totalSeconds / 3600);
|
|
6718
|
+
const minutes = Math.floor(totalSeconds % 3600 / 60);
|
|
6719
|
+
const seconds = totalSeconds % 60;
|
|
6720
|
+
const parts = [];
|
|
6721
|
+
if (hours > 0) parts.push(`${hours}h`);
|
|
6722
|
+
if (hours > 0 || minutes > 0) parts.push(`${minutes}m`);
|
|
6723
|
+
parts.push(`${seconds}s`);
|
|
6724
|
+
return parts.join(" ");
|
|
6725
|
+
}
|
|
6726
|
+
function Field({ label, value }) {
|
|
6727
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
6728
|
+
className: "flex flex-col gap-0.5",
|
|
6729
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
6730
|
+
className: "text-xs font-medium text-muted-foreground",
|
|
6731
|
+
children: label
|
|
6732
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
6733
|
+
className: "font-mono text-sm break-all text-foreground",
|
|
6734
|
+
children: value
|
|
6735
|
+
})]
|
|
6736
|
+
});
|
|
6737
|
+
}
|
|
6738
|
+
function WorkerInspector({ getInfo, onRestart }) {
|
|
6739
|
+
const [info, setInfo] = useState(null);
|
|
6740
|
+
const [error, setError] = useState(null);
|
|
6741
|
+
const [now, setNow] = useState(() => Date.now());
|
|
6742
|
+
const [restarting, setRestarting] = useState(false);
|
|
6743
|
+
const loadInfo = useCallback(async () => {
|
|
6744
|
+
try {
|
|
6745
|
+
setInfo(await getInfo());
|
|
6746
|
+
setError(null);
|
|
6747
|
+
} catch (e) {
|
|
6748
|
+
setError(e instanceof Error ? e.message : String(e));
|
|
6749
|
+
}
|
|
6750
|
+
}, [getInfo]);
|
|
6751
|
+
useEffect(() => {
|
|
6752
|
+
loadInfo();
|
|
6753
|
+
const interval = setInterval(() => {
|
|
6754
|
+
loadInfo();
|
|
6755
|
+
setNow(Date.now());
|
|
6756
|
+
}, 1e3);
|
|
6757
|
+
return () => clearInterval(interval);
|
|
6758
|
+
}, [loadInfo]);
|
|
6759
|
+
const handleRestart = useCallback(async () => {
|
|
6760
|
+
if (!window.confirm("Restart the reactor worker? All tabs sharing it will reload.")) return;
|
|
6761
|
+
setRestarting(true);
|
|
6762
|
+
try {
|
|
6763
|
+
await onRestart();
|
|
6764
|
+
} finally {
|
|
6765
|
+
setRestarting(false);
|
|
6766
|
+
}
|
|
6767
|
+
}, [onRestart]);
|
|
6768
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
6769
|
+
className: "flex h-full flex-col gap-3",
|
|
6770
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
6771
|
+
className: "flex shrink-0 items-center justify-between",
|
|
6772
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
6773
|
+
className: "text-lg font-semibold text-foreground",
|
|
6774
|
+
children: "Worker Inspector"
|
|
6775
|
+
}), /* @__PURE__ */ jsxs("button", {
|
|
6776
|
+
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"),
|
|
6777
|
+
disabled: restarting || !info,
|
|
6778
|
+
onClick: () => void handleRestart(),
|
|
6779
|
+
type: "button",
|
|
6780
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
6781
|
+
name: "Reload",
|
|
6782
|
+
size: 14
|
|
6783
|
+
}), restarting ? "Restarting..." : "Restart Worker"]
|
|
6784
|
+
})]
|
|
6785
|
+
}), error ? /* @__PURE__ */ jsx("div", {
|
|
6786
|
+
className: "rounded-lg bg-destructive/10 px-4 py-3 text-sm text-destructive",
|
|
6787
|
+
children: error
|
|
6788
|
+
}) : !info ? /* @__PURE__ */ jsx("div", {
|
|
6789
|
+
className: "rounded-lg bg-muted px-4 py-8 text-center text-sm text-muted-foreground",
|
|
6790
|
+
children: "Loading worker info..."
|
|
6791
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
6792
|
+
className: "grid grid-cols-2 gap-4 rounded-lg border border-border p-4",
|
|
6793
|
+
children: [
|
|
6794
|
+
/* @__PURE__ */ jsx(Field, {
|
|
6795
|
+
label: "Worker name",
|
|
6796
|
+
value: info.namespace
|
|
6797
|
+
}),
|
|
6798
|
+
/* @__PURE__ */ jsx(Field, {
|
|
6799
|
+
label: "Owner ID (boot)",
|
|
6800
|
+
value: info.ownerId
|
|
6801
|
+
}),
|
|
6802
|
+
/* @__PURE__ */ jsx(Field, {
|
|
6803
|
+
label: "Uptime",
|
|
6804
|
+
value: formatUptime(now - info.bootedAtMs)
|
|
6805
|
+
}),
|
|
6806
|
+
/* @__PURE__ */ jsx(Field, {
|
|
6807
|
+
label: "Connected tabs",
|
|
6808
|
+
value: String(info.connectedClients)
|
|
6809
|
+
}),
|
|
6810
|
+
/* @__PURE__ */ jsx(Field, {
|
|
6811
|
+
label: "App build",
|
|
6812
|
+
value: info.appBuildId
|
|
6813
|
+
}),
|
|
6814
|
+
/* @__PURE__ */ jsx(Field, {
|
|
6815
|
+
label: "RPC protocol",
|
|
6816
|
+
value: String(info.rpcProtocolVersion)
|
|
6817
|
+
})
|
|
6818
|
+
]
|
|
6819
|
+
})]
|
|
6820
|
+
});
|
|
6821
|
+
}
|
|
6822
|
+
//#endregion
|
|
6720
6823
|
//#region src/connect/components/modal/inspector-modal/inspector-modal.tsx
|
|
6721
|
-
function
|
|
6824
|
+
function InspectorUnavailable({ message }) {
|
|
6825
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
6826
|
+
className: "flex h-full flex-col items-center justify-center gap-2 p-6 text-center",
|
|
6827
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
6828
|
+
className: "text-sm font-semibold text-muted-foreground",
|
|
6829
|
+
children: "Not available here"
|
|
6830
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
6831
|
+
className: "max-w-md text-sm text-muted-foreground",
|
|
6832
|
+
children: message
|
|
6833
|
+
})]
|
|
6834
|
+
});
|
|
6835
|
+
}
|
|
6836
|
+
function InspectorModal({ open, onOpenChange, modalProps, containerProps, dbExplorerProps, remotesInspectorProps, queueInspectorProps, processorsInspectorProps, integrityInspectorProps, workerInspectorProps, unavailableTabs, defaultTab = "Database" }) {
|
|
6722
6837
|
return /* @__PURE__ */ jsx(Modal, {
|
|
6723
6838
|
...modalProps,
|
|
6724
6839
|
contentProps: {
|
|
@@ -6767,29 +6882,49 @@ function InspectorModal({ open, onOpenChange, modalProps, containerProps, dbExpl
|
|
|
6767
6882
|
children: /* @__PURE__ */ jsx(RemotesInspector, { ...remotesInspectorProps })
|
|
6768
6883
|
})
|
|
6769
6884
|
}),
|
|
6770
|
-
queueInspectorProps
|
|
6885
|
+
queueInspectorProps ? /* @__PURE__ */ jsx(TabContent, {
|
|
6771
6886
|
description: "Queue inspector",
|
|
6772
6887
|
label: "Queue",
|
|
6773
6888
|
children: /* @__PURE__ */ jsx("div", {
|
|
6774
6889
|
className: "h-full",
|
|
6775
6890
|
children: /* @__PURE__ */ jsx(QueueInspector, { ...queueInspectorProps })
|
|
6776
6891
|
})
|
|
6777
|
-
}),
|
|
6778
|
-
|
|
6892
|
+
}) : unavailableTabs?.Queue ? /* @__PURE__ */ jsx(TabContent, {
|
|
6893
|
+
description: "Queue inspector",
|
|
6894
|
+
label: "Queue",
|
|
6895
|
+
children: /* @__PURE__ */ jsx(InspectorUnavailable, { message: unavailableTabs.Queue })
|
|
6896
|
+
}) : null,
|
|
6897
|
+
processorsInspectorProps ? /* @__PURE__ */ jsx(TabContent, {
|
|
6779
6898
|
description: "Processors inspector",
|
|
6780
6899
|
label: "Processors",
|
|
6781
6900
|
children: /* @__PURE__ */ jsx("div", {
|
|
6782
6901
|
className: "h-full",
|
|
6783
6902
|
children: /* @__PURE__ */ jsx(ProcessorsInspector, { ...processorsInspectorProps })
|
|
6784
6903
|
})
|
|
6785
|
-
}),
|
|
6786
|
-
|
|
6904
|
+
}) : unavailableTabs?.Processors ? /* @__PURE__ */ jsx(TabContent, {
|
|
6905
|
+
description: "Processors inspector",
|
|
6906
|
+
label: "Processors",
|
|
6907
|
+
children: /* @__PURE__ */ jsx(InspectorUnavailable, { message: unavailableTabs.Processors })
|
|
6908
|
+
}) : null,
|
|
6909
|
+
integrityInspectorProps ? /* @__PURE__ */ jsx(TabContent, {
|
|
6787
6910
|
description: "Integrity inspector",
|
|
6788
6911
|
label: "Integrity",
|
|
6789
6912
|
children: /* @__PURE__ */ jsx("div", {
|
|
6790
6913
|
className: "h-full",
|
|
6791
6914
|
children: /* @__PURE__ */ jsx(IntegrityInspector, { ...integrityInspectorProps })
|
|
6792
6915
|
})
|
|
6916
|
+
}) : unavailableTabs?.Integrity ? /* @__PURE__ */ jsx(TabContent, {
|
|
6917
|
+
description: "Integrity inspector",
|
|
6918
|
+
label: "Integrity",
|
|
6919
|
+
children: /* @__PURE__ */ jsx(InspectorUnavailable, { message: unavailableTabs.Integrity })
|
|
6920
|
+
}) : null,
|
|
6921
|
+
workerInspectorProps && /* @__PURE__ */ jsx(TabContent, {
|
|
6922
|
+
description: "Worker inspector",
|
|
6923
|
+
label: "Worker",
|
|
6924
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
6925
|
+
className: "h-full",
|
|
6926
|
+
children: /* @__PURE__ */ jsx(WorkerInspector, { ...workerInspectorProps })
|
|
6927
|
+
})
|
|
6793
6928
|
})
|
|
6794
6929
|
]
|
|
6795
6930
|
})
|
|
@@ -9004,6 +9139,6 @@ const removeSuccessFiles = (files) => {
|
|
|
9004
9139
|
return files.filter((file) => file.status !== "SUCCESS");
|
|
9005
9140
|
};
|
|
9006
9141
|
//#endregion
|
|
9007
|
-
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 };
|
|
9142
|
+
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 };
|
|
9008
9143
|
|
|
9009
9144
|
//# sourceMappingURL=index.js.map
|