Allow widget field visibility to be configurable

This commit is contained in:
Jason Fischer 2022-09-29 21:15:25 -07:00
parent 756f6310af
commit 9b7d6b196f
No known key found for this signature in database
30 changed files with 246 additions and 219 deletions

View file

@ -17,11 +17,22 @@ export default function Component({ service }) {
return <Container error={t("widget.api_error")} />;
}
if (!appsData || !messagesData || !clientsData) {
return (
<Container service={service}>
<Block label="gotify.apps" />
<Block label="gotify.clients" />
<Block label="gotify.messages" />
</Container>
);
}
return (
<Container>
<Block label={t("gotify.apps")} value={appsData?.length} />
<Block label={t("gotify.clients")} value={clientsData?.length} />
<Block label={t("gotify.messages")} value={messagesData?.messages?.length} />
<Container service={service}>
<Block label="gotify.apps" value={appsData?.length} />
<Block label="gotify.clients" value={clientsData?.length} />
<Block label="gotify.messages" value={messagesData?.messages?.length} />
</Container>
);
}