| | |
| | | }, |
| | | }, |
| | | waterMarkProps: { |
| | | content: initialState?.currentUser?.nickname, |
| | | // content: initialState?.currentUser?.nickname, |
| | | }, |
| | | footerRender: () => <Footer />, |
| | | onPageChange: () => { |
New file |
| | |
| | | import { |
| | | ProFormDateTimePicker, |
| | | ProFormRadio, |
| | | ProFormSelect, |
| | | ProFormText, |
| | | ProFormTextArea, |
| | | StepsForm, |
| | | } from '@ant-design/pro-components'; |
| | | import { FormattedMessage, useIntl } from '@umijs/max'; |
| | | import { Modal } from 'antd'; |
| | | import React from 'react'; |
| | | |
| | | const UpdateForm = (props) => { |
| | | const intl = useIntl(); |
| | | return ( |
| | | <StepsForm |
| | | stepsProps={{ |
| | | size: 'small', |
| | | }} |
| | | stepsFormRender={(dom, submitter) => { |
| | | return ( |
| | | <Modal |
| | | width={640} |
| | | bodyStyle={{ padding: '32px 40px 48px' }} |
| | | destroyOnClose |
| | | title={intl.formatMessage({ |
| | | id: 'pages.searchTable.updateForm.ruleConfig', |
| | | defaultMessage: '规则配置', |
| | | })} |
| | | open={props.updateModalOpen} |
| | | footer={submitter} |
| | | onCancel={() => { |
| | | props.onCancel(); |
| | | }} |
| | | > |
| | | {dom} |
| | | </Modal> |
| | | ); |
| | | }} |
| | | onFinish={props.onSubmit} |
| | | > |
| | | <StepsForm.StepForm |
| | | initialValues={{ |
| | | name: props.values.name, |
| | | desc: props.values.desc, |
| | | }} |
| | | title={intl.formatMessage({ |
| | | id: 'pages.searchTable.updateForm.basicConfig', |
| | | defaultMessage: '基本信息', |
| | | })} |
| | | > |
| | | <ProFormText |
| | | name="name" |
| | | label={intl.formatMessage({ |
| | | id: 'pages.searchTable.updateForm.ruleName.nameLabel', |
| | | defaultMessage: '规则名称', |
| | | })} |
| | | width="md" |
| | | rules={[ |
| | | { |
| | | required: true, |
| | | message: ( |
| | | <FormattedMessage |
| | | id="pages.searchTable.updateForm.ruleName.nameRules" |
| | | defaultMessage="请输入规则名称!" |
| | | /> |
| | | ), |
| | | }, |
| | | ]} |
| | | /> |
| | | <ProFormTextArea |
| | | name="desc" |
| | | width="md" |
| | | label={intl.formatMessage({ |
| | | id: 'pages.searchTable.updateForm.ruleDesc.descLabel', |
| | | defaultMessage: '规则描述', |
| | | })} |
| | | placeholder={intl.formatMessage({ |
| | | id: 'pages.searchTable.updateForm.ruleDesc.descPlaceholder', |
| | | defaultMessage: '请输入至少五个字符', |
| | | })} |
| | | rules={[ |
| | | { |
| | | required: true, |
| | | message: ( |
| | | <FormattedMessage |
| | | id="pages.searchTable.updateForm.ruleDesc.descRules" |
| | | defaultMessage="请输入至少五个字符的规则描述!" |
| | | /> |
| | | ), |
| | | min: 5, |
| | | }, |
| | | ]} |
| | | /> |
| | | </StepsForm.StepForm> |
| | | <StepsForm.StepForm |
| | | initialValues={{ |
| | | target: '0', |
| | | template: '0', |
| | | }} |
| | | title={intl.formatMessage({ |
| | | id: 'pages.searchTable.updateForm.ruleProps.title', |
| | | defaultMessage: '配置规则属性', |
| | | })} |
| | | > |
| | | <ProFormSelect |
| | | name="target" |
| | | width="md" |
| | | label={intl.formatMessage({ |
| | | id: 'pages.searchTable.updateForm.object', |
| | | defaultMessage: '监控对象', |
| | | })} |
| | | valueEnum={{ |
| | | 0: '表一', |
| | | 1: '表二', |
| | | }} |
| | | /> |
| | | <ProFormSelect |
| | | name="template" |
| | | width="md" |
| | | label={intl.formatMessage({ |
| | | id: 'pages.searchTable.updateForm.ruleProps.templateLabel', |
| | | defaultMessage: '规则模板', |
| | | })} |
| | | valueEnum={{ |
| | | 0: '规则模板一', |
| | | 1: '规则模板二', |
| | | }} |
| | | /> |
| | | <ProFormRadio.Group |
| | | name="type" |
| | | label={intl.formatMessage({ |
| | | id: 'pages.searchTable.updateForm.ruleProps.typeLabel', |
| | | defaultMessage: '规则类型', |
| | | })} |
| | | options={[ |
| | | { |
| | | value: '0', |
| | | label: '强', |
| | | }, |
| | | { |
| | | value: '1', |
| | | label: '弱', |
| | | }, |
| | | ]} |
| | | /> |
| | | </StepsForm.StepForm> |
| | | <StepsForm.StepForm |
| | | initialValues={{ |
| | | type: '1', |
| | | frequency: 'month', |
| | | }} |
| | | title={intl.formatMessage({ |
| | | id: 'pages.searchTable.updateForm.schedulingPeriod.title', |
| | | defaultMessage: '设定调度周期', |
| | | })} |
| | | > |
| | | <ProFormDateTimePicker |
| | | name="time" |
| | | width="md" |
| | | label={intl.formatMessage({ |
| | | id: 'pages.searchTable.updateForm.schedulingPeriod.timeLabel', |
| | | defaultMessage: '开始时间', |
| | | })} |
| | | rules={[ |
| | | { |
| | | required: true, |
| | | message: ( |
| | | <FormattedMessage |
| | | id="pages.searchTable.updateForm.schedulingPeriod.timeRules" |
| | | defaultMessage="请选择开始时间!" |
| | | /> |
| | | ), |
| | | }, |
| | | ]} |
| | | /> |
| | | <ProFormSelect |
| | | name="frequency" |
| | | label={intl.formatMessage({ |
| | | id: 'pages.searchTable.updateForm.object', |
| | | defaultMessage: '监控对象', |
| | | })} |
| | | width="md" |
| | | valueEnum={{ |
| | | month: '月', |
| | | week: '周', |
| | | }} |
| | | /> |
| | | </StepsForm.StepForm> |
| | | </StepsForm> |
| | | ); |
| | | }; |
| | | |
| | | export default UpdateForm; |
| | |
| | | import React from 'react'; |
| | | import { |
| | | PageContainer, |
| | | } from '@ant-design/pro-components'; |
| | | import { EllipsisOutlined, SearchOutlined } from '@ant-design/icons'; |
| | | import { ProTable, TableDropdown } from '@ant-design/pro-components'; |
| | | import { Button, Dropdown, Input } from 'antd'; |
| | | |
| | | const User = () => { |
| | | return ( |
| | | <> |
| | | <PageContainer> |
| | | <h1>Hello world</h1> |
| | | </PageContainer> |
| | | </> |
| | | ) |
| | | const valueEnum = { |
| | | 0: 'close', |
| | | 1: 'running', |
| | | 2: 'online', |
| | | 3: 'error', |
| | | }; |
| | | |
| | | const tableListDataSource = []; |
| | | |
| | | const creators = ['付小小', '曲丽丽', '林东东', '陈帅帅', '兼某某']; |
| | | |
| | | for (let i = 0; i < 5; i += 1) { |
| | | tableListDataSource.push({ |
| | | key: i, |
| | | name: 'AppName', |
| | | containers: Math.floor(Math.random() * 20), |
| | | creator: creators[Math.floor(Math.random() * creators.length)], |
| | | status: valueEnum[((Math.floor(Math.random() * 10) % 4) + '')], |
| | | createdAt: Date.now() - Math.floor(Math.random() * 2000), |
| | | money: Math.floor(Math.random() * 2000) * i, |
| | | progress: Math.ceil(Math.random() * 100) + 1, |
| | | memo: |
| | | i % 2 === 1 |
| | | ? '很长很长很长很长很长很长很长的文字要展示但是要留下尾巴' |
| | | : '简短备注文案', |
| | | }); |
| | | } |
| | | |
| | | export default User; |
| | | const columns = [ |
| | | { |
| | | title: '排序', |
| | | dataIndex: 'index', |
| | | valueType: 'indexBorder', |
| | | width: 48, |
| | | }, |
| | | { |
| | | title: '应用名称', |
| | | dataIndex: 'name', |
| | | render: (_) => <a>{_}</a>, |
| | | // 自定义筛选项功能具体实现请参考 https://ant.design/components/table-cn/#components-table-demo-custom-filter-panel |
| | | filterDropdown: () => ( |
| | | <div style={{ padding: 8 }}> |
| | | <Input style={{ width: 188, marginBlockEnd: 8, display: 'block' }} /> |
| | | </div> |
| | | ), |
| | | filterIcon: (filtered) => ( |
| | | <SearchOutlined style={{ color: filtered ? '#1890ff' : undefined }} /> |
| | | ), |
| | | }, |
| | | { |
| | | title: '创建者', |
| | | dataIndex: 'creator', |
| | | valueEnum: { |
| | | all: { text: '全部' }, |
| | | 付小小: { text: '付小小' }, |
| | | 曲丽丽: { text: '曲丽丽' }, |
| | | 林东东: { text: '林东东' }, |
| | | 陈帅帅: { text: '陈帅帅' }, |
| | | 兼某某: { text: '兼某某' }, |
| | | }, |
| | | }, |
| | | { |
| | | title: '状态', |
| | | dataIndex: 'status', |
| | | initialValue: 'all', |
| | | filters: true, |
| | | onFilter: true, |
| | | valueEnum: { |
| | | all: { text: '全部', status: 'Default' }, |
| | | close: { text: '关闭', status: 'Default' }, |
| | | running: { text: '运行中', status: 'Processing' }, |
| | | online: { text: '已上线', status: 'Success' }, |
| | | error: { text: '异常', status: 'Error' }, |
| | | }, |
| | | }, |
| | | { |
| | | title: '备注', |
| | | dataIndex: 'memo', |
| | | ellipsis: true, |
| | | copyable: true, |
| | | }, |
| | | { |
| | | title: '操作', |
| | | width: 180, |
| | | key: 'option', |
| | | valueType: 'option', |
| | | render: () => [ |
| | | <a key="link">链路</a>, |
| | | <a key="link2">报警</a>, |
| | | <a key="link3">监控</a>, |
| | | <TableDropdown |
| | | key="actionGroup" |
| | | menus={[ |
| | | { key: 'copy', name: '复制' }, |
| | | { key: 'delete', name: '删除' }, |
| | | ]} |
| | | />, |
| | | ], |
| | | }, |
| | | ]; |
| | | |
| | | export default () => { |
| | | return ( |
| | | <ProTable |
| | | columns={columns} |
| | | request={(params, sorter, filter) => { |
| | | // 表单搜索项会从 params 传入,传递给后端接口。 |
| | | console.log(params, sorter, filter); |
| | | return Promise.resolve({ |
| | | data: tableListDataSource, |
| | | success: true, |
| | | }); |
| | | }} |
| | | rowKey="key" |
| | | pagination={{ |
| | | showQuickJumper: true, |
| | | }} |
| | | search={{ |
| | | layout: 'vertical', |
| | | defaultCollapsed: false, |
| | | }} |
| | | dateFormatter="string" |
| | | toolbar={{ |
| | | title: '高级表格', |
| | | tooltip: '这是一个标题提示', |
| | | }} |
| | | toolBarRender={() => [ |
| | | <Button key="danger" danger> |
| | | 危险按钮 |
| | | </Button>, |
| | | <Button key="show">查看日志</Button>, |
| | | <Button type="primary" key="primary"> |
| | | 创建应用 |
| | | </Button>, |
| | | |
| | | <Dropdown |
| | | key="menu" |
| | | menu={{ |
| | | items: [ |
| | | { |
| | | label: '1st item', |
| | | key: '1', |
| | | }, |
| | | { |
| | | label: '2nd item', |
| | | key: '2', |
| | | }, |
| | | { |
| | | label: '3rd item', |
| | | key: '3', |
| | | }, |
| | | ], |
| | | }} |
| | | > |
| | | <Button> |
| | | <EllipsisOutlined /> |
| | | </Button> |
| | | </Dropdown>, |
| | | ]} |
| | | /> |
| | | ); |
| | | }; |
| | |
| | | import React from 'react'; |
| | | import React, { useState } from 'react'; |
| | | import { |
| | | PageContainer, |
| | | } from '@ant-design/pro-components'; |
| | | import { EllipsisOutlined, SearchOutlined } from '@ant-design/icons'; |
| | | import { ProTable, TableDropdown } from '@ant-design/pro-components'; |
| | | import { Button, Dropdown, Input } from 'antd'; |
| | | |
| | | const valueEnum = { |
| | | 0: 'close', |
| | | 1: 'running', |
| | | 2: 'online', |
| | | 3: 'error', |
| | | }; |
| | | |
| | | const tableListDataSource = []; |
| | | |
| | | const creators = ['付小小', '曲丽丽', '林东东', '陈帅帅', '兼某某']; |
| | | |
| | | for (let i = 0; i < 25; i += 1) { |
| | | tableListDataSource.push({ |
| | | key: i, |
| | | name: 'AppName', |
| | | containers: Math.floor(Math.random() * 20), |
| | | creator: creators[Math.floor(Math.random() * creators.length)], |
| | | status: valueEnum[((Math.floor(Math.random() * 10) % 4) + '')], |
| | | createdAt: Date.now() - Math.floor(Math.random() * 2000), |
| | | money: Math.floor(Math.random() * 2000) * i, |
| | | progress: Math.ceil(Math.random() * 100) + 1, |
| | | memo: |
| | | i % 2 === 1 |
| | | ? '很长很长很长很长很长很长很长的文字要展示但是要留下尾巴' |
| | | : '简短备注文案', |
| | | }); |
| | | } |
| | | |
| | | const columns = [ |
| | | { |
| | | title: '排序', |
| | | dataIndex: 'index', |
| | | valueType: 'indexBorder', |
| | | width: 48, |
| | | }, |
| | | { |
| | | title: '应用名称', |
| | | dataIndex: 'name', |
| | | render: (_) => <a>{_}</a>, |
| | | // 自定义筛选项功能具体实现请参考 https://ant.design/components/table-cn/#components-table-demo-custom-filter-panel |
| | | filterDropdown: () => ( |
| | | <div style={{ padding: 8 }}> |
| | | <Input style={{ width: 188, marginBlockEnd: 8, display: 'block' }} /> |
| | | </div> |
| | | ), |
| | | filterIcon: (filtered) => ( |
| | | <SearchOutlined style={{ color: filtered ? '#1890ff' : undefined }} /> |
| | | ), |
| | | }, |
| | | { |
| | | title: '创建者', |
| | | dataIndex: 'creator', |
| | | valueEnum: { |
| | | all: { text: '全部' }, |
| | | 付小小: { text: '付小小' }, |
| | | 曲丽丽: { text: '曲丽丽' }, |
| | | 林东东: { text: '林东东' }, |
| | | 陈帅帅: { text: '陈帅帅' }, |
| | | 兼某某: { text: '兼某某' }, |
| | | }, |
| | | }, |
| | | { |
| | | title: '状态', |
| | | dataIndex: 'status', |
| | | initialValue: 'all', |
| | | filters: true, |
| | | onFilter: true, |
| | | valueEnum: { |
| | | all: { text: '全部', status: 'Default' }, |
| | | close: { text: '关闭', status: 'Default' }, |
| | | running: { text: '运行中', status: 'Processing' }, |
| | | online: { text: '已上线', status: 'Success' }, |
| | | error: { text: '异常', status: 'Error' }, |
| | | }, |
| | | }, |
| | | { |
| | | title: '备注', |
| | | dataIndex: 'memo', |
| | | ellipsis: true, |
| | | copyable: true, |
| | | }, |
| | | { |
| | | title: '操作', |
| | | width: 180, |
| | | key: 'option', |
| | | valueType: 'option', |
| | | render: () => [ |
| | | <a key="link">链路</a>, |
| | | <a key="link2">报警</a>, |
| | | <a key="link3">监控</a>, |
| | | <TableDropdown |
| | | key="actionGroup" |
| | | menus={[ |
| | | { key: 'copy', name: '复制' }, |
| | | { key: 'delete', name: '删除' }, |
| | | ]} |
| | | />, |
| | | ], |
| | | }, |
| | | ]; |
| | | |
| | | const App = () => { |
| | | return ( |
| | | <> |
| | | <PageContainer> |
| | | <ProTable |
| | | columns={columns} |
| | | request={(params, sorter, filter) => { |
| | | // 表单搜索项会从 params 传入,传递给后端接口。 |
| | | console.log(params, sorter, filter); |
| | | return Promise.resolve({ |
| | | data: tableListDataSource, |
| | | success: true, |
| | | }); |
| | | }} |
| | | rowKey="key" |
| | | pagination={{ |
| | | showQuickJumper: true, |
| | | }} |
| | | search={{ |
| | | layout: 'vertical', |
| | | defaultCollapsed: false, |
| | | }} |
| | | dateFormatter="string" |
| | | toolbar={{ |
| | | title: '高级表格', |
| | | tooltip: '这是一个标题提示', |
| | | }} |
| | | toolBarRender={() => [ |
| | | <Button key="danger" danger> |
| | | 危险按钮 |
| | | </Button>, |
| | | <Button key="show">查看日志</Button>, |
| | | <Button type="primary" key="primary"> |
| | | 创建应用 |
| | | </Button>, |
| | | |
| | | <Dropdown |
| | | key="menu" |
| | | menu={{ |
| | | items: [ |
| | | { |
| | | label: '1st item', |
| | | key: '1', |
| | | }, |
| | | { |
| | | label: '2nd item', |
| | | key: '2', |
| | | }, |
| | | { |
| | | label: '3rd item', |
| | | key: '3', |
| | | }, |
| | | ], |
| | | }} |
| | | > |
| | | <Button> |
| | | <EllipsisOutlined /> |
| | | </Button> |
| | | </Dropdown>, |
| | | ]} |
| | | /> |
| | | </PageContainer> |
| | | </> |
| | | ); |
| | | }; |
| | | |
| | | const User = () => { |
| | | return ( |
| | |
| | | ) |
| | | } |
| | | |
| | | export default User; |
| | | export default App; |
| | |
| | | "@@test/*": ["./src/.umi-test/*"] |
| | | } |
| | | }, |
| | | "include": ["./**/*.d.ts", "./**/*.ts", "./**/*.tsx", "src/app.tsx", "src/utils/icon-util.js", "src/pages/User/Login/index1.jsx", "src/components/Footer/index.jsx", "src/components/HeaderDropdown/index.jsx"] |
| | | "include": ["./**/*.d.ts", "./**/*.ts", "./**/*.tsx", "src/app.tsx", "src/utils/icon-util.js", "src/pages/User/Login/index1.jsx", "src/components/Footer/index.jsx", "src/components/HeaderDropdown/index.jsx", "src/pages/system/host/components/UpdateForm.jsx", "src/pages/system/host/index.jsx"] |
| | | } |
| | |
| | | jmx: |
| | | enabled: false |
| | | datasource: |
| | | hikari: |
| | | validation-timeout: 3000 |
| | | connection-test-query: select 1 |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://47.96.1.146:3306/asrs?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
| | | url: jdbc:mysql://127.0.0.1:3306/asrs?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: xltys1995 |
| | | # driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |