mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
fix bug with pulling all rtnstate (just pull visible). fix typescript errors
This commit is contained in:
+2
-2
@@ -152,7 +152,7 @@ class LineCmd extends React.Component<{screen : LineContainerModel, line : LineT
|
||||
if (staticRender || this.isCollapsed()) {
|
||||
return;
|
||||
}
|
||||
if (!visible) {
|
||||
if (!visible.get()) {
|
||||
if (this.rtnStateDiffFetched) {
|
||||
this.rtnStateDiffFetched = false;
|
||||
this.setRtnStateDiff(null);
|
||||
@@ -175,7 +175,7 @@ class LineCmd extends React.Component<{screen : LineContainerModel, line : LineT
|
||||
}
|
||||
let {line} = this.props;
|
||||
this.rtnStateDiffFetched = true;
|
||||
let usp = new URLSearchParams({screenid: line.screenid, cmdid: line.cmdid});
|
||||
let usp = new URLSearchParams({linenum: String(line.linenum), screenid: line.screenid, cmdid: line.cmdid});
|
||||
let url = GlobalModel.getBaseHostPort() + "/api/rtnstate?" + usp.toString();
|
||||
let fetchHeaders = GlobalModel.getFetchHeaders();
|
||||
fetch(url, {headers: fetchHeaders}).then((resp) => {
|
||||
|
||||
+2
-2
@@ -420,7 +420,7 @@ class TextAreaInput extends React.Component<{onHeightChange : () => void}, {}> {
|
||||
}
|
||||
|
||||
@boundMethod
|
||||
controlP(e : any) {
|
||||
controlP() {
|
||||
let inputModel = GlobalModel.inputModel;
|
||||
if (!inputModel.isHistoryLoaded()) {
|
||||
this.lastHistoryUpDown = true;
|
||||
@@ -432,7 +432,7 @@ class TextAreaInput extends React.Component<{onHeightChange : () => void}, {}> {
|
||||
}
|
||||
|
||||
@boundMethod
|
||||
controlN(e : any) {
|
||||
controlN() {
|
||||
let inputModel = GlobalModel.inputModel;
|
||||
inputModel.moveHistorySelection(-1);
|
||||
this.lastHistoryUpDown = true;
|
||||
|
||||
+2
-2
@@ -3464,8 +3464,8 @@ function _getPtyDataFromUrl(url : string) : Promise<PtyDataType> {
|
||||
});
|
||||
}
|
||||
|
||||
function getPtyData(screenId : string, cmdId : string) : Promise<PtyDataType> {
|
||||
let url = sprintf(GlobalModel.getBaseHostPort() + "/api/ptyout?screenid=%s&cmdid=%s", screenId, cmdId);
|
||||
function getPtyData(screenId : string, cmdId : string, lineNum : number) : Promise<PtyDataType> {
|
||||
let url = sprintf(GlobalModel.getBaseHostPort() + "/api/ptyout?linenum=%d&screenid=%s&cmdid=%s", lineNum, screenId, cmdId);
|
||||
return _getPtyDataFromUrl(url);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import {If, For, When, Otherwise, Choose} from "tsx-control-statements/component
|
||||
import cn from "classnames";
|
||||
import {GlobalModel, GlobalCommandRunner, TabColors} from "./model";
|
||||
import {Toggle} from "./elements";
|
||||
import {LineType, RendererPluginType} from "./types";
|
||||
import {LineType, RendererPluginType, ClientDataType} from "./types";
|
||||
|
||||
type OV<V> = mobx.IObservableValue<V>;
|
||||
type OArr<V> = mobx.IObservableArray<V>;
|
||||
|
||||
@@ -72,7 +72,7 @@ class SimpleBlobRendererModel {
|
||||
mobx.action(() => {
|
||||
this.loading.set(true);
|
||||
})();
|
||||
let rtnp = getPtyData(this.context.screenId, this.context.cmdId);
|
||||
let rtnp = getPtyData(this.context.screenId, this.context.cmdId, this.context.lineNum);
|
||||
rtnp.then((ptydata) => {
|
||||
setTimeout(() => {
|
||||
this.ptyData = ptydata;
|
||||
|
||||
+1
-1
@@ -278,7 +278,7 @@ class TermWrap {
|
||||
}
|
||||
else {
|
||||
let termContext = this.getRendererContext();
|
||||
rtnp = getPtyData(termContext.screenId, termContext.cmdId);
|
||||
rtnp = getPtyData(termContext.screenId, termContext.cmdId, termContext.lineNum);
|
||||
}
|
||||
rtnp.then((ptydata) => {
|
||||
setTimeout(() => {
|
||||
|
||||
@@ -415,11 +415,17 @@ type FeOptsType = {
|
||||
termfontsize : number,
|
||||
};
|
||||
|
||||
type ClientOptsType = {
|
||||
notelemetry : boolean,
|
||||
};
|
||||
|
||||
type ClientDataType = {
|
||||
clientid : string,
|
||||
userid : string,
|
||||
feopts : FeOptsType;
|
||||
clientopts : ClientOptsType,
|
||||
cmdstoretype : "session" | "screen";
|
||||
dbversion : number,
|
||||
migration? : ClientMigrationInfo;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user