style(settings): 外观与生图服务改用统一分组样式(标题在页面底 + 浅灰容器)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 3m40s

This commit is contained in:
qiqi committed 2026-11-23 21:48:08 +08:00
1 parent 2c2a4313f9
commit b0881bce59
6 files changed
+42 -19

No files matched your search

+1
View File
@@ -772,6 +772,7 @@ L3 Contract ── 组件整体换肤时才加,能不建就不建
- 组内容容器用 `--iwb-set-group-bg` + `--iwb-set-group-radius`,不加外边框
- 容器内行间用 `--iwb-set-divider`;首行不画线
- 说明对齐控件列(缩进 = label-w + col-gap),颜色用 hint-color,不得私自调淡
- 通用 / 外观 / 生图服务等所有设置页统一使用这些分组(不允许各页自写卡片或行样式)
- 新增设置 token 需按 §5.1 提 RFC
---
+13 -10
View File
@@ -444,11 +444,10 @@
el('span', { className: 'iwb-appear-note' }, String(value.sizes[key]) + (unit || '')))
}
const Group = function (title, rows, note) {
return el('section', { className: 'iwb-appear-group' },
el('div', { className: 'iwb-appear-ghead' },
el('span', { className: 'iwb-appear-gtitle' }, title),
note ? el('span', { className: 'iwb-appear-gnote' }, note) : null),
rows)
return el('section', { className: 'iwb-gset-group' },
el('div', { className: 'iwb-gset-group-h' }, title),
note ? el('div', { className: 'iwb-gset-group-desc' }, note) : null,
el('div', { className: 'iwb-gset-group-body' }, rows))
}
const Seg = function (val, onChange, items) {
return el('div', { className: 'iwb-seg' }, (items || []).map((item) => el('button', {
@@ -530,11 +529,15 @@
]
return el('div', { className: 'iwb-appear' },
el('div', { className: 'iwb-appear-mode' },
Seg(theme, (v) => { setTheme(v); applyTheme(v) }, [
{ value: 'light', label: '亮色' }, { value: 'dark', label: '暗色' }, { value: 'system', label: '跟随系统' },
]),
el('span', { className: 'iwb-appear-modehint' }, '正在微调:' + (isDark ? '暗色' : '亮色'))),
Group('主题', [
el('div', { className: 'iwb-appear-row' },
el('span', { className: 'iwb-appear-label' }, '外观模式'),
el('div', { className: 'iwb-appear-ctrl' },
Seg(theme, (v) => { setTheme(v); applyTheme(v) }, [
{ value: 'light', label: '亮色' }, { value: 'dark', label: '暗色' }, { value: 'system', label: '跟随系统' },
])),
el('span', { className: 'iwb-appear-note' }, '正在微调:' + (isDark ? '暗色' : '亮色'))),
]),
Group('配色来源', [
el('div', { className: 'iwb-appear-row' },
+17 -9
View File
@@ -1091,14 +1091,15 @@ function GSetGroup (props) {
: el('span', { className: 'iwb-hint', title: '内置分层模型:唯一实测可用的图层分离模型,不可删除也不可隐藏' }, '内置'),
))
provCards.push(el('div', { key: p.id, className: 'iwb-provider-card' },
el(GSetGroup, { title: '服务' },
el('div', { className: 'iwb-prov-head' },
el('input', { className: 'iwb-input iwb-prov-name', value: p.name || '', placeholder: '服务名称', 'aria-label': '服务名称', onChange: (e) => setProv(pi, { name: e.target.value }) }),
el('span', { className: 'iwb-prov-badge' }, pi === 0 ? '主服务' : '备用服务'),
el('span', { className: 'iwb-prov-sum' }, (1 + (p.fallbacks || []).length) + ' 地址 · ' + (p.models || []).length + ' 模型'),
pi > 0 ? el('button', { className: 'iwb-btn iwb-btn-sm', title: '移到第一位,作为默认服务', onClick: () => makeProviderDefault && makeProviderDefault(pi) }, '设为默认') : null,
el('button', { className: 'iwb-btn iwb-btn-sm iwb-btn-danger', onClick: () => delProv(pi) }, '删除服务'),
),
el('div', { className: 'iwb-section-sub' }, '服务器地址(多条自动切换)'),
)),
el(GSetGroup, { title: '服务器地址', desc: '多条自动切换' },
addrRows,
el('div', { className: 'iwb-row' },
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: () => addAddr(pi) }, '+ 添加地址'),
@@ -1117,30 +1118,37 @@ function GSetGroup (props) {
sp.results.some((r) => r.ok && r.cors === false) ? el('div', { className: 'iwb-hint' }, '有地址未开放跨域读状态码:显示的耗时是「连得上」的估算值,按它排序选最快即可,不影响生图。') : null,
sp.results.length && sp.results.every((r) => !r.ok) && sp.results[0].error ? el('div', { className: 'iwb-hint' }, '全部失败 · ' + String(sp.results[0].error)) : null,
) : null,
el('div', { className: 'iwb-section-sub' }, '接口路径'),
el('div', { className: 'iwb-row' },
),
el(GSetGroup, { title: '接口路径' },
el('div', { className: 'iwb-gset-row' },
el('div', { className: 'iwb-gset-row-label' }, '生图 / 编辑'),
el('div', { className: 'iwb-gset-row-ctl' },
el('input', { className: 'iwb-input iwb-grow', value: p.genPath || '', placeholder: '生图路径,默认 /images/generations', onChange: (e) => setProv(pi, { genPath: e.target.value }) }),
el('input', { className: 'iwb-input iwb-grow', value: p.editPath || '', placeholder: '编辑路径,默认 /images/edits', onChange: (e) => setProv(pi, { editPath: e.target.value }) }),
)),
),
el('div', { className: 'iwb-label' }, 'API Key 分组'),
el(GSetGroup, { title: 'API Key' },
keyRows,
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: () => addKey(pi) }, '+ 添加 Key 分组'),
el('div', { className: 'iwb-section-sub' }, '厂商分类(决定请求体怎么发尺寸)'),
),
el(GSetGroup, { title: '请求分类', desc: '决定请求体怎么发尺寸' },
shapeBox,
el('div', { className: 'iwb-section-sub' }, '模型显隐(生图节点下拉只显示可见项)'),
),
el(GSetGroup, { title: '模型', desc: '生图节点下拉只显示可见项' },
el('div', { className: 'iwb-modellist' }, modelRows.length ? modelRows : el('div', { className: 'iwb-hint' }, '暂无模型 · 手动添加')),
el('div', { className: 'iwb-row' },
el('input', { className: 'iwb-input iwb-grow', placeholder: '手动添加模型名', value: modelInput[pi] || '', onChange: (e) => setModelInput((m) => ({ ...m, [pi]: e.target.value })) }),
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: () => { addModel(pi, (modelInput[pi] || '').trim()); setModelInput((m) => ({ ...m, [pi]: '' })) } }, '+ 添加'),
),
),
// 分层模型区块属于私有功能:开关关闭时整段不渲染(普通用户看不到任何痕迹)
...(wPrivateToolsOn ? [
el('div', { className: 'iwb-section-sub' }, '分层模型(分层节点下拉只显示可见项,与生图模型清单互不影响)'),
el(GSetGroup, { title: '分层模型', desc: '分层节点下拉只显示可见项,与生图模型清单互不影响' },
el('div', { className: 'iwb-modellist' }, layerModelRows.length ? layerModelRows : el('div', { className: 'iwb-hint' }, '暂无分层模型')),
el('div', { className: 'iwb-row' },
el('input', { className: 'iwb-input iwb-grow', placeholder: '手动添加分层模型名(如 doubao-seedream-5-0-pro-260628)', value: layerModelInput[pi] || '', onChange: (e) => setLayerModelInput((m) => ({ ...m, [pi]: e.target.value })) }),
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: () => { addLayerModel(pi, (layerModelInput[pi] || '').trim()); setLayerModelInput((m) => ({ ...m, [pi]: '' })) } }, '+ 添加'),
),
)),
] : []),
))
}
+11
View File
@@ -2356,3 +2356,14 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
/* 组标题与内容容器内的文字左对齐 */
.iwb-gset-group-h,.iwb-gset-group-desc{padding-left:var(--iwb-set-group-pad-x,var(--iwb-space-20))}
/* 外观页:沿用设置面板分组 token */
.iwb-appear{display:flex;flex-direction:column;gap:var(--iwb-set-group-gap)}
.iwb-appear .iwb-gset-group-body .iwb-appear-row{display:grid;grid-template-columns:var(--iwb-set-label-w,180px) minmax(0,1fr) auto;gap:var(--iwb-set-col-gap,var(--iwb-space-16));align-items:center;min-height:var(--iwb-set-row-h,40px);padding:var(--iwb-set-row-pad-y,var(--iwb-space-8)) 0;border-top:1px solid var(--iwb-set-divider);margin:0}
.iwb-appear .iwb-gset-group-body .iwb-appear-row:first-child{border-top:0}
.iwb-appear-label{font-size:var(--iwb-font-md);color:var(--iwb-text);text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* 生图服务:详情不再用卡片,改为多组 gray body */
.iwb-provider-card{background:transparent!important;border:0!important;border-radius:0!important;padding:0!important;display:flex;flex-direction:column;gap:var(--iwb-set-group-gap)}
.iwb-provider-card .iwb-gset-group-body > .iwb-row{padding:var(--iwb-set-row-pad-y,var(--iwb-space-8)) 0;margin:0}
.iwb-provider-card .iwb-gset-group-body > .iwb-row .iwb-addr-tag{min-width:42px}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 89 KiB