Table improvements, add modals

This commit is contained in:
Jamie Curnow
2023-01-16 14:02:36 +10:00
parent 306ac20457
commit b877bea86c
17 changed files with 1149 additions and 121 deletions

View File

@ -9,6 +9,7 @@ export * from "./useHealth";
export * from "./useHosts";
export * from "./useNginxTemplates";
export * from "./useSettings";
export * from "./useUpstreamNginxConfig";
export * from "./useUpstreams";
export * from "./useUser";
export * from "./useUsers";

View File

@ -0,0 +1,19 @@
import { getUpstreamNginxConfig } from "api/npm";
import { useQuery } from "react-query";
const fetchUpstreamNginxConfig = (id: any) => {
return getUpstreamNginxConfig(id);
};
const useUpstreamNginxConfig = (id: number, options = {}) => {
return useQuery<string, Error>(
["upstream-nginx-config", id],
() => fetchUpstreamNginxConfig(id),
{
staleTime: 30 * 1000, // 30 seconds
...options,
},
);
};
export { useUpstreamNginxConfig };