mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-08 06:38:46 +00:00
Revert "Added optional boxed styling for information widgets and refactored information widgets"
This commit is contained in:
parent
347761fcad
commit
6b2930ab8d
35 changed files with 854 additions and 642 deletions
|
@ -1,31 +1,37 @@
|
|||
import useSWR from "swr";
|
||||
|
||||
import Error from "../widget/error";
|
||||
import Container from "../widget/container";
|
||||
import Raw from "../widget/raw";
|
||||
import { BiError } from "react-icons/bi";
|
||||
import { useTranslation } from "next-i18next";
|
||||
|
||||
import Node from "./node";
|
||||
|
||||
export default function Longhorn({ options }) {
|
||||
const { expanded, total, labels, include, nodes } = options;
|
||||
const { t } = useTranslation();
|
||||
const { data, error } = useSWR(`/api/widgets/longhorn`, {
|
||||
refreshInterval: 1500
|
||||
});
|
||||
|
||||
if (error || data?.error) {
|
||||
return <Error options={options} />
|
||||
return (
|
||||
<div className="flex flex-col max-w:full sm:basis-auto self-center grow-0 flex-wrap">
|
||||
<BiError className="text-theme-800 dark:text-theme-200 w-5 h-5" />
|
||||
<div className="flex flex-col ml-3 text-left">
|
||||
<span className="text-theme-800 dark:text-theme-200 text-xs">{t("widget.api_error")}</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (!data) {
|
||||
return <Container options={options}>
|
||||
<Raw>
|
||||
return (
|
||||
<div className="flex flex-col max-w:full sm:basis-auto self-center grow-0 flex-wrap">
|
||||
<div className="flex flex-row self-center flex-wrap justify-between" />
|
||||
</Raw>
|
||||
</Container>;
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return <Container options={options}>
|
||||
<Raw>
|
||||
return (
|
||||
<div className="flex flex-col max-w:full sm:basis-auto self-center grow-0 flex-wrap">
|
||||
<div className="flex flex-row self-center flex-wrap justify-between">
|
||||
{data.nodes
|
||||
.filter((node) => {
|
||||
|
@ -46,6 +52,6 @@ export default function Longhorn({ options }) {
|
|||
</div>
|
||||
)}
|
||||
</div>
|
||||
</Raw>
|
||||
</Container>;
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue