mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-07-22 17:34:33 +00:00
Table improvements, add modals
This commit is contained in:
@ -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";
|
||||
|
19
frontend/src/hooks/useUpstreamNginxConfig.ts
Normal file
19
frontend/src/hooks/useUpstreamNginxConfig.ts
Normal 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 };
|
Reference in New Issue
Block a user