mirror of
https://github.com/gethomepage/homepage.git
synced 2026-09-28 23:11:17 -07:00
Lint / Linting Checks (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Docker CI / Docker Build & Push (push) Has been cancelled
Tests / vitest (1) (push) Has been cancelled
Tests / vitest (2) (push) Has been cancelled
Release Drafter / Auto Label PR (push) Has been cancelled
Tests / vitest (3) (push) Has been cancelled
Tests / vitest (4) (push) Has been cancelled
Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com> Signed-off-by: dependabot[bot] <support@github.com>
38 lines
1.3 KiB
React
Executable File
38 lines
1.3 KiB
React
Executable File
import { useTranslation } from "next-i18next/pages";
|
|
|
|
import Block from "components/services/widget/block";
|
|
import Container from "components/services/widget/container";
|
|
import useWidgetAPI from "utils/proxy/use-widget-api";
|
|
|
|
export default function Component({ service }) {
|
|
const { t } = useTranslation();
|
|
|
|
const { widget } = service;
|
|
|
|
const { data: fileflowsData, error: fileflowsError } = useWidgetAPI(widget, "status");
|
|
|
|
if (fileflowsError) {
|
|
return <Container service={service} error={fileflowsError} />;
|
|
}
|
|
|
|
if (!fileflowsData) {
|
|
return (
|
|
<Container service={service}>
|
|
<Block label="fileflows.queue" />
|
|
<Block label="fileflows.processing" />
|
|
<Block label="fileflows.processed" />
|
|
<Block label="fileflows.time" />
|
|
</Container>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<Container service={service}>
|
|
<Block label="fileflows.queue" value={t("common.number", { value: fileflowsData.queue })} />
|
|
<Block label="fileflows.processing" value={t("common.number", { value: fileflowsData.processing })} />
|
|
<Block label="fileflows.processed" value={t("common.number", { value: fileflowsData.processed })} />
|
|
<Block label="fileflows.time" value={fileflowsData.time?.length ? fileflowsData.time : "0:00"} />
|
|
</Container>
|
|
);
|
|
}
|