chore: add changes tips
This commit is contained in:
@@ -13,7 +13,7 @@ interface AlertInfoProps {
|
|||||||
ellipsis?: boolean;
|
ellipsis?: boolean;
|
||||||
style?: React.CSSProperties;
|
style?: React.CSSProperties;
|
||||||
contentStyle?: React.CSSProperties;
|
contentStyle?: React.CSSProperties;
|
||||||
title: React.ReactNode;
|
title?: React.ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
const TitleWrapper = styled.div`
|
const TitleWrapper = styled.div`
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { useIntl } from '@umijs/max';
|
import { useIntl } from '@umijs/max';
|
||||||
import { Button, Space } from 'antd';
|
import { Button, Space } from 'antd';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import styled from 'styled-components';
|
||||||
|
|
||||||
type ModalFooterProps = {
|
type ModalFooterProps = {
|
||||||
onOk?: () => void;
|
onOk?: () => void;
|
||||||
@@ -16,7 +17,16 @@ type ModalFooterProps = {
|
|||||||
showCancelBtn?: boolean;
|
showCancelBtn?: boolean;
|
||||||
extra?: React.ReactNode;
|
extra?: React.ReactNode;
|
||||||
form?: any;
|
form?: any;
|
||||||
|
description?: React.ReactNode;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const Wrapper = styled.div`
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
gap: 20px;
|
||||||
|
`;
|
||||||
|
|
||||||
const ModalFooter: React.FC<ModalFooterProps> = ({
|
const ModalFooter: React.FC<ModalFooterProps> = ({
|
||||||
onOk,
|
onOk,
|
||||||
onCancel,
|
onCancel,
|
||||||
@@ -28,29 +38,37 @@ const ModalFooter: React.FC<ModalFooterProps> = ({
|
|||||||
htmlType = 'button',
|
htmlType = 'button',
|
||||||
style,
|
style,
|
||||||
showOkBtn = true,
|
showOkBtn = true,
|
||||||
|
description,
|
||||||
extra,
|
extra,
|
||||||
form
|
form
|
||||||
}) => {
|
}) => {
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
return (
|
return (
|
||||||
<Space size={20} style={{ ...style }}>
|
<Wrapper>
|
||||||
<Button onClick={onCancel} style={{ width: '88px' }} {...cancelBtnProps}>
|
<div>{description}</div>
|
||||||
{cancelText || intl.formatMessage({ id: 'common.button.cancel' })}
|
<Space size={20} style={{ ...style }}>
|
||||||
</Button>
|
|
||||||
{extra}
|
|
||||||
{showOkBtn && (
|
|
||||||
<Button
|
<Button
|
||||||
type="primary"
|
onClick={onCancel}
|
||||||
onClick={onOk}
|
|
||||||
style={{ width: '88px' }}
|
style={{ width: '88px' }}
|
||||||
loading={loading}
|
{...cancelBtnProps}
|
||||||
htmlType={htmlType}
|
|
||||||
{...okBtnProps}
|
|
||||||
>
|
>
|
||||||
{okText || intl.formatMessage({ id: 'common.button.save' })}
|
{cancelText || intl.formatMessage({ id: 'common.button.cancel' })}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
{extra}
|
||||||
</Space>
|
{showOkBtn && (
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
onClick={onOk}
|
||||||
|
style={{ width: '88px' }}
|
||||||
|
loading={loading}
|
||||||
|
htmlType={htmlType}
|
||||||
|
{...okBtnProps}
|
||||||
|
>
|
||||||
|
{okText || intl.formatMessage({ id: 'common.button.save' })}
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
</Space>
|
||||||
|
</Wrapper>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -130,5 +130,7 @@ export default {
|
|||||||
'models.form.check.params': 'Checking configuration...',
|
'models.form.check.params': 'Checking configuration...',
|
||||||
'models.form.check.passed': 'Compatibility Check Passed',
|
'models.form.check.passed': 'Compatibility Check Passed',
|
||||||
'models.form.check.claims':
|
'models.form.check.claims':
|
||||||
'The model requires approximately {vram} VRAM and {ram} RAM.'
|
'The model requires approximately {vram} VRAM and {ram} RAM.',
|
||||||
|
'models.form.update.tips':
|
||||||
|
'Changes will only apply after you delete and recreate the instance.'
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ export default {
|
|||||||
'Get Token <span class="note-text">(Run on the server)</span>',
|
'Get Token <span class="note-text">(Run on the server)</span>',
|
||||||
'resources.worker.add.step2': 'Register Worker',
|
'resources.worker.add.step2': 'Register Worker',
|
||||||
'resources.worker.add.step2.tips':
|
'resources.worker.add.step2.tips':
|
||||||
'(Run on the worker to be added, <span style="color: #000;font-weight: 600">mytoken</span> is the token obtained in the first step.)',
|
'(Run on the worker to be added, <span style="color: #000;font-weight: 600">token</span> is the token obtained in the first step.)',
|
||||||
'resources.worker.add.step3':
|
'resources.worker.add.step3':
|
||||||
'After success, refresh the workers list to view the new worker.',
|
'After success, refresh the workers list to view the new worker.',
|
||||||
'resources.worker.container.supported': 'Do not support macOS or Windows.',
|
'resources.worker.container.supported': 'Do not support macOS or Windows.',
|
||||||
|
|||||||
@@ -127,7 +127,9 @@ export default {
|
|||||||
'models.form.check.params': 'Checking configuration...',
|
'models.form.check.params': 'Checking configuration...',
|
||||||
'models.form.check.passed': 'Compatibility Check Passed',
|
'models.form.check.passed': 'Compatibility Check Passed',
|
||||||
'models.form.check.claims':
|
'models.form.check.claims':
|
||||||
'The model requires approximately {vram} VRAM and {ram} RAM.'
|
'The model requires approximately {vram} VRAM and {ram} RAM.',
|
||||||
|
'models.form.update.tips':
|
||||||
|
'Changes will only apply after you delete and recreate the instance.'
|
||||||
};
|
};
|
||||||
|
|
||||||
// ========== To-Do: Translate Keys (Remove After Translation) ==========
|
// ========== To-Do: Translate Keys (Remove After Translation) ==========
|
||||||
@@ -144,4 +146,5 @@ export default {
|
|||||||
// 11. 'models.form.check.passed',
|
// 11. 'models.form.check.passed',
|
||||||
// 12. 'models.form.check.claims',
|
// 12. 'models.form.check.claims',
|
||||||
// 13. 'model.deploy.search.placeholder',
|
// 13. 'model.deploy.search.placeholder',
|
||||||
|
// 14. 'models.form.update.tips
|
||||||
// ========== End of To-Do List ==========
|
// ========== End of To-Do List ==========
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ export default {
|
|||||||
'Get Token <span class="note-text">(Run on the server)</span>',
|
'Get Token <span class="note-text">(Run on the server)</span>',
|
||||||
'resources.worker.add.step2': 'ワーカーを登録',
|
'resources.worker.add.step2': 'ワーカーを登録',
|
||||||
'resources.worker.add.step2.tips':
|
'resources.worker.add.step2.tips':
|
||||||
'(Run on the worker to be added, <span style="color: #000;font-weight: 600">mytoken</span> is the token obtained in the first step.)',
|
'(Run on the worker to be added, <span style="color: #000;font-weight: 600">token</span> is the token obtained in the first step.)',
|
||||||
'resources.worker.add.step3':
|
'resources.worker.add.step3':
|
||||||
'成功後、ワーカーリストを更新して新しいワーカーを確認してください。',
|
'成功後、ワーカーリストを更新して新しいワーカーを確認してください。',
|
||||||
'resources.worker.container.supported':
|
'resources.worker.container.supported':
|
||||||
|
|||||||
@@ -129,11 +129,15 @@ export default {
|
|||||||
'При возникновении ошибки система автоматически попытается перезапуститься.',
|
'При возникновении ошибки система автоматически попытается перезапуститься.',
|
||||||
'models.form.check.params': 'Проверка конфигурации...',
|
'models.form.check.params': 'Проверка конфигурации...',
|
||||||
'models.form.check.passed': 'Compatibility Check Passed',
|
'models.form.check.passed': 'Compatibility Check Passed',
|
||||||
'models.form.check.claims': 'Модель требует примерно {vram} VRAM и {ram} RAM.'
|
'models.form.check.claims':
|
||||||
|
'Модель требует примерно {vram} VRAM и {ram} RAM.',
|
||||||
|
'models.form.update.tips':
|
||||||
|
'Changes will only apply after you delete and recreate the instance.'
|
||||||
};
|
};
|
||||||
|
|
||||||
// ========== To-Do: Translate Keys (Remove After Translation) ==========
|
// ========== To-Do: Translate Keys (Remove After Translation) ==========
|
||||||
// 1. 'models.form.check.passed',
|
// 1. 'models.form.check.passed',
|
||||||
// 2. 'models.form.partialoffload.tips
|
// 2. 'models.form.partialoffload.tips
|
||||||
// 3. 'model.deploy.search.placeholder'
|
// 3. 'model.deploy.search.placeholder',
|
||||||
|
// 4. 'models.form.update.tips',
|
||||||
// ========== End of To-Do List ==========
|
// ========== End of To-Do List ==========
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ export default {
|
|||||||
'Получить токен <span class="note-text">(Запустить на сервере)</span>',
|
'Получить токен <span class="note-text">(Запустить на сервере)</span>',
|
||||||
'resources.worker.add.step2': 'Зарегистрировать воркер',
|
'resources.worker.add.step2': 'Зарегистрировать воркер',
|
||||||
'resources.worker.add.step2.tips':
|
'resources.worker.add.step2.tips':
|
||||||
'(выполнить на подключаемом воркере, <span style="color: #000;font-weight: 600">mytoken</span> это токен, полученный на первом шаге)',
|
'(выполнить на подключаемом воркере, <span style="color: #000;font-weight: 600">token</span> это токен, полученный на первом шаге)',
|
||||||
'resources.worker.add.step3':
|
'resources.worker.add.step3':
|
||||||
'После успешной регистрации обновите список воркеров.',
|
'После успешной регистрации обновите список воркеров.',
|
||||||
'resources.worker.container.supported': 'Только для Linux.',
|
'resources.worker.container.supported': 'Только для Linux.',
|
||||||
|
|||||||
@@ -122,5 +122,6 @@ export default {
|
|||||||
'models.form.restart.onerror.tips': '当发生错误时,将自动尝试恢复',
|
'models.form.restart.onerror.tips': '当发生错误时,将自动尝试恢复',
|
||||||
'models.form.check.params': '正在校验配置...',
|
'models.form.check.params': '正在校验配置...',
|
||||||
'models.form.check.passed': '兼容性检查通过',
|
'models.form.check.passed': '兼容性检查通过',
|
||||||
'models.form.check.claims': '该模型大约需要 {vram} 显存和 {ram} 内存。'
|
'models.form.check.claims': '该模型大约需要 {vram} 显存和 {ram} 内存。',
|
||||||
|
'models.form.update.tips': '更改仅在删除并重新创建实例后生效。'
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -42,10 +42,10 @@ export default {
|
|||||||
'resources.table.unified': '统一内存',
|
'resources.table.unified': '统一内存',
|
||||||
'resources.worker.linuxormaxos': 'Linux 或 macOS',
|
'resources.worker.linuxormaxos': 'Linux 或 macOS',
|
||||||
'resources.worker.add.step1':
|
'resources.worker.add.step1':
|
||||||
'获取 token<span class="note-text">(在 Server 上运行)</span>',
|
'获取 Token<span class="note-text">(在 Server 上运行)</span>',
|
||||||
'resources.worker.add.step2': '注册 Worker',
|
'resources.worker.add.step2': '注册 Worker',
|
||||||
'resources.worker.add.step2.tips':
|
'resources.worker.add.step2.tips':
|
||||||
'(在需要添加的 Worker 上运行,<span style="color: #000;font-weight: 600">mytoken</span> 为第一步获取到的 token)',
|
'(在需要添加的 Worker 上运行,<span style="color: #000;font-weight: 600">token</span> 为第一步获取到的 token)',
|
||||||
'resources.worker.add.step3': '成功后,刷新 Worker 列表即可看到新的 Worker',
|
'resources.worker.add.step3': '成功后,刷新 Worker 列表即可看到新的 Worker',
|
||||||
'resources.worker.container.supported': '不支持 macOS 和 Windows',
|
'resources.worker.container.supported': '不支持 macOS 和 Windows',
|
||||||
'resources.worker.current.version': '当前版本为 {version}',
|
'resources.worker.current.version': '当前版本为 {version}',
|
||||||
|
|||||||
@@ -29,8 +29,9 @@ const DivWrapper = styled.div`
|
|||||||
|
|
||||||
const CloseWrapper = styled.div`
|
const CloseWrapper = styled.div`
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 10px;
|
top: 12px;
|
||||||
right: 18px;
|
right: 18px;
|
||||||
|
line-height: 1;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
background-color: var(--ant-color-warning-bg);
|
background-color: var(--ant-color-warning-bg);
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
|
|||||||
onCancel,
|
onCancel,
|
||||||
updateFormInitials: { gpuOptions, isGGUF, data: formData }
|
updateFormInitials: { gpuOptions, isGGUF, data: formData }
|
||||||
} = props || {};
|
} = props || {};
|
||||||
|
const intl = useIntl();
|
||||||
const {
|
const {
|
||||||
setWarningStatus,
|
setWarningStatus,
|
||||||
generateGPUIds,
|
generateGPUIds,
|
||||||
@@ -63,9 +64,9 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
|
|||||||
checkTokenRef,
|
checkTokenRef,
|
||||||
warningStatus
|
warningStatus
|
||||||
} = useCheckCompatibility();
|
} = useCheckCompatibility();
|
||||||
|
|
||||||
const { getRuleMessage } = useAppUtils();
|
const { getRuleMessage } = useAppUtils();
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const intl = useIntl();
|
|
||||||
const localPathCache = useRef<string>('');
|
const localPathCache = useRef<string>('');
|
||||||
const submitAnyway = useRef<boolean>(false);
|
const submitAnyway = useRef<boolean>(false);
|
||||||
|
|
||||||
@@ -353,6 +354,12 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (open && formData) {
|
if (open && formData) {
|
||||||
form.setFieldsValue(formData);
|
form.setFieldsValue(formData);
|
||||||
|
setWarningStatus({
|
||||||
|
show: true,
|
||||||
|
message: intl.formatMessage({
|
||||||
|
id: 'models.form.update.tips'
|
||||||
|
})
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (!open) {
|
if (!open) {
|
||||||
checkTokenRef.current?.cancel?.();
|
checkTokenRef.current?.cancel?.();
|
||||||
@@ -426,17 +433,19 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
|
|||||||
: 0
|
: 0
|
||||||
}
|
}
|
||||||
footer={
|
footer={
|
||||||
<CompatibilityAlert
|
<>
|
||||||
showClose={true}
|
<CompatibilityAlert
|
||||||
onClose={() => {
|
showClose={false}
|
||||||
setWarningStatus({
|
onClose={() => {
|
||||||
show: false,
|
setWarningStatus({
|
||||||
message: ''
|
show: false,
|
||||||
});
|
message: ''
|
||||||
}}
|
});
|
||||||
warningStatus={warningStatus}
|
}}
|
||||||
contentStyle={{ paddingInline: 0 }}
|
warningStatus={warningStatus}
|
||||||
></CompatibilityAlert>
|
contentStyle={{ paddingInline: 0 }}
|
||||||
|
></CompatibilityAlert>
|
||||||
|
</>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<FormContext.Provider
|
<FormContext.Provider
|
||||||
|
|||||||
@@ -228,7 +228,6 @@ export const useGenerateModelFileOptions = () => {
|
|||||||
|
|
||||||
export const useCheckCompatibility = () => {
|
export const useCheckCompatibility = () => {
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
|
|
||||||
const cacheFormValuesRef = useRef<any>({});
|
const cacheFormValuesRef = useRef<any>({});
|
||||||
const checkTokenRef = useRef<any>(null);
|
const checkTokenRef = useRef<any>(null);
|
||||||
const submitAnyway = useRef<boolean>(false);
|
const submitAnyway = useRef<boolean>(false);
|
||||||
|
|||||||
@@ -31,15 +31,15 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
|
|||||||
return commandCode?.registerWorker({
|
return commandCode?.registerWorker({
|
||||||
server: origin,
|
server: origin,
|
||||||
tag: version,
|
tag: version,
|
||||||
token: '${mytoken}',
|
token: '${token}',
|
||||||
workerip: '${myworkerip}'
|
workerip: '${workerip}'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return commandCode?.registerWorker({
|
return commandCode?.registerWorker({
|
||||||
server: origin,
|
server: origin,
|
||||||
tag: `${version}-${activeKey}`,
|
tag: `${version}-${activeKey}`,
|
||||||
token: '${mytoken}',
|
token: '${token}',
|
||||||
workerip: '${myworkerip}'
|
workerip: '${workerip}'
|
||||||
});
|
});
|
||||||
}, [versionInfo, activeKey, props.token]);
|
}, [versionInfo, activeKey, props.token]);
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
|
|||||||
<HighlightCode
|
<HighlightCode
|
||||||
code={addWorkerGuide.mac.registerWorker({
|
code={addWorkerGuide.mac.registerWorker({
|
||||||
server: origin,
|
server: origin,
|
||||||
token: '${mytoken}'
|
token: '${token}'
|
||||||
})}
|
})}
|
||||||
theme="dark"
|
theme="dark"
|
||||||
></HighlightCode>
|
></HighlightCode>
|
||||||
@@ -59,7 +59,7 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
|
|||||||
theme="dark"
|
theme="dark"
|
||||||
code={addWorkerGuide.win.registerWorker({
|
code={addWorkerGuide.win.registerWorker({
|
||||||
server: origin,
|
server: origin,
|
||||||
token: '${mytoken}'
|
token: '${token}'
|
||||||
})}
|
})}
|
||||||
></HighlightCode>
|
></HighlightCode>
|
||||||
<h3 className="m-b-0 m-t-10 font-size-14 font-600">3. {labels.step3}</h3>
|
<h3 className="m-b-0 m-t-10 font-size-14 font-600">3. {labels.step3}</h3>
|
||||||
|
|||||||
Reference in New Issue
Block a user