diff --git a/.github/workflows/build-macos-x64.yml b/.github/workflows/build-macos-x64.yml new file mode 100644 index 000000000..948413ee9 --- /dev/null +++ b/.github/workflows/build-macos-x64.yml @@ -0,0 +1,57 @@ +name: "Build MacOS x64" +on: workflow_dispatch +env: + WAVETERM_VERSION: 0.5.3 + GO_VERSION: '1.21.5' + NODE_VERSION: '21.5.0' +jobs: + runbuild-x64: + name: "Build MacOS x64" + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v4 + with: + go-version: ${{env.GO_VERSION}} + cache-dependency-path: | + wavesrv/go.sum + waveshell/go.sum + - run: brew tap scripthaus-dev/scripthaus + - run: brew install scripthaus + - uses: actions/setup-node@v4 + with: + node-version: ${{env.NODE_VERSION}} + cache: 'yarn' + - run: yarn --frozen-lockfile + - run: scripthaus run build-package + - uses: actions/upload-artifact@v3 + with: + name: waveterm-build-darwin-x64 + path: out/make/zip/darwin/x64/*.zip + retention-days: 2 + runbuild-arm64: + name: "Build MacOS arm64" + runs-on: macos-latest-xlarge + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v4 + with: + go-version: ${{env.GO_VERSION}} + cache-dependency-path: | + wavesrv/go.sum + waveshell/go.sum + - run: brew tap scripthaus-dev/scripthaus + - run: brew install scripthaus + - uses: actions/setup-node@v4 + with: + node-version: ${{env.NODE_VERSION}} + cache: 'yarn' + - run: yarn --frozen-lockfile + - run: scripthaus run build-package + - uses: actions/upload-artifact@v3 + with: + name: waveterm-build-darwin-arm64 + path: out/make/zip/darwin/arm64/*.zip + retention-days: 2 + + diff --git a/go.work.sum b/go.work.sum index 2f1321867..c02d99c32 100644 --- a/go.work.sum +++ b/go.work.sum @@ -7,6 +7,8 @@ github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/wavetermdev/ssh_config v0.0.0-20240109090616-36c8da3d7376 h1:tFhJgTu7lgd+hldLfPSzDCoWUpXI8wHKR3rxq5jTLkQ= +github.com/wavetermdev/ssh_config v0.0.0-20240109090616-36c8da3d7376/go.mod h1:q2RIzfka+BXARoNexmF9gkxEX7DmvbW9P4hIVx2Kg4M= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= diff --git a/package.json b/package.json index 7253204e9..472eabd0b 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "@tanstack/react-table": "^8.10.3", "@types/semver": "^7.5.6", "autobind-decorator": "^2.4.0", + "base64-js": "^1.5.1", "classnames": "^2.3.1", "dayjs": "^1.11.3", "dompurify": "^3.0.2", @@ -26,7 +27,6 @@ "papaparse": "^5.4.1", "react": "^18.1.0", "react-dom": "^18.1.0", - "react-json-view": "^1.21.3", "react-markdown": "^9.0.0", "remark": "^15.0.1", "remark-gfm": "^4.0.0", @@ -35,7 +35,8 @@ "tsx-control-statements": "^4.1.1", "uuid": "^9.0.0", "winston": "^3.8.2", - "xterm": "^5.0.0" + "xterm": "^5.0.0", + "xterm-addon-web-links": "^0.9.0" }, "devDependencies": { "@babel/cli": "^7.17.10", @@ -49,17 +50,17 @@ "@babel/preset-env": "^7.18.2", "@babel/preset-react": "^7.23.3", "@babel/preset-typescript": "^7.17.12", - "@electron-forge/cli": "^6.0.0-beta.70", - "@electron-forge/maker-deb": "^6.0.0-beta.70", - "@electron-forge/maker-rpm": "^6.0.0-beta.70", - "@electron-forge/maker-snap": "^6.4.2", - "@electron-forge/maker-squirrel": "^6.0.0-beta.70", - "@electron-forge/maker-zip": "^6.0.0-beta.70", + "@electron-forge/cli": "^7.2.0", + "@electron-forge/maker-deb": "^7.2.0", + "@electron-forge/maker-rpm": "^7.2.0", + "@electron-forge/maker-snap": "^7.2.0", + "@electron-forge/maker-squirrel": "^7.2.0", + "@electron-forge/maker-zip": "^7.2.0", "@electron/rebuild": "^3.4.0", "@svgr/webpack": "^8.1.0", "@types/classnames": "^2.3.1", "@types/electron": "^1.6.10", - "@types/node": "20.10.3", + "@types/node": "20.11.0", "@types/papaparse": "^5.3.10", "@types/react": "^18.0.12", "@types/sprintf-js": "^1.1.3", @@ -70,7 +71,7 @@ "babel-plugin-jsx-control-statements": "^4.1.2", "copy-webpack-plugin": "^11.0.0", "css-loader": "^6.7.1", - "electron": "27.1.3", + "electron": "28.1.3", "file-loader": "^6.2.0", "http-server": "^14.1.1", "less": "^4.1.2", @@ -81,7 +82,7 @@ "raw-loader": "^4.0.2", "react-split-it": "^2.0.0", "style-loader": "^3.3.1", - "typescript": "^4.7.3", + "typescript": "^5.0.0", "webpack": "^5.73.0", "webpack-bundle-analyzer": "^4.10.1", "webpack-cli": "^5.1.4", diff --git a/src/app/app.less b/src/app/app.less index aab2875f7..52aca9d76 100644 --- a/src/app/app.less +++ b/src/app/app.less @@ -476,17 +476,26 @@ a.a-block { } } +.icon.color-default, +.icon.color-green { + path, + circle { + fill: @tab-green; + } + + i { + color: @tab-green; + } +} + .icon.color-red { path, circle { fill: @tab-red; } -} -.icon.color-green { - path, - circle { - fill: @tab-green; + i { + color: @tab-red; } } @@ -495,6 +504,10 @@ a.a-block { circle { fill: @tab-orange; } + + i { + color: @tab-orange; + } } .icon.color-blue { @@ -502,6 +515,10 @@ a.a-block { circle { fill: @tab-blue; } + + i { + color: @tab-blue; + } } .icon.color-yellow { @@ -509,6 +526,10 @@ a.a-block { circle { fill: @tab-yellow; } + + i { + color: @tab-yellow; + } } .icon.color-pink { @@ -516,6 +537,10 @@ a.a-block { circle { fill: @tab-pink; } + + i { + color: @tab-pink; + } } .icon.color-mint { @@ -523,6 +548,10 @@ a.a-block { circle { fill: @tab-mint; } + + i { + color: @tab-mint; + } } .icon.color-cyan { @@ -530,6 +559,10 @@ a.a-block { circle { fill: @tab-cyan; } + + i { + color: @tab-cyan; + } } .icon.color-violet { @@ -537,6 +570,10 @@ a.a-block { circle { fill: @tab-violet; } + + i { + color: @tab-violet; + } } .icon.color-white { @@ -544,6 +581,10 @@ a.a-block { circle { fill: @tab-white; } + + i { + color: @tab-white; + } } .status-icon.status-connected { diff --git a/src/app/app.tsx b/src/app/app.tsx index 7b67a4cda..42dba4207 100644 --- a/src/app/app.tsx +++ b/src/app/app.tsx @@ -16,14 +16,9 @@ import { PluginsView } from "./pluginsview/pluginsview"; import { BookmarksView } from "./bookmarks/bookmarks"; import { HistoryView } from "./history/history"; import { ConnectionsView } from "./connections/connections"; -import { - ScreenSettingsModal, - SessionSettingsModal, - LineSettingsModal, - ClientSettingsModal, -} from "./common/modals/settings"; import { MainSideBar } from "./sidebar/sidebar"; -import { DisconnectedModal, ClientStopModal, ModalsProvider } from "./common/modals/modals"; +import { DisconnectedModal, ClientStopModal } from "./common/modals"; +import { ModalsProvider } from "./common/modals/provider"; import { ErrorBoundary } from "./common/error/errorboundary"; import "./app.less"; @@ -74,7 +69,6 @@ class App extends React.Component<{}, {}> { } render() { - let clientSettingsModal = GlobalModel.clientSettingsModal.get(); let remotesModel = GlobalModel.remotesModel; let disconnected = !GlobalModel.ws.open.get() || !GlobalModel.waveSrvRunning.get(); let hasClientStop = GlobalModel.getHasClientStop(); diff --git a/src/app/appconst.ts b/src/app/appconst.ts index 172bbf984..69bcf6042 100644 --- a/src/app/appconst.ts +++ b/src/app/appconst.ts @@ -7,9 +7,12 @@ export const SCREEN_SETTINGS = "screenSettings"; export const SESSION_SETTINGS = "sessionSettings"; export const LINE_SETTINGS = "lineSettings"; export const CLIENT_SETTINGS = "clientSettings"; +export const TAB_SWITCHER = "tabSwitcher"; export const LineContainer_Main = "main"; export const LineContainer_History = "history"; export const LineContainer_Sidebar = "sidebar"; +export const ConfirmKey_HideShellPrompt = "hideshellprompt"; + export const NoStrPos = -1; diff --git a/src/app/common/common.less b/src/app/common/common.less index e4a46ae0a..ddfd827c2 100644 --- a/src/app/common/common.less +++ b/src/app/common/common.less @@ -188,14 +188,14 @@ position: relative; display: flex; align-items: center; - color: #9e9e9e; + color: @term-bright-white; transition: color 250ms cubic-bezier(0.4, 0, 0.23, 1); } input[type="checkbox"] + label > span { display: flex; justify-content: center; align-items: center; - margin-right: 16px; + margin-right: 10px; width: 20px; height: 20px; background: transparent; @@ -205,10 +205,6 @@ transition: all 250ms cubic-bezier(0.4, 0, 0.23, 1); } - input[type="checkbox"] + label:hover, - input[type="checkbox"]:focus + label { - color: #fff; - } input[type="checkbox"] + label:hover > span, input[type="checkbox"]:focus + label > span { background: rgba(255, 255, 255, 0.1); @@ -356,7 +352,7 @@ background-color: @markdown-highlight; color: @term-white; font-family: @terminal-font; - display: inline-block; + border-radius: 4px; } code.inline { @@ -407,6 +403,13 @@ background-color: @markdown-highlight; margin: 4px 10px 4px 10px; padding: 6px 6px 6px 10px; + border-radius: 4px; + } + + pre.selected { + border-style: solid; + outline-width: 2px; + border-color: @term-green; } .title.is-1 { @@ -837,6 +840,14 @@ } } } + + &.no-label { + height: 34px; + + input { + height: 32px; + } + } } .wave-input-decoration { diff --git a/src/app/common/common.tsx b/src/app/common/common.tsx index 87dbcccea..90183571f 100644 --- a/src/app/common/common.tsx +++ b/src/app/common/common.tsx @@ -11,6 +11,7 @@ import cn from "classnames"; import { If } from "tsx-control-statements/components"; import type { RemoteType } from "../../types/types"; import ReactDOM from "react-dom"; +import { GlobalModel } from "../../model/model"; import { ReactComponent as CheckIcon } from "../assets/icons/line/check.svg"; import { ReactComponent as CopyIcon } from "../assets/icons/history/copy.svg"; @@ -99,23 +100,57 @@ class Toggle extends React.Component<{ checked: boolean; onChange: (value: boole } class Checkbox extends React.Component< - { checked: boolean; onChange: (value: boolean) => void; label: React.ReactNode; id: string }, - {} + { + checked?: boolean; + defaultChecked?: boolean; + onChange: (value: boolean) => void; + label: React.ReactNode; + className?: string; + id?: string; + }, + { checkedInternal: boolean } > { + generatedId; + static idCounter = 0; + + constructor(props) { + super(props); + this.state = { + checkedInternal: this.props.checked !== undefined ? this.props.checked : Boolean(this.props.defaultChecked), + }; + this.generatedId = `checkbox-${Checkbox.idCounter++}`; + } + + componentDidUpdate(prevProps) { + if (this.props.checked !== undefined && this.props.checked !== prevProps.checked) { + this.setState({ checkedInternal: this.props.checked }); + } + } + + handleChange = (e) => { + const newChecked = e.target.checked; + if (this.props.checked === undefined) { + this.setState({ checkedInternal: newChecked }); + } + this.props.onChange(newChecked); + }; + render() { - const { checked, onChange, label, id } = this.props; + const { label, className, id } = this.props; + const { checkedInternal } = this.state; + const checkboxId = id || this.generatedId; return ( -
+
onChange(e.target.checked)} - aria-checked={checked} + id={checkboxId} + checked={checkedInternal} + onChange={this.handleChange} + aria-checked={checkedInternal} role="checkbox" /> -