* feat: dnshole controls widget * feat: add duration and timer modal * fix: code improvment * fix: add support for many integrations * fix: add support for more integrations * fix: move ControlsCard outside of main component * fix: deepsource
28 lines
523 B
TypeScript
28 lines
523 B
TypeScript
"use server";
|
|
|
|
import { api } from "@homarr/api/server";
|
|
|
|
import type { WidgetProps } from "../../definition";
|
|
|
|
export default async function getServerDataAsync({ integrationIds }: WidgetProps<"dnsHoleSummary">) {
|
|
if (integrationIds.length === 0) {
|
|
return {
|
|
initialData: [],
|
|
};
|
|
}
|
|
|
|
try {
|
|
const currentDns = await api.widget.dnsHole.summary({
|
|
integrationIds,
|
|
});
|
|
|
|
return {
|
|
initialData: currentDns,
|
|
};
|
|
} catch (error) {
|
|
return {
|
|
initialData: undefined,
|
|
};
|
|
}
|
|
}
|