From d2d105c9058b0a295a0c25da8607e1f2b6a68369 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Tue, 5 Dec 2023 20:07:36 +0800 Subject: [PATCH] refactor: change monitor path --- src/client/components/monitor/MonitorDataMetrics.tsx | 2 +- src/client/components/monitor/MonitorInfo.tsx | 2 +- .../components/{modals => }/monitor/MonitorInfoEditor.tsx | 4 ++-- .../components/{modals => }/monitor/provider/http.tsx | 6 +++--- .../components/{modals => }/monitor/provider/index.ts | 2 +- .../components/{modals => }/monitor/provider/ping.tsx | 0 .../components/{modals => }/monitor/provider/types.ts | 2 +- src/client/pages/Monitor/Add.tsx | 2 +- src/client/pages/Monitor/Edit.tsx | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) rename src/client/components/{modals => }/monitor/MonitorInfoEditor.tsx (95%) rename src/client/components/{modals => }/monitor/provider/http.tsx (95%) rename src/client/components/{modals => }/monitor/provider/index.ts (92%) rename src/client/components/{modals => }/monitor/provider/ping.tsx (100%) rename src/client/components/{modals => }/monitor/provider/types.ts (84%) diff --git a/src/client/components/monitor/MonitorDataMetrics.tsx b/src/client/components/monitor/MonitorDataMetrics.tsx index 1aef262..e7de9b4 100644 --- a/src/client/components/monitor/MonitorDataMetrics.tsx +++ b/src/client/components/monitor/MonitorDataMetrics.tsx @@ -3,7 +3,7 @@ import { trpc } from '../../api/trpc'; import { useCurrentWorkspaceId } from '../../store/user'; import { ErrorTip } from '../ErrorTip'; import { Loading } from '../Loading'; -import { getMonitorProvider } from '../modals/monitor/provider'; +import { getMonitorProvider } from './provider'; import { MonitorStatsBlock } from './MonitorStatsBlock'; export const MonitorDataMetrics: React.FC<{ diff --git a/src/client/components/monitor/MonitorInfo.tsx b/src/client/components/monitor/MonitorInfo.tsx index f4779c9..fd8e34c 100644 --- a/src/client/components/monitor/MonitorInfo.tsx +++ b/src/client/components/monitor/MonitorInfo.tsx @@ -8,7 +8,7 @@ import { } from '../../api/trpc'; import { useCurrentWorkspaceId } from '../../store/user'; import { Loading } from '../Loading'; -import { getMonitorLink } from '../modals/monitor/provider'; +import { getMonitorLink } from './provider'; import { NotFoundTip } from '../NotFoundTip'; import { MonitorInfo as MonitorInfoType } from '../../../types'; import { MonitorHealthBar } from './MonitorHealthBar'; diff --git a/src/client/components/modals/monitor/MonitorInfoEditor.tsx b/src/client/components/monitor/MonitorInfoEditor.tsx similarity index 95% rename from src/client/components/modals/monitor/MonitorInfoEditor.tsx rename to src/client/components/monitor/MonitorInfoEditor.tsx index 38e074d..04554b0 100644 --- a/src/client/components/modals/monitor/MonitorInfoEditor.tsx +++ b/src/client/components/monitor/MonitorInfoEditor.tsx @@ -2,8 +2,8 @@ import React, { useMemo } from 'react'; import type { Monitor } from '@prisma/client'; import { Button, Form, Input, InputNumber, Select } from 'antd'; import { getMonitorProvider, monitorProviders } from './provider'; -import { useEvent } from '../../../hooks/useEvent'; -import { NotificationPicker } from '../../notification/NotificationPicker'; +import { useEvent } from '../../hooks/useEvent'; +import { NotificationPicker } from '../notification/NotificationPicker'; export type MonitorInfoEditorValues = Omit< Monitor, diff --git a/src/client/components/modals/monitor/provider/http.tsx b/src/client/components/monitor/provider/http.tsx similarity index 95% rename from src/client/components/modals/monitor/provider/http.tsx rename to src/client/components/monitor/provider/http.tsx index f6d31ea..7ed582e 100644 --- a/src/client/components/modals/monitor/provider/http.tsx +++ b/src/client/components/monitor/provider/http.tsx @@ -1,11 +1,11 @@ import { Form, Input, Select, Switch } from 'antd'; import React from 'react'; import { MonitorOverviewComponent, MonitorProvider } from './types'; -import { trpc } from '../../../../api/trpc'; -import { MonitorStatsBlock } from '../../../monitor/MonitorStatsBlock'; +import { trpc } from '../../../api/trpc'; +import { MonitorStatsBlock } from '../MonitorStatsBlock'; import dayjs from 'dayjs'; import { isEmpty } from 'lodash-es'; -import { useCurrentWorkspaceId } from '../../../../store/user'; +import { useCurrentWorkspaceId } from '../../../store/user'; const MonitorHttp: React.FC = React.memo(() => { return ( diff --git a/src/client/components/modals/monitor/provider/index.ts b/src/client/components/monitor/provider/index.ts similarity index 92% rename from src/client/components/modals/monitor/provider/index.ts rename to src/client/components/monitor/provider/index.ts index 5ab3704..fb5389f 100644 --- a/src/client/components/modals/monitor/provider/index.ts +++ b/src/client/components/monitor/provider/index.ts @@ -1,5 +1,5 @@ import React from 'react'; -import { MonitorInfo } from '../../../../../types'; +import { MonitorInfo } from '../../../../types'; import { pingProvider } from './ping'; import { httpProvider } from './http'; import { MonitorProvider } from './types'; diff --git a/src/client/components/modals/monitor/provider/ping.tsx b/src/client/components/monitor/provider/ping.tsx similarity index 100% rename from src/client/components/modals/monitor/provider/ping.tsx rename to src/client/components/monitor/provider/ping.tsx diff --git a/src/client/components/modals/monitor/provider/types.ts b/src/client/components/monitor/provider/types.ts similarity index 84% rename from src/client/components/modals/monitor/provider/types.ts rename to src/client/components/monitor/provider/types.ts index 58c7903..bf35eee 100644 --- a/src/client/components/modals/monitor/provider/types.ts +++ b/src/client/components/monitor/provider/types.ts @@ -1,4 +1,4 @@ -import { MonitorInfo } from '../../../../../types'; +import { MonitorInfo } from '../../../../types'; export interface MonitorProvider { label: string; diff --git a/src/client/pages/Monitor/Add.tsx b/src/client/pages/Monitor/Add.tsx index ef3ba4b..bf2ef8d 100644 --- a/src/client/pages/Monitor/Add.tsx +++ b/src/client/pages/Monitor/Add.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { useNavigate } from 'react-router'; import { useMonitorUpsert } from '../../api/model/monitor'; -import { MonitorInfoEditor } from '../../components/modals/monitor/MonitorInfoEditor'; +import { MonitorInfoEditor } from '../../components/monitor/MonitorInfoEditor'; import { useCurrentWorkspaceId } from '../../store/user'; export const MonitorAdd: React.FC = React.memo(() => { diff --git a/src/client/pages/Monitor/Edit.tsx b/src/client/pages/Monitor/Edit.tsx index 8777397..dc3ef5d 100644 --- a/src/client/pages/Monitor/Edit.tsx +++ b/src/client/pages/Monitor/Edit.tsx @@ -7,7 +7,7 @@ import { Loading } from '../../components/Loading'; import { MonitorInfoEditor, MonitorInfoEditorValues, -} from '../../components/modals/monitor/MonitorInfoEditor'; +} from '../../components/monitor/MonitorInfoEditor'; import { useCurrentWorkspaceId } from '../../store/user'; export const MonitorEdit: React.FC = React.memo(() => {