style: add worker content

main
jialin 2 years ago
parent f462e11ae2
commit 9c9b35ff9b

@ -11,7 +11,7 @@
}
&::-webkit-scrollbar-thumb {
background-color: rgba(211, 211, 220, 100%);
background-color: rgba(211, 211, 220, 50%);
border-radius: 6px;
&:hover {

@ -506,6 +506,7 @@ body {
z-index: -1;
background: url('@/assets/images/bg-2.png') center center no-repeat;
background-size: cover;
opacity: 0.6;
}
.ant-pro-page-container {

@ -22,6 +22,8 @@ export default {
'resources.table.unified': 'Unified Memory',
'resources.worker.add.step1': 'Get Token',
'resources.worker.add.step2': 'Register Worker',
'resources.worker.add.step2.tips':
'Note: <span style="color: #000;font-weight: 600">mytoken</span> is the token obtained in the first step.',
'resources.worker.add.step3':
'Refresh worker list, you can see the newly added worker'
'Refresh workers list, you can see the newly added worker.'
};

@ -22,5 +22,7 @@ export default {
'resources.table.unified': '统一内存',
'resources.worker.add.step1': '获取 Token',
'resources.worker.add.step2': '注册 Worker',
'resources.worker.add.step3': '刷新 worker 列表,可以看到新添加的 worker'
'resources.worker.add.step2.tips':
'注意:<span style="color: #000;font-weight: 600">mytoken</span> 为第一步获取到的 Token',
'resources.worker.add.step3': '刷新 workers 列表,可以看到新添加的 worker'
};

@ -195,7 +195,7 @@ const LoginForm = () => {
/>
</Form.Item>
<Form.Item noStyle name="autoLogin" valuePropName="checked">
<Checkbox style={{ marginLeft: 5, marginBottom: 12 }}>
<Checkbox style={{ marginLeft: 5, marginBottom: 16 }}>
<span style={{ color: 'var(--ant-color-text-secondary)' }}>
{' '}
{intl.formatMessage({ id: 'common.login.rember' })}
@ -206,7 +206,7 @@ const LoginForm = () => {
htmlType="submit"
type="primary"
block
style={{ height: '54px', fontSize: '16px' }}
style={{ height: '48px', fontSize: '14px' }}
>
{intl.formatMessage({ id: 'common.button.login' })}
</Button>

@ -116,7 +116,7 @@ const PasswordForm: React.FC = () => {
htmlType="submit"
type="primary"
block
style={{ height: '54px', fontSize: '16px', marginTop: 10 }}
style={{ height: '48px', fontSize: '14px', marginTop: 10 }}
>
{intl.formatMessage({ id: 'common.button.submit' })}
</Button>

@ -48,14 +48,8 @@ const ReferenceParams = (props: ReferenceParamsProps) => {
<Tooltip
title={
<Space>
<span>
{intl.formatMessage({ id: 'playground.timePerOutputToken' })}:{' '}
{_.round(usage.time_per_output_token_ms, 2)} ms
</span>
<span>
{intl.formatMessage({ id: 'playground.timeToFirstToken' })}:{' '}
{_.round(usage.time_to_first_token_ms, 2)} ms
</span>
<span>TPOT: {_.round(usage.time_per_output_token_ms, 2)} ms</span>
<span>TTFT: {_.round(usage.time_to_first_token_ms, 2)} ms</span>
</Space>
}
>

@ -74,7 +74,7 @@ const ViewCodeModal: React.FC<ViewModalProps> = (props) => {
const systemList = systemMessage
? [{ role: 'system', content: systemMessage }]
: [];
const code = `const OpenAI = require("openai");\n\nconst openai = new OpenAI({\n "apiKey": "YOUR_GPUSTACK_API_KEY",\n "baseURL": "${BaseURL}"\n});\n\n\nasync function main(){\n const params = ${JSON.stringify(
const code = `const OpenAI = require("openai");\n\nconst openai = new OpenAI({\n "apiKey": "YOUR_GPUSTACK_API_KEY",\n "baseURL": "${BaseURL}"\n});\n\nasync function main(){\n const params = ${JSON.stringify(
{
...parameters,
messages: [
@ -194,24 +194,6 @@ const ViewCodeModal: React.FC<ViewModalProps> = (props) => {
language={lang}
value={codeValue}
options={editorConfig}
overrideServices={{
quickSuggestions: {
other: false,
comments: false,
strings: false
},
disableLayerHinting: true,
languages: {
typescript: {
moduleKind: '2',
diagnosticsOptions: {
noSemanticValidation: false,
noSyntaxValidation: false,
diagnosticCodesToIgnore: [80001]
}
}
}
}}
beforeMount={handleBeforeMount}
onMount={handleEditorDidMount}
/>

@ -34,7 +34,18 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
<HighlightCode code={addWorkerGuide.mac.getToken}></HighlightCode>
<h4>Windows </h4>
<HighlightCode code={addWorkerGuide.win.getToken}></HighlightCode>
<h3>2. {intl.formatMessage({ id: 'resources.worker.add.step2' })}</h3>
<h3>
2. {intl.formatMessage({ id: 'resources.worker.add.step2' })}{' '}
<span
className="font-size-12"
style={{ color: 'var(--ant-color-text-tertiary)' }}
dangerouslySetInnerHTML={{
__html: `(${intl.formatMessage({
id: 'resources.worker.add.step2.tips'
})})`
}}
></span>
</h3>
<h4>Linux Or MacOS </h4>
<HighlightCode
code={addWorkerGuide.mac.registerWorker(origin)}

Loading…
Cancel
Save