* feat: add pi hole summary integration * feat: add pi hole summary widget * fix: type issues with integrations and integrationIds * feat: add middleware for integrations and improve cache redis channel * feat: add error boundary for widgets * fix: broken lock file * fix: format format issues * fix: typecheck issue * fix: deepsource issues * fix: widget sandbox without error boundary * chore: address pull request feedback * chore: remove todo comment and created issue * fix: format issues * fix: deepsource issue
25 lines
529 B
TypeScript
25 lines
529 B
TypeScript
"use server";
|
|
|
|
import { api } from "@homarr/api/server";
|
|
|
|
import type { WidgetProps } from "../../definition";
|
|
|
|
export default async function getServerDataAsync({ integrationIds }: WidgetProps<"dnsHoleSummary">) {
|
|
const integrationId = integrationIds.at(0);
|
|
if (!integrationId) return { initialData: undefined };
|
|
|
|
try {
|
|
const data = await api.widget.dnsHole.summary({
|
|
integrationId,
|
|
});
|
|
|
|
return {
|
|
initialData: data,
|
|
};
|
|
} catch (error) {
|
|
return {
|
|
initialData: undefined,
|
|
};
|
|
}
|
|
}
|