fix: build file warnings
This commit is contained in:
@@ -184,7 +184,13 @@ const AddModal: React.FC<AddModalProps> = ({
|
||||
<SealInput.Input
|
||||
label={intl.formatMessage({ id: 'apikeys.form.apikey' })}
|
||||
value={apikeyValue}
|
||||
addAfter={<CopyButton text={apikeyValue}></CopyButton>}
|
||||
addAfter={
|
||||
<CopyButton
|
||||
text={apikeyValue}
|
||||
shape="default"
|
||||
size="small"
|
||||
></CopyButton>
|
||||
}
|
||||
></SealInput.Input>
|
||||
</Form.Item>
|
||||
)}
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
} from 'antd';
|
||||
import dayjs from 'dayjs';
|
||||
import _ from 'lodash';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { StrictMode, useEffect, useState } from 'react';
|
||||
import { deleteApisKey, queryApisKeysList } from './apis';
|
||||
import AddAPIKeyModal from './components/add-apikey';
|
||||
import { ListItem } from './config/types';
|
||||
@@ -179,7 +179,7 @@ const Models: React.FC = () => {
|
||||
}, [queryParams]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<StrictMode>
|
||||
<PageContainer
|
||||
ghost
|
||||
header={{
|
||||
@@ -308,7 +308,7 @@ const Models: React.FC = () => {
|
||||
onCancel={handleModalCancel}
|
||||
onOk={handleModalOk}
|
||||
></AddAPIKeyModal>
|
||||
</>
|
||||
</StrictMode>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
import { PageContainer } from '@ant-design/pro-components';
|
||||
import { Spin } from 'antd';
|
||||
import { memo, useState } from 'react';
|
||||
import { StrictMode, memo, useState } from 'react';
|
||||
import DashboardInner from './components/dahboard-inner';
|
||||
|
||||
const Dashboard: React.FC = () => {
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
return (
|
||||
<PageContainer ghost extra={[]}>
|
||||
<Spin spinning={loading}>
|
||||
<DashboardInner setLoading={setLoading} />
|
||||
</Spin>
|
||||
</PageContainer>
|
||||
<StrictMode>
|
||||
<PageContainer ghost extra={[]}>
|
||||
<Spin spinning={loading}>
|
||||
<DashboardInner setLoading={setLoading} />
|
||||
</Spin>
|
||||
</PageContainer>
|
||||
</StrictMode>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import useSetChunkRequest, {
|
||||
} from '@/hooks/use-chunk-request';
|
||||
import useUpdateChunkedList from '@/hooks/use-update-chunk-list';
|
||||
import _ from 'lodash';
|
||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { StrictMode, useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { MODELS_API, MODEL_INSTANCE_API, queryModelsList } from './apis';
|
||||
import TableList from './components/table-list';
|
||||
import { ListItem } from './config/types';
|
||||
@@ -168,24 +168,26 @@ const Models: React.FC = () => {
|
||||
}, [queryParams]);
|
||||
|
||||
return (
|
||||
<TableContext.Provider
|
||||
value={{
|
||||
allChildren: modelInstances
|
||||
}}
|
||||
>
|
||||
<TableList
|
||||
dataSource={dataSource}
|
||||
handleNameChange={handleNameChange}
|
||||
handleSearch={handleSearch}
|
||||
handleShowSizeChange={handleShowSizeChange}
|
||||
handlePageChange={handlePageChange}
|
||||
createModelsChunkRequest={createModelsChunkRequest}
|
||||
queryParams={queryParams}
|
||||
loading={loading}
|
||||
total={total}
|
||||
fetchData={fetchData}
|
||||
></TableList>
|
||||
</TableContext.Provider>
|
||||
<StrictMode>
|
||||
<TableContext.Provider
|
||||
value={{
|
||||
allChildren: modelInstances
|
||||
}}
|
||||
>
|
||||
<TableList
|
||||
dataSource={dataSource}
|
||||
handleNameChange={handleNameChange}
|
||||
handleSearch={handleSearch}
|
||||
handleShowSizeChange={handleShowSizeChange}
|
||||
handlePageChange={handlePageChange}
|
||||
createModelsChunkRequest={createModelsChunkRequest}
|
||||
queryParams={queryParams}
|
||||
loading={loading}
|
||||
total={total}
|
||||
fetchData={fetchData}
|
||||
></TableList>
|
||||
</TableContext.Provider>
|
||||
</StrictMode>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { PageContainer } from '@ant-design/pro-components';
|
||||
import { useSearchParams } from '@umijs/max';
|
||||
import { Divider } from 'antd';
|
||||
import { useState } from 'react';
|
||||
import { StrictMode, useState } from 'react';
|
||||
import GroundLeft from './components/ground-left';
|
||||
import ParamsSettings from './components/params-settings';
|
||||
import './style/play-ground.less';
|
||||
@@ -12,7 +12,7 @@ const Playground: React.FC = () => {
|
||||
const [params, setParams] = useState({});
|
||||
|
||||
return (
|
||||
<div>
|
||||
<StrictMode>
|
||||
<PageContainer ghost extra={[]}>
|
||||
<div className="play-ground">
|
||||
<div className="chat">
|
||||
@@ -27,7 +27,7 @@ const Playground: React.FC = () => {
|
||||
</div>
|
||||
</div>
|
||||
</PageContainer>
|
||||
</div>
|
||||
</StrictMode>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
+88
-91
@@ -6,7 +6,6 @@ import { updatePassword } from '@/pages/login/apis';
|
||||
import { PageContainer } from '@ant-design/pro-components';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form, message } from 'antd';
|
||||
import { StrictMode } from 'react';
|
||||
|
||||
interface ProfileProps {
|
||||
username?: string;
|
||||
@@ -35,99 +34,97 @@ const Profile: React.FC = () => {
|
||||
};
|
||||
|
||||
return (
|
||||
<StrictMode>
|
||||
<PageContainer
|
||||
ghost
|
||||
header={{
|
||||
title: intl.formatMessage({ id: 'users.form.updatepassword' })
|
||||
}}
|
||||
extra={[]}
|
||||
<PageContainer
|
||||
ghost
|
||||
header={{
|
||||
title: intl.formatMessage({ id: 'users.form.updatepassword' })
|
||||
}}
|
||||
extra={[]}
|
||||
>
|
||||
<Form
|
||||
style={{ width: '524px' }}
|
||||
name="profileForm"
|
||||
form={form}
|
||||
onFinish={handleOnFinish}
|
||||
onFinishFailed={handleOnFinishFailed}
|
||||
>
|
||||
<Form
|
||||
style={{ width: '524px' }}
|
||||
name="profileForm"
|
||||
form={form}
|
||||
onFinish={handleOnFinish}
|
||||
onFinishFailed={handleOnFinishFailed}
|
||||
>
|
||||
<Form.Item<ProfileProps>
|
||||
name="current_password"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: intl.formatMessage(
|
||||
{ id: 'common.form.rule.input' },
|
||||
{
|
||||
name: intl.formatMessage({
|
||||
id: 'users.form.currentpassword'
|
||||
})
|
||||
}
|
||||
)
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInput.Password
|
||||
label={intl.formatMessage({ id: 'users.form.currentpassword' })}
|
||||
required
|
||||
style={{ width: INPUT_WIDTH.default }}
|
||||
></SealInput.Password>
|
||||
</Form.Item>
|
||||
<Form.Item<ProfileProps>
|
||||
name="new_password"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
pattern: PasswordReg,
|
||||
message: intl.formatMessage({
|
||||
id: 'users.form.rule.password'
|
||||
})
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInput.Password
|
||||
label={intl.formatMessage({ id: 'users.form.newpassword' })}
|
||||
required
|
||||
style={{ width: INPUT_WIDTH.default }}
|
||||
></SealInput.Password>
|
||||
</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' })
|
||||
)
|
||||
);
|
||||
<Form.Item<ProfileProps>
|
||||
name="current_password"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: intl.formatMessage(
|
||||
{ id: 'common.form.rule.input' },
|
||||
{
|
||||
name: intl.formatMessage({
|
||||
id: 'users.form.currentpassword'
|
||||
})
|
||||
}
|
||||
)
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInput.Password
|
||||
label={intl.formatMessage({ id: 'users.form.currentpassword' })}
|
||||
required
|
||||
style={{ width: INPUT_WIDTH.default }}
|
||||
></SealInput.Password>
|
||||
</Form.Item>
|
||||
<Form.Item<ProfileProps>
|
||||
name="new_password"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
pattern: PasswordReg,
|
||||
message: intl.formatMessage({
|
||||
id: 'users.form.rule.password'
|
||||
})
|
||||
]}
|
||||
>
|
||||
<SealInput.Password
|
||||
required={true}
|
||||
style={{ width: INPUT_WIDTH.default }}
|
||||
label={intl.formatMessage({ id: 'users.password.confirm' })}
|
||||
/>
|
||||
</Form.Item>
|
||||
<FormButtons
|
||||
htmlType="submit"
|
||||
onCancel={handleCancel}
|
||||
showCancel={false}
|
||||
></FormButtons>
|
||||
</Form>
|
||||
</PageContainer>
|
||||
</StrictMode>
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInput.Password
|
||||
label={intl.formatMessage({ id: 'users.form.newpassword' })}
|
||||
required
|
||||
style={{ width: INPUT_WIDTH.default }}
|
||||
></SealInput.Password>
|
||||
</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
|
||||
required={true}
|
||||
style={{ width: INPUT_WIDTH.default }}
|
||||
label={intl.formatMessage({ id: 'users.password.confirm' })}
|
||||
/>
|
||||
</Form.Item>
|
||||
<FormButtons
|
||||
htmlType="submit"
|
||||
onCancel={handleCancel}
|
||||
showCancel={false}
|
||||
></FormButtons>
|
||||
</Form>
|
||||
</PageContainer>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { PageContainer } from '@ant-design/pro-components';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import type { TabsProps } from 'antd';
|
||||
import { Tabs } from 'antd';
|
||||
import { useState } from 'react';
|
||||
import { StrictMode, useState } from 'react';
|
||||
import GPUs from './components/gpus';
|
||||
import Workers from './components/workers';
|
||||
|
||||
@@ -29,23 +29,25 @@ const Resources = () => {
|
||||
};
|
||||
|
||||
return (
|
||||
<PageContainer
|
||||
ghost
|
||||
header={{
|
||||
title: intl.formatMessage({ id: 'resources.title' })
|
||||
}}
|
||||
extra={[]}
|
||||
>
|
||||
<div style={{ marginTop: 60 }}>
|
||||
<Tabs
|
||||
type="card"
|
||||
defaultActiveKey="workers"
|
||||
items={items}
|
||||
accessKey={activeKey}
|
||||
onChange={handleChangeTab}
|
||||
></Tabs>
|
||||
</div>
|
||||
</PageContainer>
|
||||
<StrictMode>
|
||||
<PageContainer
|
||||
ghost
|
||||
header={{
|
||||
title: intl.formatMessage({ id: 'resources.title' })
|
||||
}}
|
||||
extra={[]}
|
||||
>
|
||||
<div style={{ marginTop: 60 }}>
|
||||
<Tabs
|
||||
type="card"
|
||||
defaultActiveKey="workers"
|
||||
items={items}
|
||||
accessKey={activeKey}
|
||||
onChange={handleChangeTab}
|
||||
></Tabs>
|
||||
</div>
|
||||
</PageContainer>
|
||||
</StrictMode>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import { useIntl } from '@umijs/max';
|
||||
import { Button, Input, Modal, Space, Table, message } from 'antd';
|
||||
import dayjs from 'dayjs';
|
||||
import _ from 'lodash';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { StrictMode, useEffect, useState } from 'react';
|
||||
import { createUser, deleteUser, queryUsersList, updateUser } from './apis';
|
||||
import AddModal from './components/add-modal';
|
||||
import { FormData, ListItem } from './config/types';
|
||||
@@ -201,7 +201,7 @@ const Users: React.FC = () => {
|
||||
}, [queryParams]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<StrictMode>
|
||||
<PageContainer
|
||||
ghost
|
||||
header={{
|
||||
@@ -330,7 +330,7 @@ const Users: React.FC = () => {
|
||||
onCancel={handleModalCancel}
|
||||
onOk={handleModalOk}
|
||||
></AddModal>
|
||||
</>
|
||||
</StrictMode>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user