fix: move index to Layout Component
parent
09077c4506
commit
e83caa1cfb
|
|
@ -1,14 +1,12 @@
|
|||
import Head from 'next/head'
|
||||
|
||||
import { Inter } from 'next/font/google'
|
||||
import { MonitorState, MonitorTarget } from '@/types/config'
|
||||
import { KVNamespace } from '@cloudflare/workers-types'
|
||||
import { maintenances, pageConfig, workerConfig } from '@/uptime.config'
|
||||
import { maintenances, workerConfig } from '@/uptime.config'
|
||||
import OverallStatus from '@/components/OverallStatus'
|
||||
import Header from '@/components/Header'
|
||||
import MonitorList from '@/components/MonitorList'
|
||||
import { Center, Divider, Text } from '@mantine/core'
|
||||
import { Center, Text } from '@mantine/core'
|
||||
import MonitorDetail from '@/components/MonitorDetail'
|
||||
import Layout from '@/components/Layout'
|
||||
|
||||
export const runtime = 'experimental-edge'
|
||||
const inter = Inter({ subsets: ['latin'] })
|
||||
|
|
@ -42,54 +40,20 @@ export default function Home({
|
|||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>{pageConfig.title}</title>
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
</Head>
|
||||
|
||||
<main className={inter.className}>
|
||||
<Header />
|
||||
|
||||
{state == undefined ? (
|
||||
<Center>
|
||||
<Text fw={700}>
|
||||
Monitor State is not defined now, please check your worker's status and KV
|
||||
binding!
|
||||
</Text>
|
||||
</Center>
|
||||
) : (
|
||||
<div>
|
||||
<OverallStatus state={state} monitors={monitors} maintenances={maintenances} />
|
||||
<MonitorList monitors={monitors} state={state} />
|
||||
</div>
|
||||
)}
|
||||
|
||||
<Divider mt="lg" />
|
||||
<Text
|
||||
size="xs"
|
||||
mt="xs"
|
||||
mb="xs"
|
||||
style={{
|
||||
textAlign: 'center',
|
||||
}}
|
||||
>
|
||||
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>
|
||||
</main>
|
||||
</>
|
||||
<Layout>
|
||||
{state == undefined ? (
|
||||
<Center>
|
||||
<Text fw={700}>
|
||||
Monitor State is not defined now, please check your worker's status and KV binding!
|
||||
</Text>
|
||||
</Center>
|
||||
) : (
|
||||
<div>
|
||||
<OverallStatus state={state} monitors={monitors} maintenances={maintenances} />
|
||||
<MonitorList monitors={monitors} state={state} />
|
||||
</div>
|
||||
)}
|
||||
</Layout>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -106,11 +70,8 @@ export async function getServerSideProps() {
|
|||
return {
|
||||
id: monitor.id,
|
||||
name: monitor.name,
|
||||
// @ts-ignore
|
||||
tooltip: monitor?.tooltip,
|
||||
// @ts-ignore
|
||||
statusPageLink: monitor?.statusPageLink,
|
||||
// @ts-ignore
|
||||
hideLatencyChart: monitor?.hideLatencyChart,
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue