mirror of
https://github.com/wavetermdev/backup.git
synced 2026-04-22 15:26:58 -07:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9a9ee68604 | |||
| 51c0c00416 | |||
| 02d605a624 | |||
| 6613f480e3 | |||
| e0427e5ed4 |
@@ -1,3 +1,4 @@
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.27.11 h1:3/gm/JTX9bX8CpzTgIlrtYpB3EVBDxyg/GY/QdcIEZw=
|
||||
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
|
||||
github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4=
|
||||
github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
|
||||
|
||||
+8
-4
@@ -1,4 +1,4 @@
|
||||
@import "@/common/themes/themes.less";
|
||||
@import "./common/themes/themes.less";
|
||||
|
||||
@font-face {
|
||||
font-family: "Martian Mono";
|
||||
@@ -8,6 +8,10 @@
|
||||
}
|
||||
|
||||
:root {
|
||||
/* updated by GlobalModel to user's preferred fontsize */
|
||||
--termfontsize: 12px;
|
||||
--termlineheight: 15px;
|
||||
|
||||
--fa-style-family: "Font Awesome 6 Sharp";
|
||||
}
|
||||
|
||||
@@ -19,7 +23,7 @@ body {
|
||||
font-weight: 300;
|
||||
line-height: 1.5;
|
||||
background: @base-background-transparent;
|
||||
color: var(--base-color);
|
||||
color: @base-color;
|
||||
}
|
||||
|
||||
body.is-dev {
|
||||
@@ -33,7 +37,7 @@ textarea {
|
||||
font-weight: 300;
|
||||
line-height: 1.5;
|
||||
background: @base-background;
|
||||
color: var(--base-color);
|
||||
color: @base-color;
|
||||
}
|
||||
|
||||
// typography
|
||||
@@ -103,7 +107,7 @@ body code {
|
||||
}
|
||||
|
||||
svg.icon {
|
||||
fill: var(--base-color);
|
||||
fill: @base-color;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: inline-block;
|
||||
|
||||
@@ -20,9 +20,6 @@ import { MainSideBar } from "./sidebar/sidebar";
|
||||
import { DisconnectedModal, ClientStopModal } from "./common/modals";
|
||||
import { ModalsProvider } from "./common/modals/provider";
|
||||
import { ErrorBoundary } from "./common/error/errorboundary";
|
||||
|
||||
import "@/common/themes/fonts.less";
|
||||
import "@/common/themes/themes.less";
|
||||
import "./app.less";
|
||||
|
||||
dayjs.extend(localizedFormat);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
svg {
|
||||
width: 1.5em;
|
||||
height: 1.5em;
|
||||
fill: var(--base-color);
|
||||
fill: @base-color;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
.icon {
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
fill: var(--base-color);
|
||||
fill: @base-color;
|
||||
}
|
||||
|
||||
.bookmarks-list {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
i {
|
||||
display: inline;
|
||||
font-size: 13px;
|
||||
fill: var(--base-color);
|
||||
fill: @base-color;
|
||||
padding-top: 0.2em;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
:root {
|
||||
--fixed-font: "Martian Mono", sans-serif;
|
||||
--terminal-font: "JetBrains Mono", sans-serif;
|
||||
|
||||
--text-s1-font: "Martian Mono", sans-serif;
|
||||
|
||||
--markdown-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif,
|
||||
"Apple Color Emoji", "Segoe UI Emoji";
|
||||
}
|
||||
@@ -77,138 +77,3 @@
|
||||
@markdown-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif,
|
||||
"Apple Color Emoji", "Segoe UI Emoji";
|
||||
@markdown-highlight: rgb(35, 35, 35);
|
||||
|
||||
:root {
|
||||
--base-color: #eceeec;
|
||||
|
||||
// semantic vars based on --base-color
|
||||
--line-avatar-color: #eceeec;
|
||||
--line-text-color: #f2f4f2;
|
||||
--line-svg-fill: var(--line-text-color);
|
||||
--line-svg-hover-fill: #eceeec;
|
||||
--line-selected-border-color: rgb(193, 195, 193);
|
||||
--line-separator-color: rgb(126, 126, 126);
|
||||
--line-meta-line1-color: rgb(150, 152, 150);
|
||||
|
||||
--base-background: rgba(21, 23, 21, 1);
|
||||
|
||||
// semantic vars based on --base-background
|
||||
--line-background: rgba(21, 23, 21, 1);
|
||||
|
||||
--base-background-transparent: rgba(21, 23, 21, 0.7);
|
||||
--base-background-dev: rgba(21, 23, 48, 0.7);
|
||||
--base-border: rgba(241, 246, 243, 0.08);
|
||||
--background-session: rgba(13, 13, 13, 0.85);
|
||||
--background-session-components: rgba(48, 49, 48, 0.6);
|
||||
--background-session-components-solid: rgb(33, 34, 33);
|
||||
--wave-green: rgb(88, 193, 66);
|
||||
|
||||
// semantic vars based on --wave-green
|
||||
--line-status-success-fill: rgb(88, 193, 66);
|
||||
|
||||
--wave-green-faded: rgba(88, 193, 66, 0.4);
|
||||
|
||||
--cmd-input-border-color: rgba(88, 193, 66, 0.8);
|
||||
|
||||
--disabled-background: rgba(76, 81, 75, 1);
|
||||
--disabled-color: #adadad;
|
||||
--disabled-color-faded: rgba(173, 173, 173, 0.6);
|
||||
--scrollbar-background: rgba(21, 23, 21, 1);
|
||||
--scrollbar-thumb-background: rgb(134, 134, 134);
|
||||
--button-background: rgb(38, 38, 38);
|
||||
--button-disabled-background: rgb(30, 29, 29);
|
||||
--success-green: rgb(38, 97, 26);
|
||||
--error-red: #cc0000;
|
||||
|
||||
// semantic vars based on --error-red
|
||||
--line-base-error-color: #cc0000;
|
||||
|
||||
// semantic vars based on --error-red
|
||||
--line-status-error-fill: #cc0000;
|
||||
|
||||
--warning-yellow: #ffa500;
|
||||
|
||||
// semantic vars based on --warning-yellow
|
||||
--line-status-warning-fill: #ffa500;
|
||||
|
||||
--textarea-background: #2a2a2a;
|
||||
|
||||
--text-primary: #fff;
|
||||
--text-secondary: #c3c8c2;
|
||||
--text-caption: #8b918a;
|
||||
|
||||
--status-connected: #46a758;
|
||||
--status-connecting: #f5d90a;
|
||||
--status-error: #e54d2e;
|
||||
--status-disconnected: #c3c8c2;
|
||||
|
||||
--term-black: #000000;
|
||||
--term-red: #cc0000;
|
||||
|
||||
// semantic vars based on --term-red
|
||||
--line-load-error-text-color: #cc0000;
|
||||
|
||||
--term-green: #4e9a06;
|
||||
|
||||
// semantic vars based on --term-green
|
||||
--line-active-border-color: rgb(97, 158, 72);
|
||||
|
||||
--term-yellow: #c4a000;
|
||||
|
||||
// semantic vars based on --term-yellow
|
||||
--line-base-yellow-color: #fce94f;
|
||||
|
||||
// semantic vars based on --term-yellow
|
||||
--line-sidebar-message-text-color: #c4a000;
|
||||
|
||||
--term-blue: #3465a4;
|
||||
--term-cyan: #06989a;
|
||||
--term-white: #d3d7cf;
|
||||
|
||||
// semantic vars based on --term-white
|
||||
--line-base-white-color: #d3d7cf;
|
||||
|
||||
--term-bright-red: #ef2929;
|
||||
--term-bright-green: #58c142;
|
||||
--term-bright-yellow: #fce94f;
|
||||
|
||||
--term-bright-blue: #32afff;
|
||||
--term-bright-magenta: #ad7fa8;
|
||||
--term-bright-cyan: #34e2e2;
|
||||
--term-bright-white: #ffffff;
|
||||
|
||||
--button-bg-yellow: #e9be68;
|
||||
--button-bg-red: #d06c68;
|
||||
|
||||
--history-error-red: #d06c68;
|
||||
|
||||
--history-selected-error-red: #f79494;
|
||||
|
||||
--tab-red: #e54d2e;
|
||||
--tab-orange: #ef713b;
|
||||
--tab-yellow: #e0b956;
|
||||
--tab-green: #58c142;
|
||||
--tab-mint: #4bffa9;
|
||||
--tab-cyan: #4bdfff;
|
||||
--tab-blue: #3971ff;
|
||||
--tab-violet: #ba76ff;
|
||||
--tab-pink: #e05677;
|
||||
--tab-white: #ffffff;
|
||||
|
||||
--soft-blue: #729fcf;
|
||||
|
||||
// semantic vars based on --soft-blue
|
||||
--line-base-soft-blue-color: #729fcf;
|
||||
--line-meta-user-color: #89afd7;
|
||||
|
||||
--active-menu-color: rgb(0, 71, 171);
|
||||
|
||||
--fixed-font: "Martian Mono", sans-serif;
|
||||
--terminal-font: "JetBrains Mono", sans-serif;
|
||||
|
||||
--text-s1-font: "Martian Mono", sans-serif;
|
||||
|
||||
--markdown-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif,
|
||||
"Apple Color Emoji", "Segoe UI Emoji";
|
||||
--markdown-highlight: rgb(35, 35, 35);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
.icon {
|
||||
width: 1.3em !important;
|
||||
height: 1.3em !important;
|
||||
fill: var(--base-color);
|
||||
fill: @base-color;
|
||||
}
|
||||
|
||||
.history-checkbox {
|
||||
@@ -51,7 +51,7 @@
|
||||
svg {
|
||||
width: 1.5em;
|
||||
height: 1.5em;
|
||||
fill: var(--base-color);
|
||||
fill: @base-color;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
font-size: 1em;
|
||||
padding: 0.5em 1em;
|
||||
background-color: @background-session-components;
|
||||
color: var(--base-color);
|
||||
color: @base-color;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
.label {
|
||||
display: inline;
|
||||
vertical-align: middle;
|
||||
color: var(--base-color);
|
||||
color: @base-color;
|
||||
}
|
||||
.icon {
|
||||
vertical-align: middle;
|
||||
@@ -163,7 +163,7 @@
|
||||
|
||||
.reset-button {
|
||||
margin-left: 1em;
|
||||
color: var(--base-color);
|
||||
color: @base-color;
|
||||
line-height: 1.75em;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -753,32 +753,6 @@ class LineCmd extends React.Component<
|
||||
/>
|
||||
</If>
|
||||
</ErrorBoundary>
|
||||
<If condition={cmd.getRtnState()}>
|
||||
<div
|
||||
key="rtnstate"
|
||||
className="cmd-rtnstate"
|
||||
style={{
|
||||
visibility: cmd.getStatus() == "done" ? "visible" : "hidden",
|
||||
}}
|
||||
>
|
||||
<If condition={rsdiff == null || rsdiff == ""}>
|
||||
<div className="cmd-rtnstate-label">state unchanged</div>
|
||||
<div className="cmd-rtnstate-sep"></div>
|
||||
</If>
|
||||
<If condition={rsdiff != null && rsdiff != ""}>
|
||||
<div className="cmd-rtnstate-label">new state</div>
|
||||
<div className="cmd-rtnstate-sep"></div>
|
||||
<div className="cmd-rtnstate-diff" style={{ fontSize: rtnStateDiffSize }}>
|
||||
<div className="cmd-rtnstate-diff-inner">{this.rtnStateDiff.get()}</div>
|
||||
</div>
|
||||
</If>
|
||||
</div>
|
||||
</If>
|
||||
<If condition={isSelected && !isFocused && rendererType == "terminal"}>
|
||||
<div className="cmd-hints">
|
||||
<div className="hint-item color-nohover-white">focus line ({renderCmdText("L")})</div>
|
||||
</div>
|
||||
</If>
|
||||
</If>
|
||||
</div>
|
||||
);
|
||||
|
||||
+45
-66
@@ -1,3 +1,5 @@
|
||||
@import "@/common/themes/themes.less";
|
||||
|
||||
.line.line-text {
|
||||
flex-direction: row;
|
||||
padding-top: 5px;
|
||||
@@ -11,7 +13,7 @@
|
||||
}
|
||||
|
||||
.line .load-error-text {
|
||||
color: var(--line-load-error-text-color);
|
||||
color: @term-red;
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
@@ -21,20 +23,11 @@
|
||||
|
||||
.line.line-cmd {
|
||||
flex-direction: column;
|
||||
scroll-margin-bottom: 20px;
|
||||
scroll-margin-bottom: var(--termlineheight);
|
||||
position: relative;
|
||||
|
||||
.plus {
|
||||
opacity: 0.5;
|
||||
}
|
||||
&:hover {
|
||||
.plus {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.sidebar-message {
|
||||
color: var(--line-sidebar-message-text-color);
|
||||
color: @term-yellow;
|
||||
}
|
||||
|
||||
.line-header {
|
||||
@@ -43,13 +36,14 @@
|
||||
padding-bottom: 0.7rem;
|
||||
width: 100%;
|
||||
line-height: 1.2;
|
||||
height: calc(var(--termlineheight) * 2);
|
||||
|
||||
&.is-expanded {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
&.hide-prompt {
|
||||
height: 32px;
|
||||
height: calc(var(--termlineheight) * 2);
|
||||
}
|
||||
|
||||
.line-icon {
|
||||
@@ -79,15 +73,15 @@
|
||||
display: block;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.meta.meta-line1 {
|
||||
color: var(--line-meta-line1-color) !important;
|
||||
font-size: 11px;
|
||||
}
|
||||
.meta.meta-line1 {
|
||||
color: rgba(@base-color, 0.6) !important;
|
||||
font-size: var(--termfontsize);
|
||||
}
|
||||
|
||||
.meta.meta-line2 {
|
||||
margin-left: -2px;
|
||||
.meta.meta-line2 {
|
||||
margin-left: -2px;
|
||||
}
|
||||
}
|
||||
|
||||
&.has-rtnstate .terminal-wrapper {
|
||||
@@ -130,7 +124,7 @@
|
||||
position: relative;
|
||||
|
||||
.cmd-rtnstate-label {
|
||||
font-family: var(--terminal-font);
|
||||
font-family: @terminal-font;
|
||||
position: relative;
|
||||
font-size: 10px;
|
||||
z-index: 2;
|
||||
@@ -138,13 +132,13 @@
|
||||
padding: 2px 5px 0px 5px;
|
||||
display: inline-block;
|
||||
font-size: 10px;
|
||||
color: var(--line-base-white-color);
|
||||
color: @term-white;
|
||||
background-color: #151715;
|
||||
}
|
||||
|
||||
.cmd-rtnstate-diff {
|
||||
font-family: var(--terminal-font);
|
||||
color: var(--line-base-white-color);
|
||||
font-family: @terminal-font;
|
||||
color: @term-white;
|
||||
white-space: pre;
|
||||
margin-left: 10px;
|
||||
padding-left: 10px;
|
||||
@@ -179,16 +173,16 @@
|
||||
overflow: hidden;
|
||||
flex-shrink: 0;
|
||||
position: relative;
|
||||
background: var(--line-background);
|
||||
background: @base-background;
|
||||
border: 1px solid transparent;
|
||||
|
||||
&.selected {
|
||||
border: 1px solid var(--line-selected-border-color) !important;
|
||||
border: 1px solid rgba(@base-color, 0.8) !important;
|
||||
box-shadow: 0px 0px 0.5px 0px rgba(255, 255, 255, 0.5) inset, 0px 0.5px 0px 0px rgba(255, 255, 255, 0.2) inset;
|
||||
}
|
||||
|
||||
&.active {
|
||||
border: 1px solid var(--line-active-border-color) !important;
|
||||
border: 1px solid rgba(@wave-green, 0.8) !important;
|
||||
box-shadow: 0px 0px 0.5px 0px rgba(255, 255, 255, 0.5) inset, 0px 0.5px 0px 0px rgba(255, 255, 255, 0.2) inset;
|
||||
}
|
||||
|
||||
@@ -200,11 +194,10 @@
|
||||
&.line-simple {
|
||||
font-size: 11px;
|
||||
line-height: 1.2;
|
||||
color: var(--line-text-color);
|
||||
color: rgba(@base-color, 0.6);
|
||||
|
||||
.simple-line-header {
|
||||
display: flex;
|
||||
margin-top: 5px;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
@@ -230,19 +223,19 @@
|
||||
height: 1em;
|
||||
margin: 0 0.5em;
|
||||
vertical-align: text-top;
|
||||
fill: var(--line-avatar-color);
|
||||
fill: @base-color;
|
||||
}
|
||||
|
||||
.success {
|
||||
fill: var(--line-status-success-fill);
|
||||
fill: @wave-green;
|
||||
}
|
||||
|
||||
.fail {
|
||||
fill: var(--line-status-error-fill);
|
||||
fill: @error-red;
|
||||
}
|
||||
|
||||
.warning {
|
||||
fill: var(--line-status-warning-fill);
|
||||
fill: @warning-yellow;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -273,8 +266,7 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: bold;
|
||||
// color: @term-white;
|
||||
color: var(--line-avatar-color);
|
||||
color: @term-white;
|
||||
|
||||
border-radius: 5px;
|
||||
position: relative;
|
||||
@@ -306,30 +298,30 @@
|
||||
|
||||
&.status-error {
|
||||
.status-icon {
|
||||
color: var(--line-base-error-color);
|
||||
color: @error-red;
|
||||
}
|
||||
}
|
||||
|
||||
&.status-hangup {
|
||||
.status-icon {
|
||||
color: var(--line-base-yellow-color);
|
||||
color: @term-yellow;
|
||||
}
|
||||
}
|
||||
|
||||
&.status-running {
|
||||
background-color: var(--line-base-soft-blue-color);
|
||||
background-color: @soft-blue;
|
||||
}
|
||||
|
||||
&.status-waiting {
|
||||
background-color: var(--line-base-yellow-color);
|
||||
background-color: @term-yellow;
|
||||
}
|
||||
|
||||
&.status-detached {
|
||||
background-color: var(--line-base-soft-blue-color);
|
||||
background-color: @soft-blue;
|
||||
.status-icon {
|
||||
top: 3px;
|
||||
right: 3px;
|
||||
color: var(--line-base-soft-blue-color);
|
||||
color: @term-white;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -347,14 +339,9 @@
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
.simple-line-status {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.user {
|
||||
color: var(--line-meta-user-color);
|
||||
color: lighten(@soft-blue, 10%);
|
||||
font-weight: bold;
|
||||
margin-top: 1px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
@@ -362,38 +349,34 @@
|
||||
.termopts,
|
||||
.renderer {
|
||||
display: flex;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.renderer {
|
||||
margin-left: 3px;
|
||||
margin-top: 5px;
|
||||
svg {
|
||||
width: 1em;
|
||||
margin-right: 0.5em;
|
||||
fill: var(--line-meta-line1-color);
|
||||
fill: rgba(@base-color, 0.6);
|
||||
}
|
||||
}
|
||||
|
||||
.settings {
|
||||
display: none;
|
||||
margin-left: 0.5em;
|
||||
margin-top: 0.65em;
|
||||
cursor: pointer;
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
border-radius: 50%;
|
||||
line-height: 1em;
|
||||
svg {
|
||||
fill: var(--line-meta-line1-color);
|
||||
fill: rgba(@base-color, 0.6);
|
||||
&:hover {
|
||||
fill: var(--line-svg-hover-fill);
|
||||
fill: @base-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.termopts {
|
||||
margin-top: 5px;
|
||||
display: none;
|
||||
.resize-button {
|
||||
cursor: pointer;
|
||||
@@ -404,7 +387,6 @@
|
||||
|
||||
.metapart-mono {
|
||||
margin-left: 8px;
|
||||
margin-top: 4px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
@@ -416,7 +398,7 @@
|
||||
.cmdtext-overflow {
|
||||
flex-shrink: 0;
|
||||
padding-right: 2px;
|
||||
color: var(--line-base-white-color);
|
||||
color: @term-white;
|
||||
cursor: pointer;
|
||||
|
||||
margin-top: 4px;
|
||||
@@ -434,7 +416,7 @@
|
||||
.cmdtext-expanded {
|
||||
white-space: pre;
|
||||
|
||||
color: var(--line-base-white-color);
|
||||
color: @term-white;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
}
|
||||
@@ -452,7 +434,7 @@
|
||||
}
|
||||
|
||||
.line.line-invalid {
|
||||
color: var(--line-base-white-color);
|
||||
color: @term-white;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
@@ -476,14 +458,10 @@
|
||||
&:focus,
|
||||
&:focus-within {
|
||||
&::-webkit-scrollbar-thumb {
|
||||
background-color: var(--scrollbar-thumb-background) !important;
|
||||
background-color: @scrollbar-thumb !important;
|
||||
}
|
||||
}
|
||||
|
||||
.line:nth-child(2) {
|
||||
padding-top: 1px;
|
||||
}
|
||||
|
||||
.lines-spacer {
|
||||
flex-grow: 1;
|
||||
}
|
||||
@@ -491,8 +469,9 @@
|
||||
.line-sep {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 1em;
|
||||
color: var(--line-separator-color);
|
||||
height: var(--termlineheight);
|
||||
font-size: var(--termfontsize);
|
||||
color: rgba(@base-color, 0.5);
|
||||
}
|
||||
|
||||
.line-sep::before,
|
||||
@@ -500,7 +479,7 @@
|
||||
content: "";
|
||||
height: 1px;
|
||||
flex-grow: 1;
|
||||
background-color: var(--line-separator-color);
|
||||
background-color: rgba(@base-color, 0.5);
|
||||
}
|
||||
|
||||
.line-sep::before {
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
svg {
|
||||
width: 1.5em;
|
||||
height: 1.5em;
|
||||
fill: var(--base-color);
|
||||
fill: @base-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@
|
||||
}
|
||||
|
||||
.menu-label {
|
||||
color: var(--base-color);
|
||||
color: @base-color;
|
||||
}
|
||||
|
||||
.menu-list {
|
||||
|
||||
@@ -5,7 +5,7 @@ import * as React from "react";
|
||||
import * as mobxReact from "mobx-react";
|
||||
import * as mobx from "mobx";
|
||||
import { GlobalModel } from "@/models";
|
||||
import { isBlank } from "@/util";
|
||||
import { isBlank } from "@/util/util";
|
||||
import { boundMethod } from "autobind-decorator";
|
||||
import cn from "classnames";
|
||||
import { For } from "tsx-control-statements/components";
|
||||
@@ -92,7 +92,7 @@ class AIChat extends React.Component<{}, {}> {
|
||||
if (checkKeyPressed(waveEvent, "Escape")) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
inputModel.closeAIAssistantChat();
|
||||
inputModel.closeAIAssistantChat(true);
|
||||
}
|
||||
|
||||
if (checkKeyPressed(waveEvent, "Ctrl:l")) {
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
height: 1em;
|
||||
margin: 0 0.5em;
|
||||
vertical-align: text-top;
|
||||
fill: var(--base-color);
|
||||
fill: @base-color;
|
||||
}
|
||||
|
||||
.warning {
|
||||
|
||||
@@ -232,7 +232,7 @@ class TextAreaInput extends React.Component<{ screen: Screen; onHeightChange: ()
|
||||
if (inputModel.inputMode.get() != null) {
|
||||
inputModel.resetInputMode();
|
||||
}
|
||||
inputModel.closeAIAssistantChat();
|
||||
inputModel.closeAIAssistantChat(true);
|
||||
return;
|
||||
}
|
||||
if (checkKeyPressed(waveEvent, "Cmd:e")) {
|
||||
|
||||
+10
-3
@@ -618,10 +618,17 @@ class InputModel {
|
||||
})();
|
||||
}
|
||||
|
||||
closeAIAssistantChat(): void {
|
||||
// pass true to give focus to the input (e.g. if this is an 'active' close of the chat)
|
||||
// when resetting the input (when switching screens, don't give focus)
|
||||
closeAIAssistantChat(giveFocus: boolean): void {
|
||||
if (!this.aIChatShow.get()) {
|
||||
return;
|
||||
}
|
||||
mobx.action(() => {
|
||||
this.aIChatShow.set(false);
|
||||
this.giveFocus();
|
||||
if (giveFocus) {
|
||||
this.giveFocus();
|
||||
}
|
||||
})();
|
||||
}
|
||||
|
||||
@@ -723,7 +730,7 @@ class InputModel {
|
||||
resetInput(): void {
|
||||
mobx.action(() => {
|
||||
this.setHistoryShow(false);
|
||||
this.closeAIAssistantChat();
|
||||
this.closeAIAssistantChat(false);
|
||||
this.infoShow.set(false);
|
||||
this.inputMode.set(null);
|
||||
this.resetHistory();
|
||||
|
||||
+8
-10
@@ -157,6 +157,10 @@ class Model {
|
||||
}
|
||||
return fontSize;
|
||||
});
|
||||
mobx.autorun(() => {
|
||||
const fontSize = this.termFontSize.get();
|
||||
this._setCssTermFontSize(fontSize);
|
||||
});
|
||||
getApi().onTCmd(this.onTCmd.bind(this));
|
||||
getApi().onICmd(this.onICmd.bind(this));
|
||||
getApi().onLCmd(this.onLCmd.bind(this));
|
||||
@@ -314,16 +318,10 @@ class Model {
|
||||
return appconst.ProdServerEndpoint;
|
||||
}
|
||||
|
||||
setTermFontSize(fontSize: number) {
|
||||
if (fontSize < appconst.MinFontSize) {
|
||||
fontSize = appconst.MinFontSize;
|
||||
}
|
||||
if (fontSize > appconst.MaxFontSize) {
|
||||
fontSize = appconst.MaxFontSize;
|
||||
}
|
||||
mobx.action(() => {
|
||||
this.termFontSize.set(fontSize);
|
||||
})();
|
||||
_setCssTermFontSize(fontSize: number) {
|
||||
const root = document.documentElement;
|
||||
root.style.setProperty("--termfontsize", fontSize + "px");
|
||||
root.style.setProperty("--termlinehight", Math.ceil(fontSize * 1.2) + "px");
|
||||
}
|
||||
|
||||
getBaseWsHostPort(): string {
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
// Copyright 2023, Command Line Inc.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package sstore
|
||||
|
||||
import "sync"
|
||||
|
||||
// This file contains structures related to holding display state for screens / UI
|
||||
|
||||
const (
|
||||
// ideal sizes for Sections/Zone
|
||||
// we allow these to drift a bit to deal with adding/removing lines
|
||||
DispZoneLines = 16 * 16
|
||||
DispSectionLines = 16
|
||||
DispMaxRatio = 1.6
|
||||
)
|
||||
|
||||
// this will be a map at some point when we have multiple windows, singleton for now
|
||||
var GlobalDisplayState *DispWindowInfo
|
||||
|
||||
// (row, px) <- we use this format so JS is
|
||||
type DispHeight [2]int
|
||||
type DispLineRange [2]int // [start, end] (inclusive). set to [0,0] if no lines
|
||||
|
||||
// this struct comes from the FE
|
||||
type DispWindowInfo struct {
|
||||
Lock *sync.Mutex `json:"-"`
|
||||
ActiveSessionId string `json:"activesessionid"`
|
||||
ActiveScreenId string `json:"activescreenid"`
|
||||
Screens map[string]DispScreenInfo `json:"screens"` // key is "sessionid:screenid" (not a struct for JS integration)
|
||||
}
|
||||
|
||||
type DispScreenInfo struct {
|
||||
SessionId string `json:"sessionid"`
|
||||
ScreenId string `json:"screenid"`
|
||||
SelectedLine int `json:"selectedline"`
|
||||
AnchorLine int `json:"anchorline"`
|
||||
AnchorOffset int `json:"anchoroffset"`
|
||||
}
|
||||
|
||||
type DispZoneInfo struct {
|
||||
ScreenId string `json:"screenid"`
|
||||
ZoneId int `json:"zoneid"`
|
||||
Height DispHeight `json:"height"`
|
||||
NumLines int `json:"numlines"`
|
||||
LineRange DispLineRange `json:"linerange"`
|
||||
}
|
||||
|
||||
type DispSectionInfo struct {
|
||||
ScreenId string `json:"screenid"`
|
||||
ZoneId int `json:"zoneid"`
|
||||
SectionId int `json:"sectionid"`
|
||||
Height DispHeight `json:"height"`
|
||||
LineRange DispLineRange `json:"linerange"`
|
||||
Parts []DispLineInfo `json:"parts"`
|
||||
}
|
||||
|
||||
// includes separators. combined into one struct for efficiency / JS transport
|
||||
type DispLineInfo struct {
|
||||
// for separators
|
||||
IsSep bool `json:"issep,omitempty"`
|
||||
SepString string `json:"sepstring,omitempty"`
|
||||
|
||||
// for lines
|
||||
LineId string `json:"lineid,omitempty"`
|
||||
LineNum int `json:"linenum,omitempty"`
|
||||
LineType string `json:"linetype,omitempty"`
|
||||
Ts int64 `json:"ts,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
Renderer string `json:"renderer,omitempty"`
|
||||
Prompt string `json:"prompt,omitempty"`
|
||||
CmdStr string `json:"cmdstr,omitempty"`
|
||||
Min bool `json:"min,omitempty"`
|
||||
TermOpts string `json:"termopts,omitempty"`
|
||||
Height DispHeight `json:"height,omitempty"`
|
||||
}
|
||||
Reference in New Issue
Block a user