mirror of
https://github.com/tale/headplane.git
synced 2026-09-04 11:15:42 +00:00
chore: switch to react-router v7
This commit is contained in:
+15
-12
@@ -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' };
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user