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;
|
||||
color: var(--ant-color-text-secondary);
|
||||
white-space: pre-line;
|
||||
word-break: break-all;
|
||||
span {
|
||||
color: var(--ant-color-text);
|
||||
display: flex;
|
||||
|
||||
Vendored
+1
-1
@@ -38,7 +38,7 @@ declare namespace Global {
|
||||
interface HintOptions {
|
||||
label: string;
|
||||
value: string;
|
||||
opts?: Array<BaseOption<string>>;
|
||||
opts?: Array<BaseOption<string | number>>;
|
||||
}
|
||||
|
||||
type SearchParams = Pagination & { search?: string };
|
||||
|
||||
@@ -74,7 +74,7 @@ export default {
|
||||
'resources.modelfiles.copy.tips': 'Copy Full Path',
|
||||
'resources.filter.path': 'Filter by path',
|
||||
'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':
|
||||
'Click the <span class="bold-text">Quick Config</span> menu.',
|
||||
'resources.register.worker.step3':
|
||||
|
||||
@@ -75,7 +75,7 @@ export default {
|
||||
'resources.modelfiles.copy.tips': 'フルパスをコピー',
|
||||
'resources.filter.path': 'パスでフィルタ',
|
||||
'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':
|
||||
'Click the <span class="bold-text">Quick Config</span> menu.',
|
||||
'resources.register.worker.step3':
|
||||
@@ -93,7 +93,7 @@ export default {
|
||||
};
|
||||
|
||||
// ========== 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.',
|
||||
// 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.',
|
||||
|
||||
@@ -73,7 +73,7 @@ export default {
|
||||
'resources.modelfiles.copy.tips': 'Скопировать полный путь',
|
||||
'resources.filter.path': 'Фильтрация по пути',
|
||||
'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':
|
||||
'Click the <span class="bold-text">Quick Config</span> menu.',
|
||||
'resources.register.worker.step3':
|
||||
@@ -91,7 +91,7 @@ export default {
|
||||
};
|
||||
|
||||
// ========== 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.',
|
||||
// 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.',
|
||||
|
||||
@@ -72,7 +72,7 @@ export default {
|
||||
'resources.modelfiles.copy.tips': '复制完整路径',
|
||||
'resources.filter.path': '路径查询',
|
||||
'resources.register.worker.step1':
|
||||
'点击菜单 <span class="bold-text">Copy token</span>。',
|
||||
'点击菜单 <span class="bold-text">Copy Token</span>。',
|
||||
'resources.register.worker.step2':
|
||||
'点击菜单 <span class="bold-text">Quick Config</span>。',
|
||||
'resources.register.worker.step3':
|
||||
|
||||
@@ -299,6 +299,7 @@ const AddModal: FC<AddModalProps> = (props) => {
|
||||
) {
|
||||
return;
|
||||
}
|
||||
console.log('isgguf==================> select 1', item.isGGUF);
|
||||
console.log('handleOnSelectModel:', item, selectedModel);
|
||||
setIsGGUF(item.isGGUF);
|
||||
clearCahceFormValues();
|
||||
@@ -343,6 +344,7 @@ const AddModal: FC<AddModalProps> = (props) => {
|
||||
if (manual) {
|
||||
form.current?.resetFields(resetFields);
|
||||
}
|
||||
console.log('isgguf==================> select 2', item.isGGUF);
|
||||
// If the item is empty
|
||||
setIsGGUF(item.isGGUF);
|
||||
updateSelectedModel(item);
|
||||
@@ -398,6 +400,7 @@ const AddModal: FC<AddModalProps> = (props) => {
|
||||
};
|
||||
|
||||
const handleSetIsGGUF = async (flag: boolean) => {
|
||||
console.log('isgguf==================>', 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 {
|
||||
hasLinuxWorker?: boolean;
|
||||
modelSource: string;
|
||||
@@ -499,6 +507,7 @@ const SearchModel: React.FC<SearchInputProps> = (props) => {
|
||||
if (model.id === currentRef.current) {
|
||||
return;
|
||||
}
|
||||
setRquestId();
|
||||
handleOnSelectModel(model, true);
|
||||
};
|
||||
|
||||
|
||||
@@ -200,7 +200,7 @@ const resultList = options.map((option) => {
|
||||
value: option.value,
|
||||
opts: option.options?.map((opt) => {
|
||||
return {
|
||||
label: opt,
|
||||
label: `${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 { 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