diff --git a/webapp/src/Routes/Connection/Download.tsx b/webapp/src/Routes/Connection/Download.tsx index f88353b..70cf320 100644 --- a/webapp/src/Routes/Connection/Download.tsx +++ b/webapp/src/Routes/Connection/Download.tsx @@ -10,7 +10,7 @@ type Props = { export function Download({id, name}:Props) { const {authInfo} = useAuthContext(); const handleDownload = () => { - fetch(AppSettings.url + '/connection/'+id, { + fetch(AppSettings.url + '/vpn/connection/'+id, { headers: { "Authorization": "Bearer " + authInfo.token }, diff --git a/webapp/src/Routes/Connection/ListConnections.tsx b/webapp/src/Routes/Connection/ListConnections.tsx index cf584cd..f7b4fbb 100644 --- a/webapp/src/Routes/Connection/ListConnections.tsx +++ b/webapp/src/Routes/Connection/ListConnections.tsx @@ -17,7 +17,7 @@ export function ListConnections() { const { isPending, error, data } = useQuery({ queryKey: ['connections'], queryFn: () => - fetch(AppSettings.url + '/connections', { + fetch(AppSettings.url + '/vpn/connections', { headers: { "Content-Type": "application/json", "Authorization": "Bearer " + authInfo.token @@ -30,7 +30,7 @@ export function ListConnections() { }) const deleteConnection = useMutation({ mutationFn: (id:string) => { - return axios.delete(AppSettings.url + '/connection/'+id, { + return axios.delete(AppSettings.url + '/vpn/connection/'+id, { headers: { "Authorization": "Bearer " + authInfo.token }, diff --git a/webapp/src/Routes/Connection/NewConnection.tsx b/webapp/src/Routes/Connection/NewConnection.tsx index 0197e50..d03a8e0 100644 --- a/webapp/src/Routes/Connection/NewConnection.tsx +++ b/webapp/src/Routes/Connection/NewConnection.tsx @@ -13,7 +13,7 @@ export function NewConnection() { const alertIcon = const newConnection = useMutation({ mutationFn: () => { - return axios.post(AppSettings.url + '/connections', {}, { + return axios.post(AppSettings.url + '/vpn/connections', {}, { headers: { "Authorization": "Bearer " + authInfo.token }, @@ -34,7 +34,7 @@ export function NewConnection() { const { isPending, error, data } = useQuery({ queryKey: ['connectionlicense'], queryFn: () => - fetch(AppSettings.url + '/connectionlicense', { + fetch(AppSettings.url + '/vpn/connectionlicense', { headers: { "Content-Type": "application/json", "Authorization": "Bearer " + authInfo.token diff --git a/webapp/src/Routes/Home/UserStats.tsx b/webapp/src/Routes/Home/UserStats.tsx index 78ed63f..a00f594 100644 --- a/webapp/src/Routes/Home/UserStats.tsx +++ b/webapp/src/Routes/Home/UserStats.tsx @@ -18,7 +18,7 @@ export function UserStats() { const { isPending, error, data } = useQuery({ queryKey: ['userstats', statsDate, unit], queryFn: () => - fetch(AppSettings.url + '/stats/user/' + format(statsDate === null ? new Date() : statsDate, "yyyy-MM-dd") + "?offset="+timezoneOffset+"&unit=" +unit, { + fetch(AppSettings.url + '/vpn/stats/user/' + format(statsDate === null ? new Date() : statsDate, "yyyy-MM-dd") + "?offset="+timezoneOffset+"&unit=" +unit, { headers: { "Content-Type": "application/json", "Authorization": "Bearer " + authInfo.token diff --git a/webapp/src/Routes/PacketLogs/PacketLogs.tsx b/webapp/src/Routes/PacketLogs/PacketLogs.tsx index 8f2b681..4d923ea 100644 --- a/webapp/src/Routes/PacketLogs/PacketLogs.tsx +++ b/webapp/src/Routes/PacketLogs/PacketLogs.tsx @@ -51,7 +51,7 @@ export function PacketLogs() { const { isPending, fetchNextPage, hasNextPage, error, data } = useInfiniteQuery({ queryKey: ['packetlogs', user, logsDate, logType, searchParam], queryFn: async ({ pageParam }) => - fetch(AppSettings.url + '/stats/packetlogs/'+(user === undefined || user === "" ? "all" : user)+'/'+(logsDate == undefined ? getDate(new Date()) : getDate(logsDate)) + "?pos="+pageParam+"&offset="+timezoneOffset+"&logtype="+encodeURIComponent(logType.join(","))+"&search="+encodeURIComponent(searchParam), { + fetch(AppSettings.url + '/vpn/stats/packetlogs/'+(user === undefined || user === "" ? "all" : user)+'/'+(logsDate == undefined ? getDate(new Date()) : getDate(logsDate)) + "?pos="+pageParam+"&offset="+timezoneOffset+"&logtype="+encodeURIComponent(logType.join(","))+"&search="+encodeURIComponent(searchParam), { headers: { "Content-Type": "application/json", "Authorization": "Bearer " + authInfo.token diff --git a/webapp/src/Routes/Setup/Restart.tsx b/webapp/src/Routes/Setup/Restart.tsx index aa017c5..cbbfd0f 100644 --- a/webapp/src/Routes/Setup/Restart.tsx +++ b/webapp/src/Routes/Setup/Restart.tsx @@ -18,7 +18,7 @@ export function Restart() { const alertIcon = ; const setupMutation = useMutation({ mutationFn: () => { - return axios.post(AppSettings.url + '/setup/restart-vpn', {}, { + return axios.post(AppSettings.url + '/vpn/setup/restart-vpn', {}, { headers: { "Authorization": "Bearer " + authInfo.token }, diff --git a/webapp/src/Routes/Setup/TemplateSetup.tsx b/webapp/src/Routes/Setup/TemplateSetup.tsx index d48985b..a09a385 100644 --- a/webapp/src/Routes/Setup/TemplateSetup.tsx +++ b/webapp/src/Routes/Setup/TemplateSetup.tsx @@ -23,7 +23,7 @@ export function TemplateSetup() { const { isPending, error, data, isSuccess } = useQuery({ queryKey: ['templates-setup'], queryFn: () => - fetch(AppSettings.url + '/setup/templates', { + fetch(AppSettings.url + '/vpn/setup/templates', { headers: { "Content-Type": "application/json", "Authorization": "Bearer " + authInfo.token @@ -44,7 +44,7 @@ export function TemplateSetup() { const alertIcon = ; const setupMutation = useMutation({ mutationFn: (setupRequest: TemplateSetupRequest) => { - return axios.post(AppSettings.url + '/setup/templates', setupRequest, { + return axios.post(AppSettings.url + '/vpn/setup/templates', setupRequest, { headers: { "Authorization": "Bearer " + authInfo.token }, diff --git a/webapp/src/Routes/Setup/VPNSetup.tsx b/webapp/src/Routes/Setup/VPNSetup.tsx index ff2a55b..62ba1ba 100644 --- a/webapp/src/Routes/Setup/VPNSetup.tsx +++ b/webapp/src/Routes/Setup/VPNSetup.tsx @@ -35,7 +35,7 @@ export function VPNSetup() { const { isPending, error, data, isSuccess } = useQuery({ queryKey: ['vpn-setup'], queryFn: () => - fetch(AppSettings.url + '/setup/vpn', { + fetch(AppSettings.url + '/vpn/setup/vpn', { headers: { "Content-Type": "application/json", "Authorization": "Bearer " + authInfo.token @@ -64,7 +64,7 @@ export function VPNSetup() { }); const setupMutation = useMutation({ mutationFn: (setupRequest: VPNSetupRequest) => { - return axios.post(AppSettings.url + '/setup/vpn', setupRequest, { + return axios.post(AppSettings.url + '/vpn/setup/vpn', setupRequest, { headers: { "Authorization": "Bearer " + authInfo.token },