mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-07 19:28:44 +01:00
cleanup screenlinecontainer model
This commit is contained in:
parent
d414657252
commit
35fa59aadd
@ -1,109 +1,29 @@
|
|||||||
// Copyright 2023, Command Line Inc.
|
// Copyright 2023, Command Line Inc.
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
import type React from "react";
|
|
||||||
import * as mobx from "mobx";
|
|
||||||
import { sprintf } from "sprintf-js";
|
|
||||||
import { v4 as uuidv4 } from "uuid";
|
|
||||||
import { boundMethod } from "autobind-decorator";
|
|
||||||
import { debounce } from "throttle-debounce";
|
|
||||||
import * as mobxReact from "mobx-react";
|
|
||||||
import {
|
|
||||||
handleJsonFetchResponse,
|
|
||||||
base64ToString,
|
|
||||||
stringToBase64,
|
|
||||||
base64ToArray,
|
|
||||||
genMergeData,
|
|
||||||
genMergeDataMap,
|
|
||||||
genMergeSimpleData,
|
|
||||||
boundInt,
|
|
||||||
isModKeyPress,
|
|
||||||
} from "../util/util";
|
|
||||||
import { TermWrap } from "../plugins/terminal/term";
|
import { TermWrap } from "../plugins/terminal/term";
|
||||||
import { PluginModel } from "../plugins/plugins";
|
import { LineType, RendererContext, RendererModel, FocusTypeStrs, WindowSize, LineContainerStrs } from "../types/types";
|
||||||
import {
|
import { windowWidthToCols } from "../util/textmeasure";
|
||||||
SessionDataType,
|
import { getRendererContext } from "../app/line/lineutil";
|
||||||
LineType,
|
import { getTermPtyData } from "../util/modelutil";
|
||||||
RemoteType,
|
|
||||||
HistoryItem,
|
|
||||||
RemoteInstanceType,
|
|
||||||
RemotePtrType,
|
|
||||||
CmdDataType,
|
|
||||||
FeCmdPacketType,
|
|
||||||
TermOptsType,
|
|
||||||
ScreenDataType,
|
|
||||||
ScreenOptsType,
|
|
||||||
PtyDataUpdateType,
|
|
||||||
ModelUpdateType,
|
|
||||||
UpdateMessage,
|
|
||||||
InfoType,
|
|
||||||
UIContextType,
|
|
||||||
HistoryInfoType,
|
|
||||||
HistoryQueryOpts,
|
|
||||||
FeInputPacketType,
|
|
||||||
RemoteInputPacketType,
|
|
||||||
ContextMenuOpts,
|
|
||||||
RendererContext,
|
|
||||||
RendererModel,
|
|
||||||
PtyDataType,
|
|
||||||
BookmarkType,
|
|
||||||
ClientDataType,
|
|
||||||
HistoryViewDataType,
|
|
||||||
AlertMessageType,
|
|
||||||
HistorySearchParams,
|
|
||||||
FocusTypeStrs,
|
|
||||||
ScreenLinesType,
|
|
||||||
HistoryTypeStrs,
|
|
||||||
RendererPluginType,
|
|
||||||
WindowSize,
|
|
||||||
WebShareOpts,
|
|
||||||
TermContextUnion,
|
|
||||||
RemoteEditType,
|
|
||||||
RemoteViewType,
|
|
||||||
CommandRtnType,
|
|
||||||
WebCmd,
|
|
||||||
WebRemote,
|
|
||||||
OpenAICmdInfoChatMessageType,
|
|
||||||
StatusIndicatorLevel,
|
|
||||||
} from "../types/types";
|
|
||||||
import * as T from "../types/types";
|
|
||||||
import { WSControl } from "./ws";
|
|
||||||
import {
|
|
||||||
getMonoFontSize,
|
|
||||||
windowWidthToCols,
|
|
||||||
windowHeightToRows,
|
|
||||||
termWidthFromCols,
|
|
||||||
termHeightFromRows,
|
|
||||||
} from "../util/textmeasure";
|
|
||||||
import dayjs from "dayjs";
|
|
||||||
import localizedFormat from "dayjs/plugin/localizedFormat";
|
|
||||||
import customParseFormat from "dayjs/plugin/customParseFormat";
|
|
||||||
import { getRendererContext, cmdStatusIsRunning } from "../app/line/lineutil";
|
|
||||||
import { MagicLayout } from "../app/magiclayout";
|
|
||||||
import { modalsRegistry } from "../app/common/modals/registry";
|
|
||||||
import * as appconst from "../app/appconst";
|
|
||||||
import { checkKeyPressed, adaptFromReactOrNativeKeyEvent, setKeyUtilPlatform } from "../util/keyutil";
|
|
||||||
import { OV, OArr, OMap, CV } from "../types/types";
|
|
||||||
import { Session } from "./session";
|
|
||||||
import { CommandRunner } from "./commandrunner";
|
|
||||||
import { ScreenLines } from "./screenlines";
|
|
||||||
import { InputModel } from "./input";
|
|
||||||
import { PluginsModel } from "./plugins";
|
|
||||||
import { BookmarksModel } from "./bookmarks";
|
|
||||||
import { Cmd } from "./cmd";
|
import { Cmd } from "./cmd";
|
||||||
import { Model } from "./model";
|
import { Model } from "./model";
|
||||||
|
|
||||||
|
type CmdFinder = {
|
||||||
|
getCmdById(cmdId: string): Cmd;
|
||||||
|
};
|
||||||
|
|
||||||
class SpecialLineContainer {
|
class SpecialLineContainer {
|
||||||
globalModel: Model;
|
globalModel: Model;
|
||||||
wsize: T.WindowSize;
|
wsize: WindowSize;
|
||||||
allowInput: boolean;
|
allowInput: boolean;
|
||||||
terminal: TermWrap;
|
terminal: TermWrap;
|
||||||
renderer: RendererModel;
|
renderer: RendererModel;
|
||||||
cmd: Cmd;
|
cmd: Cmd;
|
||||||
cmdFinder: CmdFinder;
|
cmdFinder: CmdFinder;
|
||||||
containerType: T.LineContainerStrs;
|
containerType: LineContainerStrs;
|
||||||
|
|
||||||
constructor(cmdFinder: CmdFinder, wsize: T.WindowSize, allowInput: boolean, containerType: T.LineContainerStrs) {
|
constructor(cmdFinder: CmdFinder, wsize: WindowSize, allowInput: boolean, containerType: LineContainerStrs) {
|
||||||
this.globalModel = Model.getInstance();
|
this.globalModel = Model.getInstance();
|
||||||
this.cmdFinder = cmdFinder;
|
this.cmdFinder = cmdFinder;
|
||||||
this.wsize = wsize;
|
this.wsize = wsize;
|
||||||
@ -117,7 +37,7 @@ class SpecialLineContainer {
|
|||||||
return this.cmd;
|
return this.cmd;
|
||||||
}
|
}
|
||||||
|
|
||||||
getContainerType(): T.LineContainerStrs {
|
getContainerType(): LineContainerStrs {
|
||||||
return this.containerType;
|
return this.containerType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user