committed by
GitHub
95 changed files with 2249 additions and 2583 deletions
@ -1,8 +0,0 @@ |
|||||
/lambda/ |
|
||||
/scripts |
|
||||
/config |
|
||||
.history |
|
||||
public |
|
||||
dist |
|
||||
.umi |
|
||||
mock |
|
||||
@ -1,7 +0,0 @@ |
|||||
module.exports = { |
|
||||
extends: [require.resolve('@umijs/lint/dist/config/eslint')], |
|
||||
globals: { |
|
||||
page: true, |
|
||||
REACT_APP_ENV: true, |
|
||||
}, |
|
||||
}; |
|
||||
@ -0,0 +1,30 @@ |
|||||
|
name: Deploy to GitHub Pages |
||||
|
|
||||
|
on: |
||||
|
push: |
||||
|
branches: |
||||
|
- all-blocks |
||||
|
|
||||
|
jobs: |
||||
|
build-and-deploy: |
||||
|
runs-on: ubuntu-latest |
||||
|
|
||||
|
steps: |
||||
|
- name: Checkout code |
||||
|
uses: actions/checkout@v4 |
||||
|
|
||||
|
- name: Install Bun |
||||
|
uses: oven-sh/setup-bun@v2 |
||||
|
|
||||
|
- name: Install dependencies with Bun |
||||
|
run: bun install |
||||
|
|
||||
|
- name: Build project |
||||
|
run: bun run build |
||||
|
|
||||
|
- name: Deploy to GitHub Pages |
||||
|
uses: peaceiris/actions-gh-pages@v4 |
||||
|
with: |
||||
|
github_token: ${{ secrets.GITHUB_TOKEN }} |
||||
|
publish_dir: ./dist |
||||
|
cname: preview.pro.ant.design |
||||
@ -1,6 +1,5 @@ |
|||||
{ |
{ |
||||
"**/*.{js,jsx,ts,tsx}": "npm run lint-staged:js", |
"**/*.{js,jsx,tsx,ts,md,css,less,json}": [ |
||||
"**/*.{js,jsx,tsx,ts,less,md,json,yml}": [ |
"npx @biomejs/biome check --write" |
||||
"prettier --write" |
|
||||
] |
] |
||||
} |
} |
||||
|
|||||
@ -0,0 +1 @@ |
|||||
|
legacy-peer-deps=true |
||||
@ -1,22 +0,0 @@ |
|||||
**/*.svg |
|
||||
.umi |
|
||||
.umi-production |
|
||||
/dist |
|
||||
.dockerignore |
|
||||
.DS_Store |
|
||||
.eslintignore |
|
||||
*.png |
|
||||
*.toml |
|
||||
docker |
|
||||
.editorconfig |
|
||||
Dockerfile* |
|
||||
.gitignore |
|
||||
.prettierignore |
|
||||
LICENSE |
|
||||
.eslintcache |
|
||||
*.lock |
|
||||
yarn-error.log |
|
||||
.history |
|
||||
CNAME |
|
||||
/build |
|
||||
/public |
|
||||
@ -1,21 +0,0 @@ |
|||||
module.exports = { |
|
||||
singleQuote: true, |
|
||||
trailingComma: 'all', |
|
||||
printWidth: 100, |
|
||||
proseWrap: 'never', |
|
||||
endOfLine: 'lf', |
|
||||
overrides: [ |
|
||||
{ |
|
||||
files: '.prettierrc', |
|
||||
options: { |
|
||||
parser: 'json', |
|
||||
}, |
|
||||
}, |
|
||||
{ |
|
||||
files: 'document.ejs', |
|
||||
options: { |
|
||||
parser: 'html', |
|
||||
}, |
|
||||
}, |
|
||||
], |
|
||||
}; |
|
||||
@ -0,0 +1,48 @@ |
|||||
|
{ |
||||
|
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json", |
||||
|
"files": { |
||||
|
"ignoreUnknown": true, |
||||
|
"includes": [ |
||||
|
"**/*", |
||||
|
"!**/.umi/**", |
||||
|
"!**/.umi-production/**", |
||||
|
"!**/.umi-test/**", |
||||
|
"!**/.umi-test-production/**", |
||||
|
"!**/src/services/**", |
||||
|
"!**/mock/**", |
||||
|
"!**/dist/**", |
||||
|
"!**/server/**", |
||||
|
"!**/public/**", |
||||
|
"!**/coverage/**", |
||||
|
"!**/node_modules/**", |
||||
|
"!biome.json" |
||||
|
] |
||||
|
}, |
||||
|
"formatter": { |
||||
|
"enabled": true, |
||||
|
"indentStyle": "space" |
||||
|
}, |
||||
|
"linter": { |
||||
|
"enabled": true, |
||||
|
"rules": { |
||||
|
"recommended": true, |
||||
|
"suspicious": { |
||||
|
"noExplicitAny": "off" |
||||
|
}, |
||||
|
"correctness": { |
||||
|
"useExhaustiveDependencies": "off" |
||||
|
}, |
||||
|
"a11y": { |
||||
|
"noStaticElementInteractions": "off", |
||||
|
"useValidAnchor": "off", |
||||
|
"useKeyWithClickEvents": "off" |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
"javascript": { |
||||
|
"jsxRuntime": "reactClassic", |
||||
|
"formatter": { |
||||
|
"quoteStyle": "single" |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,11 +0,0 @@ |
|||||
{ |
|
||||
"compilerOptions": { |
|
||||
"jsx": "react-jsx", |
|
||||
"emitDecoratorMetadata": true, |
|
||||
"experimentalDecorators": true, |
|
||||
"baseUrl": ".", |
|
||||
"paths": { |
|
||||
"@/*": ["./src/*"] |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,14 @@ |
|||||
|
import type { Request, Response } from 'express'; |
||||
|
import mockjs from 'mockjs'; |
||||
|
|
||||
|
const getTags = (_: Request, res: Response) => { |
||||
|
return res.json({ |
||||
|
data: mockjs.mock({ |
||||
|
'list|100': [{ name: '@city', 'value|1-100': 150, 'type|0-2': 1 }], |
||||
|
}), |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
export default { |
||||
|
'GET /api/tags': getTags, |
||||
|
}; |
||||
@ -0,0 +1,42 @@ |
|||||
|
import { createStyles } from 'antd-style'; |
||||
|
|
||||
|
const useStyles = createStyles(() => { |
||||
|
return { |
||||
|
colorWeak: { |
||||
|
filter: 'invert(80%)', |
||||
|
}, |
||||
|
'ant-layout': { |
||||
|
minHeight: '100vh', |
||||
|
}, |
||||
|
'ant-pro-sider.ant-layout-sider.ant-pro-sider-fixed': { |
||||
|
left: 'unset', |
||||
|
}, |
||||
|
canvas: { |
||||
|
display: 'block', |
||||
|
}, |
||||
|
body: { |
||||
|
textRendering: 'optimizeLegibility', |
||||
|
WebkitFontSmoothing: 'antialiased', |
||||
|
MozOsxFontSmoothing: 'grayscale', |
||||
|
}, |
||||
|
'ul,ol': { |
||||
|
listStyle: 'none', |
||||
|
}, |
||||
|
'@media(max-width: 768px)': { |
||||
|
'ant-table': { |
||||
|
width: '100%', |
||||
|
overflowX: 'auto', |
||||
|
'&-thead > tr, &-tbody > tr': { |
||||
|
'> th, > td': { |
||||
|
whiteSpace: 'pre', |
||||
|
'> span': { |
||||
|
display: 'block', |
||||
|
}, |
||||
|
}, |
||||
|
}, |
||||
|
}, |
||||
|
}, |
||||
|
}; |
||||
|
}); |
||||
|
|
||||
|
export default useStyles; |
||||
@ -0,0 +1,7 @@ |
|||||
|
import { Skeleton } from 'antd'; |
||||
|
|
||||
|
const Loading: React.FC = () => ( |
||||
|
<Skeleton style={{ margin: '24px 40px', height: '60vh' }} active /> |
||||
|
); |
||||
|
|
||||
|
export default Loading; |
||||
@ -1,6 +1,7 @@ |
|||||
export default { |
export default { |
||||
'app.pwa.offline': 'You are offline now', |
'app.pwa.offline': 'You are offline now', |
||||
'app.pwa.serviceworker.updated': 'New content is available', |
'app.pwa.serviceworker.updated': 'New content is available', |
||||
'app.pwa.serviceworker.updated.hint': 'Please press the "Refresh" button to reload current page', |
'app.pwa.serviceworker.updated.hint': |
||||
|
'Please press the "Refresh" button to reload current page', |
||||
'app.pwa.serviceworker.updated.ok': 'Refresh', |
'app.pwa.serviceworker.updated.ok': 'Refresh', |
||||
}; |
}; |
||||
|
|||||
@ -1,18 +1,20 @@ |
|||||
import { history, useIntl } from '@umijs/max'; |
import { history, useIntl } from '@umijs/max'; |
||||
import { Button, Result } from 'antd'; |
import { Button, Card, Result } from 'antd'; |
||||
import React from 'react'; |
import React from 'react'; |
||||
|
|
||||
const NoFoundPage: React.FC = () => ( |
const NoFoundPage: React.FC = () => ( |
||||
<Result |
<Card variant="borderless"> |
||||
status="404" |
<Result |
||||
title="404" |
status="404" |
||||
subTitle={useIntl().formatMessage({ id: 'pages.404.subTitle' })} |
title="404" |
||||
extra={ |
subTitle={useIntl().formatMessage({ id: 'pages.404.subTitle' })} |
||||
<Button type="primary" onClick={() => history.push('/')}> |
extra={ |
||||
{useIntl().formatMessage({ id: 'pages.404.buttonText' })} |
<Button type="primary" onClick={() => history.push('/')}> |
||||
</Button> |
{useIntl().formatMessage({ id: 'pages.404.buttonText' })} |
||||
} |
</Button> |
||||
/> |
} |
||||
|
/> |
||||
|
</Card> |
||||
); |
); |
||||
|
|
||||
export default NoFoundPage; |
export default NoFoundPage; |
||||
|
|||||
@ -1,213 +0,0 @@ |
|||||
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'; |
|
||||
|
|
||||
export type FormValueType = { |
|
||||
target?: string; |
|
||||
template?: string; |
|
||||
type?: string; |
|
||||
time?: string; |
|
||||
frequency?: string; |
|
||||
} & Partial<API.RuleListItem>; |
|
||||
|
|
||||
export type UpdateFormProps = { |
|
||||
onCancel: (flag?: boolean, formVals?: FormValueType) => void; |
|
||||
onSubmit: (values: FormValueType) => Promise<void>; |
|
||||
updateModalOpen: boolean; |
|
||||
values: Partial<API.RuleListItem>; |
|
||||
}; |
|
||||
|
|
||||
const UpdateForm: React.FC<UpdateFormProps> = (props) => { |
|
||||
const intl = useIntl(); |
|
||||
return ( |
|
||||
<StepsForm |
|
||||
stepsProps={{ |
|
||||
size: 'small', |
|
||||
}} |
|
||||
stepsFormRender={(dom, submitter) => { |
|
||||
return ( |
|
||||
<Modal |
|
||||
width={640} |
|
||||
styles={{ |
|
||||
body: { |
|
||||
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; |
|
||||
File diff suppressed because it is too large
@ -0,0 +1,80 @@ |
|||||
|
import { PlusOutlined } from '@ant-design/icons'; |
||||
|
import { |
||||
|
type ActionType, |
||||
|
ModalForm, |
||||
|
ProFormText, |
||||
|
ProFormTextArea, |
||||
|
} from '@ant-design/pro-components'; |
||||
|
import { FormattedMessage, useIntl, useRequest } from '@umijs/max'; |
||||
|
import { Button, message } from 'antd'; |
||||
|
import type { FC } from 'react'; |
||||
|
import { addRule } from '@/services/ant-design-pro/api'; |
||||
|
|
||||
|
interface CreateFormProps { |
||||
|
reload?: ActionType['reload']; |
||||
|
} |
||||
|
|
||||
|
const CreateForm: FC<CreateFormProps> = (props) => { |
||||
|
const { reload } = props; |
||||
|
|
||||
|
const [messageApi, contextHolder] = message.useMessage(); |
||||
|
/** |
||||
|
* @en-US International configuration |
||||
|
* @zh-CN 国际化配置 |
||||
|
* */ |
||||
|
const intl = useIntl(); |
||||
|
|
||||
|
const { run, loading } = useRequest(addRule, { |
||||
|
manual: true, |
||||
|
onSuccess: () => { |
||||
|
messageApi.success('Added successfully'); |
||||
|
reload?.(); |
||||
|
}, |
||||
|
onError: () => { |
||||
|
messageApi.error('Adding failed, please try again!'); |
||||
|
}, |
||||
|
}); |
||||
|
|
||||
|
return ( |
||||
|
<> |
||||
|
{contextHolder} |
||||
|
<ModalForm |
||||
|
title={intl.formatMessage({ |
||||
|
id: 'pages.searchTable.createForm.newRule', |
||||
|
defaultMessage: 'New rule', |
||||
|
})} |
||||
|
trigger={ |
||||
|
<Button type="primary" icon={<PlusOutlined />}> |
||||
|
<FormattedMessage id="pages.searchTable.new" defaultMessage="New" /> |
||||
|
</Button> |
||||
|
} |
||||
|
width="400px" |
||||
|
modalProps={{ okButtonProps: { loading } }} |
||||
|
onFinish={async (value) => { |
||||
|
await run({ data: value as API.RuleListItem }); |
||||
|
|
||||
|
return true; |
||||
|
}} |
||||
|
> |
||||
|
<ProFormText |
||||
|
rules={[ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: ( |
||||
|
<FormattedMessage |
||||
|
id="pages.searchTable.ruleName" |
||||
|
defaultMessage="Rule name is required" |
||||
|
/> |
||||
|
), |
||||
|
}, |
||||
|
]} |
||||
|
width="md" |
||||
|
name="name" |
||||
|
/> |
||||
|
<ProFormTextArea width="md" name="desc" /> |
||||
|
</ModalForm> |
||||
|
</> |
||||
|
); |
||||
|
}; |
||||
|
|
||||
|
export default CreateForm; |
||||
@ -0,0 +1,247 @@ |
|||||
|
import { |
||||
|
ProFormDateTimePicker, |
||||
|
ProFormRadio, |
||||
|
ProFormSelect, |
||||
|
ProFormText, |
||||
|
ProFormTextArea, |
||||
|
StepsForm, |
||||
|
} from '@ant-design/pro-components'; |
||||
|
import { FormattedMessage, useIntl, useRequest } from '@umijs/max'; |
||||
|
import { Modal, message } from 'antd'; |
||||
|
import React, { cloneElement, useCallback, useState } from 'react'; |
||||
|
import { updateRule } from '@/services/ant-design-pro/api'; |
||||
|
|
||||
|
export type FormValueType = { |
||||
|
target?: string; |
||||
|
template?: string; |
||||
|
type?: string; |
||||
|
time?: string; |
||||
|
frequency?: string; |
||||
|
} & Partial<API.RuleListItem>; |
||||
|
|
||||
|
export type UpdateFormProps = { |
||||
|
trigger?: React.ReactElement<any>; |
||||
|
onOk?: () => void; |
||||
|
values: Partial<API.RuleListItem>; |
||||
|
}; |
||||
|
|
||||
|
const UpdateForm: React.FC<UpdateFormProps> = (props) => { |
||||
|
const { onOk, values, trigger } = props; |
||||
|
|
||||
|
const intl = useIntl(); |
||||
|
|
||||
|
const [open, setOpen] = useState(false); |
||||
|
|
||||
|
const [messageApi, contextHolder] = message.useMessage(); |
||||
|
|
||||
|
const { run } = useRequest(updateRule, { |
||||
|
manual: true, |
||||
|
onSuccess: () => { |
||||
|
messageApi.success('Configuration is successful'); |
||||
|
onOk?.(); |
||||
|
}, |
||||
|
onError: () => { |
||||
|
messageApi.error('Configuration failed, please try again!'); |
||||
|
}, |
||||
|
}); |
||||
|
|
||||
|
const onCancel = useCallback(() => { |
||||
|
setOpen(false); |
||||
|
}, []); |
||||
|
|
||||
|
const onOpen = useCallback(() => { |
||||
|
setOpen(true); |
||||
|
}, []); |
||||
|
|
||||
|
const onFinish = useCallback( |
||||
|
async (values?: any) => { |
||||
|
await run({ data: values }); |
||||
|
|
||||
|
onCancel(); |
||||
|
}, |
||||
|
[onCancel, run], |
||||
|
); |
||||
|
|
||||
|
return ( |
||||
|
<> |
||||
|
{contextHolder} |
||||
|
{trigger |
||||
|
? cloneElement(trigger, { |
||||
|
onClick: onOpen, |
||||
|
}) |
||||
|
: null} |
||||
|
<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={open} |
||||
|
footer={submitter} |
||||
|
onCancel={onCancel} |
||||
|
> |
||||
|
{dom} |
||||
|
</Modal> |
||||
|
); |
||||
|
}} |
||||
|
onFinish={onFinish} |
||||
|
> |
||||
|
<StepsForm.StepForm |
||||
|
initialValues={values} |
||||
|
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; |
||||
File diff suppressed because it is too large
@ -1 +0,0 @@ |
|||||
{} |
|
||||
File diff suppressed because one or more lines are too long
@ -1,324 +0,0 @@ |
|||||
module.exports = { |
|
||||
'GET /api/currentUser': { |
|
||||
data: { |
|
||||
name: 'Serati Ma', |
|
||||
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png', |
|
||||
userid: '00000001', |
|
||||
email: 'antdesign@alipay.com', |
|
||||
signature: '海纳百川,有容乃大', |
|
||||
title: '交互专家', |
|
||||
group: '蚂蚁金服-某某某事业群-某某平台部-某某技术部-UED', |
|
||||
tags: [ |
|
||||
{ key: '0', label: '很有想法的' }, |
|
||||
{ key: '1', label: '专注设计' }, |
|
||||
{ key: '2', label: '辣~' }, |
|
||||
{ key: '3', label: '大长腿' }, |
|
||||
{ key: '4', label: '川妹子' }, |
|
||||
{ key: '5', label: '海纳百川' }, |
|
||||
], |
|
||||
notifyCount: 12, |
|
||||
unreadCount: 11, |
|
||||
country: 'China', |
|
||||
geographic: { |
|
||||
province: { label: '浙江省', key: '330000' }, |
|
||||
city: { label: '杭州市', key: '330100' }, |
|
||||
}, |
|
||||
address: '西湖区工专路 77 号', |
|
||||
phone: '0752-268888888', |
|
||||
}, |
|
||||
}, |
|
||||
'GET /api/rule': { |
|
||||
data: [ |
|
||||
{ |
|
||||
key: 99, |
|
||||
disabled: false, |
|
||||
href: 'https://ant.design', |
|
||||
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', |
|
||||
name: 'TradeCode 99', |
|
||||
owner: '曲丽丽', |
|
||||
desc: '这是一段描述', |
|
||||
callNo: 503, |
|
||||
status: '0', |
|
||||
updatedAt: '2022-12-06T05:00:57.040Z', |
|
||||
createdAt: '2022-12-06T05:00:57.040Z', |
|
||||
progress: 81, |
|
||||
}, |
|
||||
{ |
|
||||
key: 98, |
|
||||
disabled: false, |
|
||||
href: 'https://ant.design', |
|
||||
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', |
|
||||
name: 'TradeCode 98', |
|
||||
owner: '曲丽丽', |
|
||||
desc: '这是一段描述', |
|
||||
callNo: 164, |
|
||||
status: '0', |
|
||||
updatedAt: '2022-12-06T05:00:57.040Z', |
|
||||
createdAt: '2022-12-06T05:00:57.040Z', |
|
||||
progress: 12, |
|
||||
}, |
|
||||
{ |
|
||||
key: 97, |
|
||||
disabled: false, |
|
||||
href: 'https://ant.design', |
|
||||
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', |
|
||||
name: 'TradeCode 97', |
|
||||
owner: '曲丽丽', |
|
||||
desc: '这是一段描述', |
|
||||
callNo: 174, |
|
||||
status: '1', |
|
||||
updatedAt: '2022-12-06T05:00:57.040Z', |
|
||||
createdAt: '2022-12-06T05:00:57.040Z', |
|
||||
progress: 81, |
|
||||
}, |
|
||||
{ |
|
||||
key: 96, |
|
||||
disabled: true, |
|
||||
href: 'https://ant.design', |
|
||||
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', |
|
||||
name: 'TradeCode 96', |
|
||||
owner: '曲丽丽', |
|
||||
desc: '这是一段描述', |
|
||||
callNo: 914, |
|
||||
status: '0', |
|
||||
updatedAt: '2022-12-06T05:00:57.040Z', |
|
||||
createdAt: '2022-12-06T05:00:57.040Z', |
|
||||
progress: 7, |
|
||||
}, |
|
||||
{ |
|
||||
key: 95, |
|
||||
disabled: false, |
|
||||
href: 'https://ant.design', |
|
||||
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', |
|
||||
name: 'TradeCode 95', |
|
||||
owner: '曲丽丽', |
|
||||
desc: '这是一段描述', |
|
||||
callNo: 698, |
|
||||
status: '2', |
|
||||
updatedAt: '2022-12-06T05:00:57.040Z', |
|
||||
createdAt: '2022-12-06T05:00:57.040Z', |
|
||||
progress: 82, |
|
||||
}, |
|
||||
{ |
|
||||
key: 94, |
|
||||
disabled: false, |
|
||||
href: 'https://ant.design', |
|
||||
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', |
|
||||
name: 'TradeCode 94', |
|
||||
owner: '曲丽丽', |
|
||||
desc: '这是一段描述', |
|
||||
callNo: 488, |
|
||||
status: '1', |
|
||||
updatedAt: '2022-12-06T05:00:57.040Z', |
|
||||
createdAt: '2022-12-06T05:00:57.040Z', |
|
||||
progress: 14, |
|
||||
}, |
|
||||
{ |
|
||||
key: 93, |
|
||||
disabled: false, |
|
||||
href: 'https://ant.design', |
|
||||
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', |
|
||||
name: 'TradeCode 93', |
|
||||
owner: '曲丽丽', |
|
||||
desc: '这是一段描述', |
|
||||
callNo: 580, |
|
||||
status: '2', |
|
||||
updatedAt: '2022-12-06T05:00:57.040Z', |
|
||||
createdAt: '2022-12-06T05:00:57.040Z', |
|
||||
progress: 77, |
|
||||
}, |
|
||||
{ |
|
||||
key: 92, |
|
||||
disabled: false, |
|
||||
href: 'https://ant.design', |
|
||||
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', |
|
||||
name: 'TradeCode 92', |
|
||||
owner: '曲丽丽', |
|
||||
desc: '这是一段描述', |
|
||||
callNo: 244, |
|
||||
status: '3', |
|
||||
updatedAt: '2022-12-06T05:00:57.040Z', |
|
||||
createdAt: '2022-12-06T05:00:57.040Z', |
|
||||
progress: 58, |
|
||||
}, |
|
||||
{ |
|
||||
key: 91, |
|
||||
disabled: false, |
|
||||
href: 'https://ant.design', |
|
||||
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', |
|
||||
name: 'TradeCode 91', |
|
||||
owner: '曲丽丽', |
|
||||
desc: '这是一段描述', |
|
||||
callNo: 959, |
|
||||
status: '0', |
|
||||
updatedAt: '2022-12-06T05:00:57.040Z', |
|
||||
createdAt: '2022-12-06T05:00:57.040Z', |
|
||||
progress: 66, |
|
||||
}, |
|
||||
{ |
|
||||
key: 90, |
|
||||
disabled: true, |
|
||||
href: 'https://ant.design', |
|
||||
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', |
|
||||
name: 'TradeCode 90', |
|
||||
owner: '曲丽丽', |
|
||||
desc: '这是一段描述', |
|
||||
callNo: 958, |
|
||||
status: '0', |
|
||||
updatedAt: '2022-12-06T05:00:57.040Z', |
|
||||
createdAt: '2022-12-06T05:00:57.040Z', |
|
||||
progress: 72, |
|
||||
}, |
|
||||
{ |
|
||||
key: 89, |
|
||||
disabled: false, |
|
||||
href: 'https://ant.design', |
|
||||
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', |
|
||||
name: 'TradeCode 89', |
|
||||
owner: '曲丽丽', |
|
||||
desc: '这是一段描述', |
|
||||
callNo: 301, |
|
||||
status: '2', |
|
||||
updatedAt: '2022-12-06T05:00:57.040Z', |
|
||||
createdAt: '2022-12-06T05:00:57.040Z', |
|
||||
progress: 2, |
|
||||
}, |
|
||||
{ |
|
||||
key: 88, |
|
||||
disabled: false, |
|
||||
href: 'https://ant.design', |
|
||||
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', |
|
||||
name: 'TradeCode 88', |
|
||||
owner: '曲丽丽', |
|
||||
desc: '这是一段描述', |
|
||||
callNo: 277, |
|
||||
status: '1', |
|
||||
updatedAt: '2022-12-06T05:00:57.040Z', |
|
||||
createdAt: '2022-12-06T05:00:57.040Z', |
|
||||
progress: 12, |
|
||||
}, |
|
||||
{ |
|
||||
key: 87, |
|
||||
disabled: false, |
|
||||
href: 'https://ant.design', |
|
||||
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', |
|
||||
name: 'TradeCode 87', |
|
||||
owner: '曲丽丽', |
|
||||
desc: '这是一段描述', |
|
||||
callNo: 810, |
|
||||
status: '1', |
|
||||
updatedAt: '2022-12-06T05:00:57.040Z', |
|
||||
createdAt: '2022-12-06T05:00:57.040Z', |
|
||||
progress: 82, |
|
||||
}, |
|
||||
{ |
|
||||
key: 86, |
|
||||
disabled: false, |
|
||||
href: 'https://ant.design', |
|
||||
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', |
|
||||
name: 'TradeCode 86', |
|
||||
owner: '曲丽丽', |
|
||||
desc: '这是一段描述', |
|
||||
callNo: 780, |
|
||||
status: '3', |
|
||||
updatedAt: '2022-12-06T05:00:57.040Z', |
|
||||
createdAt: '2022-12-06T05:00:57.040Z', |
|
||||
progress: 22, |
|
||||
}, |
|
||||
{ |
|
||||
key: 85, |
|
||||
disabled: false, |
|
||||
href: 'https://ant.design', |
|
||||
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', |
|
||||
name: 'TradeCode 85', |
|
||||
owner: '曲丽丽', |
|
||||
desc: '这是一段描述', |
|
||||
callNo: 705, |
|
||||
status: '3', |
|
||||
updatedAt: '2022-12-06T05:00:57.040Z', |
|
||||
createdAt: '2022-12-06T05:00:57.040Z', |
|
||||
progress: 12, |
|
||||
}, |
|
||||
{ |
|
||||
key: 84, |
|
||||
disabled: true, |
|
||||
href: 'https://ant.design', |
|
||||
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', |
|
||||
name: 'TradeCode 84', |
|
||||
owner: '曲丽丽', |
|
||||
desc: '这是一段描述', |
|
||||
callNo: 203, |
|
||||
status: '0', |
|
||||
updatedAt: '2022-12-06T05:00:57.040Z', |
|
||||
createdAt: '2022-12-06T05:00:57.040Z', |
|
||||
progress: 79, |
|
||||
}, |
|
||||
{ |
|
||||
key: 83, |
|
||||
disabled: false, |
|
||||
href: 'https://ant.design', |
|
||||
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', |
|
||||
name: 'TradeCode 83', |
|
||||
owner: '曲丽丽', |
|
||||
desc: '这是一段描述', |
|
||||
callNo: 491, |
|
||||
status: '2', |
|
||||
updatedAt: '2022-12-06T05:00:57.040Z', |
|
||||
createdAt: '2022-12-06T05:00:57.040Z', |
|
||||
progress: 59, |
|
||||
}, |
|
||||
{ |
|
||||
key: 82, |
|
||||
disabled: false, |
|
||||
href: 'https://ant.design', |
|
||||
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', |
|
||||
name: 'TradeCode 82', |
|
||||
owner: '曲丽丽', |
|
||||
desc: '这是一段描述', |
|
||||
callNo: 73, |
|
||||
status: '0', |
|
||||
updatedAt: '2022-12-06T05:00:57.040Z', |
|
||||
createdAt: '2022-12-06T05:00:57.040Z', |
|
||||
progress: 100, |
|
||||
}, |
|
||||
{ |
|
||||
key: 81, |
|
||||
disabled: false, |
|
||||
href: 'https://ant.design', |
|
||||
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', |
|
||||
name: 'TradeCode 81', |
|
||||
owner: '曲丽丽', |
|
||||
desc: '这是一段描述', |
|
||||
callNo: 406, |
|
||||
status: '3', |
|
||||
updatedAt: '2022-12-06T05:00:57.040Z', |
|
||||
createdAt: '2022-12-06T05:00:57.040Z', |
|
||||
progress: 61, |
|
||||
}, |
|
||||
{ |
|
||||
key: 80, |
|
||||
disabled: false, |
|
||||
href: 'https://ant.design', |
|
||||
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', |
|
||||
name: 'TradeCode 80', |
|
||||
owner: '曲丽丽', |
|
||||
desc: '这是一段描述', |
|
||||
callNo: 112, |
|
||||
status: '2', |
|
||||
updatedAt: '2022-12-06T05:00:57.040Z', |
|
||||
createdAt: '2022-12-06T05:00:57.040Z', |
|
||||
progress: 20, |
|
||||
}, |
|
||||
], |
|
||||
total: 100, |
|
||||
success: true, |
|
||||
pageSize: 20, |
|
||||
current: 1, |
|
||||
}, |
|
||||
'POST /api/login/outLogin': { data: {}, success: true }, |
|
||||
'POST /api/login/account': { |
|
||||
status: 'ok', |
|
||||
type: 'account', |
|
||||
currentAuthority: 'admin', |
|
||||
}, |
|
||||
}; |
|
||||
Loading…
Reference in new issue