Compare commits

..

32 Commits

Author SHA1 Message Date
sawka c711d32f54 bump version to v0.7.4 2024-05-01 21:07:48 -07:00
sawka 89f117b922 remove k8s prompt commands (performance issue) 2024-05-01 21:06:57 -07:00
Mike Sawka 03cdc067e7 cmdinput keybindings (#627) 2024-04-30 18:44:40 -07:00
Cole Lashley 6c3e5b8746 Block store (#578)
Contains the implementation of the block store

In this pr is a simple way to send and receive data through a database

I have implemented the base functionality as well as quite a few tests
to make sure that everything works
 
There are a few methods that have yet to be implemented, but
theoretically they should be implemented as calls to the other
functions, ie append should just be a call to WriteAt

This doesn't affect anything yet so it can safely be merged whenever. I
don't want this pr to stagnate like file view, so I'm happy to write
multiple prs for this
2024-04-30 18:21:31 -07:00
Evan Simkowitz e1a931056c Fix the sidebar X target so that there isn't a weird padding that shows the pointer cursor (#626) 2024-04-30 18:12:21 -07:00
Evan Simkowitz 1c2c0c5efc Use FOSSA to generate license reports on every PR (#625) 2024-04-30 17:27:20 -07:00
Cole Lashley f6881cf380 Ai chat select fix (#622) 2024-04-30 17:16:03 -07:00
Evan Simkowitz 345356d8d4 Make connections modal scrollable (#623) 2024-04-30 16:43:47 -07:00
Ian Jennings 8cea209823 TestDriver.ai: Validate that overlapping text does not appear in UI (#528) 2024-04-30 16:43:27 -07:00
Evan Simkowitz a16e01f73b Make Client Settings and connections views scrollable, fix regression in unused bookmarks feature (#621)
Makes clientsettings scrollable, adds an option for mainview to wrap the
mainview-content in an OverlayScrollbarsComponent
2024-04-30 16:05:49 -07:00
Mike Sawka 8c63be4ea0 fix cmdinput cursor positioning on mount (#620) 2024-04-30 14:28:52 -07:00
Evan Simkowitz 35e0488f7b Call makeObservable for all cmdInput classes (#619) 2024-04-30 13:58:54 -07:00
Ian Jennings c53e0a99f6 TestDriver.ai: Add comments to PRs (#498) 2024-04-30 12:37:22 -07:00
Cole Lashley e6df2c216d Client show defaults small fix (#614) 2024-04-30 11:37:01 -07:00
Evan Simkowitz c6a8797ddd Break out non-autocomplete changes from autocomplete PR (#618)
This improves the ephemeral command runner to allow for honoring of
timeouts and proper handling of overriding the current working
directory. It also fixes some partially transparent font colors in light
mode, making them solid instead. It also updates the InputModel to be
auto-observable and utilize some getters to ensure the cmdinput is
getting updated whenever necessary state changes take place.
2024-04-29 18:29:27 -07:00
Cole Lashley ac91fa8596 fixed ai timeout bug (#617) 2024-04-29 15:56:20 -07:00
Evan Simkowitz 50662c2152 Fixes a regression that would unfocus from the history input (#615)
* Fixes a regression that would unfocus from the history input

* remove debug statements

* Update historyinfo.tsx

* fix scrolling the right way
2024-04-29 15:08:11 -07:00
Cole Lashley 4296856cc1 Fixed separator code in config path (#616)
* un quoted separator in config

* addressed review comments
2024-04-29 12:40:36 -07:00
Evan Simkowitz d0867477ff add path separator for config dir handler (#613) 2024-04-26 12:08:10 -07:00
Evan Simkowitz 25b77c7fee Attempt 2 to resolve security warning (#612)
* replace path with filepath

* remove configPath from error

* remove unnecessary printf

* replace more paths with filepath

* remove unnecessary abs path call

* bad commit
2024-04-26 12:00:11 -07:00
Evan Simkowitz db557e0b69 Validate config dir path to resolve security warning (#611)
* Attempt to validate config path to resolve security warning

* move above fullpath

* make sure path does not reference parent dir
2024-04-26 11:23:09 -07:00
Ian Jennings 22c5d224bd TestDriver: Update to 2.9.4 (#607)
* update to 2.9.4

* move prerun to action file

* update v

* migrate prompt

* bunk update to trigger re-run
2024-04-26 11:11:30 -07:00
Cole Lashley 4f32c459a6 Small aux view fixes that make cmdinput focus work a bit better (#594)
* added some more fixes for aichat and cmdinput

* removed comments and fixed up merge conflicts

* small fix

* fixed bug
2024-04-26 11:11:03 -07:00
Sylvie Crowe a449cec33a Sudo Config Gui (#603)
* feat: add gui elements to configure ssh pw cache

This adds a dropdown for on/off/notimeout, a number entry box for a
timeout value, and a toggle for clearing when the computer sleeps.

* fix: improve password timeout entry

This makes the password timeout more consistent by  using an inline
settings element. It also creates the inline settings element to parse
the input.

* feat: turn sudo password caching on and off

* feat: use configurable sudo timeout

This makes it possible to control how long waveterm stores your sudo
password. Note that if it changes, it immediately clears the cached
passwords.

* fix: clear existing sudo passwords if switched off

When the sudo password store state is changed to "off", all existing
passwords must immediately be cleared automatically.

* feat: allow clearing sudo passwords on suspend

This option makes it so the sudo passwords will be cleared when the
computer falls asleep.  It will never be used in the case where the
password is set to never time out.

* feat: allow notimeout to prevent sudo pw clear

This option allows the sudo timeout to be ignored while it is selected.

* feat: adjust current deadline based on user config

This allows the deadline to update as changes to the config are
happening.

* fix: reject a sudopwtimeout of 0 on the backend

* fix: use the default sudoPwTimeout for empty input

* fix: specify the timeout length is minutes

* fix: store sudopwtimeout in ms instead of minutes

* fix: formatting the default sudo timeout

By changing the order of operations, this no longer shows up as NaN if
the default is used.

* refactor: consolidate inlinesettingstextedit

This removes the number variant and combines them into the same class
with an option to switch between the two behaviors.

* refactor: consolidate textfield and numberfield

This removes the number variant of textfield. The textfield component
can now act as a numberfield when  the optional isNumber prop is true.
2024-04-25 18:19:43 -07:00
Cole Lashley 5e3243564b Open AI Timeout setting and aliases for AI settings (#590)
* added ai timeout setting

* addressed review comments

* fixed baseurl gating for telemetry

* updated copy

* addressed review comments

* removed prefix for client:show and added units to timeout

* changed timeout to use ms precision
2024-04-25 16:14:37 -07:00
Mike Sawka fcf8e4ed44 ignore ptmx error (#608) 2024-04-25 15:35:48 -07:00
Mike Sawka 21d0dd076b increase max websocket read limit. protect frontend from exceeding the read limit. limit input size to 10k characters. (#606) 2024-04-25 15:07:41 -07:00
Mike Sawka 6e28151dad update dependencies (including electron v30) (#605)
* remove console.logs

* update dependencies
2024-04-25 14:03:38 -07:00
Red J Adaya 12e267ad81 Truncate dropdown value (#602)
* truncate dropdown value

* more defensive programming for width
2024-04-25 13:36:11 -07:00
Red J Adaya 35037ac1f1 add padding around remote status warning (#598) 2024-04-25 13:29:24 -07:00
Mike Sawka 0649a73d84 bump wave version to v0.7.3, bump waveshell version to v0.7 (#604) 2024-04-25 11:17:52 -07:00
Red J Adaya 50203a6934 Simplified terminal theming (#570)
* save work

* reusable StyleBlock component

* StyleBlock in elements dir

* root level

* ability to inherit root styles

* change prop from classname to selector

* selector should always be :root

* remove selector prop from StyleBlock

* working

* cleanup

* loadThemeStyles doesn't have to be async

* revert changes in tabs2.less

* remove old implementation

* cleanup

* remove file from another branch

* fix issue where line in history view doesn't reflect the terminal theme

* add key and value validation

* add label to tab settings terminal theme dropdown

* save work

* save work

* save work

* working

* trigger componentDidUpdate when switching tabs and sessions

* cleanup

* save work

* save work

* use UpdatePacket for theme changes as well

* make methods cohesive

* use themes coming from backend

* reload terminal when styel block is unmounted and mounted

* fix validation

* re-render terminal when theme is updated

* remove test styles

* cleanup

* more cleanup

* revert unneeded change

* more cleanup

* fix type

* more cleanup

* render style blocks in the header instead of body using portal

* add ability to reuse and dispose TermThemes instance and file watcher

* remove comment

* minor change

* separate filewatcher as singleton

* do not render app when term theme style blocks aren't rendered first

* only render main when termstyles have been rendered already

* add comment

* use DoUpdate to send themes to front-end

* support to watch subdirectories

* added support for watch subdirectories

* make watcher more flexible so it can be closed anywhere

* cleanup

* undo the app/main split

* use TermThemesType in creating initial value for Themes field

* simplify code

* fix issue where dropdown label doesn't float when the theme selected is Inherit

* remove unsed var

* start watcher in main, merge themes (don't overwrite) on event.

* ensure terminal-themes directory is created on startup

* ah, wait for termThemes to be set (the connect packet needs to have been processed to proceed with rendering)
2024-04-23 23:22:35 -07:00
98 changed files with 3849 additions and 25490 deletions
+51 -12
View File
@@ -1,26 +1,65 @@
name: TestDriver.ai Regression Testing
on:
push:
branches: ["main"]
branches:
- main
pull_request:
branches: ["main"]
branches:
- main
schedule:
- cron: "0 21 * * *" # every day at 9pm
workflow_dispatch:
- cron: 0 21 * * *
workflow_dispatch: null
permissions:
contents: read # To allow the action to read repository contents
pull-requests: write # To allow the action to create/update pull request comments
jobs:
test:
name: "TestDriver"
name: TestDriver
runs-on: ubuntu-latest
steps:
- uses: dashcamio/testdriver@main
id: testdriver
# note that .testdriver/prerun.sh runs before this, so the app has launched already
with:
version: v2.10.2
prerun: |
rm ~/Desktop/WITH-LOVE-FROM-AMERICA.txt
cd ~/actions-runner/_work/testdriver/testdriver/
brew install go
brew tap scripthaus-dev/scripthaus
brew install scripthaus
npm install -g yarn
scripthaus run build-backend
echo "Yarn"
yarn
echo "Rebuild"
scripthaus run electron-rebuild
echo "Webpack"
scripthaus run webpack-build
echo "Starting Electron"
scripthaus run electron 1>/dev/null 2>&1 &
echo "Electron Done"
exit
prompt: |
2. click "Continue"
2. focus the Wave input with the keyboard shorcut Command + I
3. type 'ls' into the input
4. press return
5. validate Wave shows the result of 'ls'
1. wait 10 seconds
1. click "Continue"
1. click "Create new tab"
1. validate that overlapping text does not appear in the application
1. focus the Wave input with the keyboard shorcut Command + I
1. type 'ls' into the input
1. press return
1. validate Wave shows the result of 'ls'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: peter-evans/create-or-update-comment@v4
if: ${{always()}}
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
## TestDriver Summary
${{ steps.testdriver.outputs.markdown }}
${{ steps.testdriver.outputs.summary }}
reactions: |
+1
-1
+6
View File
@@ -9,6 +9,8 @@
# Wave Terminal
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fwavetermdev%2Fwaveterm.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fwavetermdev%2Fwaveterm?ref=badge_shield)
Wave is an open-source AI-native terminal built for seamless workflows.
Wave isn't just another terminal emulator; it's a rethink on how terminals are built. Wave combines command line with the power of the open web to help veteran CLI users and new developers alike.
@@ -56,3 +58,7 @@ Find more information in our [Contributions Guide](CONTRIBUTING.md), which inclu
- [Ways to contribute](CONTRIBUTING.md#contributing-to-wave-terminal)
- [Contribution guidelines](CONTRIBUTING.md#before-you-start)
## License
Wave Terminal is licensed under the Apache-2.0 License. For more information on our dependencies, see [here](./acknowledgements/README.md).
+2 -17
View File
@@ -1,20 +1,5 @@
# Open-Source Acknowledgements
We make use of many amazing open-source projects to build Wave Terminal. Here are the links to the latest acknowledgements for each of our components, including license disclaimers for each dependency:
We make use of many amazing open-source projects to build Wave Terminal. We automatically generate license reports via FOSSA to comply with the license distribution requirements of our dependencies. Below is a summary of the licenses used by our product. Clicking on the image will take you to the full report on FOSSA's website.
- [Frontend](./disclaimers/frontend.md)
- [Backend](./disclaimers/backend.md)
## Generating license disclaimers
The license disclaimers for the backend are generated using the [go-licenses](https://github.com/google/go-licenses) tool. We supply a template file ([`go_licenses_report.tpl`](./go_licenses_report.tpl)) to generate a pretty print of the disclaimers for each dependency. This outputs to the file [`backend.md`](./disclaimers/backend.md).
The license disclaimers for the frontend are generated using the [`yarn licenses` tool](https://classic.yarnpkg.com/lang/en/docs/cli/licenses/). This outputs to the file [`frontend.md`](./disclaimers/frontend.md).
These disclaimer files linked above will be periodically regenerated to reflect new dependencies.
The [`scripthaus.md` file](../scripthaus.md) contains scripts to generate the disclaimers and package them. To manually generate the disclaimers, run the following from the repository root directory:
```bash
scripthaus run generate-license-disclaimers
```
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fwavetermdev%2Fwaveterm.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fwavetermdev%2Fwaveterm?ref=badge_large)
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
-16
View File
@@ -1,16 +0,0 @@
# Wave Terminal Backend Acknowledgements
The following sets forth attribution notices for third party software that may be contained in portions of the Wave Terminal product.
{{ range . }}
## {{ .Name }}
* Name: {{ .Name }}
* Version: {{ .Version }}
* License: [{{ .LicenseName }}]({{ .LicenseURL }})
```txt
{{ .LicenseText }}
```
-----
{{ end }}
+7 -11
View File
@@ -6,7 +6,7 @@
},
"productName": "Wave",
"description": "An Open-Source, AI-Native, Terminal Built for Seamless Workflows",
"version": "0.7.2",
"version": "0.7.4",
"main": "dist/emain.js",
"license": "Apache-2.0",
"repository": {
@@ -24,7 +24,6 @@
"@table-nav/react": "^0.0.7",
"@tanstack/match-sorter-utils": "^8.8.4",
"@tanstack/react-table": "^8.10.3",
"@withfig/autocomplete": "^2.652.3",
"autobind-decorator": "^2.4.0",
"base64-js": "^1.5.1",
"classnames": "^2.3.1",
@@ -33,10 +32,10 @@
"electron-squirrel-startup": "^1.0.0",
"electron-updater": "^6.1.8",
"framer-motion": "^10.16.16",
"lexical": "^0.14.3",
"lexical": "0.14.5",
"mobx": "6.12",
"mobx-react": "^7.5.0",
"monaco-editor": "^0.44.0",
"monaco-editor": "0.48.0",
"mustache": "^4.2.0",
"node-fetch": "^3.2.10",
"overlayscrollbars": "^2.6.1",
@@ -47,7 +46,6 @@
"react-markdown": "^9.0.0",
"remark": "^15.0.1",
"remark-gfm": "^4.0.0",
"shell-quote": "^1.8.1",
"sprintf-js": "^1.1.2",
"throttle-debounce": "^5.0.0",
"tsx-control-statements": "^5.1.1",
@@ -78,17 +76,15 @@
"@types/papaparse": "^5.3.10",
"@types/react": "^18.0.12",
"@types/semver": "^7.5.6",
"@types/shell-quote": "^1.7.5",
"@types/sprintf-js": "^1.1.3",
"@types/throttle-debounce": "^5.0.1",
"@types/uuid": "^9.0.7",
"@types/webpack-env": "^1.18.3",
"@withfig/autocomplete-types": "^1.30.0",
"babel-loader": "^9.1.3",
"babel-plugin-jsx-control-statements": "^4.1.2",
"copy-webpack-plugin": "^12.0.0",
"css-loader": "^6.7.1",
"electron": "^29.0.1",
"css-loader": "^7.1.0",
"electron": "^30.0.1",
"electron-builder": "^24.13.3",
"electron-builder-squirrel-windows": "^24.13.3",
"file-loader": "^6.2.0",
@@ -100,7 +96,7 @@
"prettier": "^2.8.8",
"raw-loader": "^4.0.2",
"react-split-it": "^2.0.0",
"style-loader": "^3.3.1",
"style-loader": "4.0.0",
"typescript": "^5.0.0",
"webpack": "^5.73.0",
"webpack-bundle-analyzer": "^4.10.1",
@@ -112,4 +108,4 @@
"scripts": {
"postinstall": "electron-builder install-app-deps"
}
}
}
+1 -1
View File
@@ -156,7 +156,7 @@
--table-border-color: rgba(241, 246, 243, 0.15);
--table-thead-border-top-color: rgba(250, 250, 250, 0.1);
--table-thead-bright-border-color: rgb(204, 204, 204);
--table-thead-bg-color: rgba(250, 250, 250, 0.02);
--table-thead-bg-color: rgb(5, 5, 5);
--table-tr-border-bottom-color: rgba(241, 246, 243, 0.15);
--table-tr-hover-bg-color: rgba(255, 255, 255, 0.06);
--table-tr-selected-bg-color: rgb(34, 34, 34);
+4
View File
@@ -57,6 +57,10 @@
--scrollbar-thumb-hover-color: rgba(0, 0, 0, 0.4);
--scrollbar-thumb-active-color: rgba(0, 0, 0, 0.5);
/* table colors */
--table-thead-bg-color: rgb(253, 253, 253);
--table-tr-selected-bg-color: rgb(216, 216, 216);
/* line color */
--line-actions-bg-color: rgba(0, 0, 0, 0.1);
--line-actions-inactive-color: rgba(0, 0, 0, 0.3);
+3 -3
View File
@@ -44,7 +44,7 @@ rm -rf bin/
rm -rf build/
node_modules/.bin/webpack --env prod
WAVESRV_VERSION=$(node -e 'console.log(require("./version.js"))')
WAVESHELL_VERSION=v0.6
WAVESHELL_VERSION=v0.7
GO_LDFLAGS="-s -w -X main.BuildTime=$(date +'%Y%m%d%H%M')"
function buildWaveShell {
(cd waveshell; CGO_ENABLED=0 GOOS=$1 GOARCH=$2 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-$WAVESHELL_VERSION-$1.$2 main-waveshell.go)
@@ -69,7 +69,7 @@ rm -rf bin/
rm -rf build/
node_modules/.bin/webpack --env prod
WAVESRV_VERSION=$(node -e 'console.log(require("./version.js"))')
WAVESHELL_VERSION=v0.6
WAVESHELL_VERSION=v0.7
GO_LDFLAGS="-s -w -X main.BuildTime=$(date +'%Y%m%d%H%M')"
function buildWaveShell {
(cd waveshell; CGO_ENABLED=0 GOOS=$1 GOARCH=$2 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-$WAVESHELL_VERSION-$1.$2 main-waveshell.go)
@@ -96,7 +96,7 @@ CGO_ENABLED=1 go build -tags "osusergo,netgo,sqlite_omit_load_extension" -ldflag
```bash
# @scripthaus command fullbuild-waveshell
set -e
WAVESHELL_VERSION=v0.6
WAVESHELL_VERSION=v0.7
GO_LDFLAGS="-s -w -X main.BuildTime=$(date +'%Y%m%d%H%M')"
function buildWaveShell {
(cd waveshell; CGO_ENABLED=0 GOOS=$1 GOARCH=$2 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-$WAVESHELL_VERSION-$1.$2 main-waveshell.go)
+64 -43
View File
@@ -4,10 +4,10 @@
import * as React from "react";
import * as mobxReact from "mobx-react";
import * as mobx from "mobx";
import cn from "classnames";
import { boundMethod } from "autobind-decorator";
import { If } from "tsx-control-statements/components";
import dayjs from "dayjs";
import localizedFormat from "dayjs/plugin/localizedFormat";
import { GlobalModel } from "@/models";
import { isBlank } from "@/util/util";
import { WorkspaceView } from "./workspace/workspaceview";
@@ -22,15 +22,15 @@ import { DisconnectedModal, ClientStopModal } from "@/modals";
import { ModalsProvider } from "@/modals/provider";
import { Button } from "@/elements";
import { ErrorBoundary } from "@/common/error/errorboundary";
import cn from "classnames";
import "./app.less";
import { TermStyleList } from "@/elements";
dayjs.extend(localizedFormat);
import "./app.less";
@mobxReact.observer
class App extends React.Component<{}, {}> {
dcWait: OV<boolean> = mobx.observable.box(false, { name: "dcWait" });
mainContentRef: React.RefObject<HTMLDivElement> = React.createRef();
termThemesLoaded: OV<boolean> = mobx.observable.box(false, { name: "termThemesLoaded" });
constructor(props: {}) {
super(props);
@@ -80,6 +80,13 @@ class App extends React.Component<{}, {}> {
rightSidebarModel.saveState(width, false);
}
@boundMethod
handleTermThemesRendered() {
mobx.action(() => {
this.termThemesLoaded.set(true);
})();
}
render() {
const remotesModel = GlobalModel.remotesModel;
const disconnected = !GlobalModel.ws.open.get() || !GlobalModel.waveSrvRunning.get();
@@ -90,7 +97,8 @@ class App extends React.Component<{}, {}> {
// Previously, this is done in sidebar.tsx but it causes flicker when clientData is null cos screen-view shifts around.
// Doing it here fixes the flicker cos app is not rendered until clientData is populated.
if (clientData == null) {
// wait for termThemes as well (this actually means that the "connect" packet has been received)
if (clientData == null || GlobalModel.termThemes.get() == null) {
return null;
}
@@ -118,52 +126,65 @@ class App extends React.Component<{}, {}> {
if (dcWait) {
setTimeout(() => this.updateDcWait(false), 0);
}
// used to force a full reload of the application
const renderVersion = GlobalModel.renderVersion.get();
const mainSidebarCollapsed = GlobalModel.mainSidebarModel.getCollapsed();
const rightSidebarCollapsed = GlobalModel.rightSidebarModel.getCollapsed();
const activeMainView = GlobalModel.activeMainView.get();
const lightDarkClass = GlobalModel.isDarkTheme.get() ? "is-dark" : "is-light";
const mainClassName = cn(
"platform-" + platform,
{
"mainsidebar-collapsed": mainSidebarCollapsed,
"rightsidebar-collapsed": rightSidebarCollapsed,
},
lightDarkClass
);
return (
<div
key={"version-" + renderVersion}
id="main"
className={cn(
"platform-" + platform,
{ "mainsidebar-collapsed": mainSidebarCollapsed, "rightsidebar-collapsed": rightSidebarCollapsed },
lightDarkClass
)}
onContextMenu={this.handleContextMenu}
>
<If condition={mainSidebarCollapsed}>
<div key="logo-button" className="logo-button-container">
<div className="logo-button-spacer" />
<div className="logo-button" onClick={this.openMainSidebar}>
<img src="public/logos/wave-logo.png" alt="logo" />
<>
<TermStyleList onRendered={this.handleTermThemesRendered} />
<div
key={`version- + ${renderVersion}`}
id="main"
className={mainClassName}
onContextMenu={this.handleContextMenu}
>
<If condition={this.termThemesLoaded.get()}>
<If condition={mainSidebarCollapsed}>
<div key="logo-button" className="logo-button-container">
<div className="logo-button-spacer" />
<div className="logo-button" onClick={this.openMainSidebar}>
<img src="public/logos/wave-logo.png" alt="logo" />
</div>
</div>
</If>
<If condition={GlobalModel.isDev && rightSidebarCollapsed && activeMainView == "session"}>
<div className="right-sidebar-triggers">
<Button
className="secondary ghost right-sidebar-trigger"
onClick={this.openRightSidebar}
>
<i className="fa-sharp fa-solid fa-sidebar-flip"></i>
</Button>
</div>
</If>
<div ref={this.mainContentRef} className="main-content">
<MainSideBar parentRef={this.mainContentRef} />
<ErrorBoundary>
<PluginsView />
<WorkspaceView />
<HistoryView />
<BookmarksView />
<ConnectionsView model={remotesModel} />
<ClientSettingsView model={remotesModel} />
</ErrorBoundary>
<RightSideBar parentRef={this.mainContentRef} />
</div>
</div>
</If>
<If condition={GlobalModel.isDev && rightSidebarCollapsed && activeMainView == "session"}>
<div className="right-sidebar-triggers">
<Button className="secondary ghost right-sidebar-trigger" onClick={this.openRightSidebar}>
<i className="fa-sharp fa-solid fa-sidebar-flip"></i>
</Button>
</div>
</If>
<div ref={this.mainContentRef} className="main-content">
<MainSideBar parentRef={this.mainContentRef} />
<ErrorBoundary>
<PluginsView />
<WorkspaceView />
<HistoryView />
<BookmarksView />
<ConnectionsView model={remotesModel} />
<ClientSettingsView model={remotesModel} />
</ErrorBoundary>
<RightSideBar parentRef={this.mainContentRef} />
<ModalsProvider />
</If>
</div>
<ModalsProvider />
</div>
</>
);
}
}
+4 -1
View File
@@ -46,6 +46,10 @@ export const TabIcons = [
"heart",
"file",
];
export const DefaultSudoPwStore = "on";
export const DefaultSudoPwTimeoutMs = 5 * 60 * 1000;
export const MaxWebSocketSendSize = 64 * 1024 - 100;
// @ts-ignore
export const VERSION = __WAVETERM_VERSION__;
@@ -68,4 +72,3 @@ export const ErrorCode_InvalidCwd = "ERRCWD";
export const InputAuxView_History = "history";
export const InputAuxView_Info = "info";
export const InputAuxView_AIChat = "aichat";
export const InputAuxView_Suggestions = "suggestions";
+2 -1
View File
@@ -1,6 +1,7 @@
.clientsettings-view {
.content {
padding: 14px 18px 0 30px;
padding: 14px 18px 14px 30px;
overflow-y: scroll;
}
.wave-dropdown {
+90 -28
View File
@@ -11,9 +11,10 @@ import { Toggle, InlineSettingsTextEdit, SettingsError, Dropdown } from "@/commo
import { commandRtnHandler, isBlank } from "@/util/util";
import { getTermThemes } from "@/util/themeutil";
import * as appconst from "@/app/appconst";
import { MainView } from "@/common/elements/mainview";
import "./clientsettings.less";
import { MainView } from "../common/elements/mainview";
import { OverlayScrollbarsComponent } from "overlayscrollbars-react";
class ClientSettingsKeybindings extends React.Component<{}, {}> {
componentDidMount() {
@@ -76,14 +77,13 @@ class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hove
@boundMethod
handleChangeTermTheme(theme: string): void {
// For global terminal theme, the key is global, otherwise it's either
// For root terminal theme, the key is root, otherwise it's either
// sessionId or screenId.
const currTheme = GlobalModel.getTermTheme()["global"];
const currTheme = GlobalModel.getTermThemeSettings()["root"];
if (currTheme == theme) {
return;
}
const prtn = GlobalCommandRunner.setGlobalTermTheme(theme, false);
const prtn = GlobalCommandRunner.setRootTermTheme(theme, false);
commandRtnHandler(prtn, this.errorMessage);
}
@@ -110,19 +110,6 @@ class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hove
GlobalModel.getElectronApi().changeAutoUpdate(val);
}
@boundMethod
handleChangeAutocompleteEnabled(val: boolean): void {
const prtn: Promise<CommandRtnType> = GlobalCommandRunner.setAutocompleteEnabled(val);
commandRtnHandler(prtn, this.errorMessage);
}
@boundMethod
handleChangeAutocompleteDebuggingEnabled(val: boolean): void {
mobx.action(() => {
GlobalModel.autocompleteModel.loggingEnabled = val;
})();
}
getFontSizes(): DropdownItem[] {
const availableFontSizes: DropdownItem[] = [];
for (let s = appconst.MinFontSize; s <= appconst.MaxFontSize; s++) {
@@ -171,6 +158,12 @@ class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hove
commandRtnHandler(prtn, this.errorMessage);
}
@boundMethod
inlineUpdateOpenAITimeout(newTimeout: string): void {
const prtn = GlobalCommandRunner.setClientOpenAISettings({ timeout: newTimeout });
commandRtnHandler(prtn, this.errorMessage);
}
@boundMethod
setErrorMessage(msg: string): void {
mobx.action(() => {
@@ -205,6 +198,35 @@ class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hove
GlobalModel.clientSettingsViewModel.closeView();
}
@boundMethod
getSudoPwStoreOptions(): DropdownItem[] {
const sudoCacheSources: DropdownItem[] = [];
sudoCacheSources.push({ label: "On", value: "on" });
sudoCacheSources.push({ label: "Off", value: "off" });
sudoCacheSources.push({ label: "On Without Timeout", value: "notimeout" });
return sudoCacheSources;
}
@boundMethod
handleChangeSudoPwStoreConfig(store: string) {
const prtn = GlobalCommandRunner.setSudoPwStore(store);
commandRtnHandler(prtn, this.errorMessage);
}
@boundMethod
handleChangeSudoPwTimeoutConfig(timeout: string) {
if (Number(timeout) != 0) {
const prtn = GlobalCommandRunner.setSudoPwTimeout(timeout);
commandRtnHandler(prtn, this.errorMessage);
}
}
@boundMethod
handleChangeSudoPwClearOnSleepConfig(clearOnSleep: boolean) {
const prtn = GlobalCommandRunner.setSudoPwClearOnSleep(clearOnSleep);
commandRtnHandler(prtn, this.errorMessage);
}
render() {
const isHidden = GlobalModel.activeMainView.get() != "clientsettings";
if (isHidden) {
@@ -217,14 +239,25 @@ class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hove
const maxTokensStr = String(
openAIOpts.maxtokens == null || openAIOpts.maxtokens == 0 ? 1000 : openAIOpts.maxtokens
);
const aiTimeoutStr = String(
openAIOpts.timeout == null || openAIOpts.timeout == 0 ? 10 : openAIOpts.timeout / 1000
);
const curFontSize = GlobalModel.getTermFontSize();
const curFontFamily = GlobalModel.getTermFontFamily();
const curTheme = GlobalModel.getThemeSource();
const termThemes = getTermThemes(GlobalModel.termThemes, "Wave Default");
const currTermTheme = GlobalModel.getTermTheme()["global"] ?? termThemes[0].label;
const termThemes = getTermThemes(GlobalModel.termThemes.get(), "Wave Default");
const currTermTheme = GlobalModel.getTermThemeSettings()["root"] ?? termThemes[0].label;
const curSudoPwStore = GlobalModel.getSudoPwStore();
const curSudoPwTimeout = String(GlobalModel.getSudoPwTimeout());
const curSudoPwClearOnSleep = GlobalModel.getSudoPwClearOnSleep();
return (
<MainView className="clientsettings-view" title="Client Settings" onClose={this.handleClose}>
<MainView
className="clientsettings-view"
title="Client Settings"
onClose={this.handleClose}
scrollable={true}
>
<If condition={!isHidden}>
<ClientSettingsKeybindings></ClientSettingsKeybindings>
</If>
@@ -356,6 +389,19 @@ class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hove
/>
</div>
</div>
<div className="settings-field">
<div className="settings-label">AI Timeout (seconds)</div>
<div className="settings-input">
<InlineSettingsTextEdit
placeholder=""
text={aiTimeoutStr}
value={aiTimeoutStr}
onChange={this.inlineUpdateOpenAITimeout}
maxLength={10}
showIcon={true}
/>
</div>
</div>
<div className="settings-field">
<div className="settings-label">Global Hotkey</div>
<div className="settings-input">
@@ -368,20 +414,36 @@ class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hove
</div>
</div>
<div className="settings-field">
<div className="settings-label">Command Autocomplete</div>
<div className="settings-label">Remember Sudo Password</div>
<div className="settings-input">
<Toggle
checked={cdata.clientopts.autocompleteenabled ?? false}
onChange={this.handleChangeAutocompleteEnabled}
<Dropdown
className="hotkey-dropdown"
options={this.getSudoPwStoreOptions()}
defaultValue={curSudoPwStore}
onChange={this.handleChangeSudoPwStoreConfig}
/>
</div>
</div>
<div className="settings-field">
<div className="settings-label">Command Autocomplete Debugging</div>
<div className="settings-label">Sudo Timeout (Minutes)</div>
<div className="settings-input">
<InlineSettingsTextEdit
placeholder=""
text={curSudoPwTimeout}
value={curSudoPwTimeout}
onChange={this.handleChangeSudoPwTimeoutConfig}
maxLength={6}
showIcon={true}
isNumber={true}
/>
</div>
</div>
<div className="settings-field">
<div className="settings-label">Clear Sudo Password on Sleep</div>
<div className="settings-input">
<Toggle
checked={GlobalModel.autocompleteModel.loggingEnabled}
onChange={this.handleChangeAutocompleteDebuggingEnabled}
checked={curSudoPwClearOnSleep}
onChange={this.handleChangeSudoPwClearOnSleepConfig}
/>
</div>
</div>
+9 -2
View File
@@ -258,7 +258,11 @@ class Dropdown extends React.Component<DropdownProps, DropdownState> {
document.getElementById("app")!
)
: null;
let selectedOptionLabelStyle = {};
const wrapperClientWidth = this.wrapperRef.current?.clientWidth;
if ((wrapperClientWidth ?? 0) > 0) {
selectedOptionLabelStyle["width"] = Math.max(wrapperClientWidth - 55, 0);
}
return (
<div
className={cn("wave-dropdown", className, {
@@ -284,7 +288,10 @@ class Dropdown extends React.Component<DropdownProps, DropdownState> {
</div>
</If>
<div
className={cn("wave-dropdown-display unselectable", { "offset-left": decoration?.startDecoration })}
className={cn("wave-dropdown-display unselectable truncate", {
"offset-left": decoration?.startDecoration,
})}
style={selectedOptionLabelStyle}
>
{selectedOptionLabel}
</div>
+1 -1
View File
@@ -8,7 +8,6 @@ export { InputDecoration } from "./inputdecoration";
export { LinkButton } from "./linkbutton";
export { Markdown } from "./markdown";
export { Modal } from "./modal";
export { NumberField } from "./numberfield";
export { PasswordField } from "./passwordfield";
export { ResizableSidebar } from "./resizablesidebar";
export { SettingsError } from "./settingserror";
@@ -18,4 +17,5 @@ export { Toggle } from "./toggle";
export { Tooltip } from "./tooltip";
export { TabIcon } from "./tabicon";
export { DatePicker } from "./datepicker";
export { TermStyleList } from "./termstyle";
export { CopyButton } from "./copybutton";
@@ -22,6 +22,7 @@ class InlineSettingsTextEdit extends React.Component<
maxLength: number;
placeholder: string;
showIcon?: boolean;
isNumber?: boolean;
},
{}
> {
@@ -46,6 +47,12 @@ class InlineSettingsTextEdit extends React.Component<
@boundMethod
handleChangeText(e: any): void {
const isNumber = this.props.isNumber ?? false;
const value = e.target.value;
if (isNumber && value !== "" && !/^\d*$/.test(value)) {
return;
}
mobx.action(() => {
this.tempText.set(e.target.value);
})();
+2 -1
View File
@@ -40,7 +40,8 @@
}
.mainview-content {
padding-top: 14px;
display: flex;
flex-direction: column;
}
}
+19 -1
View File
@@ -7,6 +7,8 @@ import cn from "classnames";
import { GlobalModel } from "@/models";
import "./mainview.less";
import { Choose, If, Otherwise, When } from "tsx-control-statements/components";
import { OverlayScrollbarsComponent } from "overlayscrollbars-react";
@mobxReact.observer
class MainView extends React.Component<{
@@ -14,6 +16,8 @@ class MainView extends React.Component<{
onClose: () => void;
children: React.ReactNode;
className?: string;
scrollable?: boolean;
onScrollbarInitialized?: () => void;
}> {
render() {
const sidebarModel = GlobalModel.mainSidebarModel;
@@ -31,7 +35,21 @@ class MainView extends React.Component<{
</div>
</header>
</div>
<div className="mainview-content">{this.props.children}</div>
<Choose>
<When condition={this.props.scrollable}>
<OverlayScrollbarsComponent
className="mainview-content"
options={{ scrollbars: { autoHide: "leave" } }}
defer={true}
events={{ initialized: this.props.onScrollbarInitialized }}
>
{this.props.children}
</OverlayScrollbarsComponent>
</When>
<Otherwise>
<div className="mainview-content">{this.props.children}</div>
</Otherwise>
</Choose>
</div>
);
}
+1
View File
@@ -52,6 +52,7 @@
}
button {
padding-right: 4px !important;
i {
font-size: 18px;
}

Some files were not shown because too many files have changed in this diff Show More