diff --git a/src/client/components/monitor/MonitorInfo.tsx b/src/client/components/monitor/MonitorInfo.tsx index 7f499e7..89f2fb9 100644 --- a/src/client/components/monitor/MonitorInfo.tsx +++ b/src/client/components/monitor/MonitorInfo.tsx @@ -15,6 +15,7 @@ import { ErrorTip } from '../ErrorTip'; import { ColorTag } from '../ColorTag'; import { useNavigate } from 'react-router'; import { MonitorStatsBlock } from './MonitorStatsBlock'; +import { MonitorEventList } from './MonitorEventList'; interface MonitorInfoProps { monitorId: string; @@ -43,62 +44,66 @@ export const MonitorInfo: React.FC = React.memo((props) => { } return ( - - -
- -
{monitorInfo.name}
+
+ + +
+ +
{monitorInfo.name}
-
- - - {getMonitorLink(monitorInfo as any as MonitorInfoType)} - +
+ + + {getMonitorLink(monitorInfo as any as MonitorInfoType)} + +
+ + +
+ Monitored for {dayjs().diff(dayjs(monitorInfo.createdAt), 'days')}{' '} + days
- - -
- Monitored for {dayjs().diff(dayjs(monitorInfo.createdAt), 'days')}{' '} - days
-
-
- -
+
+ +
- - { - setCurrentResponse(last(items)?.value ?? 0); - }} - /> - + + { + setCurrentResponse(last(items)?.value ?? 0); + }} + /> + - - - + + + - - - -
- + + + + + + + +
); }); MonitorInfo.displayName = 'MonitorInfo'; diff --git a/src/client/pages/Layout.tsx b/src/client/pages/Layout.tsx index 7cee6ad..076e325 100644 --- a/src/client/pages/Layout.tsx +++ b/src/client/pages/Layout.tsx @@ -71,8 +71,8 @@ export const Layout: React.FC = React.memo(() => {
)} -
-
+
+
diff --git a/src/client/pages/Monitor/Detail.tsx b/src/client/pages/Monitor/Detail.tsx index 8c32115..af0e0ca 100644 --- a/src/client/pages/Monitor/Detail.tsx +++ b/src/client/pages/Monitor/Detail.tsx @@ -11,7 +11,7 @@ export const MonitorDetail: React.FC = React.memo(() => { } return ( -
+
); diff --git a/src/client/pages/Monitor/index.tsx b/src/client/pages/Monitor/index.tsx index 18e8562..c3377d0 100644 --- a/src/client/pages/Monitor/index.tsx +++ b/src/client/pages/Monitor/index.tsx @@ -11,7 +11,7 @@ export const MonitorPage: React.FC = React.memo(() => { return (
-
+
{
-
+
diff --git a/src/server/model/monitor/index.ts b/src/server/model/monitor/index.ts index 1036503..f5b5047 100644 --- a/src/server/model/monitor/index.ts +++ b/src/server/model/monitor/index.ts @@ -156,7 +156,7 @@ class MonitorRunner { if (value < 0 && currentStatus === 'UP') { await prisma.monitorEvent.create({ data: { - message: `Monitor ${monitor.name} has been down`, + message: `Monitor [${monitor.name}] has been down`, monitorId: monitor.id, type: 'DOWN', }, @@ -170,7 +170,7 @@ class MonitorRunner { } else if (value > 0 && currentStatus === 'DOWN') { await prisma.monitorEvent.create({ data: { - message: `Monitor ${monitor.name} has been up`, + message: `Monitor [${monitor.name}] has been up`, monitorId: monitor.id, type: 'UP', },