fix: update the requestId when switch model
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
import CopyToken from '@/assets/images/copy-token.png';
|
||||
import QuickConfig from '@/assets/images/quick-config.png';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Image, Space, Typography } from 'antd';
|
||||
import { Space, Typography } from 'antd';
|
||||
import React, { useMemo } from 'react';
|
||||
|
||||
const { Text } = Typography;
|
||||
@@ -12,7 +10,7 @@ interface AddWorkerMacOSProps {
|
||||
|
||||
const registerWorkerSteps = [
|
||||
'resources.register.worker.step2',
|
||||
`resources.register.worker.step3`,
|
||||
// `resources.register.worker.step3`,
|
||||
`resources.register.worker.step4`,
|
||||
'resources.register.worker.step5',
|
||||
'resources.register.worker.step6',
|
||||
@@ -48,10 +46,7 @@ const AddWorkerMacOS: React.FC<AddWorkerMacOSProps> = () => {
|
||||
</h3>
|
||||
<Typography.Paragraph style={{ paddingLeft: 14 }}>
|
||||
<div className="flex">
|
||||
<Typography.Text
|
||||
type="secondary"
|
||||
style={{ width: 320, marginRight: 20 }}
|
||||
>
|
||||
<Typography.Text type="secondary">
|
||||
<span
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: intl.formatMessage({
|
||||
@@ -60,7 +55,6 @@ const AddWorkerMacOS: React.FC<AddWorkerMacOSProps> = () => {
|
||||
}}
|
||||
></span>
|
||||
</Typography.Text>
|
||||
<Image src={CopyToken} style={{ width: 160 }}></Image>
|
||||
</div>
|
||||
</Typography.Paragraph>
|
||||
<h3 className="m-t-10 font-size-14 font-600">
|
||||
@@ -75,7 +69,7 @@ const AddWorkerMacOS: React.FC<AddWorkerMacOSProps> = () => {
|
||||
</h3>
|
||||
<Typography.Paragraph style={{ paddingLeft: 14 }}>
|
||||
<div className="flex">
|
||||
<Space direction="vertical" style={{ width: 320, marginRight: 20 }}>
|
||||
<Space direction="vertical">
|
||||
{registerWorkerSteps.map((step, index) => (
|
||||
<Typography.Text key={index} type="secondary">
|
||||
{index + 1}.{' '}
|
||||
@@ -87,7 +81,6 @@ const AddWorkerMacOS: React.FC<AddWorkerMacOSProps> = () => {
|
||||
</Typography.Text>
|
||||
))}
|
||||
</Space>
|
||||
<Image src={QuickConfig} style={{ width: 160 }}></Image>
|
||||
</div>
|
||||
</Typography.Paragraph>
|
||||
<h3 className="m-b-0 m-t-10 font-size-14 font-600">4. {labels.step3}</h3>
|
||||
|
||||
@@ -1,11 +1,91 @@
|
||||
import React from 'react';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Space, Typography } from 'antd';
|
||||
import React, { useMemo } from 'react';
|
||||
|
||||
interface AddWorkerWindowsProps {
|
||||
const { Text } = Typography;
|
||||
|
||||
interface AddWorkerProps {
|
||||
token?: string;
|
||||
}
|
||||
|
||||
const AddWorkerWindows: React.FC<AddWorkerWindowsProps> = () => {
|
||||
return <div>add worker in windows</div>;
|
||||
const registerWorkerSteps = [
|
||||
'resources.register.worker.step2',
|
||||
// `resources.register.worker.step3`,
|
||||
`resources.register.worker.step4`,
|
||||
'resources.register.worker.step5',
|
||||
'resources.register.worker.step6',
|
||||
`resources.register.worker.step7`
|
||||
];
|
||||
|
||||
const AddWorkerWindows: React.FC<AddWorkerProps> = () => {
|
||||
const intl = useIntl();
|
||||
const labels = useMemo(
|
||||
() => ({
|
||||
step1: intl.formatMessage({ id: 'resources.worker.add.step1' }),
|
||||
step2: intl.formatMessage({ id: 'resources.worker.add.step2' }),
|
||||
step2Tips: intl.formatMessage({ id: 'resources.worker.add.step2.tips' }),
|
||||
step3: intl.formatMessage({ id: 'resources.worker.add.step3' }),
|
||||
linuxOrMac: intl.formatMessage({ id: 'resources.worker.linuxormaxos' })
|
||||
}),
|
||||
[intl]
|
||||
);
|
||||
return (
|
||||
<div className="script-install">
|
||||
<h3 className="font-size-14 font-600">
|
||||
1. {intl.formatMessage({ id: 'resources.register.install.title' })}
|
||||
</h3>
|
||||
<Typography.Paragraph type="secondary" style={{ paddingLeft: 14 }}>
|
||||
<span
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: intl.formatMessage({ id: 'resources.register.download' })
|
||||
}}
|
||||
></span>
|
||||
</Typography.Paragraph>
|
||||
<h3 className="font-size-14 font-600">
|
||||
2. <span dangerouslySetInnerHTML={{ __html: labels.step1 }}></span>
|
||||
</h3>
|
||||
<Typography.Paragraph style={{ paddingLeft: 14 }}>
|
||||
<div className="flex">
|
||||
<Typography.Text type="secondary">
|
||||
<span
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: intl.formatMessage({
|
||||
id: 'resources.register.worker.step1'
|
||||
})
|
||||
}}
|
||||
></span>
|
||||
</Typography.Text>
|
||||
</div>
|
||||
</Typography.Paragraph>
|
||||
<h3 className="m-t-10 font-size-14 font-600">
|
||||
3. {labels.step2}{' '}
|
||||
<span
|
||||
className="font-size-12"
|
||||
style={{ color: 'var(--ant-color-text-tertiary)' }}
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `${labels.step2Tips}`
|
||||
}}
|
||||
></span>
|
||||
</h3>
|
||||
<Typography.Paragraph style={{ paddingLeft: 14 }}>
|
||||
<div className="flex">
|
||||
<Space direction="vertical">
|
||||
{registerWorkerSteps.map((step, index) => (
|
||||
<Typography.Text key={index} type="secondary">
|
||||
{index + 1}.{' '}
|
||||
<span
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: intl.formatMessage({ id: step })
|
||||
}}
|
||||
></span>
|
||||
</Typography.Text>
|
||||
))}
|
||||
</Space>
|
||||
</div>
|
||||
</Typography.Paragraph>
|
||||
<h3 className="m-b-0 m-t-10 font-size-14 font-600">4. {labels.step3}</h3>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default AddWorkerWindows;
|
||||
|
||||
@@ -30,13 +30,13 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
|
||||
},
|
||||
{
|
||||
key: 'macos',
|
||||
label: 'macOS(M series 14+)',
|
||||
label: 'macOS',
|
||||
icon: <AppleOutlined />,
|
||||
children: <MacOS token={token} />
|
||||
},
|
||||
{
|
||||
key: 'windows',
|
||||
label: 'Windows(win 10, win 11)',
|
||||
label: 'Windows',
|
||||
icon: <WindowsOutlined />,
|
||||
children: <Windows token={token} />
|
||||
}
|
||||
@@ -46,16 +46,19 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
|
||||
<Modal
|
||||
title={intl.formatMessage({ id: 'resources.button.create' })}
|
||||
open={open}
|
||||
centered={true}
|
||||
centered={false}
|
||||
onCancel={onCancel}
|
||||
destroyOnClose={true}
|
||||
closeIcon={true}
|
||||
maskClosable={false}
|
||||
keyboard={false}
|
||||
width={700}
|
||||
style={{
|
||||
top: 100
|
||||
}}
|
||||
styles={{
|
||||
body: {
|
||||
height: 650
|
||||
minHeight: 450
|
||||
}
|
||||
}}
|
||||
footer={null}
|
||||
|
||||
Reference in New Issue
Block a user