mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-09 23:08:48 +00:00
further restructuring
This commit is contained in:
parent
9b07f3eb90
commit
4386999c38
55 changed files with 224 additions and 224 deletions
|
@ -1,8 +1,8 @@
|
|||
import useSWR from "swr";
|
||||
import { useTranslation } from "next-i18next";
|
||||
|
||||
import Widget from "components/services/widgets/widget";
|
||||
import Block from "components/services/widgets/block";
|
||||
import Container from "components/services/widget/container";
|
||||
import Block from "components/services/widget/block";
|
||||
import { formatProxyUrl } from "utils/proxy/api-helpers";
|
||||
|
||||
export default function Component({ service }) {
|
||||
|
@ -15,16 +15,16 @@ export default function Component({ service }) {
|
|||
const { data: failedLoginsData, error: failedLoginsError } = useSWR(formatProxyUrl(config, "login_failed"));
|
||||
|
||||
if (usersError || loginsError || failedLoginsError) {
|
||||
return <Widget error={t("widget.api_error")} />;
|
||||
return <Container error={t("widget.api_error")} />;
|
||||
}
|
||||
|
||||
if (!usersData || !loginsData || !failedLoginsData) {
|
||||
return (
|
||||
<Widget>
|
||||
<Container>
|
||||
<Block label={t("authentik.users")} />
|
||||
<Block label={t("authentik.loginsLast24H")} />
|
||||
<Block label={t("authentik.failedLoginsLast24H")} />
|
||||
</Widget>
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -39,10 +39,10 @@ export default function Component({ service }) {
|
|||
);
|
||||
|
||||
return (
|
||||
<Widget>
|
||||
<Container>
|
||||
<Block label={t("authentik.users")} value={t("common.number", { value: usersData.pagination.count })} />
|
||||
<Block label={t("authentik.loginsLast24H")} value={t("common.number", { value: loginsLast24H })} />
|
||||
<Block label={t("authentik.failedLoginsLast24H")} value={t("common.number", { value: failedLoginsLast24H })} />
|
||||
</Widget>
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue