feat: dnshole controls widget (#867)

* 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
This commit is contained in:
Yossi Hillali authored and GitHub committed 2024-08-04 18:47:00 +03:00
1 parent 9013d5dbf0
commit 65c6854e44
14 files changed
+501 -29

No files matched your search

@@ -0,0 +1,27 @@
"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,
};
}
}