@@ -5,10 +5,8 @@ import {
55 History ,
66 Play ,
77 RefreshCw ,
8- Save ,
98 ShieldCheck ,
109 Shuffle ,
11- SlidersHorizontal ,
1210 Split ,
1311 X ,
1412 Zap ,
@@ -45,7 +43,6 @@ interface ChannelRoutingWorkbenchProps {
4543 onModeChange : ( mode : ChannelRouteMode ) => void ;
4644 onShadowEnabledChange : ( enabled : boolean ) => void ;
4745 onShadowModeChange : ( mode : ChannelRouteMode ) => void ;
48- onSave : ( ) => void ;
4946 onExplain : ( ) => void ;
5047 onRefreshEvents ?: ( ) => void ;
5148}
@@ -76,7 +73,6 @@ export default function ChannelRoutingWorkbench({
7673 onModeChange,
7774 onShadowEnabledChange,
7875 onShadowModeChange,
79- onSave,
8076 onExplain,
8177 onRefreshEvents,
8278} : ChannelRoutingWorkbenchProps ) {
@@ -85,7 +81,6 @@ export default function ChannelRoutingWorkbench({
8581 const legacyMask = buildLegacyRoutingMaskPanel ( ) ;
8682 const eventSummaries = routeEvents . slice ( 0 , 5 ) . map ( ( event ) => buildChannelRouteAuditEventSummary ( event ) ) ;
8783 const hasExplain = explainView . hasExplain ;
88- const routeModeLabel = resolveRouteModeLabel ( config . routeMode ) ;
8984 const shadowPanelLabel = config . shadowEnabled ? ( hasExplain ? explainView . shadowLabel : '开启' ) : '关闭' ;
9085 const shadowPanelMeta = config . shadowEnabled && hasExplain ? explainView . shadowMeta : '' ;
9186 const participantRows = buildChannelRoutingParticipantRows ( config , accounts ) ;
@@ -114,53 +109,34 @@ export default function ChannelRoutingWorkbench({
114109 aria-label = { `${ channel } 请求模式` }
115110 className = "overflow-hidden border-2 border-[var(--border-color)] bg-[var(--bg-main)]"
116111 >
117- < header className = "flex flex-wrap items-center justify-between gap-3 p-4" >
118- < div className = "flex min-w-0 items-center gap-2" >
119- < Zap className = "h-4 w-4 shrink-0 text-[var(--text-secondary)]" strokeWidth = { 3 } />
120- < h2 className = "min-w-0 text-[length:var(--font-size-ui-lg)] font-black leading-5 tracking-[0] text-[var(--text-primary)] sm:text-[length:var(--font-size-heading-sm)] sm:leading-normal" >
121- 请求模式
122- </ h2 >
123- < button
124- type = "button"
125- onClick = { ( ) => setHelpOpen ( true ) }
126- aria-label = "查看请求模式说明"
127- title = "查看请求模式说明"
128- aria-pressed = { helpOpen }
129- className = { `flex h-8 w-8 shrink-0 items-center justify-center border-2 transition-colors active:scale-95 ${
130- helpOpen
131- ? 'border-[var(--text-primary)] bg-[var(--text-primary)] text-[var(--bg-main)]'
132- : 'border-[var(--border-color)] bg-[var(--bg-main)] text-[var(--text-primary)] [@media(hover:hover)]:hover:border-[var(--text-primary)]'
133- } `}
134- >
135- < CircleHelp className = "h-4 w-4" strokeWidth = { 4 } />
136- </ button >
137- { preview ? (
138- < span className = "font-mono text-[length:var(--font-size-ui-2xs)] font-black uppercase tracking-wide text-[var(--text-muted)]" >
139- 预览
140- </ span >
141- ) : null }
142- </ div >
143- < button
144- type = "button"
145- onClick = { onSave }
146- disabled = { disabled || saving }
147- className = "btn-swiss flex min-h-10 items-center gap-2 !px-3 !py-2 !text-[length:var(--font-size-ui-sm)]"
148- >
149- < Save className = "h-3.5 w-3.5" strokeWidth = { 4 } />
150- { saving ? '保存中' : '保存' }
151- </ button >
152- </ header >
153-
154- < div className = "border-t-2 border-[var(--border-color)]" >
155- < section className = "min-w-0 p-4" >
156- < div className = "flex flex-wrap items-center justify-between gap-2" >
157- < SectionHeading icon = { SlidersHorizontal } label = "当前模式" />
158- < span className = "font-mono text-[length:var(--font-size-ui-2xs)] font-black uppercase tracking-wide text-[var(--text-muted)]" >
159- { routeModeLabel }
160- </ span >
112+ < header className = "p-4" >
113+ < div className = "flex min-w-0 flex-wrap items-center justify-between gap-3" >
114+ < div className = "flex min-w-0 items-center gap-2" >
115+ < Zap className = "h-4 w-4 shrink-0 text-[var(--text-secondary)]" strokeWidth = { 3 } />
116+ < h2 className = "min-w-0 text-[length:var(--font-size-ui-lg)] font-black leading-5 tracking-[0] text-[var(--text-primary)] sm:text-[length:var(--font-size-heading-sm)] sm:leading-normal" >
117+ 请求模式
118+ </ h2 >
119+ < button
120+ type = "button"
121+ onClick = { ( ) => setHelpOpen ( true ) }
122+ aria-label = "查看请求模式说明"
123+ title = "查看请求模式说明"
124+ aria-pressed = { helpOpen }
125+ className = { `flex h-8 w-8 shrink-0 items-center justify-center border-2 transition-colors active:scale-95 ${
126+ helpOpen
127+ ? 'border-[var(--text-primary)] bg-[var(--text-primary)] text-[var(--bg-main)]'
128+ : 'border-[var(--border-color)] bg-[var(--bg-main)] text-[var(--text-primary)] [@media(hover:hover)]:hover:border-[var(--text-primary)]'
129+ } `}
130+ >
131+ < CircleHelp className = "h-4 w-4" strokeWidth = { 4 } />
132+ </ button >
133+ { preview ? (
134+ < span className = "font-mono text-[length:var(--font-size-ui-2xs)] font-black uppercase tracking-wide text-[var(--text-muted)]" >
135+ 预览
136+ </ span >
137+ ) : null }
161138 </ div >
162-
163- < div className = "mt-3 grid gap-2 sm:grid-cols-2" >
139+ < div className = "grid min-w-0 flex-1 gap-2 sm:max-w-[28rem] sm:flex-none sm:grid-cols-2" >
164140 { routeModes . map ( ( item ) => (
165141 < StrategyButton
166142 key = { item . mode }
@@ -169,13 +145,15 @@ export default function ChannelRoutingWorkbench({
169145 label = { item . label }
170146 cue = { item . cue }
171147 active = { config . routeMode === item . mode }
172- disabled = { disabled }
148+ disabled = { disabled || saving }
173149 onModeChange = { onModeChange }
174150 />
175151 ) ) }
176152 </ div >
177- </ section >
153+ </ div >
154+ </ header >
178155
156+ < div className = "border-t-2 border-[var(--border-color)]" >
179157 < details className = "group/participants min-w-0 border-t-2 border-[var(--border-color)] p-4" >
180158 < summary className = "flex cursor-pointer list-none items-center justify-between gap-2 [&::-webkit-details-marker]:hidden" >
181159 < SectionHeading icon = { Split } label = "参与账号" />
@@ -381,14 +359,14 @@ function StrategyButton({
381359 onClick = { ( ) => onModeChange ( mode ) }
382360 disabled = { disabled }
383361 aria-pressed = { active }
384- className = { `grid min-h-14 grid-cols-[1.75rem_minmax (0,1fr)_auto] items-center gap-3 border-2 px-3 py-2 text-left transition-colors active:scale-[0.98] ${
362+ className = { `grid min-h-10 grid-cols-[1.5rem_minmax (0,1fr)_auto] items-center gap-2 border-2 px-3 py-2 text-left transition-colors active:scale-[0.98] ${
385363 active
386364 ? 'border-[var(--text-primary)] bg-[var(--text-primary)] text-[var(--bg-main)]'
387365 : 'border-[var(--border-color)] bg-[var(--bg-main)] text-[var(--text-primary)] [@media(hover:hover)]:hover:border-[var(--text-primary)]'
388366 } `}
389367 >
390- < Icon className = "h-4 w-4 shrink-0" strokeWidth = { 4 } />
391- < span className = "min-w-0 text-[length:var(--font-size-ui-md )] font-black" > { label } </ span >
368+ < Icon className = "h-3.5 w-3.5 shrink-0" strokeWidth = { 4 } />
369+ < span className = "min-w-0 truncate text-[length:var(--font-size-ui-sm )] font-black" > { label } </ span >
392370 < span
393371 className = { `min-w-0 truncate font-mono text-[length:var(--font-size-ui-2xs)] font-black uppercase tracking-wide ${
394372 active ? 'text-[var(--bg-main)]/75' : 'text-[var(--text-muted)]'
0 commit comments