diff --git a/src/App.tsx b/src/App.tsx index ecae2df..e97f190 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -18,20 +18,19 @@ import { ListInsideApiPage, ListInsideCrdByApiGroupPage, ListInsideApiByApiGroupPage, - TableCrdPage, + // TableCrdPage, TableApiPage, TableBuiltinPage, FormBuiltinPage, FormApiPage, - FormCrdPage, + // FormCrdPage, FactoryPage, - FactoryAdminPage, + // FactoryAdminPage, SearchPage, - ListThenWatchPage, } from 'pages' import { getBasePrefix } from 'utils/getBaseprefix' import { colorsLight, colorsDark, sizes } from 'constants/colors' -import { MainLayout } from 'templates/MainLayout' +import { MainLayout, AppShell } from 'templates' type TAppProps = { isFederation?: boolean @@ -62,6 +61,25 @@ export const App: FC = ({ isFederation, forcedTheme }) => { } /> } /> } /> + + }> + {/* } /> */} + } /> + } /> + {/* } /> */} + } /> + } /> + } /> + + }> + {/* } /> */} + } /> + } /> + {/* } /> */} + } /> + } /> + + } /> } /> = ({ isFederation, forcedTheme }) => { path={`${prefix}/inside/:clusterName/:namespace?/apis-by-api/:apiGroup/:apiVersion/`} element={} /> - } - /> - } - /> - } - /> - } - /> - } - /> - } - /> - } - /> - } - /> - } - /> - } - /> - } - /> - } - /> - } - /> + } /> - } /> - } - /> ) diff --git a/src/pages/FactoryAdminPage/AddComponentModal.tsx b/src/pages/FactoryAdminPage/AddComponentModal.tsx deleted file mode 100644 index f2d7616..0000000 --- a/src/pages/FactoryAdminPage/AddComponentModal.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import React, { useState } from 'react' -import { Modal, Button, Form, Select } from 'antd' -import { ComponentType } from './types' - -export const componentTypes: ComponentType[] = [ - 'antdText', - 'antdCard', - 'antdFlex', - 'antdRow', - 'antdCol', - 'partsOfUrl', - 'multiQuery', - 'parsedText', -] - -interface AddComponentModalProps { - onAdd: (type: ComponentType) => void - title?: string -} - -export const AddComponentModal: React.FC = ({ onAdd, title = 'Add Component' }) => { - const [visible, setVisible] = useState(false) - const [form] = Form.useForm() - - const handleSubmit = (values: { type: ComponentType }) => { - onAdd(values.type) - setVisible(false) - form.resetFields() - } - - return ( - <> - - setVisible(false)} footer={null}> -
- - - - -
-
- - ) -} diff --git a/src/pages/FactoryAdminPage/AntdCardForm.tsx b/src/pages/FactoryAdminPage/AntdCardForm.tsx deleted file mode 100644 index 7e97207..0000000 --- a/src/pages/FactoryAdminPage/AntdCardForm.tsx +++ /dev/null @@ -1,73 +0,0 @@ -/* eslint-disable no-console */ -/* eslint-disable no-param-reassign */ -/* eslint-disable @typescript-eslint/no-explicit-any */ -import React, { useEffect } from 'react' -import { Form, Input, Select, Button, Switch } from 'antd' - -const { TextArea } = Input -const { Option } = Select - -interface AntdCardFormProps { - initialValues: any // This would be `TDynamicComponentsAppTypeMap['antdCard']` - onSave: (data: any) => void -} - -export const AntdCardForm: React.FC = ({ initialValues, onSave }) => { - const [form] = Form.useForm() - - useEffect(() => { - form.setFieldsValue(initialValues) - }, [initialValues, form]) - - const handleSubmit = (values: any) => { - try { - if (values.style) { - values.style = JSON.parse(values.style) - } - } catch (e) { - console.log('Invalid JSON for style', e) - return - } - - onSave(values) - } - - return ( -
- - - - - - - - - - - - - - - - - -