mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-07-22 17:34:33 +00:00
- Added upstream objects
- Renamed host templates to nginx templates - Generate upstream templates - Better nginx error reporting when reloading - Use tparse for golang test reporting
This commit is contained in:
@ -6,7 +6,7 @@ export * from "./useDNSProviders";
|
||||
export * from "./useDNSProvidersAcmesh";
|
||||
export * from "./useHealth";
|
||||
export * from "./useHosts";
|
||||
export * from "./useHostTemplates";
|
||||
export * from "./useNginxTemplates";
|
||||
export * from "./useSettings";
|
||||
export * from "./useUser";
|
||||
export * from "./useUsers";
|
||||
|
@ -1,18 +1,18 @@
|
||||
import {
|
||||
getHostTemplates,
|
||||
HostTemplatesResponse,
|
||||
getNginxTemplates,
|
||||
NginxTemplatesResponse,
|
||||
tableSortToAPI,
|
||||
tableFiltersToAPI,
|
||||
} from "api/npm";
|
||||
import { useQuery } from "react-query";
|
||||
|
||||
const fetchHostTemplates = (
|
||||
const fetchNginxTemplates = (
|
||||
offset = 0,
|
||||
limit = 10,
|
||||
sortBy?: any,
|
||||
filters?: any,
|
||||
) => {
|
||||
return getHostTemplates(
|
||||
return getNginxTemplates(
|
||||
offset,
|
||||
limit,
|
||||
tableSortToAPI(sortBy),
|
||||
@ -20,16 +20,16 @@ const fetchHostTemplates = (
|
||||
);
|
||||
};
|
||||
|
||||
const useHostTemplates = (
|
||||
const useNginxTemplates = (
|
||||
offset = 0,
|
||||
limit = 10,
|
||||
sortBy?: any,
|
||||
filters?: any,
|
||||
options = {},
|
||||
) => {
|
||||
return useQuery<HostTemplatesResponse, Error>(
|
||||
["hosts", { offset, limit, sortBy, filters }],
|
||||
() => fetchHostTemplates(offset, limit, sortBy, filters),
|
||||
return useQuery<NginxTemplatesResponse, Error>(
|
||||
["nginx-templates", { offset, limit, sortBy, filters }],
|
||||
() => fetchNginxTemplates(offset, limit, sortBy, filters),
|
||||
{
|
||||
keepPreviousData: true,
|
||||
staleTime: 15 * 1000, // 15 seconds
|
||||
@ -38,4 +38,4 @@ const useHostTemplates = (
|
||||
);
|
||||
};
|
||||
|
||||
export { fetchHostTemplates, useHostTemplates };
|
||||
export { fetchNginxTemplates, useNginxTemplates };
|
Reference in New Issue
Block a user