Fixed frontend issues, switched back to nginxproxymanager dockerhub space

This commit is contained in:
Jamie Curnow 2024-05-09 08:41:49 +10:00
parent ae9504584c
commit ecc3b2b5b7
No known key found for this signature in database
GPG Key ID: FFBB624C43388E9E
26 changed files with 304 additions and 1106 deletions

View File

@ -4,7 +4,7 @@
# This file assumes that these scripts have been run first:
# - ./scripts/ci/build-frontend
FROM jc21/testca as testca
FROM nginxproxymanager/testca as testca
FROM letsencrypt/pebble as pebbleca
FROM jc21/gotools:latest AS gobuild
@ -32,7 +32,7 @@ RUN mkdir -p /dist \
# Final image
#===============
FROM jc21/nginx-full:acmesh AS final
FROM nginxproxymanager/nginx-full:acmesh AS final
COPY --from=gobuild /dist/server /app/bin/server
COPY --from=gobuild /dist/ipranges /app/bin/ipranges

View File

@ -1,6 +1,6 @@
FROM jc21/testca as testca
FROM nginxproxymanager/testca as testca
FROM letsencrypt/pebble as pebbleca
FROM jc21/nginx-full:acmesh-golang
FROM nginxproxymanager/nginx-full:acmesh-golang
LABEL maintainer="Jamie Curnow <jc@jc21.com>"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

View File

