chore: add changes tips

This commit is contained in:
jialin
2025-04-08 16:33:19 +08:00
parent c09503aad8
commit 5766a50bc2
15 changed files with 82 additions and 45 deletions
@@ -29,8 +29,9 @@ const DivWrapper = styled.div`
const CloseWrapper = styled.div`
position: absolute;
top: 10px;
top: 12px;
right: 18px;
line-height: 1;
cursor: pointer;
background-color: var(--ant-color-warning-bg);
`;
+21 -12
View File
@@ -56,6 +56,7 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
onCancel,
updateFormInitials: { gpuOptions, isGGUF, data: formData }
} = props || {};
const intl = useIntl();
const {
setWarningStatus,
generateGPUIds,
@@ -63,9 +64,9 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
checkTokenRef,
warningStatus
} = useCheckCompatibility();
const { getRuleMessage } = useAppUtils();
const [form] = Form.useForm();
const intl = useIntl();
const localPathCache = useRef<string>('');
const submitAnyway = useRef<boolean>(false);
@@ -353,6 +354,12 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
useEffect(() => {
if (open && formData) {
form.setFieldsValue(formData);
setWarningStatus({
show: true,
message: intl.formatMessage({
id: 'models.form.update.tips'
})
});
}
if (!open) {
checkTokenRef.current?.cancel?.();
@@ -426,17 +433,19 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
: 0
}
footer={
<CompatibilityAlert
showClose={true}
onClose={() => {
setWarningStatus({
show: false,
message: ''
});
}}
warningStatus={warningStatus}
contentStyle={{ paddingInline: 0 }}
></CompatibilityAlert>
<>
<CompatibilityAlert
showClose={false}
onClose={() => {
setWarningStatus({
show: false,
message: ''
});
}}
warningStatus={warningStatus}
contentStyle={{ paddingInline: 0 }}
></CompatibilityAlert>
</>
}
>
<FormContext.Provider
-1
View File
@@ -228,7 +228,6 @@ export const useGenerateModelFileOptions = () => {
export const useCheckCompatibility = () => {
const intl = useIntl();
const cacheFormValuesRef = useRef<any>({});
const checkTokenRef = useRef<any>(null);
const submitAnyway = useRef<boolean>(false);
@@ -31,15 +31,15 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
return commandCode?.registerWorker({
server: origin,
tag: version,
token: '${mytoken}',
workerip: '${myworkerip}'
token: '${token}',
workerip: '${workerip}'
});
}
return commandCode?.registerWorker({
server: origin,
tag: `${version}-${activeKey}`,
token: '${mytoken}',
workerip: '${myworkerip}'
token: '${token}',
workerip: '${workerip}'
});
}, [versionInfo, activeKey, props.token]);
@@ -50,7 +50,7 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
<HighlightCode
code={addWorkerGuide.mac.registerWorker({
server: origin,
token: '${mytoken}'
token: '${token}'
})}
theme="dark"
></HighlightCode>
@@ -59,7 +59,7 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
theme="dark"
code={addWorkerGuide.win.registerWorker({
server: origin,
token: '${mytoken}'
token: '${token}'
})}
></HighlightCode>
<h3 className="m-b-0 m-t-10 font-size-14 font-600">3. {labels.step3}</h3>