format code

This commit is contained in:
lyc8503 committed 2023-11-06 00:38:30 +08:00
1 parent 6157bc0879
commit eba65bd654
23 files changed
+2380 -2192

No files matched your search

+36 -24
View File
@@ -23,39 +23,51 @@ export default function Home({ state }: { state: MonitorState }) {
<main className={inter.className}>
<Header />
{
state === undefined ?
(
<Center>
<Text fw={700}>
Monitor State is not defined now, please check your worker&apos;s status and KV binding!
</Text>
</Center>
) :
(
<div>
<OverallStatus state={state} />
<MonitorList config={config} state={state} />
</div>
)
}
{state === undefined ? (
<Center>
<Text fw={700}>
Monitor State is not defined now, please check your worker&apos;s
status and KV binding!
</Text>
</Center>
) : (
<div>
<OverallStatus state={state} />
<MonitorList config={config} state={state} />
</div>
)}
<Divider mt='lg' />
<Divider mt="lg" />
<Center>
<Text size='xs' mt='xs' mb='xs'>
Open-source monitoring and status page powered by <a href='https://github.com/lyc8503/UptimeFlare' target='_blank'>Uptimeflare</a> and <a href='https://www.cloudflare.com/' target='_blank'>Cloudflare</a>, made with ❤ by <a href='https://github.com/lyc8503' target='_blank'>lyc8503</a>.
<Text size="xs" mt="xs" mb="xs">
Open-source monitoring and status page powered by{' '}
<a href="https://github.com/lyc8503/UptimeFlare" target="_blank">
Uptimeflare
</a>{' '}
and{' '}
<a href="https://www.cloudflare.com/" target="_blank">
Cloudflare
</a>
, made with ❤ by{' '}
<a href="https://github.com/lyc8503" target="_blank">
lyc8503
</a>
.
</Text>
</Center>
</main>
</>
)
}
export async function getServerSideProps() {
const { UPTIMEFLARE_STATE } = process.env as unknown as { UPTIMEFLARE_STATE: KVNamespace }
const state = await UPTIMEFLARE_STATE?.get('state', 'json') as unknown as MonitorState
const { UPTIMEFLARE_STATE } = process.env as unknown as {
UPTIMEFLARE_STATE: KVNamespace
}
const state = (await UPTIMEFLARE_STATE?.get(
'state',
'json'
)) as unknown as MonitorState
return { props: { state } }
}