style: area chart

This commit is contained in:
jialin
2024-06-30 21:30:42 +08:00
parent 5746eb191f
commit 018c8cd208
16 changed files with 204 additions and 34 deletions
+13 -8
View File
@@ -1,4 +1,5 @@
import CardWrapper from '@/components/card-wrapper';
import AreaChart from '@/components/charts/area';
import ColumnBar from '@/components/charts/column-bar';
import HBar from '@/components/charts/h-bar';
import PageTools from '@/components/page-tools';
@@ -34,16 +35,16 @@ const projects = [
const APIRequestData = generateRandomArray({
length: times.length,
max: 100,
min: 0,
offset: 10
max: 1000,
min: 10,
offset: 0
});
const TokensData = generateRandomArray({
length: times.length,
max: 2000,
min: 200,
offset: 200
min: 0,
offset: 500
});
const usersData = generateRandomArray({
@@ -189,7 +190,11 @@ const Usage = () => {
</span>
}
right={
<RangePicker onChange={handleSelectDate} style={{ width: 300 }} />
<RangePicker
onChange={handleSelectDate}
style={{ width: 300 }}
picker="month"
/>
}
/>
<Row style={{ width: '100%' }} gutter={[0, 20]}>
@@ -204,13 +209,13 @@ const Usage = () => {
<CardWrapper style={{ width: '100%' }}>
<Row style={{ width: '100%' }}>
<Col span={12}>
<ColumnBar
<AreaChart
title={intl.formatMessage({ id: 'dashboard.apirequest' })}
data={requestData}
xField="time"
yField="value"
height={360}
></ColumnBar>
></AreaChart>
</Col>
<Col span={12}>
<ColumnBar
+1 -1
View File
@@ -371,7 +371,7 @@ const Models: React.FC = () => {
};
useEffect(() => {
fetchData();
// fetchData();
createModelsChunkRequest();
return () => {
chunkRequedtRef.current?.current?.cancel?.();
+50 -3
View File
@@ -47,8 +47,21 @@ const PasswordForm: React.FC = () => {
style={{ width: '400px', margin: '0 auto', paddingTop: '5%' }}
onFinish={handleSubmit}
>
<h2 className="justify-center m-b-20">
{intl.formatMessage({ id: 'users.password.modify.title' })}
<h2 className="justify-center m-b-20 flex-column flex-center">
<span>
{' '}
{intl.formatMessage({ id: 'users.password.modify.title' })}
</span>
<span
style={{
padding: '6px 0',
fontSize: 'var(--font-size-base)',
fontWeight: 'var(--font-weight-normal)',
color: 'var(--ant-color-text-tertiary)'
}}
>
{intl.formatMessage({ id: 'users.password.modify.description' })}
</span>
</h2>
<Form.Item
@@ -87,8 +100,42 @@ const PasswordForm: React.FC = () => {
label={intl.formatMessage({ id: 'users.form.newpassword' })}
/>
</Form.Item>
<Form.Item
name="confirm_password"
dependencies={['new_password']}
rules={[
{
required: true,
message: intl.formatMessage({
id: 'users.password.confirm.empty'
})
},
({ getFieldValue }) => ({
validator(_, value) {
if (!value || getFieldValue('new_password') === value) {
return Promise.resolve();
}
return Promise.reject(
new Error(
intl.formatMessage({ id: 'users.password.confirm.error' })
)
);
}
})
]}
>
<SealInput.Password
prefix={<LockOutlined />}
label={intl.formatMessage({ id: 'users.password.confirm' })}
/>
</Form.Item>
<Button htmlType="submit" type="primary" block>
<Button
htmlType="submit"
type="primary"
block
style={{ marginTop: 20 }}
>
{intl.formatMessage({ id: 'common.button.submit' })}
</Button>
</Form>