@ -22,7 +22,7 @@ function App() {
<Router />
</AuthProvider>
</ChakraProvider>
<ReactQueryDevtools position="bottom-right" panelPosition="right" />
<ReactQueryDevtools buttonPosition="bottom-right" position="right" />
</QueryClientProvider>
</LocaleProvider>
</RawIntlProvider>

View File

@ -27,7 +27,7 @@ function SiteWrapper({ children }: Props) {
const j: SSEMessage = JSON.parse(e.data);
if (j) {
if (j.affects) {
queryClient.invalidateQueries([j.affects]);
queryClient.invalidateQueries({ queryKey: [j.affects] });
}
if (j.type) {
toast({

View File

@ -31,7 +31,6 @@ const useAccessLists = (
return useQuery<AccessListsResponse, Error>({
queryKey: ["access-lists", { offset, limit, sortBy, filters }],
queryFn: () => fetchAccessLists(offset, limit, sortBy, filters),
keepPreviousData: true,
staleTime: 15 * 1000, // 15 seconds
...options,
});

View File

@ -22,14 +22,13 @@ const useCertificate = (id: number, options = {}) => {
const useSetCertificate = () => {
const queryClient = useQueryClient();
return useMutation(
(values: Certificate) => {
return useMutation({
mutationFn: (values: Certificate) => {
return values.id
? setCertificate(values.id, values)
: createCertificate(values);
},
{
onMutate: (values) => {
onMutate: (values: Certificate) => {
const previousObject = queryClient.getQueryData([
"certificate",
values.id,
@ -45,11 +44,10 @@ const useSetCertificate = () => {
},
onError: (_, __, rollback: any) => rollback(),
onSuccess: async ({ id }: Certificate) => {
queryClient.invalidateQueries(["certificate", id]);
queryClient.invalidateQueries(["certificates"]);
queryClient.invalidateQueries({ queryKey: ["certificate", id] });
queryClient.invalidateQueries({ queryKey: ["certificates"] });
},
},
);
});
};
export { useCertificate, useSetCertificate };

View File

@ -31,7 +31,6 @@ const useCertificateAuthorities = (
return useQuery<CertificateAuthoritiesResponse, Error>({
queryKey: ["certificate-authorities", { offset, limit, sortBy, filters }],
queryFn: () => fetchCertificateAuthorities(offset, limit, sortBy, filters),
keepPreviousData: true,
staleTime: 15 * 1000, // 15 seconds
...options,
});

View File

@ -22,14 +22,13 @@ const useCertificateAuthority = (id: number, options = {}) => {
const useSetCertificateAuthority = () => {
const queryClient = useQueryClient();
return useMutation(
(values: CertificateAuthority) => {
return useMutation({
mutationFn: (values: CertificateAuthority) => {
return values.id
? setCertificateAuthority(values.id, values)
: createCertificateAuthority(values);
},
{
onMutate: (values) => {
onMutate: (values: CertificateAuthority) => {
const previousObject = queryClient.getQueryData([
"certificate-authority",
values.id,
@ -49,13 +48,16 @@ const useSetCertificateAuthority = () => {
previousObject,
);
},
onError: (_, __, rollback: any) => rollback(),
onError: (_: any, __: any, rollback: any) => rollback(),
onSuccess: async ({ id }: CertificateAuthority) => {
queryClient.invalidateQueries(["certificate-authority", id]);
queryClient.invalidateQueries(["certificate-authorities"]);
queryClient.invalidateQueries({
queryKey: ["certificate-authority", id],
});
queryClient.invalidateQueries({
queryKey: ["certificate-authorities"],
});
},
},
);
});
};
export { useCertificateAuthority, useSetCertificateAuthority };

View File

@ -31,7 +31,6 @@ const useCertificates = (
return useQuery<CertificatesResponse, Error>({
queryKey: ["certificates", { offset, limit, sortBy, filters }],
queryFn: () => fetchCertificates(offset, limit, sortBy, filters),
keepPreviousData: true,
staleTime: 15 * 1000, // 15 seconds
...options,
});

View File

@ -22,14 +22,13 @@ const useDNSProvider = (id: number, options = {}) => {
const useSetDNSProvider = () => {
const queryClient = useQueryClient();
return useMutation(
(values: DNSProvider) => {
return useMutation({
mutationFn: (values: DNSProvider) => {
return values.id
? setDNSProvider(values.id, values)
: createDNSProvider(values);
},
{
onMutate: (values) => {
onMutate: (values: DNSProvider) => {
const previousObject = queryClient.getQueryData([
"dns-provider",
values.id,
@ -45,11 +44,10 @@ const useSetDNSProvider = () => {
},
onError: (_, __, rollback: any) => rollback(),
onSuccess: async ({ id }: DNSProvider) => {
queryClient.invalidateQueries(["dns-provider", id]);
queryClient.invalidateQueries(["dns-providers"]);
queryClient.invalidateQueries({ queryKey: ["dns-provider", id] });
queryClient.invalidateQueries({ queryKey: ["dns-providers"] });
},
},
);
});
};
export { useDNSProvider, useSetDNSProvider };

View File

@ -31,7 +31,6 @@ const useDNSProviders = (
return useQuery<DNSProvidersResponse, Error>({
queryKey: ["dns-providers", { offset, limit, sortBy, filters }],
queryFn: () => fetchDNSProviders(offset, limit, sortBy, filters),
keepPreviousData: true,
staleTime: 15 * 1000, // 15 seconds
...options,
});

View File

@ -6,7 +6,6 @@ const useDNSProvidersAcmesh = (options = {}) => {
return useQuery<DNSProvidersAcmesh[], Error>({
queryKey: ["dns-providers-acmesh"],
queryFn: () => getDNSProvidersAcmesh(),
keepPreviousData: true,
staleTime: 60 * 60 * 1000, // 1 hour
...options,
});

View File

@ -26,7 +26,6 @@ const useHosts = (
return useQuery<HostsResponse, Error>({
queryKey: ["hosts", { offset, limit, sortBy, filters }],
queryFn: () => fetchHosts(offset, limit, sortBy, filters),
keepPreviousData: true,
staleTime: 15 * 1000, // 15 seconds
...options,
});

View File

@ -31,7 +31,6 @@ const useNginxTemplates = (
return useQuery<NginxTemplatesResponse, Error>({
queryKey: ["nginx-templates", { offset, limit, sortBy, filters }],
queryFn: () => fetchNginxTemplates(offset, limit, sortBy, filters),
keepPreviousData: true,
staleTime: 15 * 1000, // 15 seconds
...options,
});

View File

@ -26,7 +26,6 @@ const useSettings = (
return useQuery<SettingsResponse, Error>({
queryKey: ["settings", { offset, limit, sortBy, filters }],
queryFn: () => fetchSettings(offset, limit, sortBy, filters),
keepPreviousData: true,
staleTime: 15 * 1000, // 15 seconds
...options,
});

View File

@ -31,7 +31,6 @@ const useUpstreams = (
return useQuery<HostsResponse, Error>({
queryKey: ["upstreams", { offset, limit, sortBy, filters }],
queryFn: () => fetchUpstreams(offset, limit, sortBy, filters),
keepPreviousData: true,
staleTime: 15 * 1000, // 15 seconds
...options,
});

View File

@ -17,7 +17,8 @@ const useUser = (id: string | number, options = {}) => {
const useSetUser = () => {
const queryClient = useQueryClient();
return useMutation((values: User) => setUser(values.id, values), {
return useMutation({
mutationFn: (values: User) => setUser(values.id, values),
onMutate: (values) => {
const previousObject = queryClient.getQueryData(["user", values.id]);
@ -31,8 +32,8 @@ const useSetUser = () => {
},
onError: (_, __, rollback: any) => rollback(),
onSuccess: async ({ id }: User) => {
queryClient.invalidateQueries(["user", id]);
queryClient.invalidateQueries(["users"]);
queryClient.invalidateQueries({ queryKey: ["user", id] });
queryClient.invalidateQueries({ queryKey: ["users"] });
},
});
};

View File

@ -26,7 +26,6 @@ const useUsers = (
return useQuery<UsersResponse, Error>({
queryKey: ["users", { offset, limit, sortBy, filters }],
queryFn: () => fetchUsers(offset, limit, sortBy, filters),
keepPreviousData: true,
staleTime: 15 * 1000, // 15 seconds
...options,
});

View File

@ -79,7 +79,7 @@ function CertificateAuthorityEditModal({
closeOnOverlayClick={false}>
<ModalOverlay />
<ModalContent>
{status === "loading" ? (
{status === "pending" ? (
// todo nicer
<p>loading</p>
) : (

View File

@ -79,7 +79,7 @@ function CertificateEditModal({
closeOnOverlayClick={false}>
<ModalOverlay />
<ModalContent>
{status === "loading" ? (
{status === "pending" ? (
// todo nicer
<p>loading</p>
) : (

View File

@ -80,7 +80,7 @@ function UpstreamEditModal({
closeOnOverlayClick={false}>
<ModalOverlay />
<ModalContent>
{status === "loading" ? (
{status === "pending" ? (
// todo nicer
<p>loading</p>
) : (

View File

@ -79,7 +79,7 @@ function UserCreateModal({ isOpen, onClose }: UserCreateModalProps) {
const response = await createUser(payload);
if (response && typeof response.id !== "undefined" && response.id) {
// ok
queryClient.invalidateQueries(["users"]);
queryClient.invalidateQueries({ queryKey: ["users"] });
onClose();
resetForm();
} else {

View File

@ -98,7 +98,7 @@ function UserEditModal({ userId, isOpen, onClose }: UserEditModalProps) {
closeOnOverlayClick={false}>
<ModalOverlay />
<ModalContent>
{status === "loading" ? (
{status === "pending" ? (
// todo nicer
<p>loading</p>
) : (

View File

@ -55,7 +55,7 @@ function TableWrapper() {
isClosable: true,
});
setTimeout(() => {
queryClient.invalidateQueries(["certificates"]);
queryClient.invalidateQueries({ queryKey: ["certificates"] });
}, 500);
} catch (err: any) {
toast({

View File

@ -67,7 +67,7 @@ function Setup() {
try {
await login(response.email, password);
// Trigger a Health change
await queryClient.refetchQueries(["health"]);
await queryClient.refetchQueries({ queryKey: ["health"] });
// window.location.reload();
} catch (err: any) {
showErr(err.message);

File diff suppressed because it is too large Load Diff