mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-09 19:48:45 +01:00
on connect message, reset session and remote information completely (clear lists)
This commit is contained in:
parent
bc09722ef3
commit
abe8cc6f2a
@ -755,7 +755,7 @@ class InfoMsg extends React.Component<{}, {}> {
|
|||||||
</div>
|
</div>
|
||||||
<div className="remote-field">
|
<div className="remote-field">
|
||||||
<div className="remote-field-def"> alias</div>
|
<div className="remote-field-def"> alias</div>
|
||||||
<div className="remote-field-val">{isBlank(remote.alias) ? "-" : remote.alias}</div>
|
<div className="remote-field-val">{isBlank(remote.remotealias) ? "-" : remote.remotealias}</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="remote-field">
|
<div className="remote-field">
|
||||||
<div className="remote-field-def"> canonicalname</div>
|
<div className="remote-field-def"> canonicalname</div>
|
||||||
|
12
src/model.ts
12
src/model.ts
@ -5,7 +5,7 @@ import {debounce} from "throttle-debounce";
|
|||||||
import {handleJsonFetchResponse, base64ToArray, genMergeData, genMergeSimpleData} from "./util";
|
import {handleJsonFetchResponse, base64ToArray, genMergeData, genMergeSimpleData} from "./util";
|
||||||
import {TermWrap} from "./term";
|
import {TermWrap} from "./term";
|
||||||
import {v4 as uuidv4} from "uuid";
|
import {v4 as uuidv4} from "uuid";
|
||||||
import type {SessionDataType, WindowDataType, LineType, RemoteType, HistoryItem, RemoteInstanceType, RemotePtrType, CmdDataType, FeCmdPacketType, TermOptsType, RemoteStateType, ScreenDataType, ScreenWindowType, ScreenOptsType, LayoutType, PtyDataUpdateType, ModelUpdateType, UpdateMessage, InfoType, CmdLineUpdateType, UIContextType, HistoryInfoType, HistoryQueryOpts, FeInputPacketType, TermWinSize} from "./types";
|
import type {SessionDataType, WindowDataType, LineType, RemoteType, HistoryItem, RemoteInstanceType, RemotePtrType, CmdDataType, FeCmdPacketType, TermOptsType, RemoteStateType, ScreenDataType, ScreenWindowType, ScreenOptsType, LayoutType, PtyDataUpdateType, ModelUpdateType, UpdateMessage, InfoType, CmdLineUpdateType, UIContextType, HistoryInfoType, HistoryQueryOpts, FeInputPacketType, TermWinSize, RemoteInputPacketType} from "./types";
|
||||||
import {WSControl} from "./ws";
|
import {WSControl} from "./ws";
|
||||||
|
|
||||||
var GlobalUser = "sawka";
|
var GlobalUser = "sawka";
|
||||||
@ -1499,6 +1499,9 @@ class Model {
|
|||||||
}
|
}
|
||||||
let update : ModelUpdateType = genUpdate;
|
let update : ModelUpdateType = genUpdate;
|
||||||
if ("sessions" in update) {
|
if ("sessions" in update) {
|
||||||
|
if (update.connect) {
|
||||||
|
this.sessionList.clear();
|
||||||
|
}
|
||||||
let oldActiveScreen = this.getActiveScreen();
|
let oldActiveScreen = this.getActiveScreen();
|
||||||
genMergeData(this.sessionList, update.sessions, (s : Session) => s.sessionId, (sdata : SessionDataType) => sdata.sessionid, (sdata : SessionDataType) => new Session(sdata), (s : Session) => s.sessionIdx.get());
|
genMergeData(this.sessionList, update.sessions, (s : Session) => s.sessionId, (sdata : SessionDataType) => sdata.sessionid, (sdata : SessionDataType) => new Session(sdata), (s : Session) => s.sessionIdx.get());
|
||||||
if (!("activesessionid" in update)) {
|
if (!("activesessionid" in update)) {
|
||||||
@ -1531,7 +1534,10 @@ class Model {
|
|||||||
this.updateWindow(update.window, false);
|
this.updateWindow(update.window, false);
|
||||||
}
|
}
|
||||||
if ("remotes" in update) {
|
if ("remotes" in update) {
|
||||||
this.updateRemote(update.remotes);
|
if (update.connect) {
|
||||||
|
this.remotes.clear();
|
||||||
|
}
|
||||||
|
this.updateRemotes(update.remotes);
|
||||||
}
|
}
|
||||||
if (interactive && "info" in update) {
|
if (interactive && "info" in update) {
|
||||||
let info : InfoType = update.info;
|
let info : InfoType = update.info;
|
||||||
@ -1552,7 +1558,7 @@ class Model {
|
|||||||
// console.log("run-update>", Date.now(), interactive, update);
|
// console.log("run-update>", Date.now(), interactive, update);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateRemote(remotes : RemoteType[]) : void {
|
updateRemotes(remotes : RemoteType[]) : void {
|
||||||
genMergeSimpleData(this.remotes, remotes, (r) => r.remoteid, null);
|
genMergeSimpleData(this.remotes, remotes, (r) => r.remoteid, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,9 +17,12 @@ type SessionDataType = {
|
|||||||
type LineType = {
|
type LineType = {
|
||||||
sessionid : string,
|
sessionid : string,
|
||||||
windowid : string,
|
windowid : string,
|
||||||
|
userid : string,
|
||||||
lineid : string,
|
lineid : string,
|
||||||
ts : number,
|
ts : number,
|
||||||
userid : string,
|
linenum : number,
|
||||||
|
linenumtemp : boolean,
|
||||||
|
linelocal : boolean,
|
||||||
linetype : string,
|
linetype : string,
|
||||||
text : string,
|
text : string,
|
||||||
cmdid : string,
|
cmdid : string,
|
||||||
@ -293,4 +296,4 @@ type HistoryQueryOpts = {
|
|||||||
|
|
||||||
type UpdateMessage = PtyDataUpdateType | ModelUpdateType;
|
type UpdateMessage = PtyDataUpdateType | ModelUpdateType;
|
||||||
|
|
||||||
export type {SessionDataType, LineType, RemoteType, RemoteStateType, RemoteInstanceType, WindowDataType, HistoryItem, CmdRemoteStateType, FeCmdPacketType, TermOptsType, CmdStartPacketType, CmdDonePacketType, CmdDataType, ScreenDataType, ScreenOptsType, ScreenWindowType, LayoutType, PtyDataUpdateType, ModelUpdateType, UpdateMessage, InfoType, CmdLineUpdateType, RemotePtrType, UIContextType, HistoryInfoType, HistoryQueryOpts, WatchScreenPacketType, TermWinSize, FeInputPacketType};
|
export type {SessionDataType, LineType, RemoteType, RemoteStateType, RemoteInstanceType, WindowDataType, HistoryItem, CmdRemoteStateType, FeCmdPacketType, TermOptsType, CmdStartPacketType, CmdDonePacketType, CmdDataType, ScreenDataType, ScreenOptsType, ScreenWindowType, LayoutType, PtyDataUpdateType, ModelUpdateType, UpdateMessage, InfoType, CmdLineUpdateType, RemotePtrType, UIContextType, HistoryInfoType, HistoryQueryOpts, WatchScreenPacketType, TermWinSize, FeInputPacketType, RemoteInputPacketType};
|
||||||
|
Loading…
Reference in New Issue
Block a user