mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
Declare types as global (#282)
* declare types as global * remove mobx types aliases * put back model_old.ts * remove types.ts
This commit is contained in:
@@ -7,7 +7,6 @@ import * as mobx from "mobx";
|
|||||||
import { boundMethod } from "autobind-decorator";
|
import { boundMethod } from "autobind-decorator";
|
||||||
import { If } from "tsx-control-statements/components";
|
import { If } from "tsx-control-statements/components";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import type { ContextMenuOpts } from "../types/types";
|
|
||||||
import localizedFormat from "dayjs/plugin/localizedFormat";
|
import localizedFormat from "dayjs/plugin/localizedFormat";
|
||||||
import { GlobalModel } from "../models";
|
import { GlobalModel } from "../models";
|
||||||
import { isBlank } from "../util/util";
|
import { isBlank } from "../util/util";
|
||||||
@@ -25,8 +24,6 @@ import "./app.less";
|
|||||||
|
|
||||||
dayjs.extend(localizedFormat);
|
dayjs.extend(localizedFormat);
|
||||||
|
|
||||||
type OV<V> = mobx.IObservableValue<V>;
|
|
||||||
|
|
||||||
@mobxReact.observer
|
@mobxReact.observer
|
||||||
class App extends React.Component<{}, {}> {
|
class App extends React.Component<{}, {}> {
|
||||||
dcWait: OV<boolean> = mobx.observable.box(false, { name: "dcWait" });
|
dcWait: OV<boolean> = mobx.observable.box(false, { name: "dcWait" });
|
||||||
|
|||||||
@@ -47,3 +47,13 @@ export const TabIcons = [
|
|||||||
export const VERSION = __WAVETERM_VERSION__;
|
export const VERSION = __WAVETERM_VERSION__;
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
export const BUILD = __WAVETERM_BUILD__;
|
export const BUILD = __WAVETERM_BUILD__;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Levels for the screen status indicator
|
||||||
|
*/
|
||||||
|
export enum StatusIndicatorLevel {
|
||||||
|
None = 0,
|
||||||
|
Output = 1,
|
||||||
|
Success = 2,
|
||||||
|
Error = 3,
|
||||||
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import * as mobx from "mobx";
|
|||||||
import { boundMethod } from "autobind-decorator";
|
import { boundMethod } from "autobind-decorator";
|
||||||
import { If, For } from "tsx-control-statements/components";
|
import { If, For } from "tsx-control-statements/components";
|
||||||
import cn from "classnames";
|
import cn from "classnames";
|
||||||
import type { BookmarkType } from "../../types/types";
|
|
||||||
import { GlobalModel } from "../../models";
|
import { GlobalModel } from "../../models";
|
||||||
import { CmdStrCode, Markdown } from "../common/elements";
|
import { CmdStrCode, Markdown } from "../common/elements";
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import { boundMethod } from "autobind-decorator";
|
|||||||
import cn from "classnames";
|
import cn from "classnames";
|
||||||
import { GlobalModel, GlobalCommandRunner, RemotesModel } from "../../models";
|
import { GlobalModel, GlobalCommandRunner, RemotesModel } from "../../models";
|
||||||
import { Toggle, InlineSettingsTextEdit, SettingsError, Dropdown } from "../common/elements";
|
import { Toggle, InlineSettingsTextEdit, SettingsError, Dropdown } from "../common/elements";
|
||||||
import * as types from "../../types/types";
|
|
||||||
import { commandRtnHandler, isBlank } from "../../util/util";
|
import { commandRtnHandler, isBlank } from "../../util/util";
|
||||||
import * as appconst from "../appconst";
|
import * as appconst from "../appconst";
|
||||||
|
|
||||||
@@ -16,10 +15,10 @@ import "./clientsettings.less";
|
|||||||
|
|
||||||
@mobxReact.observer
|
@mobxReact.observer
|
||||||
class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hoveredItemId: string }> {
|
class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hoveredItemId: string }> {
|
||||||
fontSizeDropdownActive: types.OV<boolean> = mobx.observable.box(false, {
|
fontSizeDropdownActive: OV<boolean> = mobx.observable.box(false, {
|
||||||
name: "clientSettings-fontSizeDropdownActive",
|
name: "clientSettings-fontSizeDropdownActive",
|
||||||
});
|
});
|
||||||
errorMessage: types.OV<string> = mobx.observable.box(null, { name: "ClientSettings-errorMessage" });
|
errorMessage: OV<string> = mobx.observable.box(null, { name: "ClientSettings-errorMessage" });
|
||||||
|
|
||||||
@boundMethod
|
@boundMethod
|
||||||
dismissError(): void {
|
dismissError(): void {
|
||||||
@@ -48,7 +47,7 @@ class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hove
|
|||||||
|
|
||||||
@boundMethod
|
@boundMethod
|
||||||
handleChangeTelemetry(val: boolean): void {
|
handleChangeTelemetry(val: boolean): void {
|
||||||
let prtn: Promise<types.CommandRtnType> = null;
|
let prtn: Promise<CommandRtnType> = null;
|
||||||
if (val) {
|
if (val) {
|
||||||
prtn = GlobalCommandRunner.telemetryOn(false);
|
prtn = GlobalCommandRunner.telemetryOn(false);
|
||||||
} else {
|
} else {
|
||||||
@@ -59,7 +58,7 @@ class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hove
|
|||||||
|
|
||||||
@boundMethod
|
@boundMethod
|
||||||
handleChangeReleaseCheck(val: boolean): void {
|
handleChangeReleaseCheck(val: boolean): void {
|
||||||
let prtn: Promise<types.CommandRtnType> = null;
|
let prtn: Promise<CommandRtnType> = null;
|
||||||
if (val) {
|
if (val) {
|
||||||
prtn = GlobalCommandRunner.releaseCheckAutoOn(false);
|
prtn = GlobalCommandRunner.releaseCheckAutoOn(false);
|
||||||
} else {
|
} else {
|
||||||
@@ -112,7 +111,7 @@ class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hove
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
let cdata: types.ClientDataType = GlobalModel.clientData.get();
|
let cdata: ClientDataType = GlobalModel.clientData.get();
|
||||||
let openAIOpts = cdata.openaiopts ?? {};
|
let openAIOpts = cdata.openaiopts ?? {};
|
||||||
let apiTokenStr = isBlank(openAIOpts.apitoken) ? "(not set)" : "********";
|
let apiTokenStr = isBlank(openAIOpts.apitoken) ? "(not set)" : "********";
|
||||||
let maxTokensStr = String(
|
let maxTokensStr = String(
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ import { checkKeyPressed, adaptFromReactOrNativeKeyEvent } from "../../../util/k
|
|||||||
|
|
||||||
import "./inlinesettingstextedit.less";
|
import "./inlinesettingstextedit.less";
|
||||||
|
|
||||||
type OV<V> = mobx.IObservableValue<V>;
|
|
||||||
|
|
||||||
@mobxReact.observer
|
@mobxReact.observer
|
||||||
class InlineSettingsTextEdit extends React.Component<
|
class InlineSettingsTextEdit extends React.Component<
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,8 +10,6 @@ import { IconButton } from "./iconbutton";
|
|||||||
|
|
||||||
import "./modal.less";
|
import "./modal.less";
|
||||||
|
|
||||||
type OV<V> = mobx.IObservableValue<V>;
|
|
||||||
|
|
||||||
interface ModalHeaderProps {
|
interface ModalHeaderProps {
|
||||||
onClose?: () => void;
|
onClose?: () => void;
|
||||||
title: string;
|
title: string;
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ import { MagicLayout } from "../../magiclayout";
|
|||||||
|
|
||||||
import "./resizablesidebar.less";
|
import "./resizablesidebar.less";
|
||||||
|
|
||||||
type OV<V> = mobx.IObservableValue<V>;
|
|
||||||
|
|
||||||
interface ResizableSidebarProps {
|
interface ResizableSidebarProps {
|
||||||
parentRef: React.RefObject<HTMLElement>;
|
parentRef: React.RefObject<HTMLElement>;
|
||||||
position: "left" | "right";
|
position: "left" | "right";
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ import * as mobxReact from "mobx-react";
|
|||||||
import * as mobx from "mobx";
|
import * as mobx from "mobx";
|
||||||
import { boundMethod } from "autobind-decorator";
|
import { boundMethod } from "autobind-decorator";
|
||||||
|
|
||||||
type OV<V> = mobx.IObservableValue<V>;
|
|
||||||
|
|
||||||
@mobxReact.observer
|
@mobxReact.observer
|
||||||
class SettingsError extends React.Component<{ errorMessage: OV<string> }, {}> {
|
class SettingsError extends React.Component<{ errorMessage: OV<string> }, {}> {
|
||||||
@boundMethod
|
@boundMethod
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import React, { Component, ReactNode } from "react";
|
import React, { Component, ReactNode } from "react";
|
||||||
import { RendererContext } from "../../../types/types";
|
|
||||||
import cn from "classnames";
|
import cn from "classnames";
|
||||||
|
|
||||||
interface ErrorBoundaryState {
|
interface ErrorBoundaryState {
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { StatusIndicatorLevel } from "../../../types/types";
|
|
||||||
import cn from "classnames";
|
import cn from "classnames";
|
||||||
import { ReactComponent as SpinnerIndicator } from "../../assets/icons/spinner-indicator.svg";
|
import { ReactComponent as SpinnerIndicator } from "../../assets/icons/spinner-indicator.svg";
|
||||||
import { boundMethod } from "autobind-decorator";
|
import { boundMethod } from "autobind-decorator";
|
||||||
import * as mobx from "mobx";
|
import * as mobx from "mobx";
|
||||||
import * as mobxReact from "mobx-react";
|
import * as mobxReact from "mobx-react";
|
||||||
|
import * as appconst from "../../appconst";
|
||||||
|
|
||||||
import { ReactComponent as RotateIconSvg } from "../../assets/icons/line/rotate.svg";
|
import { ReactComponent as RotateIconSvg } from "../../assets/icons/line/rotate.svg";
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ interface StatusIndicatorProps {
|
|||||||
/**
|
/**
|
||||||
* The level of the status indicator. This will determine the color of the status indicator.
|
* The level of the status indicator. This will determine the color of the status indicator.
|
||||||
*/
|
*/
|
||||||
level: StatusIndicatorLevel;
|
level: appconst.StatusIndicatorLevel;
|
||||||
className?: string;
|
className?: string;
|
||||||
/**
|
/**
|
||||||
* If true, a spinner will be shown around the status indicator.
|
* If true, a spinner will be shown around the status indicator.
|
||||||
@@ -191,16 +191,16 @@ export class StatusIndicator extends React.Component<StatusIndicatorProps> {
|
|||||||
const { level, className, runningCommands } = this.props;
|
const { level, className, runningCommands } = this.props;
|
||||||
const spinnerVisible = this.spinnerVisible.get();
|
const spinnerVisible = this.spinnerVisible.get();
|
||||||
let statusIndicator = null;
|
let statusIndicator = null;
|
||||||
if (level != StatusIndicatorLevel.None || spinnerVisible) {
|
if (level != appconst.StatusIndicatorLevel.None || spinnerVisible) {
|
||||||
let indicatorLevelClass = null;
|
let indicatorLevelClass = null;
|
||||||
switch (level) {
|
switch (level) {
|
||||||
case StatusIndicatorLevel.Output:
|
case appconst.StatusIndicatorLevel.Output:
|
||||||
indicatorLevelClass = "output";
|
indicatorLevelClass = "output";
|
||||||
break;
|
break;
|
||||||
case StatusIndicatorLevel.Success:
|
case appconst.StatusIndicatorLevel.Success:
|
||||||
indicatorLevelClass = "success";
|
indicatorLevelClass = "success";
|
||||||
break;
|
break;
|
||||||
case StatusIndicatorLevel.Error:
|
case appconst.StatusIndicatorLevel.Error:
|
||||||
indicatorLevelClass = "error";
|
indicatorLevelClass = "error";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import * as mobx from "mobx";
|
|||||||
import { boundMethod } from "autobind-decorator";
|
import { boundMethod } from "autobind-decorator";
|
||||||
import { If } from "tsx-control-statements/components";
|
import { If } from "tsx-control-statements/components";
|
||||||
import { GlobalModel, GlobalCommandRunner, RemotesModel } from "../../../models";
|
import { GlobalModel, GlobalCommandRunner, RemotesModel } from "../../../models";
|
||||||
import * as T from "../../../types/types";
|
|
||||||
import {
|
import {
|
||||||
Modal,
|
Modal,
|
||||||
TextField,
|
TextField,
|
||||||
@@ -22,8 +21,6 @@ import * as util from "../../../util/util";
|
|||||||
|
|
||||||
import "./createremoteconn.less";
|
import "./createremoteconn.less";
|
||||||
|
|
||||||
type OV<V> = mobx.IObservableValue<V>;
|
|
||||||
|
|
||||||
@mobxReact.observer
|
@mobxReact.observer
|
||||||
class CreateRemoteConnModal extends React.Component<{}, {}> {
|
class CreateRemoteConnModal extends React.Component<{}, {}> {
|
||||||
tempAlias: OV<string>;
|
tempAlias: OV<string>;
|
||||||
@@ -35,7 +32,7 @@ class CreateRemoteConnModal extends React.Component<{}, {}> {
|
|||||||
tempKeyFile: OV<string>;
|
tempKeyFile: OV<string>;
|
||||||
tempShellPref: OV<string>;
|
tempShellPref: OV<string>;
|
||||||
errorStr: OV<string>;
|
errorStr: OV<string>;
|
||||||
remoteEdit: T.RemoteEditType;
|
remoteEdit: RemoteEditType;
|
||||||
model: RemotesModel;
|
model: RemotesModel;
|
||||||
|
|
||||||
constructor(props: { remotesModel?: RemotesModel }) {
|
constructor(props: { remotesModel?: RemotesModel }) {
|
||||||
|
|||||||
@@ -7,14 +7,11 @@ import * as mobx from "mobx";
|
|||||||
import { If } from "tsx-control-statements/components";
|
import { If } from "tsx-control-statements/components";
|
||||||
import { boundMethod } from "autobind-decorator";
|
import { boundMethod } from "autobind-decorator";
|
||||||
import { GlobalModel, GlobalCommandRunner, RemotesModel } from "../../../models";
|
import { GlobalModel, GlobalCommandRunner, RemotesModel } from "../../../models";
|
||||||
import * as T from "../../../types/types";
|
|
||||||
import { Modal, TextField, InputDecoration, Dropdown, PasswordField, Tooltip } from "../elements";
|
import { Modal, TextField, InputDecoration, Dropdown, PasswordField, Tooltip } from "../elements";
|
||||||
import * as util from "../../../util/util";
|
import * as util from "../../../util/util";
|
||||||
|
|
||||||
import "./editremoteconn.less";
|
import "./editremoteconn.less";
|
||||||
|
|
||||||
type OV<V> = mobx.IObservableValue<V>;
|
|
||||||
|
|
||||||
const PasswordUnchangedSentinel = "--unchanged--";
|
const PasswordUnchangedSentinel = "--unchanged--";
|
||||||
|
|
||||||
@mobxReact.observer
|
@mobxReact.observer
|
||||||
@@ -42,11 +39,11 @@ class EditRemoteConnModal extends React.Component<{}, {}> {
|
|||||||
return this.model.selectedRemoteId.get();
|
return this.model.selectedRemoteId.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
get selectedRemote(): T.RemoteType {
|
get selectedRemote(): RemoteType {
|
||||||
return GlobalModel.getRemote(this.selectedRemoteId);
|
return GlobalModel.getRemote(this.selectedRemoteId);
|
||||||
}
|
}
|
||||||
|
|
||||||
get remoteEdit(): T.RemoteEditType {
|
get remoteEdit(): RemoteEditType {
|
||||||
return this.model.remoteEdit.get();
|
return this.model.remoteEdit.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,14 +7,11 @@ import * as mobx from "mobx";
|
|||||||
import { boundMethod } from "autobind-decorator";
|
import { boundMethod } from "autobind-decorator";
|
||||||
import { GlobalModel, GlobalCommandRunner } from "../../../models";
|
import { GlobalModel, GlobalCommandRunner } from "../../../models";
|
||||||
import { SettingsError, Modal, Dropdown } from "../elements";
|
import { SettingsError, Modal, Dropdown } from "../elements";
|
||||||
import { LineType, RendererPluginType } from "../../../types/types";
|
|
||||||
import { PluginModel } from "../../../plugins/plugins";
|
import { PluginModel } from "../../../plugins/plugins";
|
||||||
import { commandRtnHandler } from "../../../util/util";
|
import { commandRtnHandler } from "../../../util/util";
|
||||||
|
|
||||||
import "./linesettings.less";
|
import "./linesettings.less";
|
||||||
|
|
||||||
type OV<V> = mobx.IObservableValue<V>;
|
|
||||||
|
|
||||||
@mobxReact.observer
|
@mobxReact.observer
|
||||||
class LineSettingsModal extends React.Component<{}, {}> {
|
class LineSettingsModal extends React.Component<{}, {}> {
|
||||||
rendererDropdownActive: OV<boolean> = mobx.observable.box(false, { name: "lineSettings-rendererDropdownActive" });
|
rendererDropdownActive: OV<boolean> = mobx.observable.box(false, { name: "lineSettings-rendererDropdownActive" });
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import { If, For } from "tsx-control-statements/components";
|
|||||||
import cn from "classnames";
|
import cn from "classnames";
|
||||||
import { GlobalModel, GlobalCommandRunner, Screen } from "../../../models";
|
import { GlobalModel, GlobalCommandRunner, Screen } from "../../../models";
|
||||||
import { Toggle, InlineSettingsTextEdit, SettingsError, Modal, Dropdown, Tooltip } from "../elements";
|
import { Toggle, InlineSettingsTextEdit, SettingsError, Modal, Dropdown, Tooltip } from "../elements";
|
||||||
import { RemoteType } from "../../../types/types";
|
|
||||||
import * as util from "../../../util/util";
|
import * as util from "../../../util/util";
|
||||||
import { commandRtnHandler } from "../../../util/util";
|
import { commandRtnHandler } from "../../../util/util";
|
||||||
import { ReactComponent as SquareIcon } from "../../assets/icons/tab/square.svg";
|
import { ReactComponent as SquareIcon } from "../../assets/icons/tab/square.svg";
|
||||||
@@ -19,8 +18,6 @@ import * as appconst from "../../appconst";
|
|||||||
|
|
||||||
import "./screensettings.less";
|
import "./screensettings.less";
|
||||||
|
|
||||||
type OV<V> = mobx.IObservableValue<V>;
|
|
||||||
|
|
||||||
const ScreenDeleteMessage = `
|
const ScreenDeleteMessage = `
|
||||||
Are you sure you want to delete this tab?
|
Are you sure you want to delete this tab?
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,6 @@ import { commandRtnHandler } from "../../../util/util";
|
|||||||
|
|
||||||
import "./sessionsettings.less";
|
import "./sessionsettings.less";
|
||||||
|
|
||||||
type OV<V> = mobx.IObservableValue<V>;
|
|
||||||
|
|
||||||
const SessionDeleteMessage = `
|
const SessionDeleteMessage = `
|
||||||
Are you sure you want to delete this workspace?
|
Are you sure you want to delete this workspace?
|
||||||
|
|
||||||
|
|||||||
@@ -15,9 +15,6 @@ import { ReactComponent as SquareIcon } from "../../assets/icons/tab/square.svg"
|
|||||||
|
|
||||||
import "./tabswitcher.less";
|
import "./tabswitcher.less";
|
||||||
|
|
||||||
type OV<V> = mobx.IObservableValue<V>;
|
|
||||||
type OArr<V> = mobx.IObservableArray<V>;
|
|
||||||
|
|
||||||
type SwitcherDataType = {
|
type SwitcherDataType = {
|
||||||
sessionId: string;
|
sessionId: string;
|
||||||
sessionName: string;
|
sessionName: string;
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import { boundMethod } from "autobind-decorator";
|
|||||||
import { GlobalModel, GlobalCommandRunner } from "../../../models";
|
import { GlobalModel, GlobalCommandRunner } from "../../../models";
|
||||||
import { Toggle, Modal, Button } from "../elements";
|
import { Toggle, Modal, Button } from "../elements";
|
||||||
import * as util from "../../../util/util";
|
import * as util from "../../../util/util";
|
||||||
import { ClientDataType } from "../../../types/types";
|
|
||||||
|
|
||||||
import shield from "../../assets/icons/shield_check.svg";
|
import shield from "../../assets/icons/shield_check.svg";
|
||||||
import help from "../../assets/icons/help_filled.svg";
|
import help from "../../assets/icons/help_filled.svg";
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import * as React from "react";
|
|||||||
import { GlobalModel } from "../../../models";
|
import { GlobalModel } from "../../../models";
|
||||||
import { Choose, When, If } from "tsx-control-statements/components";
|
import { Choose, When, If } from "tsx-control-statements/components";
|
||||||
import { Modal, PasswordField, Markdown } from "../elements";
|
import { Modal, PasswordField, Markdown } from "../elements";
|
||||||
import { UserInputRequest } from "../../../types/types";
|
|
||||||
|
|
||||||
import "./userinput.less";
|
import "./userinput.less";
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import { boundMethod } from "autobind-decorator";
|
|||||||
import { If, For } from "tsx-control-statements/components";
|
import { If, For } from "tsx-control-statements/components";
|
||||||
import cn from "classnames";
|
import cn from "classnames";
|
||||||
import { GlobalModel, GlobalCommandRunner, RemotesModel } from "../../../models";
|
import { GlobalModel, GlobalCommandRunner, RemotesModel } from "../../../models";
|
||||||
import * as T from "../../../types/types";
|
|
||||||
import { Modal, Tooltip, Button, Status } from "../elements";
|
import { Modal, Tooltip, Button, Status } from "../elements";
|
||||||
import * as util from "../../../util/util";
|
import * as util from "../../../util/util";
|
||||||
import * as textmeasure from "../../../util/textmeasure";
|
import * as textmeasure from "../../../util/textmeasure";
|
||||||
@@ -27,7 +26,7 @@ class ViewRemoteConnDetailModal extends React.Component<{}, {}> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@mobx.computed
|
@mobx.computed
|
||||||
getSelectedRemote(): T.RemoteType {
|
getSelectedRemote(): RemoteType {
|
||||||
const selectedRemoteId = this.model.selectedRemoteId.get();
|
const selectedRemoteId = this.model.selectedRemoteId.get();
|
||||||
return GlobalModel.getRemote(selectedRemoteId);
|
return GlobalModel.getRemote(selectedRemoteId);
|
||||||
}
|
}
|
||||||
@@ -58,7 +57,7 @@ class ViewRemoteConnDetailModal extends React.Component<{}, {}> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getRemoteTypeStr(remote: T.RemoteType): string {
|
getRemoteTypeStr(remote: RemoteType): string {
|
||||||
if (!util.isBlank(remote.uname)) {
|
if (!util.isBlank(remote.uname)) {
|
||||||
let unameStr = remote.uname;
|
let unameStr = remote.uname;
|
||||||
unameStr = unameStr.replace("|", ", ");
|
unameStr = unameStr.replace("|", ", ");
|
||||||
@@ -136,7 +135,7 @@ class ViewRemoteConnDetailModal extends React.Component<{}, {}> {
|
|||||||
this.model.setRecentConnAdded(false);
|
this.model.setRecentConnAdded(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderInstallStatus(remote: T.RemoteType): any {
|
renderInstallStatus(remote: RemoteType): any {
|
||||||
let statusStr: string = null;
|
let statusStr: string = null;
|
||||||
if (remote.installstatus == "disconnected") {
|
if (remote.installstatus == "disconnected") {
|
||||||
if (remote.needsmshellupgrade) {
|
if (remote.needsmshellupgrade) {
|
||||||
@@ -160,7 +159,7 @@ class ViewRemoteConnDetailModal extends React.Component<{}, {}> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderHeaderBtns(remote: T.RemoteType): React.ReactNode {
|
renderHeaderBtns(remote: RemoteType): React.ReactNode {
|
||||||
let buttons: React.ReactNode[] = [];
|
let buttons: React.ReactNode[] = [];
|
||||||
const disconnectButton = (
|
const disconnectButton = (
|
||||||
<Button theme="secondary" onClick={() => this.disconnectRemote(remote.remoteid)}>
|
<Button theme="secondary" onClick={() => this.disconnectRemote(remote.remoteid)}>
|
||||||
@@ -254,7 +253,7 @@ class ViewRemoteConnDetailModal extends React.Component<{}, {}> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
getMessage(remote: T.RemoteType): string {
|
getMessage(remote: RemoteType): string {
|
||||||
let message = "";
|
let message = "";
|
||||||
if (remote.status == "connected") {
|
if (remote.status == "connected") {
|
||||||
message = "Connected and ready to run commands.";
|
message = "Connected and ready to run commands.";
|
||||||
@@ -393,7 +392,7 @@ class ViewRemoteConnDetailModal extends React.Component<{}, {}> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getImportTooltip(remote: T.RemoteType): React.ReactElement<any, any> {
|
function getImportTooltip(remote: RemoteType): React.ReactElement<any, any> {
|
||||||
if (remote.sshconfigsrc == "sshconfig-import") {
|
if (remote.sshconfigsrc == "sshconfig-import") {
|
||||||
return (
|
return (
|
||||||
<Tooltip
|
<Tooltip
|
||||||
|
|||||||
@@ -3,17 +3,9 @@
|
|||||||
|
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import * as mobxReact from "mobx-react";
|
import * as mobxReact from "mobx-react";
|
||||||
import * as mobx from "mobx";
|
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import localizedFormat from "dayjs/plugin/localizedFormat";
|
import localizedFormat from "dayjs/plugin/localizedFormat";
|
||||||
import { GlobalModel } from "../../../models";
|
import { GlobalModel } from "../../../models";
|
||||||
import type {
|
|
||||||
LineType,
|
|
||||||
RemoteType,
|
|
||||||
RemotePtrType,
|
|
||||||
LineHeightChangeCallbackType,
|
|
||||||
LineContainerType,
|
|
||||||
} from "../../../types/types";
|
|
||||||
import cn from "classnames";
|
import cn from "classnames";
|
||||||
import { isBlank } from "../../../util/util";
|
import { isBlank } from "../../../util/util";
|
||||||
import { ReactComponent as FolderIcon } from "../../assets/icons/folder.svg";
|
import { ReactComponent as FolderIcon } from "../../assets/icons/folder.svg";
|
||||||
@@ -22,23 +14,6 @@ import "./prompt.less";
|
|||||||
|
|
||||||
dayjs.extend(localizedFormat);
|
dayjs.extend(localizedFormat);
|
||||||
|
|
||||||
type OV<V> = mobx.IObservableValue<V>;
|
|
||||||
type OArr<V> = mobx.IObservableArray<V>;
|
|
||||||
type OMap<K, V> = mobx.ObservableMap<K, V>;
|
|
||||||
|
|
||||||
type RendererComponentProps = {
|
|
||||||
screen: LineContainerType;
|
|
||||||
line: LineType;
|
|
||||||
width: number;
|
|
||||||
staticRender: boolean;
|
|
||||||
visible: OV<boolean>;
|
|
||||||
onHeightChange: LineHeightChangeCallbackType;
|
|
||||||
collapsed: boolean;
|
|
||||||
};
|
|
||||||
type RendererComponentType = {
|
|
||||||
new (props: RendererComponentProps): React.Component<RendererComponentProps, {}>;
|
|
||||||
};
|
|
||||||
|
|
||||||
function makeFullRemoteRef(ownerName: string, remoteRef: string, name: string): string {
|
function makeFullRemoteRef(ownerName: string, remoteRef: string, name: string): string {
|
||||||
if (isBlank(ownerName) && isBlank(name)) {
|
if (isBlank(ownerName) && isBlank(name)) {
|
||||||
return remoteRef;
|
return remoteRef;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user