fix(style): add worker

This commit is contained in:
jialin
2025-03-28 19:15:57 +08:00
parent 59d01a6bd9
commit 2079fc1801
10 changed files with 51 additions and 26 deletions
@@ -1,6 +1,6 @@
import HighlightCode from '@/components/highlight-code';
import { useIntl } from '@umijs/max';
import React from 'react';
import React, { useMemo } from 'react';
import { addWorkerGuide } from '../config';
type ViewModalProps = { token: string };
@@ -10,32 +10,41 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
const origin = window.location.origin;
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>1. {intl.formatMessage({ id: 'resources.worker.add.step1' })}</h3>
<h4>{intl.formatMessage({ id: 'resources.worker.linuxormaxos' })}</h4>
<h3 className="font-size-14 font-600">1. {labels.step1}</h3>
<h4 className="font-size-13">{labels.linuxOrMac}</h4>
<HighlightCode
code={addWorkerGuide.mac.getToken}
theme="dark"
></HighlightCode>
<h4 className="m-t-6">Windows </h4>
<h4 className="m-t-6 font-size-13">Windows </h4>
<HighlightCode
code={addWorkerGuide.win.getToken}
theme="dark"
></HighlightCode>
<h3 className="m-t-10">
2. {intl.formatMessage({ id: 'resources.worker.add.step2' })}{' '}
<h3 className="m-t-10 font-size-14 font-600">
2. {labels.step2}{' '}
<span
className="font-size-12"
style={{ color: 'var(--ant-color-text-tertiary)' }}
dangerouslySetInnerHTML={{
__html: `(${intl.formatMessage({
id: 'resources.worker.add.step2.tips'
})})`
__html: `(${labels.step2Tips})`
}}
></span>
</h3>
<h4>{intl.formatMessage({ id: 'resources.worker.linuxormaxos' })}</h4>
<h4 className="font-size-13">{labels.linuxOrMac}</h4>
<HighlightCode
code={addWorkerGuide.mac.registerWorker({
server: origin,
@@ -43,7 +52,7 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
})}
theme="dark"
></HighlightCode>
<h4 className="m-t-6">Windows </h4>
<h4 className="m-t-6 font-size-13">Windows </h4>
<HighlightCode
theme="dark"
code={addWorkerGuide.win.registerWorker({
@@ -51,9 +60,7 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
token: '${mytoken}'
})}
></HighlightCode>
<h3 className="m-b-0 m-t-10">
3. {intl.formatMessage({ id: 'resources.worker.add.step3' })}
</h3>
<h3 className="m-b-0 m-t-10 font-size-14 font-600">3. {labels.step3}</h3>
</div>
);
};