fix(beszel): restore timePeriod cast and improve error visibility
- Restore timePeriod union cast to fix typecheck (TS2769) - Clear live data on subscription error so error UI always shows - Emit error when no integration is configured for live subscription - Add error state to system select input when query fails
This commit is contained in:
5 files changed
+11
-4
No files matched your search
@@ -16,7 +16,7 @@ export const WidgetBeszelSystemInput = ({ property, kind }: CommonWidgetInputPro
|
||||
|
||||
const integrationIds = form.values.integrationIds;
|
||||
|
||||
const { data: systemsResult = [], isPending } = clientApi.widget.beszel.getSystems.useQuery(
|
||||
const { data: systemsResult = [], isPending, isError } = clientApi.widget.beszel.getSystems.useQuery(
|
||||
{ integrationIds },
|
||||
{ enabled: integrationIds.length > 0, staleTime: 30_000 },
|
||||
);
|
||||
@@ -40,6 +40,8 @@ export const WidgetBeszelSystemInput = ({ property, kind }: CommonWidgetInputPro
|
||||
searchable
|
||||
nothingFoundMessage={t("noSystems")}
|
||||
data={systems}
|
||||
disabled={isError}
|
||||
error={isError ? t("loadError") : undefined}
|
||||
{...form.getInputProps(`options.${property}`)}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user