mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
force update usedRows when terminal is resized
This commit is contained in:
+8
-2
@@ -1064,10 +1064,16 @@ class ScreenWindowView extends React.Component<{sw : ScreenWindow}, {}> {
|
||||
cmdNum++;
|
||||
}
|
||||
}
|
||||
let isActive = sw.isActive();
|
||||
return (
|
||||
<div className="window-view" style={this.getWindowViewStyle()} id={this.getWindowViewDOMId()}>
|
||||
<div key="window-tag" className="window-tag">
|
||||
<span>{sw.name.get()}{sw.shouldFollow.get() ? "*" : ""}</span>
|
||||
<div key="window-tag" className={cn("window-tag", {"is-active": isActive})}>
|
||||
<span>
|
||||
{sw.name.get()}
|
||||
<If condition={sw.shouldFollow.get()}>
|
||||
<i className="fa fa-caret-down"/>
|
||||
</If>
|
||||
</span>
|
||||
</div>
|
||||
<div key="lines" className="lines" onScroll={this.scrollHandler} id={this.getLinesDOMId()} style={linesStyle}>
|
||||
<div className="lines-spacer"></div>
|
||||
|
||||
+6
-2
@@ -67,12 +67,16 @@ html, body, #main {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
background-color: rgba(78, 154, 6, 0.5);
|
||||
color: white;
|
||||
background-color: rgba(78, 154, 6, 0.65);
|
||||
color: black;
|
||||
padding: 2px 4px 2px 4px;
|
||||
border-bottom-left-radius: 5px;
|
||||
z-index: 10;
|
||||
font-size: 12px;
|
||||
|
||||
&.is-active {
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
|
||||
.window-empty {
|
||||
|
||||
+9
-5
@@ -136,10 +136,13 @@ class TermWrap {
|
||||
return usedRows;
|
||||
}
|
||||
|
||||
updateUsedRows() {
|
||||
updateUsedRows(forceFull : boolean) {
|
||||
if (this.terminal == null) {
|
||||
return;
|
||||
}
|
||||
if (forceFull) {
|
||||
this.atRowMax = false;
|
||||
}
|
||||
if (this.atRowMax) {
|
||||
return;
|
||||
}
|
||||
@@ -147,11 +150,11 @@ class TermWrap {
|
||||
if (tur >= this.terminal.rows) {
|
||||
this.atRowMax = true;
|
||||
}
|
||||
if (tur <= this.usedRows.get()) {
|
||||
return;
|
||||
}
|
||||
mobx.action(() => {
|
||||
let oldUsedRows = this.usedRows.get();
|
||||
if (!forceFull && tur <= oldUsedRows) {
|
||||
return;
|
||||
}
|
||||
this.usedRows.set(tur);
|
||||
GlobalModel.setTUR(this.sessionId, this.cmdId, this.termSize, tur);
|
||||
if (this.connectedElem) {
|
||||
@@ -184,6 +187,7 @@ class TermWrap {
|
||||
}
|
||||
this.termSize = newSize;
|
||||
this.terminal.resize(newSize.cols, newSize.rows);
|
||||
this.updateUsedRows(true);
|
||||
}
|
||||
|
||||
reloadTerminal(delayMs : number) {
|
||||
@@ -240,7 +244,7 @@ class TermWrap {
|
||||
}
|
||||
this.ptyPos += data.length;
|
||||
this.terminal.write(data, () => {
|
||||
this.updateUsedRows();
|
||||
this.updateUsedRows(false);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user