mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-03-10 13:09:14 +01:00
archived screens display
This commit is contained in:
parent
21c4e979d4
commit
5882897e3e
13
src/main.tsx
13
src/main.tsx
@ -2308,11 +2308,18 @@ class ScreenTabs extends React.Component<{session : Session}, {}> {
|
||||
}
|
||||
let screen : Screen = null;
|
||||
let index = 0;
|
||||
let showingScreens = [];
|
||||
let activeScreenId = session.activeScreenId.get();
|
||||
for (let screen of session.screens) {
|
||||
if (!screen.archived.get() || activeScreenId == screen.screenId) {
|
||||
showingScreens.push(screen);
|
||||
}
|
||||
}
|
||||
return (
|
||||
<div className="screen-tabs">
|
||||
<For each="screen" index="index" of={session.screens}>
|
||||
<div key={screen.screenId} className={cn("screen-tab", {"is-active": session.activeScreenId.get() == screen.screenId}, "color-" + screen.getTabColor())} onClick={() => this.handleSwitchScreen(screen.screenId)} onContextMenu={(event) => this.handleContextMenu(event, screen.screenId)}>
|
||||
{screen.name.get()}
|
||||
<For each="screen" index="index" of={showingScreens}>
|
||||
<div key={screen.screenId} className={cn("screen-tab", {"is-active": activeScreenId == screen.screenId, "is-archived": screen.archived.get()}, "color-" + screen.getTabColor())} onClick={() => this.handleSwitchScreen(screen.screenId)} onContextMenu={(event) => this.handleContextMenu(event, screen.screenId)}>
|
||||
<If condition={screen.archived.get()}><i title="archived" className="fa fa-archive"/></If>{screen.name.get()}
|
||||
<If condition={index+1 <= 9}>
|
||||
<div className="tab-index">⌘{index+1}</div>
|
||||
</If>
|
||||
|
@ -214,6 +214,7 @@ class Screen {
|
||||
name : OV<string>;
|
||||
activeWindowId : OV<string>;
|
||||
windows : OArr<ScreenWindow>;
|
||||
archived : OV<boolean>;
|
||||
|
||||
constructor(sdata : ScreenDataType) {
|
||||
this.sessionId = sdata.sessionid;
|
||||
@ -222,6 +223,7 @@ class Screen {
|
||||
this.screenIdx = mobx.observable.box(sdata.screenidx, {name: "screen-screenidx"});
|
||||
this.opts = mobx.observable.box(sdata.screenopts, {name: "screen-opts"});
|
||||
this.activeWindowId = mobx.observable.box(ces(sdata.activewindowid), {name: "screen-activewindowid"});
|
||||
this.archived = mobx.observable.box(!!sdata.archived, {name: "screen-archived"});
|
||||
let swArr : ScreenWindow[] = [];
|
||||
let wins = sdata.windows || [];
|
||||
for (let i=0; i<wins.length; i++) {
|
||||
@ -251,6 +253,7 @@ class Screen {
|
||||
if (!isBlank(data.activewindowid)) {
|
||||
this.activeWindowId.set(data.activewindowid);
|
||||
}
|
||||
this.archived.set(!!data.archived);
|
||||
// TODO merge windows
|
||||
})();
|
||||
}
|
||||
|
@ -137,6 +137,12 @@ html, body, #main {
|
||||
opacity: 1.0;
|
||||
}
|
||||
|
||||
&.is-archived {
|
||||
.fa.fa-archive {
|
||||
margin-right: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
.tab-index {
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
|
Loading…
Reference in New Issue
Block a user