feat(web): 主题皮肤系统与 LLM 设置面板重构
- useThemeSkin 重构主题皮肤应用逻辑,支持企业 AI 风格主题切换 - settingsModelHelper 新增主题与模型表字段映射,useSettings 适配 - LlmSettingsPanel/SettingsView 面板重构,支持多模型行编辑与主题区块 - settings-view.css 适配主题样式,新增 settings-theme-section 测试,更新 settings-llm-section 测试
This commit is contained in:
@@ -252,6 +252,331 @@
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.model-config-surface {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.model-table-card > .model-table-wrap {
|
||||
margin-top: 0;
|
||||
padding: 0;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.add-model-button,
|
||||
.secondary-button,
|
||||
.icon-action-button {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 1px solid #cbd5e1;
|
||||
border-radius: 4px;
|
||||
background: #ffffff;
|
||||
color: #334155;
|
||||
font-size: 12.5px;
|
||||
font-weight: 700;
|
||||
transition: all 0.2s ease;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.add-model-button {
|
||||
min-height: 36px;
|
||||
gap: 6px;
|
||||
padding: 0 14px;
|
||||
border-color: var(--theme-primary);
|
||||
background: var(--theme-primary);
|
||||
color: #ffffff;
|
||||
box-shadow: 0 4px 12px rgba(var(--theme-primary-rgb, 58, 124, 165), 0.14);
|
||||
}
|
||||
|
||||
.add-model-button:hover,
|
||||
.secondary-button:hover,
|
||||
.icon-action-button:hover:not(:disabled) {
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.secondary-button {
|
||||
min-height: 36px;
|
||||
padding: 0 16px;
|
||||
}
|
||||
|
||||
.icon-action-button {
|
||||
min-width: 52px;
|
||||
width: auto;
|
||||
height: 32px;
|
||||
padding: 0 10px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.icon-action-button:hover:not(:disabled) {
|
||||
border-color: var(--theme-primary);
|
||||
color: var(--theme-primary-active);
|
||||
background: var(--theme-primary-soft);
|
||||
}
|
||||
|
||||
.icon-action-button.danger:hover:not(:disabled) {
|
||||
border-color: #fecaca;
|
||||
background: #fef2f2;
|
||||
color: #dc2626;
|
||||
}
|
||||
|
||||
.icon-action-button:disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: 0.42;
|
||||
}
|
||||
|
||||
.model-config-table {
|
||||
width: 100%;
|
||||
min-width: 960px;
|
||||
border-collapse: collapse;
|
||||
table-layout: fixed;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.model-config-table th,
|
||||
.model-config-table td {
|
||||
padding: 13px 16px;
|
||||
border-bottom: 1px solid #e2e8f0;
|
||||
color: #334155;
|
||||
font-size: 12.5px;
|
||||
line-height: 1.45;
|
||||
text-align: left;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.model-config-table th {
|
||||
background: #f8fafc;
|
||||
color: #475569;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.model-config-table tbody tr:hover {
|
||||
background: #f8fafc;
|
||||
}
|
||||
|
||||
.model-config-table th:nth-child(1),
|
||||
.model-config-table td:nth-child(1) {
|
||||
width: 132px;
|
||||
}
|
||||
|
||||
.model-config-table th:nth-child(2),
|
||||
.model-config-table td:nth-child(2) {
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
.model-config-table th:nth-child(3),
|
||||
.model-config-table td:nth-child(3) {
|
||||
width: 180px;
|
||||
}
|
||||
|
||||
.model-config-table th:nth-child(5),
|
||||
.model-config-table td:nth-child(5) {
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.model-config-table th:nth-child(6),
|
||||
.model-config-table td:nth-child(6) {
|
||||
width: 180px;
|
||||
}
|
||||
|
||||
.model-action-col,
|
||||
.model-config-table td:last-child {
|
||||
width: 184px;
|
||||
}
|
||||
|
||||
.model-icon-text {
|
||||
color: var(--theme-primary-active);
|
||||
font-size: 13px;
|
||||
font-weight: 900;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.model-type-pill,
|
||||
.secret-state,
|
||||
.test-feedback-inline {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
max-width: 100%;
|
||||
gap: 6px;
|
||||
min-height: 26px;
|
||||
padding: 0 9px;
|
||||
border-radius: 4px;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.model-type-pill {
|
||||
background: var(--theme-primary-soft);
|
||||
color: var(--theme-primary-active);
|
||||
}
|
||||
|
||||
.secret-state {
|
||||
background: #f1f5f9;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.secret-state.configured {
|
||||
background: #ecfdf5;
|
||||
color: #047857;
|
||||
}
|
||||
|
||||
.test-feedback-inline {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.test-feedback-inline.is-idle {
|
||||
background: #f1f5f9;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.test-feedback-inline.is-testing {
|
||||
background: #eff6ff;
|
||||
color: #2563eb;
|
||||
}
|
||||
|
||||
.test-feedback-inline.is-success {
|
||||
background: #ecfdf5;
|
||||
color: #047857;
|
||||
}
|
||||
|
||||
.test-feedback-inline.is-error {
|
||||
background: #fef2f2;
|
||||
color: #dc2626;
|
||||
}
|
||||
|
||||
.model-provider-name,
|
||||
.model-id-text,
|
||||
.model-url-text {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.model-provider-name {
|
||||
color: #0f172a;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.model-id-text {
|
||||
padding: 2px 0;
|
||||
color: #0f172a;
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
||||
font-size: 12px;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.model-url-text {
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.model-row-actions {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.model-dialog-overlay {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 80;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
padding: 24px;
|
||||
background: rgba(15, 23, 42, 0.36);
|
||||
}
|
||||
|
||||
.model-dialog {
|
||||
width: min(720px, 100%);
|
||||
max-height: min(720px, calc(100vh - 48px));
|
||||
display: grid;
|
||||
grid-template-rows: auto minmax(0, 1fr) auto;
|
||||
overflow: hidden;
|
||||
border: 1px solid #cbd5e1;
|
||||
border-radius: 6px;
|
||||
background: #ffffff;
|
||||
box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
|
||||
}
|
||||
|
||||
.model-dialog-head {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
padding: 18px 22px;
|
||||
border-bottom: 1px solid #e2e8f0;
|
||||
background: #f8fafc;
|
||||
}
|
||||
|
||||
.model-dialog-head h4 {
|
||||
margin: 0;
|
||||
color: #0f172a;
|
||||
font-size: 17px;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.model-dialog-head p {
|
||||
margin: 4px 0 0;
|
||||
color: #64748b;
|
||||
font-size: 12.5px;
|
||||
}
|
||||
|
||||
.model-dialog-form {
|
||||
min-height: 0;
|
||||
overflow: auto;
|
||||
padding: 22px;
|
||||
}
|
||||
|
||||
.model-type-segment {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.model-type-segment button {
|
||||
min-height: 40px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 7px;
|
||||
padding: 0 12px;
|
||||
border: 1px solid #cbd5e1;
|
||||
border-radius: 4px;
|
||||
background: #ffffff;
|
||||
color: #475569;
|
||||
font-size: 12.5px;
|
||||
font-weight: 800;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.model-type-segment button.active {
|
||||
border-color: var(--theme-primary);
|
||||
background: var(--theme-primary-soft);
|
||||
color: var(--theme-primary-active);
|
||||
}
|
||||
|
||||
.model-type-segment button:disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: 0.62;
|
||||
}
|
||||
|
||||
.model-dialog-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 10px;
|
||||
padding: 16px 22px;
|
||||
border-top: 1px solid #e2e8f0;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.save-button.compact {
|
||||
min-height: 36px;
|
||||
padding: 0 16px;
|
||||
}
|
||||
|
||||
.profile-grid {
|
||||
grid-template-columns: 96px repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
@@ -387,18 +712,18 @@
|
||||
color: var(--theme-primary-active);
|
||||
}
|
||||
|
||||
.skin-option-grid {
|
||||
.theme-option-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.skin-option {
|
||||
min-height: 104px;
|
||||
.theme-option {
|
||||
min-height: 148px;
|
||||
display: grid;
|
||||
grid-template-columns: auto minmax(0, 1fr) auto;
|
||||
align-items: center;
|
||||
gap: 14px;
|
||||
grid-template-columns: minmax(0, 1fr) auto;
|
||||
align-items: start;
|
||||
gap: 16px;
|
||||
padding: 16px;
|
||||
border: 1px solid #d8dee8;
|
||||
border-radius: 4px;
|
||||
@@ -411,18 +736,19 @@
|
||||
box-shadow 160ms var(--ease);
|
||||
}
|
||||
|
||||
.skin-option:hover,
|
||||
.skin-option.active {
|
||||
.theme-option:hover,
|
||||
.theme-option.active {
|
||||
border-color: var(--primary);
|
||||
background: var(--theme-primary-light-9);
|
||||
background: #ffffff;
|
||||
box-shadow: 0 0 0 3px var(--theme-focus-ring);
|
||||
}
|
||||
|
||||
.skin-swatch {
|
||||
width: 64px;
|
||||
height: 38px;
|
||||
.theme-style-preview {
|
||||
grid-column: 1 / -1;
|
||||
width: 100%;
|
||||
height: 42px;
|
||||
display: grid;
|
||||
grid-template-columns: 1.3fr 1fr 1fr 1fr;
|
||||
grid-template-columns: 1.4fr 1fr 1fr 0.8fr;
|
||||
grid-template-rows: 1fr;
|
||||
border: 1px solid #d8dee8;
|
||||
border-radius: 4px;
|
||||
@@ -430,28 +756,48 @@
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.skin-swatch i + i {
|
||||
.theme-style-preview i + i {
|
||||
border-left: 1px solid rgba(255, 255, 255, 0.72);
|
||||
}
|
||||
|
||||
.skin-copy {
|
||||
.theme-copy {
|
||||
display: grid;
|
||||
gap: 4px;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.skin-copy strong {
|
||||
.theme-copy strong {
|
||||
color: #111827;
|
||||
font-size: 14px;
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.skin-copy small {
|
||||
.theme-copy small {
|
||||
color: #64748b;
|
||||
font-size: 12px;
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
.skin-current {
|
||||
.theme-keywords {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.theme-keywords em {
|
||||
min-height: 22px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 0 8px;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 4px;
|
||||
background: #f8fafc;
|
||||
color: #64748b;
|
||||
font-size: 11px;
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.theme-current {
|
||||
min-height: 24px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
@@ -464,7 +810,7 @@
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.skin-preview-panel {
|
||||
.theme-preview-panel {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
@@ -472,33 +818,56 @@
|
||||
padding: 16px;
|
||||
border: 1px solid #d8dee8;
|
||||
border-radius: 4px;
|
||||
background: linear-gradient(180deg, #ffffff 0%, var(--theme-primary-light-9) 100%);
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.skin-preview-panel div {
|
||||
.theme-preview-panel div {
|
||||
display: grid;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.skin-preview-panel strong {
|
||||
.theme-preview-panel strong {
|
||||
color: #111827;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.skin-preview-panel span {
|
||||
.theme-preview-panel span {
|
||||
color: #64748b;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.skin-preview-action {
|
||||
min-height: 34px;
|
||||
padding: 0 14px;
|
||||
border: 1px solid var(--primary);
|
||||
.theme-preview-surface {
|
||||
width: min(220px, 36%);
|
||||
min-width: 160px;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 44px;
|
||||
gap: 8px;
|
||||
padding: 12px;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 4px;
|
||||
background: #f8fafc;
|
||||
}
|
||||
|
||||
.theme-preview-surface span,
|
||||
.theme-preview-surface i,
|
||||
.theme-preview-surface b {
|
||||
display: block;
|
||||
min-height: 10px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.theme-preview-surface span {
|
||||
grid-column: 1 / -1;
|
||||
background: var(--theme-primary-soft);
|
||||
}
|
||||
|
||||
.theme-preview-surface i {
|
||||
background: #ffffff;
|
||||
border: 1px solid #e2e8f0;
|
||||
}
|
||||
|
||||
.theme-preview-surface b {
|
||||
background: var(--theme-gradient-primary);
|
||||
color: #fff;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.secret-bound-state {
|
||||
|
||||
Reference in New Issue
Block a user