feat: 合并代码后 系统设置 ui样式优化、bug修复、全局统一图标对齐等
This commit is contained in:
@@ -1281,20 +1281,18 @@ export default function ModelCostSettings() {
|
||||
render: (_, row) => (
|
||||
<Space>
|
||||
<Button
|
||||
size='small'
|
||||
theme='borderless'
|
||||
type='tertiary'
|
||||
disabled={historyCount(row) === 0}
|
||||
onClick={() => setHistoryModel(row.model_name)}
|
||||
type='link'
|
||||
size='small'
|
||||
>
|
||||
{t('版本')}({historyCount(row)})
|
||||
</Button>
|
||||
<Button
|
||||
size='small'
|
||||
theme='borderless'
|
||||
type='tertiary'
|
||||
disabled={!row.slots.some((k) => isPositive(slotValue(row, k)))}
|
||||
onClick={() => clearModel(row)}
|
||||
type='link'
|
||||
size='small'
|
||||
>
|
||||
{t('清空')}
|
||||
</Button>
|
||||
@@ -1408,7 +1406,7 @@ export default function ModelCostSettings() {
|
||||
/>
|
||||
<RadioGroup
|
||||
type='button'
|
||||
buttonSize='small'
|
||||
buttonSize='default'
|
||||
value={fillFilter}
|
||||
onChange={(e) => {
|
||||
setFillFilter(e.target.value);
|
||||
@@ -1699,7 +1697,6 @@ export default function ModelCostSettings() {
|
||||
render: (_, r) => (
|
||||
<Space>
|
||||
<Button
|
||||
size='small'
|
||||
onClick={() =>
|
||||
setAdvanced({
|
||||
base: r,
|
||||
@@ -1709,6 +1706,8 @@ export default function ModelCostSettings() {
|
||||
note: r.note || '',
|
||||
})
|
||||
}
|
||||
type='link'
|
||||
size='small'
|
||||
>
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
@@ -1719,7 +1718,7 @@ export default function ModelCostSettings() {
|
||||
)}
|
||||
onConfirm={() => deleteRow(r.id)}
|
||||
>
|
||||
<Button type='danger' size='small'>
|
||||
<Button type='link' size='small' danger>
|
||||
{t('删除')}
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
@@ -1839,9 +1838,6 @@ export default function ModelCostSettings() {
|
||||
title: t('操作'),
|
||||
render: (_, r) => (
|
||||
<Button
|
||||
size='small'
|
||||
theme='light'
|
||||
type='primary'
|
||||
onClick={() => {
|
||||
setUncoveredVisible(false);
|
||||
switchChannel(String(r.channel_id));
|
||||
@@ -1849,6 +1845,8 @@ export default function ModelCostSettings() {
|
||||
setFillFilter('all');
|
||||
setSnapshotTick((v) => v + 1);
|
||||
}}
|
||||
type='link'
|
||||
size='small'
|
||||
>
|
||||
{t('去配置')}
|
||||
</Button>
|
||||
|
||||
@@ -989,9 +989,6 @@ export default function ModelOfficialPriceSettings(props) {
|
||||
width: 90,
|
||||
render: (_, record) => (
|
||||
<Button
|
||||
size='small'
|
||||
theme='borderless'
|
||||
type='tertiary'
|
||||
disabled={
|
||||
!prices[record.model_name] &&
|
||||
!Object.keys(drafts).some((k) =>
|
||||
@@ -999,6 +996,8 @@ export default function ModelOfficialPriceSettings(props) {
|
||||
)
|
||||
}
|
||||
onClick={() => clearModel(record.model_name)}
|
||||
type='link'
|
||||
size='small'
|
||||
>
|
||||
{t('清空')}
|
||||
</Button>
|
||||
|
||||
@@ -30,13 +30,7 @@ import {
|
||||
Checkbox,
|
||||
Tag,
|
||||
} from '@/components/ui';
|
||||
import {
|
||||
IconDelete,
|
||||
IconPlus,
|
||||
IconSearch,
|
||||
IconSave,
|
||||
IconEdit,
|
||||
} from '@/components/ui/icons';
|
||||
import { IconPlus, IconSearch, IconSave } from '@/components/ui/icons';
|
||||
import { API, showError, showSuccess, getQuotaPerUnit } from '../../../helpers';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
@@ -237,16 +231,17 @@ export default function ModelSettingsVisualEditor(props) {
|
||||
key: 'action',
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button onClick={() => editModel(record)} type='link' size='small'>
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
<Button
|
||||
type='primary'
|
||||
icon={<IconEdit />}
|
||||
onClick={() => editModel(record)}
|
||||
></Button>
|
||||
<Button
|
||||
icon={<IconDelete />}
|
||||
type='danger'
|
||||
onClick={() => deleteModel(record.name)}
|
||||
/>
|
||||
type='link'
|
||||
size='small'
|
||||
danger
|
||||
>
|
||||
{t('删除')}
|
||||
</Button>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
|
||||
@@ -17,12 +17,15 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import {
|
||||
RefreshCcw as ActionRefreshCcw,
|
||||
CheckSquare as ActionCheckSquare,
|
||||
} from '@/components/common/icons/ActionIcons';
|
||||
import React, { useState, useCallback, useMemo, useEffect } from 'react';
|
||||
import {
|
||||
Button,
|
||||
Table,
|
||||
Tag,
|
||||
Empty,
|
||||
Checkbox,
|
||||
Form,
|
||||
Input,
|
||||
@@ -31,12 +34,7 @@ import {
|
||||
Modal,
|
||||
} from '@/components/ui';
|
||||
import { IconSearch } from '@/components/ui/icons';
|
||||
import {
|
||||
RefreshCcw,
|
||||
CheckSquare,
|
||||
AlertTriangle,
|
||||
CheckCircle,
|
||||
} from 'lucide-react';
|
||||
import { AlertTriangle, CheckCircle } from 'lucide-react';
|
||||
import {
|
||||
API,
|
||||
showError,
|
||||
@@ -47,10 +45,6 @@ import {
|
||||
import { useIsMobile } from '../../../hooks/common/useIsMobile';
|
||||
import { DEFAULT_ENDPOINT } from '../../../constants';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
IllustrationNoResult,
|
||||
IllustrationNoResultDark,
|
||||
} from '../../../components/common/illustrations';
|
||||
import ChannelSelectorModal from '../../../components/settings/ChannelSelectorModal';
|
||||
|
||||
function ConflictConfirmModal({ t, visible, items, onOk, onCancel }) {
|
||||
@@ -107,9 +101,6 @@ export default function UpstreamRatioSync(props) {
|
||||
const [differences, setDifferences] = useState({});
|
||||
const [resolutions, setResolutions] = useState({});
|
||||
|
||||
// 是否已经执行过同步
|
||||
const [hasSynced, setHasSynced] = useState(false);
|
||||
|
||||
// 分页相关状态
|
||||
const [currentPage, setCurrentPage] = useState(1);
|
||||
const [pageSize, setPageSize] = useState(10);
|
||||
@@ -227,7 +218,6 @@ export default function UpstreamRatioSync(props) {
|
||||
|
||||
setDifferences(differences);
|
||||
setResolutions({});
|
||||
setHasSynced(true);
|
||||
|
||||
if (Object.keys(differences).length === 0) {
|
||||
showSuccess(t('未找到差异化倍率,无需同步'));
|
||||
@@ -428,7 +418,7 @@ export default function UpstreamRatioSync(props) {
|
||||
<div className='flex flex-col md:flex-row justify-between items-center gap-4 w-full'>
|
||||
<div className='flex flex-col md:flex-row gap-2 w-full md:w-auto order-2 md:order-1'>
|
||||
<Button
|
||||
icon={<RefreshCcw size={14} />}
|
||||
icon={<ActionRefreshCcw size={14} />}
|
||||
className='w-full md:w-auto mt-2'
|
||||
onClick={() => {
|
||||
setModalVisible(true);
|
||||
@@ -445,7 +435,7 @@ export default function UpstreamRatioSync(props) {
|
||||
|
||||
return (
|
||||
<Button
|
||||
icon={<CheckSquare size={14} />}
|
||||
icon={<ActionCheckSquare size={14} />}
|
||||
type='secondary'
|
||||
onClick={applySync}
|
||||
disabled={!hasSelections}
|
||||
@@ -543,27 +533,6 @@ export default function UpstreamRatioSync(props) {
|
||||
}, [filteredDataSource]);
|
||||
|
||||
const renderDifferenceTable = () => {
|
||||
if (filteredDataSource.length === 0) {
|
||||
return (
|
||||
<Empty
|
||||
image={<IllustrationNoResult style={{ width: 150, height: 150 }} />}
|
||||
darkModeImage={
|
||||
<IllustrationNoResultDark style={{ width: 150, height: 150 }} />
|
||||
}
|
||||
description={
|
||||
searchKeyword.trim()
|
||||
? t('未找到匹配的模型')
|
||||
: Object.keys(differences).length === 0
|
||||
? hasSynced
|
||||
? t('暂无差异化倍率显示')
|
||||
: t('请先选择同步渠道')
|
||||
: t('请先选择同步渠道')
|
||||
}
|
||||
style={{ padding: 30 }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: t('模型'),
|
||||
|
||||
Reference in New Issue
Block a user