feat: option to hide latency chart
parent
dabccd83f6
commit
d1857502bb
|
|
@ -70,7 +70,7 @@ export default function MonitorDetail({
|
|||
</div>
|
||||
|
||||
<DetailBar monitor={monitor} state={state} />
|
||||
<DetailChart monitor={monitor} state={state} />
|
||||
{!monitor.hideLatencyChart && <DetailChart monitor={monitor} state={state} />}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { MonitorState, MonitorTarget } from '@/uptime.types'
|
||||
import { Card, Center, Divider } from '@mantine/core'
|
||||
import { Card, Center } from '@mantine/core'
|
||||
import MonitorDetail from './MonitorDetail'
|
||||
|
||||
export default function MonitorList({ monitors, state }: { monitors: any; state: MonitorState }) {
|
||||
|
|
@ -20,7 +20,6 @@ export default function MonitorList({ monitors, state }: { monitors: any; state:
|
|||
<Card.Section ml="xs" mr="xs">
|
||||
<MonitorDetail monitor={monitor} state={state} />
|
||||
</Card.Section>
|
||||
<Divider />
|
||||
</div>
|
||||
))}
|
||||
</Card>
|
||||
|
|
|
|||
|
|
@ -108,7 +108,9 @@ export async function getServerSideProps() {
|
|||
// @ts-ignore
|
||||
tooltip: monitor?.tooltip,
|
||||
// @ts-ignore
|
||||
statusPageLink: monitor?.statusPageLink
|
||||
statusPageLink: monitor?.statusPageLink,
|
||||
// @ts-ignore
|
||||
hideLatencyChart: monitor?.hideLatencyChart,
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ const workerConfig = {
|
|||
tooltip: 'This is a tooltip for this monitor',
|
||||
// [OPTIONAL] `statusPageLink` is ONLY used for clickable link at status page
|
||||
statusPageLink: 'https://example.com',
|
||||
// [OPTIONAL] `hideLatencyChart` will hide status page latency chart if set to true
|
||||
hideLatencyChart: false,
|
||||
// [OPTIONAL] `expectedCodes` is an array of acceptable HTTP response codes, if not specified, default to 2xx
|
||||
expectedCodes: [200],
|
||||
// [OPTIONAL] `timeout` in millisecond, if not specified, default to 10000
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ type MonitorTarget = {
|
|||
tooltip?: string
|
||||
statusPageLink?: string
|
||||
checkLocationWorkerRoute?: string
|
||||
hideLatencyChart?: boolean
|
||||
|
||||
// HTTP Code
|
||||
expectedCodes?: number[]
|
||||
|
|
|
|||
Loading…
Reference in New Issue