fix(style): dark style

This commit is contained in:
jialin
2025-04-29 18:05:43 +08:00
parent e5aa5ace15
commit 954b034b8b
23 changed files with 176 additions and 111 deletions
+12 -14
View File
@@ -1,18 +1,16 @@
import { history } from '@umijs/max';
import { Button, Result } from 'antd';
import { useIntl } from '@umijs/max';
import { Result } from 'antd';
import React from 'react';
const NoFoundPage: React.FC = () => (
<Result
status="404"
title="404"
subTitle="Sorry, the page you visited does not exist."
extra={
<Button type="primary" onClick={() => history.push('/')}>
Back Home
</Button>
}
/>
);
const NoFoundPage: React.FC = () => {
const intl = useIntl();
return (
<Result
status="404"
title="404"
subTitle={intl.formatMessage({ id: 'common.exception.404' })}
/>
);
};
export default NoFoundPage;
@@ -154,6 +154,7 @@ const AddModal: FC<AddModalProps> = (props) => {
const handleOnSelectModel = (item: any, evaluate?: boolean) => {
setSelectedModel(item);
console.log('item.isGGUF=========>', item.isGGUF);
if (!item.isGGUF) {
setIsGGUF(false);
form.current?.form?.resetFields(resetFields);
+2 -1
View File
@@ -489,7 +489,8 @@ export const updateExcludeFields = [
'ollama_library_model_name',
'scheduleType',
'backend',
'gpu_selector'
'gpu_selector',
'categories'
];
export const formFields = [
+2 -1
View File
@@ -1,4 +1,5 @@
import Bg2 from '@/assets/images/bg-2.png';
import GridBg from '@/assets/images/grid_background_1920x1080.png';
import { userAtom } from '@/atoms/user';
import Footer from '@/components/footer';
import useUserSettings from '@/hooks/use-user-settings';
@@ -21,7 +22,7 @@ const Wrapper = styled.div<{ $isDarkTheme: boolean }>`
z-index: -1;
background: ${({ $isDarkTheme }) =>
$isDarkTheme
? `repeating-linear-gradient(45deg, #000, transparent 120px)`
? `url(${GridBg}) center center /cover no-repeat`
: `url(${Bg2}) center center /cover no-repeat`};
opacity: ${({ $isDarkTheme }) => ($isDarkTheme ? 1 : 0.6)};
`;
@@ -80,7 +80,6 @@
width: 100%;
display: flex;
position: relative;
background-color: var(--ant-color-bg-elevated);
border-radius: var(--border-radius-base);
textarea {
+12 -5
View File
@@ -154,8 +154,10 @@ const getWorkerName = (
};
const getModelInfo = (record: ListItem) => {
const source = _.get(modelSourceMap, record.source, '');
if (record.source === modelSourceMap.huggingface_value) {
return {
source: `${source}/${record.huggingface_repo_id}`,
repo_id: record.huggingface_repo_id,
title: `${record.huggingface_repo_id}/${record.huggingface_filename}`,
filename: record.huggingface_filename || record.huggingface_repo_id
@@ -163,6 +165,7 @@ const getModelInfo = (record: ListItem) => {
}
if (record.source === modelSourceMap.modelscope_value) {
return {
source: `${source}/${record.model_scope_model_id}`,
repo_id: record.model_scope_model_id,
title: `${record.model_scope_model_id}/${record.model_scope_file_path}`,
filename: record.model_scope_file_path || record.model_scope_model_id
@@ -170,12 +173,14 @@ const getModelInfo = (record: ListItem) => {
}
if (record.source === modelSourceMap.ollama_library_value) {
return {
source: `${source}/${record.ollama_library_model_name}`,
repo_id: record.ollama_library_model_name,
title: record.ollama_library_model_name,
filename: record.ollama_library_model_name
};
}
return {
source: `${source}${record.local_path}`,
repo_id: record.local_path,
title: record.local_path,
filename: _.split(record.local_path, /[\\/]/).pop()
@@ -551,11 +556,11 @@ const ModelFiles = () => {
},
render: (text: string, record: ListItem) => {
const modelInfo = getModelInfo(record);
const { repo_id } = modelInfo;
const { repo_id, source } = modelInfo;
return (
<TextWrapper>
<AutoTooltip ghost showTitle title={repo_id}>
{_.get(modelSourceMap, record.source, '')}
<TextWrapper style={{ paddingRight: 8 }}>
<AutoTooltip ghost title={source}>
{source}
</AutoTooltip>
</TextWrapper>
);
@@ -586,7 +591,7 @@ const ModelFiles = () => {
{
title: intl.formatMessage({ id: 'resources.modelfiles.form.path' }),
dataIndex: 'resolved_paths',
width: '35%',
width: '30%',
ellipsis: {
showTitle: false
},
@@ -597,6 +602,7 @@ const ModelFiles = () => {
{
title: intl.formatMessage({ id: 'resources.modelfiles.size' }),
dataIndex: 'size',
width: 100,
ellipsis: {
showTitle: false
},
@@ -612,6 +618,7 @@ const ModelFiles = () => {
title: intl.formatMessage({ id: 'common.table.createTime' }),
dataIndex: 'created_at',
sorter: false,
width: 180,
ellipsis: {
showTitle: false
},
+4
View File
@@ -12,6 +12,10 @@ const Wrapper = styled.div`
.ant-page-header-heading {
padding-inline: 8px;
}
.ant-tabs-nav .ant-tabs-tab-active,
.ant-tabs-tab {
background: transparent;
}
`;
const Resources = () => {