diff --git a/src/app/common/common.tsx b/src/app/common/common.tsx index a328049ee..2b09d7233 100644 --- a/src/app/common/common.tsx +++ b/src/app/common/common.tsx @@ -1122,10 +1122,12 @@ interface ModalFooterProps { const ModalFooter: React.FC = ({ onCancel, onOk, cancelLabel = "Cancel", okLabel = "Ok" }) => (
- - + {onCancel && ( + + )} + {onOk && }
); diff --git a/src/app/common/modals/modals.less b/src/app/common/modals/modals.less index de534fdcb..fe475f298 100644 --- a/src/app/common/modals/modals.less +++ b/src/app/common/modals/modals.less @@ -388,6 +388,25 @@ } } +.screen-settings-modal { + width: 640px; + min-height: 329px; + + .wave-modal-content { + gap: 24px; + + .wave-modal-body { + display: flex; + padding: 0px 20px; + flex-direction: column; + align-items: flex-start; + gap: 4px; + align-self: stretch; + width: 100%; + } + } +} + .erconn-modal { width: 502px; min-height: 411px; @@ -732,31 +751,32 @@ fill: @tab-pink; } - .tab-colors { + .tab-colors, + .tab-icons { display: flex; flex-direction: row; align-items: center; - .tab-color-sep { + .tab-color-sep, + .tab-icon-sep { padding-left: 10px; padding-right: 10px; font-weight: bold; } - .tab-color-cur { - width: 100px; - } - - .tab-color-icon { + .tab-color-icon, + .tab-icon-icon { width: 1.1em; vertical-align: middle; } - .tab-color-name { + .tab-color-name, + .tab-icon-name { margin-left: 1em; } - .tab-color-select { + .tab-color-select, + .tab-icon-select { cursor: pointer; margin: 5px; &:hover { diff --git a/src/app/common/modals/settings.tsx b/src/app/common/modals/settings.tsx index 4acdf281b..03e3e3a63 100644 --- a/src/app/common/modals/settings.tsx +++ b/src/app/common/modals/settings.tsx @@ -7,8 +7,16 @@ import * as mobx from "mobx"; import { boundMethod } from "autobind-decorator"; import { If, For } from "tsx-control-statements/components"; import cn from "classnames"; -import { GlobalModel, GlobalCommandRunner, TabColors, MinFontSize, MaxFontSize } from "../../../model/model"; -import { Toggle, InlineSettingsTextEdit, SettingsError, InfoMessage } from "../common"; +import { + GlobalModel, + GlobalCommandRunner, + TabColors, + MinFontSize, + MaxFontSize, + TabIcons, + Screen, +} from "../../../model/model"; +import { Toggle, InlineSettingsTextEdit, SettingsError, InfoMessage, Modal } from "../common"; import { LineType, RendererPluginType, ClientDataType, CommandRtnType } from "../../../types/types"; import { ConnectionDropdown } from "../../connections_deprecated/connections"; import { PluginModel } from "../../../plugins/plugins"; @@ -53,12 +61,13 @@ Are you sure you want to stop web-sharing this tab? class ScreenSettingsModal extends React.Component<{ sessionId: string; screenId: string }, {}> { shareCopied: OV = mobx.observable.box(false, { name: "ScreenSettings-shareCopied" }); errorMessage: OV = mobx.observable.box(null, { name: "ScreenSettings-errorMessage" }); + screen: Screen; constructor(props: any) { super(props); let { sessionId, screenId } = props; - let screen = GlobalModel.getScreenById(sessionId, screenId); - if (screen == null) { + this.screen = GlobalModel.getScreenById(sessionId, screenId); + if (this.screen == null) { return; } } @@ -84,6 +93,15 @@ class ScreenSettingsModal extends React.Component<{ sessionId: string; screenId: commandRtnHandler(prtn, this.errorMessage); } + @boundMethod + selectTabIcon(icon: string): void { + if (this.screen.getTabIcon() == icon) { + return; + } + let prtn = GlobalCommandRunner.screenSetSettings(this.screen.screenId, { tabicon: icon }, false); + util.commandRtnHandler(prtn, this.errorMessage); + } + @boundMethod handleChangeArchived(val: boolean): void { let { sessionId, screenId } = this.props; @@ -203,108 +221,123 @@ class ScreenSettingsModal extends React.Component<{ sessionId: string; screenId: render() { let { sessionId, screenId } = this.props; let inline = false; - let screen = GlobalModel.getScreenById(sessionId, screenId); + let screen = this.screen; if (screen == null) { return null; } + console.log("screen.getTabIcon()", screen.getTabIcon()); let color: string = null; + let icon: string = null; let curRemote = GlobalModel.getRemote(GlobalModel.getActiveScreen().getCurRemoteInstance().remoteid); return ( -
-
-
- {this.shareCopied.get() &&
} -
-
tab settings ({screen.name.get()})
-
- -
-
-
-
-
Tab Id
-
{screen.screenId}
-
-
-
Name
-
- -
-
-
-
Connection
-
- -
-
-
-
Tab Color
-
-
-
- - {screen.getTabColor()} -
-
|
- -
this.selectTabColor(color)} - > - -
-
-
-
-
-
-
-
Archived
- - Archive will hide the tab. Commands and output will be retained in history. - -
-
- -
-
-
-
-
Actions
- - Delete will remove the tab, removing all commands and output from history. - -
-
-
- Delete Tab -
-
-
- + + +
+
+
Tab Id
+
{screen.screenId}
-
-
- Close +
+
Name
+
+
-
+
+
+
Connection
+
+ +
+
+
+
Tab Color
+
+
+
+ + {screen.getTabColor()} +
+
|
+ +
this.selectTabColor(color)} + > + +
+
+
+
+
+
+
Tab Icon
+
+
+
+ + + + + + + {screen.getTabIcon()} +
+
|
+ +
this.selectTabIcon(icon)} + > + +
+
+
+
+
+
+
+
Archived
+ + Archive will hide the tab. Commands and output will be retained in history. + +
+
+ +
+
+
+
+
Actions
+ + Delete will remove the tab, removing all commands and output from history. + +
+
+
+ Delete Tab +
+
+
+
-
+ + ); } } diff --git a/src/app/workspace/screen/screenview.tsx b/src/app/workspace/screen/screenview.tsx index 0588f27d2..d7152bff0 100644 --- a/src/app/workspace/screen/screenview.tsx +++ b/src/app/workspace/screen/screenview.tsx @@ -11,24 +11,19 @@ import cn from "classnames"; import { debounce } from "throttle-debounce"; import dayjs from "dayjs"; import { GlobalCommandRunner, TabColors, TabIcons } from "../../../model/model"; -import type { LineType, RenderModeType, LineFactoryProps, CommandRtnType } from "../../../types/types"; +import type { LineType, RenderModeType, LineFactoryProps } from "../../../types/types"; import * as T from "../../../types/types"; import localizedFormat from "dayjs/plugin/localizedFormat"; -import { InlineSettingsTextEdit, RemoteStatusLight, Button } from "../../common/common"; +import { Button } from "../../common/common"; import { getRemoteStr } from "../../common/prompt/prompt"; import { GlobalModel, ScreenLines, Screen, Session } from "../../../model/model"; import { Line } from "../../line/linecomps"; import { LinesView } from "../../line/linesview"; import { ConnectionDropdown } from "../../connections_deprecated/connections"; import * as util from "../../../util/util"; -import { TextField, InputDecoration } from "../../common/common"; +import { TextField } from "../../common/common"; import { ReactComponent as EllipseIcon } from "../../assets/icons/ellipse.svg"; import { ReactComponent as Check12Icon } from "../../assets/icons/check12.svg"; -import { ReactComponent as GlobeIcon } from "../../assets/icons/globe.svg"; -import { ReactComponent as StatusCircleIcon } from "../../assets/icons/statuscircle.svg"; -import { ReactComponent as ArrowsUpDownIcon } from "../../assets/icons/arrowsupdown.svg"; -import { ReactComponent as CircleIcon } from "../../assets/icons/circle.svg"; -import { ReactComponent as AddIcon } from "../../assets/icons/add.svg"; import { ReactComponent as SquareIcon } from "../../assets/icons/tab/square.svg"; import "./screenview.less"; @@ -439,12 +434,12 @@ class ScreenWindowView extends React.Component<{ session: Session; screen: Scree /> -
+