1
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -28,7 +28,7 @@
|
|||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
<script type="module" crossorigin src="/assets/index-Dd-dxmJz.js"></script>
|
<script type="module" crossorigin src="/assets/index-B4COIxz1.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-D7ShJUt4.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-D7ShJUt4.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ const AdminImageEngines: React.FC = () => {
|
|||||||
const values = await form.validateFields();
|
const values = await form.validateFields();
|
||||||
// Build supportedSizes from form values
|
// Build supportedSizes from form values
|
||||||
const sizes: Record<string, Record<string, string>> = {};
|
const sizes: Record<string, Record<string, string>> = {};
|
||||||
for (const tier of ["2K", "4K"]) {
|
for (const tier of ["1K", "2K", "4K"]) {
|
||||||
const selected: string[] = values[`size_${tier}`] || [];
|
const selected: string[] = values[`size_${tier}`] || [];
|
||||||
if (selected.length > 0) {
|
if (selected.length > 0) {
|
||||||
sizes[tier] = {};
|
sizes[tier] = {};
|
||||||
@@ -157,7 +157,7 @@ const AdminImageEngines: React.FC = () => {
|
|||||||
setModal({ open: true, engine: engine || null });
|
setModal({ open: true, engine: engine || null });
|
||||||
if (engine) {
|
if (engine) {
|
||||||
const sizeFields: Record<string, string[]> = {};
|
const sizeFields: Record<string, string[]> = {};
|
||||||
for (const tier of ["2K", "4K"]) {
|
for (const tier of ["1K", "2K", "4K"]) {
|
||||||
sizeFields[`size_${tier}`] = Object.keys(engine.supportedSizes?.[tier] || {});
|
sizeFields[`size_${tier}`] = Object.keys(engine.supportedSizes?.[tier] || {});
|
||||||
}
|
}
|
||||||
form.setFieldsValue({
|
form.setFieldsValue({
|
||||||
@@ -171,6 +171,7 @@ const AdminImageEngines: React.FC = () => {
|
|||||||
supportedModels: ['doubao-seedream-5-0-260128'],
|
supportedModels: ['doubao-seedream-5-0-260128'],
|
||||||
defaultSize: '2K',
|
defaultSize: '2K',
|
||||||
maxImageCount: 0,
|
maxImageCount: 0,
|
||||||
|
size_1K: ALL_RATIOS,
|
||||||
size_2K: ALL_RATIOS,
|
size_2K: ALL_RATIOS,
|
||||||
size_4K: ALL_RATIOS,
|
size_4K: ALL_RATIOS,
|
||||||
});
|
});
|
||||||
@@ -197,6 +198,16 @@ const AdminImageEngines: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '1K 支持比例', key: 'sizes_1k', width: 260,
|
||||||
|
render: (_: any, r: ImageEngine) => {
|
||||||
|
const ratios = Object.keys(r.supportedSizes?.["1K"] || {});
|
||||||
|
if (ratios.length === 0) return <span style={{ color: '#bfbfbf' }}>-</span>;
|
||||||
|
return <Space size={2} wrap>{ratios.map(ratio => (
|
||||||
|
<Tag key={ratio} color="green">{ratio} {r.supportedSizes["1K"][ratio]}</Tag>
|
||||||
|
))}</Space>;
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '2K 支持比例', key: 'sizes_2k', width: 260,
|
title: '2K 支持比例', key: 'sizes_2k', width: 260,
|
||||||
render: (_: any, r: ImageEngine) => {
|
render: (_: any, r: ImageEngine) => {
|
||||||
@@ -304,7 +315,7 @@ const AdminImageEngines: React.FC = () => {
|
|||||||
</Typography.Text>
|
</Typography.Text>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{["2K", "4K"].map(tier => (
|
{["1K", "2K", "4K"].map(tier => (
|
||||||
<div key={tier} style={{
|
<div key={tier} style={{
|
||||||
background: '#fafbfc', borderRadius: 10, padding: '12px 16px',
|
background: '#fafbfc', borderRadius: 10, padding: '12px 16px',
|
||||||
marginBottom: 12, border: '1px solid #f0f0f5',
|
marginBottom: 12, border: '1px solid #f0f0f5',
|
||||||
@@ -328,6 +339,7 @@ const AdminImageEngines: React.FC = () => {
|
|||||||
|
|
||||||
<Form.Item name="defaultSize" label="默认尺寸档位">
|
<Form.Item name="defaultSize" label="默认尺寸档位">
|
||||||
<Select size="large" options={[
|
<Select size="large" options={[
|
||||||
|
{ value: '1K', label: '1K' },
|
||||||
{ value: '2K', label: '2K' },
|
{ value: '2K', label: '2K' },
|
||||||
{ value: '4K', label: '4K' },
|
{ value: '4K', label: '4K' },
|
||||||
]} />
|
]} />
|
||||||
|
|||||||
Reference in New Issue
Block a user