chore: switch to react-router v7

This commit is contained in:
Aarnav Tale
2024-12-31 10:30:14 +05:30
parent 39504e2487
commit aa9872a45b
101 changed files with 3825 additions and 6796 deletions
+15 -12
View File
@@ -1,23 +1,26 @@
import { loadContext } from '~/utils/config/headplane'
import { HeadscaleError, pull } from '~/utils/headscale'
import { data } from '@remix-run/node'
import log from '~/utils/log'
import { loadContext } from '~/utils/config/headplane';
import { HeadscaleError, pull } from '~/utils/headscale';
import { data } from 'react-router';
import log from '~/utils/log';
export async function loader() {
const context = await loadContext()
const context = await loadContext();
try {
// Doesn't matter, we just need a 401
await pull('v1/', 'wrongkey')
await pull('v1/', 'wrongkey');
} catch (e) {
if (!(e instanceof HeadscaleError)) {
log.debug('Healthz', 'Headscale is not reachable')
return data({
status: 'NOT OK',
error: e.message
}, { status: 500 })
log.debug('Healthz', 'Headscale is not reachable');
return data(
{
status: 'NOT OK',
error: e.message,
},
{ status: 500 },
);
}
}
return { status: 'OK' }
return { status: 'OK' };
}
+2 -2
View File
@@ -1,5 +1,5 @@
import { redirect } from '@remix-run/node'
import { redirect } from 'react-router';
export async function loader() {
return redirect('/machines')
return redirect('/machines');
}