From 95f992b1c08938a1c190fe7f8d725d30d14e17b9 Mon Sep 17 00:00:00 2001 From: sawka Date: Tue, 13 Sep 2022 17:17:52 -0700 Subject: [PATCH] working on remote display, bug fixes --- src/main.tsx | 20 ++++++++++++++++++-- src/model.ts | 11 ++++++++++- src/sh2.less | 15 ++++++++++++++- 3 files changed, 42 insertions(+), 4 deletions(-) diff --git a/src/main.tsx b/src/main.tsx index 1c3d248b..b96a21a0 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1231,13 +1231,26 @@ class MainSideBar extends React.Component<{}, {}> { })(); } + remoteDisplayName(remote : RemoteType) : any { + if (!isBlank(remote.remotealias)) { + return ( + <> + {remote.remotealias} + {remote.remotecanonicalname} + + ); + } + return ({remote.remotecanonicalname}); + } + render() { let model = GlobalModel; let activeSessionId = model.activeSessionId.get(); let session : Session = null; - let remotes = model.remotes; + let remotes = model.remotes ?? []; let remote : RemoteType = null; let idx : number = 0; + remotes = remotes.filter((r) => !r.archived); return (
@@ -1304,7 +1317,10 @@ class MainSideBar extends React.Component<{}, {}> {

diff --git a/src/model.ts b/src/model.ts index 2912ce37..f47b36d8 100644 --- a/src/model.ts +++ b/src/model.ts @@ -1265,6 +1265,15 @@ class Model { cmdStatusUpdate(sessionId : string, cmdId : string, origStatus : string, newStatus : string) { // TODO force recompute usedrows in terminal when status changes to done console.log("cmd status", sessionId, cmdId, origStatus, "=>", newStatus); + let sw = this.getActiveSW(); + if (sw == null || sw.sessionId != sessionId) { + return; + } + let term = sw.terms[cmdId]; + if (term == null) { + return; + } + setTimeout(() => term.updateUsedRows(true), 500); } onMetaArrowUp() : void { @@ -1406,7 +1415,7 @@ class Model { if ("sessions" in update) { 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()); - if (!("activatesessionid" in update)) { + if (!("activesessionid" in update)) { let newActiveScreen = this.getActiveScreen(); if (oldActiveScreen != newActiveScreen) { if (newActiveScreen == null) { diff --git a/src/sh2.less b/src/sh2.less index a16fe6cc..2ebf299e 100644 --- a/src/sh2.less +++ b/src/sh2.less @@ -184,7 +184,7 @@ html, body, #main { border-right: 1px solid #aaa; padding: 0 5px 5px 5px; width: 200px; - overflow-x: auto; + overflow-x: hidden; display: flex; flex-direction: column; color: #ddd; @@ -234,6 +234,14 @@ html, body, #main { } } + .menu-list li.remote-menu-item { + a { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + } + .menu-list li a { color: #bbb; white-space: nowrap; @@ -260,6 +268,11 @@ html, body, #main { font-size: 10px; } + .small-text { + color: #777; + font-size: 10px; + } + &.is-active { color: #ddd; font-weight: bold;