mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-25 15:25:50 +00:00
style: clean up whisper model layout
This commit is contained in:
@@ -1868,54 +1868,106 @@
|
|||||||
|
|
||||||
.model-status-card {
|
.model-status-card {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: stretch;
|
||||||
gap: 16px;
|
gap: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.model-info {
|
.model-info {
|
||||||
flex: 1;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 10px;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
|
||||||
|
.model-name-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
.model-name {
|
.model-name {
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: var(--text-primary);
|
color: var(--text-primary);
|
||||||
margin-bottom: 6px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.model-path {
|
.model-size {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 3px 9px;
|
||||||
|
border-radius: 999px;
|
||||||
|
background: color-mix(in srgb, var(--primary) 8%, var(--bg-secondary));
|
||||||
|
color: var(--text-secondary);
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.model-meta {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 4px;
|
align-items: flex-start;
|
||||||
|
gap: 10px;
|
||||||
|
|
||||||
.status-indicator {
|
.status-indicator {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 4px;
|
gap: 4px;
|
||||||
|
width: fit-content;
|
||||||
|
padding: 4px 10px;
|
||||||
|
border-radius: 999px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-weight: 500;
|
font-weight: 600;
|
||||||
|
|
||||||
&.success {
|
&.success {
|
||||||
|
background: rgba(16, 185, 129, 0.1);
|
||||||
|
border: 1px solid rgba(16, 185, 129, 0.2);
|
||||||
color: #10b981;
|
color: #10b981;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.warning {
|
&.warning {
|
||||||
|
background: rgba(245, 158, 11, 0.1);
|
||||||
|
border: 1px solid rgba(245, 158, 11, 0.2);
|
||||||
color: #f59e0b;
|
color: #f59e0b;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.model-path-block {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 6px;
|
||||||
|
padding: 10px 12px;
|
||||||
|
border: 1px solid var(--border-color);
|
||||||
|
border-radius: 12px;
|
||||||
|
background: var(--bg-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.path-label {
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--text-tertiary);
|
||||||
|
letter-spacing: 0.02em;
|
||||||
|
}
|
||||||
|
|
||||||
.path-text {
|
.path-text {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: var(--text-tertiary);
|
color: var(--text-tertiary);
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
word-break: break-all;
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.model-actions {
|
.model-actions {
|
||||||
flex-shrink: 0;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 10px;
|
||||||
|
align-items: flex-start;
|
||||||
|
padding-top: 14px;
|
||||||
|
border-top: 1px solid var(--border-color);
|
||||||
|
|
||||||
.btn-download {
|
.btn-download {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
@@ -1950,16 +2002,18 @@
|
|||||||
.download-status {
|
.download-status {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 6px;
|
gap: 8px;
|
||||||
width: 280px;
|
width: 100%;
|
||||||
|
max-width: 420px;
|
||||||
|
|
||||||
.status-header,
|
.status-header,
|
||||||
.progress-info {
|
.progress-info {
|
||||||
// specific layout class
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center; // Align vertically
|
align-items: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
gap: 12px;
|
||||||
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.percent {
|
.percent {
|
||||||
@@ -1973,6 +2027,7 @@
|
|||||||
.details {
|
.details {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
gap: 6px;
|
gap: 6px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: var(--text-secondary);
|
color: var(--text-secondary);
|
||||||
@@ -2047,10 +2102,12 @@
|
|||||||
.path-selector {
|
.path-selector {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
input {
|
input {
|
||||||
margin-bottom: 0 !important;
|
margin-bottom: 0 !important;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
min-width: 220px;
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1425,6 +1425,8 @@ function SettingsPage({ onClose }: SettingsPageProps = {}) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
const resolvedWhisperModelPath = whisperModelDir || whisperModelStatus?.modelPath || ''
|
||||||
|
|
||||||
const renderModelsTab = () => (
|
const renderModelsTab = () => (
|
||||||
<div className="tab-content">
|
<div className="tab-content">
|
||||||
<div className="form-group">
|
<div className="form-group">
|
||||||
@@ -1439,16 +1441,25 @@ function SettingsPage({ onClose }: SettingsPageProps = {}) {
|
|||||||
<div className="setting-control vertical has-border">
|
<div className="setting-control vertical has-border">
|
||||||
<div className="model-status-card">
|
<div className="model-status-card">
|
||||||
<div className="model-info">
|
<div className="model-info">
|
||||||
<div className="model-name">SenseVoiceSmall (245 MB)</div>
|
<div className="model-name-row">
|
||||||
<div className="model-path">
|
<div className="model-name">SenseVoiceSmall</div>
|
||||||
|
<span className="model-size">245 MB</span>
|
||||||
|
</div>
|
||||||
|
<div className="model-meta">
|
||||||
{whisperModelStatus?.exists ? (
|
{whisperModelStatus?.exists ? (
|
||||||
<span className="status-indicator success"><Check size={14} /> 已安装</span>
|
<span className="status-indicator success"><Check size={14} /> 已安装</span>
|
||||||
) : (
|
) : (
|
||||||
<span className="status-indicator warning">未安装</span>
|
<span className="status-indicator warning">未安装</span>
|
||||||
)}
|
)}
|
||||||
{whisperModelDir && <div className="path-text" title={whisperModelDir}>{whisperModelDir}</div>}
|
{resolvedWhisperModelPath && (
|
||||||
|
<div className="model-path-block">
|
||||||
|
<span className="path-label">模型目录</span>
|
||||||
|
<div className="path-text" title={resolvedWhisperModelPath}>{resolvedWhisperModelPath}</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{(!whisperModelStatus?.exists || isWhisperDownloading) && (
|
||||||
<div className="model-actions">
|
<div className="model-actions">
|
||||||
{!whisperModelStatus?.exists && !isWhisperDownloading && (
|
{!whisperModelStatus?.exists && !isWhisperDownloading && (
|
||||||
<button
|
<button
|
||||||
@@ -1475,6 +1486,7 @@ function SettingsPage({ onClose }: SettingsPageProps = {}) {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="sub-setting">
|
<div className="sub-setting">
|
||||||
|
|||||||
Reference in New Issue
Block a user