修改文案

main
陈博文 3 weeks ago
parent 5d20921a32
commit 9f7ec74b0e

@ -86,6 +86,8 @@ html {
--ant-line-type: solid; --ant-line-type: solid;
--ant-line-width: 1px; --ant-line-width: 1px;
--color-esc-hint-bg: rgba(0, 0, 0, 75%); --color-esc-hint-bg: rgba(0, 0, 0, 75%);
--color-menu-title: #000;
} }
html[data-theme='realDark'] { html[data-theme='realDark'] {
@ -102,6 +104,7 @@ html[data-theme='realDark'] {
--color-modal-box-shadow: none; --color-modal-box-shadow: none;
--color-spotlight-bg: #3e3e3e; --color-spotlight-bg: #3e3e3e;
--color-esc-hint-bg: rgba(150, 150, 150, 75%); --color-esc-hint-bg: rgba(150, 150, 150, 75%);
--color-menu-title: rgba(255, 255, 255, 0.65);
background: #141414; background: #141414;

@ -1,10 +1,14 @@
// @ts-nocheck // @ts-nocheck
import SmallLogo from '@/assets/images/small-logo-200x200.png'; import SmallLogo from '@/assets/images/small-logo-200x200.png';
import React from 'react'; import React from 'react';
import { useIntl } from '@umijs/max';
const LogoIcon: React.FC = () => { const LogoIcon: React.FC = () => {
const intl = useIntl();
// return <img src={GpustackLogo} alt="logo" style={{ height: 16 }} />; // return <img src={GpustackLogo} alt="logo" style={{ height: 16 }} />;
return <b className="font-size-20"></b>; return <b style={{ color: 'var(--color-menu-title)' }} className="font-size-20">{intl.formatMessage({ id: 'menu.title', defaultMessage: '资源管理' })}</b>;
}; };
const SLogoIcon: React.FC = () => { const SLogoIcon: React.FC = () => {
return <img src={SmallLogo} alt="logo" style={{ height: 24 }} />; return <img src={SmallLogo} alt="logo" style={{ height: 24 }} />;

@ -1,4 +1,5 @@
export default { export default {
'menu.title': 'Resource Management',
'menu.dashboard': 'Dashboard', 'menu.dashboard': 'Dashboard',
'menu.playground': 'Playground', 'menu.playground': 'Playground',
'menu.playground.rerank': 'Rerank', 'menu.playground.rerank': 'Rerank',

@ -1,4 +1,5 @@
export default { export default {
'models.running': 'Running Model',
'models.button.deploy': 'Deploy Model', 'models.button.deploy': 'Deploy Model',
'models.title': 'Models', 'models.title': 'Models',
'models.title.edit': 'Edit Model', 'models.title.edit': 'Edit Model',

@ -1,6 +1,6 @@
export default { export default {
'dashboard.title': '概览', 'dashboard.title': '概览',
'dashboard.workers': 'Workers', 'dashboard.workers': '节点',
'dashboard.models': '模型', 'dashboard.models': '模型',
'dashboard.totalgpus': 'GPUs', 'dashboard.totalgpus': 'GPUs',
'dashboard.allocategpus': '已分配 GPU 数量', 'dashboard.allocategpus': '已分配 GPU 数量',

@ -1,4 +1,5 @@
export default { export default {
'menu.title': '资源管理',
'menu.dashboard': '概览', 'menu.dashboard': '概览',
'menu.playground': '试验场', 'menu.playground': '试验场',
'menu.playground.rerank': '重排', 'menu.playground.rerank': '重排',
@ -20,9 +21,9 @@ export default {
'menu.login': '登录', 'menu.login': '登录',
'menu.usage': '使用量', 'menu.usage': '使用量',
'menu.404': '404', 'menu.404': '404',
'menu.resources.workers': 'Workers', 'menu.resources.workers': '节点',
'menu.resources.gpus': 'GPUs', 'menu.resources.gpus': 'GPUs',
'menu.resources.modelfiles': '模型文件', 'menu.resources.modelfiles': '大模型仓库',
'menu.accessControl': '访问控制', 'menu.accessControl': '访问控制',
'menu.accessControl.apikeys': 'API 密钥', 'menu.accessControl.apikeys': 'API 密钥',
'menu.accessControl.users': '用户' 'menu.accessControl.users': '用户'

@ -1,4 +1,5 @@
export default { export default {
'models.running': '正在运行的模型',
'models.button.deploy': '部署模型', 'models.button.deploy': '部署模型',
'models.title': '模型', 'models.title': '模型',
'models.title.edit': '编辑模型', 'models.title.edit': '编辑模型',

@ -1,6 +1,6 @@
export default { export default {
'resources.title': '资源', 'resources.title': '资源',
'resources.button.create': '添加 Worker', 'resources.button.create': '添加 节点',
'resources.button.edit': '编辑 Worker', 'resources.button.edit': '编辑 Worker',
'resources.button.edittags': '编辑标签', 'resources.button.edittags': '编辑标签',
'resources.button.update': '更新标签', 'resources.button.update': '更新标签',
@ -28,7 +28,7 @@ export default {
'resources.table.disk': '磁盘', 'resources.table.disk': '磁盘',
'resources.table.vram': '显存', 'resources.table.vram': '显存',
'resources.table.index': '序号', 'resources.table.index': '序号',
'resources.table.workername': '节点名称', 'resources.table.workername': '节点IP',
'resources.table.vender': '厂商', 'resources.table.vender': '厂商',
'resources.table.temperature': '温度', 'resources.table.temperature': '温度',
'resources.table.core': '核数', 'resources.table.core': '核数',
@ -57,7 +57,7 @@ export default {
'resources.worker.cann.tips': 'resources.worker.cann.tips':
'按需要挂载的 NPU index 设置 <span class="bold-text">--device /dev/davinci{index}</span>,如需挂载 NPU0 - NPU1则添加 <span class="bold-text">--device /dev/davinci0 --device /dev/davinci1</span>', '按需要挂载的 NPU index 设置 <span class="bold-text">--device /dev/davinci{index}</span>,如需挂载 NPU0 - NPU1则添加 <span class="bold-text">--device /dev/davinci0 --device /dev/davinci1</span>',
'resources.modelfiles.form.path': '存储路径', 'resources.modelfiles.form.path': '存储路径',
'resources.modelfiles.modelfile': '模型文件', 'resources.modelfiles.modelfile': '大模型仓库',
'resources.modelfiles.download': '添加模型文件', 'resources.modelfiles.download': '添加模型文件',
'resources.modelfiles.size': '文件大小', 'resources.modelfiles.size': '文件大小',
'resources.modelfiles.selecttarget': '选择目标位置', 'resources.modelfiles.selecttarget': '选择目标位置',

@ -34,10 +34,10 @@ const Overview: React.FC = () => {
value: value:
| number | number
| { | {
healthy: number; healthy: number;
warning: number; warning: number;
error: number; error: number;
} }
) => { ) => {
if (typeof value === 'number') { if (typeof value === 'number') {
return value; return value;
@ -63,7 +63,7 @@ const Overview: React.FC = () => {
key={config.key} key={config.key}
> >
{renderCardItem({ {renderCardItem({
label: intl.formatMessage({ id: config.label }), label: intl.formatMessage({ id: config.label, defaultMessage: index === 3 ? "正在运行的模型" : undefined }),
value: renderValue(_.get(data, config.key, 0)), value: renderValue(_.get(data, config.key, 0)),
bgColor: config.backgroundColor bgColor: config.backgroundColor
})} })}

@ -17,7 +17,7 @@ export const overviewConfigs = [
}, },
{ {
key: 'model_instance_count', key: 'model_instance_count',
label: 'models.form.replicas', label: 'models.running',
backgroundColor: 'var(--color-white-1)' backgroundColor: 'var(--color-white-1)'
} }
]; ];

@ -207,13 +207,13 @@ const InstanceStatusTag = (props: { data: ListItem }) => {
statusValue={{ statusValue={{
status: status:
data.state === ModelfileStateMap.Downloading && data.state === ModelfileStateMap.Downloading &&
data.download_progress === 100 data.download_progress === 100
? ModelfileState[ModelfileStateMap.Ready] ? ModelfileState[ModelfileStateMap.Ready]
: ModelfileState[data.state], : ModelfileState[data.state],
text: ModelfileStateMapValue[data.state], text: ModelfileStateMapValue[data.state],
message: message:
data.state === ModelfileStateMap.Downloading && data.state === ModelfileStateMap.Downloading &&
data.download_progress === 100 data.download_progress === 100
? '' ? ''
: data.state_message : data.state_message
}} }}
@ -391,9 +391,9 @@ const ModelFiles = () => {
let name = _.toLower( let name = _.toLower(
_.split( _.split(
record.huggingface_repo_id || record.huggingface_repo_id ||
record.ollama_library_model_name || record.ollama_library_model_name ||
record.model_scope_model_id || record.model_scope_model_id ||
record.local_path, record.local_path,
/[\\/]/ /[\\/]/
).pop() ).pop()
); );
@ -406,8 +406,8 @@ const ModelFiles = () => {
local_path: record.resolved_paths?.[0], local_path: record.resolved_paths?.[0],
worker_selector: targetWorker worker_selector: targetWorker
? { ? {
'worker-name': targetWorker 'worker-name': targetWorker
} }
: {}, : {},
name: extractFileName(name), name: extractFileName(name),
backend: checkCurrentbackend({ backend: checkCurrentbackend({
@ -567,19 +567,30 @@ const ModelFiles = () => {
); );
} }
}, },
// {
// title: 'Worker',
// dataIndex: 'worker_name',
// ellipsis: {
// showTitle: false
// },
// render: (text: string, record: ListItem) => {
// return (
// <AutoTooltip ghost>
// <span>{getWorkerName(record.worker_id, workersList)}</span>
// </AutoTooltip>
// );
// }
// },
{ {
title: 'Worker', title: intl.formatMessage({ id: 'models.table.name' }),
dataIndex: 'worker_name', dataIndex: 'resolved_paths',
width: '30%',
ellipsis: { ellipsis: {
showTitle: false showTitle: false
}, },
render: (text: string, record: ListItem) => { render: (text: string, record: ListItem) => (
return ( <ResolvedPathColumn record={record} />
<AutoTooltip ghost> )
<span>{getWorkerName(record.worker_id, workersList)}</span>
</AutoTooltip>
);
}
}, },
{ {
title: intl.formatMessage({ id: 'common.table.status' }), title: intl.formatMessage({ id: 'common.table.status' }),
@ -589,17 +600,6 @@ const ModelFiles = () => {
return <InstanceStatusTag data={record} />; return <InstanceStatusTag data={record} />;
} }
}, },
{
title: intl.formatMessage({ id: 'resources.modelfiles.form.path' }),
dataIndex: 'resolved_paths',
width: '30%',
ellipsis: {
showTitle: false
},
render: (text: string, record: ListItem) => (
<ResolvedPathColumn record={record} />
)
},
{ {
title: intl.formatMessage({ id: 'resources.modelfiles.size' }), title: intl.formatMessage({ id: 'resources.modelfiles.size' }),
dataIndex: 'size', dataIndex: 'size',

@ -207,7 +207,7 @@ const Workers: React.FC = () => {
<PageContainer <PageContainer
ghost ghost
header={{ header={{
title: 'Workers', title: intl.formatMessage({ id: 'menu.resources.workers' }),
style: { style: {
paddingInline: 'var(--layout-content-header-inlinepadding)' paddingInline: 'var(--layout-content-header-inlinepadding)'
}, },

Loading…
Cancel
Save