feat: refine mobile dashboard experience
This commit is contained in:
1 parent
9f0969ec22
commit
315520beca
116 files changed
+2499
-586
No files matched your search
@@ -39,6 +39,7 @@ import { useBeszelFilteredSystems } from "../beszel/_shared/hooks";
|
||||
import { BeszelIntegrationErrorIndicator } from "../beszel/_shared/error-indicator";
|
||||
import { BeszelSystemStatsModal } from "../beszel/_shared/system-stats-modal";
|
||||
import { DiskUsage } from "../beszel/_shared/disk-usage";
|
||||
import { BeszelSystemsMobileSummary } from "../beszel/_shared/mobile-summary";
|
||||
|
||||
interface SizeConfig {
|
||||
iconSize: number;
|
||||
@@ -358,7 +359,23 @@ const SystemCard = ({ system, options, t, size, maxMetrics, itemRadius, onClick
|
||||
);
|
||||
};
|
||||
|
||||
export default function BeszelSystemGridWidget({
|
||||
export default function BeszelSystemGridWidget({ displayMode, ...props }: WidgetComponentProps<"beszelSystemGrid">) {
|
||||
const t = useScopedI18n("widget.beszelSystemGrid");
|
||||
|
||||
if (displayMode === "mobileSummary") {
|
||||
return (
|
||||
<BeszelSystemsMobileSummary
|
||||
integrationIds={props.integrationIds}
|
||||
statusFilter={props.options.statusFilter}
|
||||
label={t("name")}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return <BeszelSystemGridContent {...props} />;
|
||||
}
|
||||
|
||||
function BeszelSystemGridContent({
|
||||
options,
|
||||
integrationIds,
|
||||
isEditMode,
|
||||
|
||||
@@ -6,6 +6,13 @@ import { optionsBuilder } from "../options";
|
||||
|
||||
export const { definition, componentLoader } = createWidgetDefinition("beszelSystemGrid", {
|
||||
icon: IconLayoutGrid,
|
||||
mobile: {
|
||||
width: 2,
|
||||
height: 1,
|
||||
supportsCompactSummary: true,
|
||||
supportsDetailView: true,
|
||||
unmountWhenOffscreen: true,
|
||||
},
|
||||
queryKey: [["widget", "beszel"]],
|
||||
supportedIntegrations: ["beszel", "mock"],
|
||||
integrationsRequired: true,
|
||||
|
||||
Reference in new issue
Block a user