mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-22 16:48:23 +01:00
implement delete session, bug fixes
This commit is contained in:
parent
057637660c
commit
6340a3e9ff
@ -559,7 +559,7 @@ class ScreenTabs extends React.Component<{session : Session}, {}> {
|
||||
if (screen == null) {
|
||||
return;
|
||||
}
|
||||
GlobalModel.activateScreen(screen.sessionId, screen.screenId);
|
||||
GlobalModel.submitCommand(sprintf("/s %s", screenId));
|
||||
}
|
||||
|
||||
render() {
|
||||
@ -572,7 +572,7 @@ class ScreenTabs extends React.Component<{session : Session}, {}> {
|
||||
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})} onClick={() => this.handleSwitchScreen(screen.screenId)}>
|
||||
<div key={screen.screenId} className={cn("screen-tab", {"is-active": session.activeScreenId.get() == screen.screenId})} onClick={() => this.handleSwitchScreen(screen.screenId, index+1)}>
|
||||
{screen.name.get()}
|
||||
<If condition={index+1 <= 9}>
|
||||
<div className="tab-index">⌘{index+1}</div>
|
||||
|
@ -534,7 +534,7 @@ class Model {
|
||||
if (newScreenId == null) {
|
||||
return;
|
||||
}
|
||||
this.activateScreen(activeSession.sessionId, newScreenId);
|
||||
this.submitCommand(sprintf("/s %s", newScreenId));
|
||||
}
|
||||
|
||||
onDigitCmd(e : any, arg : {digit: number}, mods : KeyModsType) {
|
||||
@ -558,14 +558,18 @@ class Model {
|
||||
}
|
||||
if ("sessions" in message) {
|
||||
let sessionUpdateMsg : SessionUpdateType = message;
|
||||
console.log("update-sessions", sessionUpdateMsg.sessions);
|
||||
mobx.action(() => {
|
||||
let oldActiveScreen = this.getActiveScreen();
|
||||
genMergeData(this.sessionList, sessionUpdateMsg.sessions, (s : Session) => s.sessionId, (sdata : SessionDataType) => sdata.sessionid, (sdata : SessionDataType) => new Session(sdata), (s : Session) => s.sessionIdx.get());
|
||||
let newActiveScreen = this.getActiveScreen();
|
||||
if (oldActiveScreen != newActiveScreen) {
|
||||
if (newActiveScreen == null) {
|
||||
this.activateScreen(this.activeSessionId.get(), null, oldActiveScreen);
|
||||
}
|
||||
else {
|
||||
this.activateScreen(newActiveScreen.sessionId, newActiveScreen.screenId, oldActiveScreen);
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
}
|
||||
@ -741,6 +745,7 @@ class Model {
|
||||
})();
|
||||
let curScreen = this.getActiveScreen();
|
||||
if (curScreen == null) {
|
||||
this.ws.pushMessage({type: "watchscreen", sessionid: sessionId});
|
||||
return;
|
||||
}
|
||||
this.ws.pushMessage({type: "watchscreen", sessionid: curScreen.sessionId, screenid: curScreen.screenId});
|
||||
|
Loading…
Reference in New Issue
Block a user