feat(web): add tools approvals models and images

This commit is contained in:
Wenxin Duan
2026-09-08 10:20:21 +08:00
parent 145033974e
commit 36b6cbac3e
18 changed files with 627 additions and 20 deletions
+60 -1
View File
@@ -48,6 +48,7 @@
.scroll-button { position: sticky; bottom: 8px; left: 50%; width: 38px; height: 38px; border: 1px solid var(--border-strong); border-radius: 50%; background: var(--surface-raised); color: var(--text); box-shadow: var(--shadow); }
.composer-area { padding: 0 clamp(16px, 4vw, 56px) 16px; }
.composer { max-width: 820px; margin: 0 auto; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.composer-dropzone { display: block; }
.composer:focus-within { border-color: #4c7775; }
.composer__input { width: 100%; min-height: 76px; max-height: 190px; resize: none; padding: 16px 18px 8px; border: 0; outline: 0; color: var(--text); background: transparent; line-height: 1.5; }
.composer__input::placeholder { color: #65716f; }
@@ -72,7 +73,65 @@
.state-view--error svg { color: var(--danger); }
.state-view strong { display: block; }
.state-view p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.tool-card { margin: 14px 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.tool-card--write { border-color: #584d32; }
.tool-card__head { min-height: 58px; padding: 10px 12px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.tool-card__head > div { display: grid; gap: 3px; }
.tool-card__icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--accent); background: #17302e; }
.tool-card--write .tool-card__icon { color: var(--warning); background: #332b19; }
.tool-status { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.tool-status--success { color: var(--accent); }
.tool-status--failed { color: var(--danger); }
.tool-status--waiting { color: var(--warning); }
.tool-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--border); }
.tool-summary > div { min-width: 0; padding: 10px 12px; }
.tool-summary > div + div { border-left: 1px solid var(--border); }
.tool-summary dt, .approval-details dt { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.tool-summary dd, .approval-details dd { margin: 5px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; }
.report-summary { padding: 12px; border-top: 1px solid var(--border); }
.report-summary p { margin: 6px 0; max-height: 58px; overflow: hidden; color: var(--muted); font-size: 12px; }
.report-summary code { color: var(--accent); font-size: 10px; }
.dialog-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 20px; background: rgb(0 0 0 / 68%); }
.dialog { width: min(520px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 24px; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 28px 80px rgb(0 0 0 / 58%); }
.dialog h2 { margin: 8px 0 10px; font-size: 22px; }
.dialog > p { color: var(--muted); line-height: 1.6; }
.dialog-icon { width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 13px; }
.dialog-icon--warning { color: var(--warning); background: #322b1b; }
.approval-details { display: grid; gap: 1px; margin: 18px 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.approval-details > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); padding: 10px 12px; background: var(--surface-raised); }
.approval-details dd { margin-top: 0; text-align: right; }
.dialog-actions, .settings-actions, .dialog-title-row { display: flex; align-items: center; }
.dialog-actions { justify-content: flex-end; gap: 8px; }
.dialog-actions .secondary-button { margin-top: 0; }
.dialog-note { margin: 12px 0 0; text-align: right; font-size: 10px; }
.dialog-title-row { justify-content: space-between; }
.dialog-title-row h2 { margin-bottom: 0; }
.settings-dialog { width: min(650px, 100%); }
.settings-intro { margin-bottom: 20px; }
.settings-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.settings-form label { display: grid; gap: 7px; color: var(--muted); font-size: 11px; }
.settings-form input, .settings-form select { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); background: var(--surface-raised); outline: 0; }
.settings-form input:focus, .settings-form select:focus { border-color: #4d8b88; }
.settings-form__wide, .settings-actions, .settings-message, .key-hint { grid-column: 1 / -1; }
.password-field { position: relative; }
.password-field > svg { position: absolute; left: 12px; top: 14px; color: var(--muted); }
.password-field input { padding-left: 40px; padding-right: 48px; }
.password-field button { position: absolute; right: 2px; top: 2px; width: 40px; height: 40px; display: grid; place-items: center; border: 0; color: var(--muted); background: transparent; }
.settings-actions { justify-content: flex-end; gap: 8px; margin-top: 5px; }
.settings-actions .secondary-button { margin-top: 0; }
.settings-message, .key-hint { margin: 0; font-size: 11px; }
.settings-message { color: var(--accent); }
.settings-message--warning { color: var(--warning); }
.image-attachment { display: grid; grid-template-columns: 42px minmax(0, 1fr) 36px; align-items: center; gap: 8px; margin: 10px 10px 0; padding: 7px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-raised); }
.image-attachment__preview { width: 42px; height: 42px; overflow: hidden; display: grid; place-items: center; border: 0; border-radius: 7px; color: var(--muted); background: #101313; }
.image-attachment__preview img { width: 100%; height: 100%; object-fit: cover; }
.image-attachment > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.image-attachment .icon-button { width: 36px; height: 36px; }
.dialog-backdrop--preview { z-index: 30; }
.image-preview-dialog { position: relative; width: min(820px, 100%); max-height: calc(100dvh - 40px); padding: 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); }
.image-preview-dialog .icon-button { position: absolute; z-index: 1; right: 16px; top: 16px; background: rgb(0 0 0 / 70%); color: white; }
.image-preview-dialog img { display: block; width: 100%; max-height: calc(100dvh - 66px); border-radius: 11px; object-fit: contain; }
.spin { animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
@media (max-width: 720px) { .topbar { grid-template-columns: 1fr auto; padding: 0 12px; } .topbar__actions { grid-column: 2; } .thread-viewport { padding: 20px 16px; } .composer-area { padding: 0 10px 10px; } }
@media (max-width: 720px) { .topbar { grid-template-columns: 1fr auto; padding: 0 12px; } .topbar__actions { grid-column: 2; } .thread-viewport { padding: 20px 16px; } .composer-area { padding: 0 10px 10px; } .tool-summary { grid-template-columns: repeat(2, 1fr); } .tool-summary > div + div { border-left: 0; } .settings-form { grid-template-columns: 1fr; } .settings-form > * { grid-column: 1; } .settings-actions { flex-wrap: wrap; } }