@@ -15,6 +15,7 @@ import {
1515 type ApplicationGatewaySnapshot ,
1616} from "../../app/context.ts" ;
1717import { loadSettings } from "../../app/settings.ts" ;
18+ import { renderHubTabs } from "../../components/hub-tabs.ts" ;
1819import { renderSettingsWorkspace } from "../../components/settings-workspace.ts" ;
1920import { t } from "../../i18n/index.ts" ;
2021import { isMissingOperatorReadScopeError } from "../../lib/gateway-errors.ts" ;
@@ -358,38 +359,29 @@ class ActivityPage extends OpenClawLightDomElement {
358359 } ) ;
359360 const mode = this . routeData ?. mode ?? "live" ;
360361 const body = html `
361- < div
362- class ="activity-mode-tabs "
363- role ="tablist "
364- aria-label =${ t ( "activity.runInspector.activityView" ) }
365- >
366- < button
367- type ="button "
368- role ="tab "
369- aria-selected =${ mode === "live" ? "true" : "false" }
370- aria-controls ="activity-live-panel"
371- @click=${ ( ) => this . selectMode ( "live" ) }
372- >
373- ${ t ( "activity.runInspector.liveMode" ) }
374- </ button >
375- < button
376- type ="button "
377- role ="tab "
378- aria-selected =${ mode === "run" ? "true" : "false" }
379- aria-controls ="activity-run-panel"
380- @click=${ ( ) => this . selectMode ( "run" ) }
381- >
382- ${ t ( "activity.runInspector.mode" ) }
383- </ button >
362+ ${ renderHubTabs ( {
363+ id : "activity-mode" ,
364+ active : mode ,
365+ tabs : [
366+ { value : "live" , label : t ( "activity.runInspector.liveMode" ) } ,
367+ { value : "run" , label : t ( "activity.runInspector.mode" ) } ,
368+ ] ,
369+ ariaLabel : t ( "activity.runInspector.activityView" ) ,
370+ panelId : "activity-mode-panel" ,
371+ className : "activity-mode-tabs" ,
372+ variant : "sub" ,
373+ onSelect : ( selected ) => this . selectMode ( selected ) ,
374+ } ) }
375+ < div id ="activity-mode-panel ">
376+ ${ mode === "run"
377+ ? renderRunInspector ( {
378+ basePath : this . context . basePath ,
379+ state : this . runInspector ,
380+ onRetry : ( ) =>
381+ this . syncRunInspector ( this . context . gateway , this . context . gateway . snapshot , true ) ,
382+ } )
383+ : html `< div id ="activity-live-panel "> ${ liveActivity } </ div > ` }
384384 </ div >
385- ${ mode === "run"
386- ? renderRunInspector ( {
387- basePath : this . context . basePath ,
388- state : this . runInspector ,
389- onRetry : ( ) =>
390- this . syncRunInspector ( this . context . gateway , this . context . gateway . snapshot , true ) ,
391- } )
392- : html `< div id ="activity-live-panel "> ${ liveActivity } </ div > ` }
393385 ` ;
394386 return html `
395387 < section class ="content-header ">
0 commit comments