fix: update the requestId when switch model
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 34 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 59 KiB |
@@ -33,6 +33,7 @@ const useStyles = createStyles(({ css }) => ({
|
|||||||
padding-left: 30px;
|
padding-left: 30px;
|
||||||
color: var(--ant-color-text-secondary);
|
color: var(--ant-color-text-secondary);
|
||||||
white-space: pre-line;
|
white-space: pre-line;
|
||||||
|
word-break: break-all;
|
||||||
span {
|
span {
|
||||||
color: var(--ant-color-text);
|
color: var(--ant-color-text);
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
Vendored
+1
-1
@@ -38,7 +38,7 @@ declare namespace Global {
|
|||||||
interface HintOptions {
|
interface HintOptions {
|
||||||
label: string;
|
label: string;
|
||||||
value: string;
|
value: string;
|
||||||
opts?: Array<BaseOption<string>>;
|
opts?: Array<BaseOption<string | number>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
type SearchParams = Pagination & { search?: string };
|
type SearchParams = Pagination & { search?: string };
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ export default {
|
|||||||
'resources.modelfiles.copy.tips': 'Copy Full Path',
|
'resources.modelfiles.copy.tips': 'Copy Full Path',
|
||||||
'resources.filter.path': 'Filter by path',
|
'resources.filter.path': 'Filter by path',
|
||||||
'resources.register.worker.step1':
|
'resources.register.worker.step1':
|
||||||
'Click the <span class="bold-text">Copy token</span> menu.',
|
'Click the <span class="bold-text">Copy Token</span> menu.',
|
||||||
'resources.register.worker.step2':
|
'resources.register.worker.step2':
|
||||||
'Click the <span class="bold-text">Quick Config</span> menu.',
|
'Click the <span class="bold-text">Quick Config</span> menu.',
|
||||||
'resources.register.worker.step3':
|
'resources.register.worker.step3':
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ export default {
|
|||||||
'resources.modelfiles.copy.tips': 'フルパスをコピー',
|
'resources.modelfiles.copy.tips': 'フルパスをコピー',
|
||||||
'resources.filter.path': 'パスでフィルタ',
|
'resources.filter.path': 'パスでフィルタ',
|
||||||
'resources.register.worker.step1':
|
'resources.register.worker.step1':
|
||||||
'Click the <span class="bold-text">Copy token</span> menu.',
|
'Click the <span class="bold-text">Copy Token</span> menu.',
|
||||||
'resources.register.worker.step2':
|
'resources.register.worker.step2':
|
||||||
'Click the <span class="bold-text">Quick Config</span> menu.',
|
'Click the <span class="bold-text">Quick Config</span> menu.',
|
||||||
'resources.register.worker.step3':
|
'resources.register.worker.step3':
|
||||||
@@ -93,7 +93,7 @@ export default {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// ========== To-Do: Translate Keys (Remove After Translation) ==========
|
// ========== To-Do: Translate Keys (Remove After Translation) ==========
|
||||||
// 1. 'resources.register.worker.step1': 'Click the <span class="bold-text">Copy token</span> menu.',
|
// 1. 'resources.register.worker.step1': 'Click the <span class="bold-text">Copy Token</span> menu.',
|
||||||
// 2. 'resources.register.worker.step2': 'Click the <span class="bold-text">Quick Config</span> menu.',
|
// 2. 'resources.register.worker.step2': 'Click the <span class="bold-text">Quick Config</span> menu.',
|
||||||
// 3. 'resources.register.worker.step3': 'Click the <span class="bold-text">General</span> tab.',
|
// 3. 'resources.register.worker.step3': 'Click the <span class="bold-text">General</span> tab.',
|
||||||
// 4. 'resources.register.worker.step4': 'Select <span class="bold-text">Worker</span> as the service role.',
|
// 4. 'resources.register.worker.step4': 'Select <span class="bold-text">Worker</span> as the service role.',
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ export default {
|
|||||||
'resources.modelfiles.copy.tips': 'Скопировать полный путь',
|
'resources.modelfiles.copy.tips': 'Скопировать полный путь',
|
||||||
'resources.filter.path': 'Фильтрация по пути',
|
'resources.filter.path': 'Фильтрация по пути',
|
||||||
'resources.register.worker.step1':
|
'resources.register.worker.step1':
|
||||||
'Click the <span class="bold-text">Copy token</span> menu.',
|
'Click the <span class="bold-text">Copy Token</span> menu.',
|
||||||
'resources.register.worker.step2':
|
'resources.register.worker.step2':
|
||||||
'Click the <span class="bold-text">Quick Config</span> menu.',
|
'Click the <span class="bold-text">Quick Config</span> menu.',
|
||||||
'resources.register.worker.step3':
|
'resources.register.worker.step3':
|
||||||
@@ -91,7 +91,7 @@ export default {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// ========== To-Do: Translate Keys (Remove After Translation) ==========
|
// ========== To-Do: Translate Keys (Remove After Translation) ==========
|
||||||
// 1. 'resources.register.worker.step1': 'Click the <span class="bold-text">Copy token</span> menu.',
|
// 1. 'resources.register.worker.step1': 'Click the <span class="bold-text">Copy Token</span> menu.',
|
||||||
// 2. 'resources.register.worker.step2': 'Click the <span class="bold-text">Quick Config</span> menu.',
|
// 2. 'resources.register.worker.step2': 'Click the <span class="bold-text">Quick Config</span> menu.',
|
||||||
// 3. 'resources.register.worker.step3': 'Click the <span class="bold-text">General</span> tab.',
|
// 3. 'resources.register.worker.step3': 'Click the <span class="bold-text">General</span> tab.',
|
||||||
// 4. 'resources.register.worker.step4': 'Select <span class="bold-text">Worker</span> as the service role.',
|
// 4. 'resources.register.worker.step4': 'Select <span class="bold-text">Worker</span> as the service role.',
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ export default {
|
|||||||
'resources.modelfiles.copy.tips': '复制完整路径',
|
'resources.modelfiles.copy.tips': '复制完整路径',
|
||||||
'resources.filter.path': '路径查询',
|
'resources.filter.path': '路径查询',
|
||||||
'resources.register.worker.step1':
|
'resources.register.worker.step1':
|
||||||
'点击菜单 <span class="bold-text">Copy token</span>。',
|
'点击菜单 <span class="bold-text">Copy Token</span>。',
|
||||||
'resources.register.worker.step2':
|
'resources.register.worker.step2':
|
||||||
'点击菜单 <span class="bold-text">Quick Config</span>。',
|
'点击菜单 <span class="bold-text">Quick Config</span>。',
|
||||||
'resources.register.worker.step3':
|
'resources.register.worker.step3':
|
||||||
|
|||||||
@@ -299,6 +299,7 @@ const AddModal: FC<AddModalProps> = (props) => {
|
|||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
console.log('isgguf==================> select 1', item.isGGUF);
|
||||||
console.log('handleOnSelectModel:', item, selectedModel);
|
console.log('handleOnSelectModel:', item, selectedModel);
|
||||||
setIsGGUF(item.isGGUF);
|
setIsGGUF(item.isGGUF);
|
||||||
clearCahceFormValues();
|
clearCahceFormValues();
|
||||||
@@ -343,6 +344,7 @@ const AddModal: FC<AddModalProps> = (props) => {
|
|||||||
if (manual) {
|
if (manual) {
|
||||||
form.current?.resetFields(resetFields);
|
form.current?.resetFields(resetFields);
|
||||||
}
|
}
|
||||||
|
console.log('isgguf==================> select 2', item.isGGUF);
|
||||||
// If the item is empty
|
// If the item is empty
|
||||||
setIsGGUF(item.isGGUF);
|
setIsGGUF(item.isGGUF);
|
||||||
updateSelectedModel(item);
|
updateSelectedModel(item);
|
||||||
@@ -398,6 +400,7 @@ const AddModal: FC<AddModalProps> = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleSetIsGGUF = async (flag: boolean) => {
|
const handleSetIsGGUF = async (flag: boolean) => {
|
||||||
|
console.log('isgguf==================>', flag);
|
||||||
setIsGGUF(flag);
|
setIsGGUF(flag);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,14 @@ const PaginationMain = styled(Pagination)`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
const IconFontWrapper = styled.div`
|
||||||
|
.ant-pagination-item-link {
|
||||||
|
display: flex !important;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
interface SearchInputProps {
|
interface SearchInputProps {
|
||||||
hasLinuxWorker?: boolean;
|
hasLinuxWorker?: boolean;
|
||||||
modelSource: string;
|
modelSource: string;
|
||||||
@@ -499,6 +507,7 @@ const SearchModel: React.FC<SearchInputProps> = (props) => {
|
|||||||
if (model.id === currentRef.current) {
|
if (model.id === currentRef.current) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
setRquestId();
|
||||||
handleOnSelectModel(model, true);
|
handleOnSelectModel(model, true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ const resultList = options.map((option) => {
|
|||||||
value: option.value,
|
value: option.value,
|
||||||
opts: option.options?.map((opt) => {
|
opts: option.options?.map((opt) => {
|
||||||
return {
|
return {
|
||||||
label: opt,
|
label: `${opt}`,
|
||||||
value: opt
|
value: opt
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -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 { useIntl } from '@umijs/max';
|
||||||
import { Image, Space, Typography } from 'antd';
|
import { Space, Typography } from 'antd';
|
||||||
import React, { useMemo } from 'react';
|
import React, { useMemo } from 'react';
|
||||||
|
|
||||||
const { Text } = Typography;
|
const { Text } = Typography;
|
||||||
@@ -12,7 +10,7 @@ interface AddWorkerMacOSProps {
|
|||||||
|
|
||||||
const registerWorkerSteps = [
|
const registerWorkerSteps = [
|
||||||
'resources.register.worker.step2',
|
'resources.register.worker.step2',
|
||||||
`resources.register.worker.step3`,
|
// `resources.register.worker.step3`,
|
||||||
`resources.register.worker.step4`,
|
`resources.register.worker.step4`,
|
||||||
'resources.register.worker.step5',
|
'resources.register.worker.step5',
|
||||||
'resources.register.worker.step6',
|
'resources.register.worker.step6',
|
||||||
@@ -48,10 +46,7 @@ const AddWorkerMacOS: React.FC<AddWorkerMacOSProps> = () => {
|
|||||||
</h3>
|
</h3>
|
||||||
<Typography.Paragraph style={{ paddingLeft: 14 }}>
|
<Typography.Paragraph style={{ paddingLeft: 14 }}>
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<Typography.Text
|
<Typography.Text type="secondary">
|
||||||
type="secondary"
|
|
||||||
style={{ width: 320, marginRight: 20 }}
|
|
||||||
>
|
|
||||||
<span
|
<span
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: intl.formatMessage({
|
__html: intl.formatMessage({
|
||||||
@@ -60,7 +55,6 @@ const AddWorkerMacOS: React.FC<AddWorkerMacOSProps> = () => {
|
|||||||
}}
|
}}
|
||||||
></span>
|
></span>
|
||||||
</Typography.Text>
|
</Typography.Text>
|
||||||
<Image src={CopyToken} style={{ width: 160 }}></Image>
|
|
||||||
</div>
|
</div>
|
||||||
</Typography.Paragraph>
|
</Typography.Paragraph>
|
||||||
<h3 className="m-t-10 font-size-14 font-600">
|
<h3 className="m-t-10 font-size-14 font-600">
|
||||||
@@ -75,7 +69,7 @@ const AddWorkerMacOS: React.FC<AddWorkerMacOSProps> = () => {
|
|||||||
</h3>
|
</h3>
|
||||||
<Typography.Paragraph style={{ paddingLeft: 14 }}>
|
<Typography.Paragraph style={{ paddingLeft: 14 }}>
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<Space direction="vertical" style={{ width: 320, marginRight: 20 }}>
|
<Space direction="vertical">
|
||||||
{registerWorkerSteps.map((step, index) => (
|
{registerWorkerSteps.map((step, index) => (
|
||||||
<Typography.Text key={index} type="secondary">
|
<Typography.Text key={index} type="secondary">
|
||||||
{index + 1}.{' '}
|
{index + 1}.{' '}
|
||||||
@@ -87,7 +81,6 @@ const AddWorkerMacOS: React.FC<AddWorkerMacOSProps> = () => {
|
|||||||
</Typography.Text>
|
</Typography.Text>
|
||||||
))}
|
))}
|
||||||
</Space>
|
</Space>
|
||||||
<Image src={QuickConfig} style={{ width: 160 }}></Image>
|
|
||||||
</div>
|
</div>
|
||||||
</Typography.Paragraph>
|
</Typography.Paragraph>
|
||||||
<h3 className="m-b-0 m-t-10 font-size-14 font-600">4. {labels.step3}</h3>
|
<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;
|
token?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const AddWorkerWindows: React.FC<AddWorkerWindowsProps> = () => {
|
const registerWorkerSteps = [
|
||||||
return <div>add worker in windows</div>;
|
'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;
|
export default AddWorkerWindows;
|
||||||
|
|||||||
@@ -30,13 +30,13 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'macos',
|
key: 'macos',
|
||||||
label: 'macOS(M series 14+)',
|
label: 'macOS',
|
||||||
icon: <AppleOutlined />,
|
icon: <AppleOutlined />,
|
||||||
children: <MacOS token={token} />
|
children: <MacOS token={token} />
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'windows',
|
key: 'windows',
|
||||||
label: 'Windows(win 10, win 11)',
|
label: 'Windows',
|
||||||
icon: <WindowsOutlined />,
|
icon: <WindowsOutlined />,
|
||||||
children: <Windows token={token} />
|
children: <Windows token={token} />
|
||||||
}
|
}
|
||||||
@@ -46,16 +46,19 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
|
|||||||
<Modal
|
<Modal
|
||||||
title={intl.formatMessage({ id: 'resources.button.create' })}
|
title={intl.formatMessage({ id: 'resources.button.create' })}
|
||||||
open={open}
|
open={open}
|
||||||
centered={true}
|
centered={false}
|
||||||
onCancel={onCancel}
|
onCancel={onCancel}
|
||||||
destroyOnClose={true}
|
destroyOnClose={true}
|
||||||
closeIcon={true}
|
closeIcon={true}
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
keyboard={false}
|
keyboard={false}
|
||||||
width={700}
|
width={700}
|
||||||
|
style={{
|
||||||
|
top: 100
|
||||||
|
}}
|
||||||
styles={{
|
styles={{
|
||||||
body: {
|
body: {
|
||||||
height: 650
|
minHeight: 450
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
footer={null}
|
footer={null}
|
||||||
|
|||||||
Reference in New Issue
Block a user