mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-22 16:48:23 +01:00
fix return type of writeRemoteFile, small formatting/fixes
This commit is contained in:
parent
b5e9e34c52
commit
238c8fb250
14
src/model.ts
14
src/model.ts
@ -3655,7 +3655,13 @@ class Model {
|
||||
return prtn;
|
||||
}
|
||||
|
||||
writeRemoteFile(screenId: string, lineId: string, path: string, data: Uint8Array, opts?: { useTemp?: boolean }) {
|
||||
writeRemoteFile(
|
||||
screenId: string,
|
||||
lineId: string,
|
||||
path: string,
|
||||
data: Uint8Array,
|
||||
opts?: { useTemp?: boolean }
|
||||
): Promise<void> {
|
||||
opts = opts || {};
|
||||
let params = {
|
||||
screenid: screenId,
|
||||
@ -3670,7 +3676,11 @@ class Model {
|
||||
let url = new URL(GlobalModel.getBaseHostPort() + "/api/write-file");
|
||||
let fetchHeaders = this.getFetchHeaders();
|
||||
let prtn = fetch(url, { method: "post", headers: fetchHeaders, body: formData });
|
||||
return prtn;
|
||||
return prtn
|
||||
.then((resp) => handleJsonFetchResponse(url, resp))
|
||||
.then((data) => {
|
||||
return;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,7 @@ import type {
|
||||
import { PacketDataBuffer } from "./ptydata";
|
||||
import { debounce, throttle } from "throttle-debounce";
|
||||
import * as util from "./util";
|
||||
import { GlobalModel } from "./model";
|
||||
|
||||
type OV<V> = mobx.IObservableValue<V>;
|
||||
type CV<V> = mobx.IComputedValue<V>;
|
||||
@ -94,8 +95,7 @@ class SimpleBlobRendererModel {
|
||||
})();
|
||||
if (delayMs == 0) {
|
||||
this.reload_noDelay();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
reload_noDelay();
|
||||
}, delayMs);
|
||||
@ -106,11 +106,9 @@ class SimpleBlobRendererModel {
|
||||
let source = this.lineState["prompt:source"] || "pty";
|
||||
if (source == "pty") {
|
||||
this.reloadPtyData();
|
||||
}
|
||||
else if (source == "file") {
|
||||
} else if (source == "file") {
|
||||
this.reloadFileData();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
mobx.action(() => {
|
||||
this.loadError.set("error: invalid load source: " + source);
|
||||
})();
|
||||
|
@ -393,7 +393,7 @@ type RendererModelInitializeParams = {
|
||||
rawCmd: WebCmd;
|
||||
savedHeight: number;
|
||||
opts: RendererOpts;
|
||||
lineState: LineStateType,
|
||||
lineState: LineStateType;
|
||||
api: RendererModelContainerApi;
|
||||
ptyDataSource: (termContext: TermContextUnion) => Promise<PtyDataType>;
|
||||
};
|
||||
@ -410,7 +410,7 @@ type RendererModel = {
|
||||
};
|
||||
|
||||
type SimpleBlobRendererComponent = React.ComponentType<{
|
||||
path: String;
|
||||
path: string;
|
||||
data: Blob;
|
||||
context: RendererContext;
|
||||
opts: RendererOpts;
|
||||
|
Loading…
Reference in New Issue
Block a user