mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-22 16:48:23 +01:00
frontend for session archiving
This commit is contained in:
parent
5882897e3e
commit
7f9b347562
19
src/main.tsx
19
src/main.tsx
@ -2450,6 +2450,12 @@ class MainSideBar extends React.Component<{}, {}> {
|
||||
let remote : RemoteType = null;
|
||||
let idx : number = 0;
|
||||
remotes = sortAndFilterRemotes(remotes);
|
||||
let sessionList = [];
|
||||
for (let session of model.sessionList) {
|
||||
if (!session.archived.get() || session.sessionId == activeSessionId) {
|
||||
sessionList.push(session);
|
||||
}
|
||||
}
|
||||
return (
|
||||
<div className={cn("main-sidebar", {"collapsed": this.collapsed.get()})}>
|
||||
<div className="collapse-container">
|
||||
@ -2467,9 +2473,14 @@ class MainSideBar extends React.Component<{}, {}> {
|
||||
<li className="menu-loading-message"><a>(loading)</a></li>
|
||||
</If>
|
||||
<If condition={model.sessionListLoaded.get()}>
|
||||
<For each="session" index="idx" of={model.sessionList}>
|
||||
<For each="session" index="idx" of={sessionList}>
|
||||
<li key={session.sessionId}><a className={cn({"is-active": activeSessionId == session.sessionId})} onClick={() => this.handleSessionClick(session.sessionId)}>
|
||||
<span className="session-num">{idx+1} </span>
|
||||
<If condition={!session.archived.get()}>
|
||||
<span className="session-num">{idx+1} </span>
|
||||
</If>
|
||||
<If condition={session.archived.get()}>
|
||||
<i title="archived" className="fa fa-archive"/>
|
||||
</If>
|
||||
{session.name.get()}
|
||||
</a></li>
|
||||
</For>
|
||||
@ -2480,8 +2491,8 @@ class MainSideBar extends React.Component<{}, {}> {
|
||||
<If condition={GlobalModel.debugSW.get() && sw != null}>
|
||||
<div>
|
||||
focus={sw.focusType.get()}<br/>
|
||||
sline={sw.selectedLine.get()}<br/>
|
||||
termfocus={sw.termLineNumFocus.get()}<br/>
|
||||
sline={sw.selectedLine.get()}<br/>
|
||||
termfocus={sw.termLineNumFocus.get()}<br/>
|
||||
</div>
|
||||
</If>
|
||||
<p className="menu-label">
|
||||
|
@ -742,11 +742,13 @@ class Session {
|
||||
screens : OArr<Screen>;
|
||||
notifyNum : OV<number> = mobx.observable.box(0);
|
||||
remoteInstances : OArr<RemoteInstanceType>;
|
||||
archived : OV<boolean>;
|
||||
|
||||
constructor(sdata : SessionDataType) {
|
||||
this.sessionId = sdata.sessionid;
|
||||
this.name = mobx.observable.box(sdata.name);
|
||||
this.sessionIdx = mobx.observable.box(sdata.sessionidx);
|
||||
this.archived = mobx.observable.box(!!sdata.archived);
|
||||
let screenData = sdata.screens || [];
|
||||
let screens : Screen[] = [];
|
||||
for (let i=0; i<screenData.length; i++) {
|
||||
@ -777,6 +779,7 @@ class Session {
|
||||
if (sdata.notifynum >= 0) {
|
||||
this.notifyNum.set(sdata.notifynum);
|
||||
}
|
||||
this.archived.set(!!sdata.archived);
|
||||
genMergeData(this.screens, sdata.screens, (s : Screen) => s.screenId, (s : ScreenDataType) => s.screenid, (data : ScreenDataType) => new Screen(data), (s : Screen) => s.screenIdx.get());
|
||||
if (!isBlank(sdata.activescreenid)) {
|
||||
let screen = this.getScreenById(sdata.activescreenid);
|
||||
|
Loading…
Reference in New Issue
Block a user