Compare commits

..

99 Commits

Author SHA1 Message Date
Red Adaya 7cc22b877c fix conflicts 2024-02-02 11:02:24 +08:00
Red Adaya 637915554f remove modals.tsx as it's no longer used. rename modals.less to settings.less 2024-02-02 10:55:26 +08:00
Sylvie Crowe 51ee7bef61 Shellpref for sshconfig import (#270) 2024-01-31 14:11:12 -08:00
Evan Simkowitz 5ce7b92232 Simplify logic for startResizing width calculation (#269)
* Apply Red's suggestion and move width logic to getWidth

* remove unnecessary

* a little more

* remove comment
2024-01-30 22:34:00 -08:00
Evan Simkowitz 81a9e74991 Fix onMouseDown causing width to snap back to persisted width (#268)
* Fix onMouseDown causing width to snap back to persisted width

* var name change

* remove logs

* remove redundant call
2024-01-30 22:23:00 -08:00
Evan Simkowitz 679e85a84a Fix sidebar width not persisting when un-collapsing (#267)
* Do not persist collapsed width to db

* remove console.logs

* one more

* one more

* remove setTemp from getWidth and add to the startResize call
2024-01-30 22:04:25 -08:00
Evan Simkowitz da69a0f583 Fix broken merge (#266) 2024-01-30 20:56:32 -08:00
Red J Adaya 37ab1bca90 allow resizing of left sidebar (#244)
* wip

* integrate original sidebar content

* ResizableSidebar component

* trigger toggleCollapse

* remove debugging code

* minor refactor. disable text select on mousemove

* replace icons with fontawesome icons. fix alignment issues

* fix session view width when tabs overflow

* prevent index and icon from shifting when resizing

* snap effect

* minor refactor

* apply collapsed mode to sidebar contents

* change default width to 240px

* backend implementation

* fix wrong subcmd

* save collapsed state

* retore sidebar state on reload/launch

* use collapse data form db on first load. use previously saved width on expand.

* persist width as well collapse state

* various fixes and improvements

* bind methods

* refactor

* more refactor

* fix minor bug

* fix merge issues

* various fixes

* refactor

* fixes

* fix issues

* fix all issues

* resolve undefind tempWidth

* fix toggleCollapsed

* use Promise in stopResizing method

* use tempCollapsed to for real time toggling between logos

* minor method name change

* refactor

* remove debugging code

* fix conflict

* fix setting collapsed state via CLI

* minor refactor

* remove debugging code

* create setTempWidthAndTempCollapsed method

* handle invalid width set via cli

* refactor: setbycli not actually needed

* remove unused code
2024-01-30 20:17:49 -08:00
Evan Simkowitz 40757fa7f4 Prevent the status indicator flickering for quick-returning commands (#265)
* add status-indicator-visible

* save

* save

* Prevent the status indicator flickering for quick returns

* flx regression

* reduce delay, reset spinnerVisible when there's no more running commands

* clean up code reuse

* move code around

* slight optimizations to prevent rendering before spinner is visible

* rename var

* revert shouldSync change as it broke the sync
2024-01-30 16:31:38 -08:00
Evan Simkowitz e576f7f07d Sync RotateIcon spin as well (#262)
* Sync RotateIcon spin as well

* make shouldSync a boolean value
2024-01-30 14:16:33 -08:00
Evan Simkowitz 9e804232c2 Fix SidebarItem key error (#263) 2024-01-30 11:54:35 -08:00
sawka d3dbac6e77 fix missing react key 2024-01-30 11:29:12 -08:00
Mike Sawka 198de02a65 code to restore indicator state on refresh (#260)
* code to restore indicator state on refresh

* fix style
2024-01-29 23:51:01 -08:00
Mike Sawka 8f64d6a589 set animation startTime to sync spinners for status indicators (#259)
* set animation startTime to sync spinners for status indicators

* catch animationstart (hover interaction) to restart startTime.

* use const

---------

Co-authored-by: Evan Simkowitz <esimkowitz@users.noreply.github.com>
2024-01-29 23:48:37 -08:00
Evan Simkowitz 1a51d93a54 Fix add-workspace so that only the plus button shows pointer (#258) 2024-01-29 14:10:58 -08:00
sawka 9ab3b2a5b7 only run prettier on js/ts/css/less files 2024-01-29 13:35:09 -08:00
Evan Simkowitz 856c879cdf Adjust the status indicator icon to make the spinner a little bigger (#257) 2024-01-29 11:03:18 -08:00
sawka ea3f744d93 bump to v0.6.1 2024-01-29 09:39:36 -08:00
Evan Simkowitz dd3d52e47d Add indicator to tabs and workspaces to show when commands are running (#254)
* save

* not working yet but close

* logic is working, just need to do styling

* save work

* save

* save work

* ta da!

* fix line height

* format files

* remove running commands on hangup.  also don't allow numrunning to be less than 0

* remove < 0 check (safer without for concurrency)
2024-01-28 13:47:36 -08:00
Evan Simkowitz 32499f0421 Add workspace settings for formatter and recommended extensions (#255) 2024-01-28 13:14:54 -08:00
Mike Sawka b136c915df Restart command (#253)
* working on cmd restart logic

* button to restart command

* bind Cmd-R to restart selected command, and Cmd-Shift-R to restart last command.  Browser Refresh is now Option-R.  also fix 'clear' command to not delete running commands (like archive).  some small changes to keyboard utility code to always set 'alt' and 'meta' appropriately.  use 'cmd' and 'option' for crossplatform bindings

* focus restarted line

* update termopts, use current winsize to set termopts for new command

* add cmd.restartts to track restart time

* display restarted time in line w/ tooltip with original time

* add restartts to line:show
2024-01-26 16:25:21 -08:00
Cole Lashley 0648d48ba1 Intenational key binding fixes (#234)
* first pass of copy file

* first pass fixing up function

* first pass fixing key press

* fixed up key press parsing

* reverted cmdrunner.go

* fixed cmdrunner.go again :p

* fixed cmdrunner again lol

* Add job status indicators to tabs within a workspace (#232)

Adds job status indicators that will show any updates to running commands while you are focused away from a tab. These will show up as status icons in the tab view.

These indicators will reset for a given tab when you focus back to it.

I've updated the inner formatting of the tab to use flexboxes, allowing the title to display more text when there are no icons to display.

Also includes some miscellaneous for-loop pattern improvements in model.ts and removing of unused variables, etc.

* first pass fixing key press

* added key util check file

* addressed rebase artifacts

* fixed more rebase artifacts

* fixed keybindings

* removed log

* fixed a ton of rebase artifacts

* fixed a ton of rebase artifacts

* added cmd maps to altKey if not on macos

* fixed platform check code and fixed some small bugs
2024-01-26 10:50:11 -08:00
Evan Simkowitz b97423268c Move icons out of common, clean up visibility story (#251) 2024-01-25 16:17:03 -08:00
Evan Simkowitz 34ec4ff39f Add status indicators to workspace items in the sidebar (#245)
* save work

* refactor end-icon and actions-icon into separate components

* reverting change part 1

* fix

* separate out workspace and tab formatting more

* save work

* Got it working!

* fix scrollbar but hide it so that the formatting doesn't jump when hovering

* revert some changes, replace some svgs with fontawesome

* remove listitem

* remove log
2024-01-25 13:31:20 -08:00
Sylvie Crowe 018bb14b6a Use ssh library for remote connections (#250)
* create proof of concept ssh library integration

This is a first attempt to integrate the golang crypto/ssh library for
handling remote connections. As it stands, this features is limited to
identity files without passphrases. It needs to be expanded to include
key+passphrase and password verifications as well.

* add password and keyboard-interactive ssh auth

This adds several new ssh auth methods. In addition to the PublicKey
method used previously, this adds password authentication,
keyboard-interactive authentication, and PublicKey+Passphrase
authentication.

Furthermore, it refactores the ssh connection code into its own wavesrv
file rather than storing int in waveshell's shexec file.

* clean up old mshell launch methods

In the debugging the addition of the ssh library, i had several versions
of the MShellProc Launch function. Since this seems mostly stable, I
have removed the old version and the experimental version in favor of
the combined version.

* allow switching between new and old ssh for dev

It is inconvenient to create milestones without being able to merge into
the main branch. But due to the experimental nature of the ssh changes,
it is not desired to use these changes in the main branch yet. This
change disables the new ssh launcher by default. It can be used by
changing the UseSshLibrary constant to true in remote.go. With this, it
becomes possible to merge these changes into the main branch without
them being used in production.

* fix: allow retry after ssh auth failure

Previously, the error status was not set when an ssh connection failed.
Because of this, an ssh connection failure would lock the failed remote
until waveterm was rebooted. This fix properly sets the error status so
this cannot happen.
2024-01-25 10:18:11 -08:00
Evan Simkowitz 99f5c094d2 Merge pull request #249 from wavetermdev:evan/update-disclaimer
Update disclaimers with latest dependencies
2024-01-24 14:52:02 -08:00
Evan Simkowitz f23da6a476 Update disclaimers with latest dependencies 2024-01-24 14:51:48 -08:00
sawka 3ae38b4aa4 don't show archived screens with Cmd-P 2024-01-24 12:02:05 -08:00
Evan Simkowitz 2f57a6e067 Fix bug where active session ID is sometimes not persisted (#248) 2024-01-24 11:32:48 -08:00
Mike Sawka b762df179f zsh cleanup and stats (#247)
* better osrelease parsing (ignore garbage at end of string)

* add defaultshelltype to telemetry input

* track reinit errors by shelltype to see if zsh integration is working
2024-01-23 17:19:03 -08:00
sawka 6bcd37c28e 'clear' should not reset nextlinenum 2024-01-23 09:54:16 -08:00
Mike Sawka 9879fe4d11 small performance update for history info. separate each item into a full react component to allow for fine grained reactive updates (prevents large tree reconcilations when there are thousands of history items) (#246) 2024-01-22 23:18:30 -08:00
Cole Lashley 1b81b2906c Fixed chat bug "r.replace is not a function" (#241)
* fixed bug

* ran prettier

* use innerText to get code value

* prettier, and remove console.log
2024-01-22 16:09:22 -08:00
Mike Sawka 974275bcb4 update waveshell install message, link to docs (#243) 2024-01-22 15:17:55 -08:00
Evan Simkowitz 57f07994e4 Add view menu with zoom controls (#242) 2024-01-22 13:13:44 -08:00
sawka 713acb664d fix setting of readonly vars issue with zsh rc files 2024-01-20 13:18:14 -08:00
Evan Simkowitz 613cd30c36 Merge pull request #239 from wavetermdev:evan/tab-drag-fix
Fix tab drag events not registering state update
2024-01-18 14:40:38 -05:00
Evan Simkowitz c0309f1796 Fix tab drag events not registering state update 2024-01-18 11:38:57 -08:00
Evan Simkowitz 1d18a47f72 Merge pull request #238 from wavetermdev:evan/fix-first-tab
Remove different padding for first tab
2024-01-18 14:11:35 -05:00
Evan Simkowitz d3e821af1c Remove different padding for first tab 2024-01-18 11:11:04 -08:00
sawka 467664af85 don't try to set readonly variables 2024-01-18 11:00:13 -08:00
Sylvia Crowe 0feaa57662 add two readonly variables to the ZshIgnoreVars
Readonly variables cannot be reset and attempting to do so causes errors
on my machine. The `keymaps` and `widgets` variables caused problems, so
they have been added to the list of variables to ignore.
2024-01-18 10:50:26 -08:00
sawka 6ea70ff788 build-universal updates to work with new aws s3 version of build-helper 2024-01-17 20:04:27 -08:00
sawka f8e2aadf98 update build-helper (quotes) 2024-01-17 19:49:00 -08:00
sawka f21a9e2aa1 update to build-helper (debug aws) 2024-01-17 18:32:17 -08:00
sawka 13d3d3a180 upload build-helper builds to aws s3 as github artifacts are painfully slow to download 2024-01-17 17:51:50 -08:00
Evan Simkowitz 5216f58e2f Tweak the color of the output status indicator, adjust the placement of the tab end-icons a bit (#236)
* Tweak the color of the output status indicator, adjust the placement of the tab end-icons a bit

* adjust the margins a bit more

* a few more slight adjustments to even out the spacing

* save work

* fix nullref, some smaller tweaks to the front icon

* made the tab slightly smaller so that the ratios made more sense

* remove unnecessary width

* format fix
2024-01-17 17:25:57 -08:00
Mike Sawka 7b9287316d touchups to UI for AI chat feature (#237) 2024-01-17 15:39:24 -08:00
sawka 781ed2e57e updated build-helper.yml 2024-01-17 14:52:49 -08:00
Evan Simkowitz 4ac5d93ed2 Add job status indicators to tabs within a workspace (#232)
Adds job status indicators that will show any updates to running commands while you are focused away from a tab. These will show up as status icons in the tab view.

These indicators will reset for a given tab when you focus back to it.

I've updated the inner formatting of the tab to use flexboxes, allowing the title to display more text when there are no icons to display.

Also includes some miscellaneous for-loop pattern improvements in model.ts and removing of unused variables, etc.

---------

Co-authored-by: sawka <mike.sawka@gmail.com>
2024-01-17 10:07:01 -08:00
sawka a7afefc340 update build-helper.yml (single artifact with all builds) 2024-01-16 22:35:17 -08:00
sawka fc12dcac2f update build-helper.yml (use local scripthaus) 2024-01-16 22:05:45 -08:00
sawka aeacfb094e update build-helper.yml (go workspace) 2024-01-16 22:02:20 -08:00
sawka 14da9b76e0 update build-helper.yml 2024-01-16 21:56:40 -08:00
sawka 2f32d89b85 update build-helper.yml 2024-01-16 21:47:05 -08:00
Evan Simkowitz 2e3e07d24b Update to latest CodeQL workflow actions (#235) 2024-01-16 21:34:22 -08:00
sawka e2d0664901 split workflow steps 2024-01-16 21:27:49 -08:00
sawka 5638e7857b add go mod download 2024-01-16 21:09:02 -08:00
sawka 6c9dbabd56 reorder job steps 2024-01-16 21:01:36 -08:00
sawka 13cd9dfe50 bump to version v0.6.0, testing linux in build workflow 2024-01-16 20:37:46 -08:00
Evan Simkowitz 6fa799daf5 Add ref to filter out downloads due to upgrade notification (#233) 2024-01-16 16:11:37 -08:00
Mike Sawka 422338c04b zsh support (#227)
adds zsh support to waveterm.  big change, lots going on here.  lots of other improvements and bug fixes added while debugging and building out the feature.

Commits:

* refactor shexec parser.go into new package shellenv.  separate out bash specific parsing from generic functions

* checkpoint

* work on refactoring shexec.  created two new packages shellapi (for bash/zsh specific stuff), and shellutil (shared between shellapi and shexec)

* more refactoring

* create shellapi interface to abstract bash specific functionality

* more refactoring, move bash shell state parsing to shellapi

* move makeRcFile to shellapi.  remove all of the 'client' options CLI options from waveshell

* get shellType passed through to server/single paths for waveshell

* add a local shelltype detector

* mock out a zshapi

* move shelltype through more of the code

* get a command to run via zsh

* zsh can now switch directories.  poc, needs cleanup

* working on ShellState encoding differences between zsh/bash.  Working on parsing zsh decls.  move utilfn package into waveshell (shouldn't have been in wavesrv)

* switch to use []byte for vardecl serialization + diffs

* progress on zsh environment.  still have issues reconciling init environment with trap environment

* fix typeset argument parsing

* parse promptvars, more zsh specific ignores

* fix bug with promptvar not getting set (wrong check in FeState func)

* add sdk (issue #188) to list of rtnstate commands

* more zsh compatibility -- working with a larger ohmyzsh environment.  ignore more variables, handle exit trap better.  unique path/fpath.  add a processtype variable to base.

* must return a value

* zsh alias parsing/restoring.  diff changes (and rtnstate changes).  introduces linediff v1.

* force zmodload of zsh/parameter

* starting work on zsh functions

* need a v1 of mapdiff as well (to handle null chars)

* pack/unpack of ints was wrong (one used int and one use uint).  turned out we only ever encoded '0' so it worked.  that also means it is safe to change unpack to unpackUInt

* reworking for binary encoding of aliases and functions (because of zsh allows any character, including nulls, in names and values)

* fixes, working on functions, issue with line endings

* zsh functions.  lots of ugliness here around dealing with line dicipline and cooked stty.  new runcommand function to grab output from a non-tty fd.  note that we still to run the actual command in a stty to get the proper output.

* write uuid tempdir, cleanup with tmprcfilename code

* hack in some simple zsh function declaration finding code for rtnstate.  create function diff for rtnstate that supports zsh

* make sure key order is constant so shell hashes are consistent

* fix problems with state diffs to support new zsh formats.  add diff/apply code to shellapi (moved from shellenv), that is now specific to zsh or bash

* add log packet and new shellstate packets

* switch to shellstate map that's also keyed by shelltype

* add shelltype to remoteinstance

* remove shell argument from waveshell

* added new shelltype statemap to remote.go (msh), deal with fallout

* move shellstate out of init packet, and move to an explicit reinit call.  try to initialize all of the active shell states

* change dont always store init state (only store on demand).  initialize shell states on demand (if not already initialized).  allow reset to change shells

* add shellpref field to remote table.  use to drive the default shell choice for new tabs

* show shelltag on cmdinput, pass through ri and remote (defaultshellstate)

* bump mshell version to v0.4

* better version validation for shellstate.  also relax compatibility requirements for diffing states (shelltype + major version need to match)

* better error handling, check shellstate compatibility during run (on waveshell server)

* add extra separator for bash shellstate processing to deal with spurious output from rc files

* special migration for v30 -- flag invalid bash shell states and show special button in UI to fix

* format

* remove zsh-decls (unused)

* remove test code

* remove debug print

* fix typo
2024-01-16 16:11:04 -08:00
Red J Adaya 76988a5277 "Escape" should close/cancel most modals (#229)
* init

* client settings view

* close and escape support for connections view

* close and escape support for clientsettings view
2024-01-15 12:16:46 -08:00
Red J Adaya da69c0411d Move the Client Settings Modal into its own "main view" (#226)
* init

* client settings view

* add some extra padding and a border below the header

* move settings-field classes under the main class to prevent conflicts

* fix style overrides
2024-01-15 12:08:58 -08:00
Evan Simkowitz ff65a3f042 Bump electron to version 28 (#225)
* Bump electron to version 28

* update electron-forge
2024-01-11 19:08:17 -08:00
Evan Simkowitz d431ac1ecf Upgrade to Typescript 5, along with a bunch of other minor bumps (#224)
* Bump electron and dependencies

* upgrade typescript and webpack

* upgrade remaining outdated

* bump node types
2024-01-11 18:57:15 -08:00
dependabot[bot] f8024799ed Bump follow-redirects from 1.15.3 to 1.15.4 (#222)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.3 to 1.15.4.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.3...v1.15.4)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-11 18:31:07 -08:00
Evan Simkowitz ebdf8b5aee Remove unused and unmaintained react-json-view (#223) 2024-01-11 18:28:21 -08:00
Evan Simkowitz ed2a345555 Add support for opening web links in the default browser (#221)
* Add support for opening web links in the default browser

* require modifier key to click

* undo emain change

* remove newline
2024-01-11 17:49:13 -08:00
Cole Lashley ea3be8115a Chat GPT Command Info Chat (#207)
* first draft at ui

* first draft connecting openai to cmd info ui

* added more updates and added prompt engineering

* focus textarea on mount

* fix aichat layout issue

* added focus back to input after closing cmd info chat

* added ability to clear chat history, closes on command enter, better initial greeting message, and small things like user can refocus the help textarea by pressing ctrl + space again

* added a bunch of small upgrades

* added context for chatgpt info command

* added context to chatgpt cmd info command

* added ability to use arrow keys to grab code markdown

* added error handling as well as fixed the text area outline bug

* slightly changed the ui for selecting

* revamped ui and added correct scroll behavior

* changed ui, fixed up code block selection, some other small changes

* deep copied cmd info chat when we return

* added error checking and removed logs

* made deep copy code more clear

* prettier with the right version

* more prettier changes

* removed extraneous comment
2024-01-11 17:34:23 -08:00
Red J Adaya 077cb2be03 Split up modals.tsx file (#220)
* init

* diconnected and clientstop modals

* alert and createremoteconn modals

* tabswitcher, view and edit remoteconn modals

* migrate clientstop modal to Modal

* LinkButton

* import styles for createremoteconn modal

* import tabswitcher modal styles

* disable buttons while status is 'connecting'

* minor refactor

* apply changes to viewremoteconn modal from main
2024-01-11 09:42:03 -08:00
Red J Adaya 8f39f0fc5e Add a modal confirmation before installing WaveShell (#212)
* init

* integrate showShellPrompt flag

* renive debugging code

* remove debugging code

* run gofmt. add migration files.

* remove debugging code

* remove migrations and adjust code. show prompt on import ssh configs as well.

* fix show/hide logic

* reset mmap.go

* use resolveBool and utilfn.ContainsStr

* make AlertModal take a generic 'confirmkey' instead of hard coding hideShellPrompt

* rename confirmkey to confirmflag (to be consistent).  move confirmflag checking into the alertmodal.  short circuit with Promise.resolve(true) if noConfirm checked.

* disable buttons while status is 'connecting'

* minor refactor
2024-01-10 15:00:18 -08:00
Sylvie Crowe 00e709d515 reload ssh config files when importing them (#219)
The ssh_config library only loaded the config data the first time
certain functions are used. After that, cached values are used instead.
This library has been updated in a fork to add a method that allows the
configuration files to be reloaded. This update takes advantage of that
change so the config files can be updated without restarting waveterm.
2024-01-09 18:04:19 -08:00
Sylvie Crowe c2a894b280 SSH Configuration Import Alert Modal (#218)
* add an alert modal for the sshconfig import button

When the sshconfig import button is pressed, there currently is no
visual indicator of what changed. This adds an alert modal to pop up
only in the case where the gui button is used.

* improve alert modal for sshconfig imports

The previous message for SSH configuration imports was vague and did not
provide detailed information as what happened during the import. This
clarifies that by specifying which remotes were deleted, created, and
updated. Updates are only ran and recorded if they would actually change
something.

* fix port value limiting

The SSH config import port limiting was correct but set off a warning in
linters. It has been updated to do the same behavior in a different way.

Also, port limiting was never added to manually adding a new remote.
This change adds it there as well.

* change user-facing term to connection

Previously, the ssh configuration alert modal used to use the word
"remote" to describe connections. "Remote" is the internal name but it
isn't consistent with what is being displayed to users. So it has been
replaced with "Connection" instead to match.

* change remote to connection for ssh import buttons

Like the previous change, the word "remote" was used instead of
"connection." This was for the tooltips added to connections that had
been imported in the connections menu.

* update one more remote -> connection
2024-01-09 16:13:23 -08:00
Mike Sawka fad48b0d09 bind cmd-w to delete a screen (with a confirm message). also fix 'esc' so it closes the alert modal with a 'cancel' (#215) 2024-01-08 22:59:17 -08:00
Mike Sawka 8ac1943d56 Add Icon / HotKey to Delete Line (Cmd-D) (#214)
* work on cmd-d to delete a selected line

* call stoppropagation when code.tsx captures keyboard input

* finish up with line delete.  add a trash icon to line.  prevent delete when cmd is running (show error msg)
2024-01-08 22:58:32 -08:00
Red J Adaya f6a6068674 Connection Screen Terminal "Flash" Making it Impossible to Enter Manual Passwords (#217)
* fix flashing view modal

* cleanup

* fix name typo, also unset setRecentConnAdded once the modal is open
2024-01-08 22:56:49 -08:00
Sylvie Crowe e1e5b67ff6 I18n fixes (#211)
* remove byte sanitization for user commands

When serializing jsonBytes in packet.go::MarshalPacket, a step existed
that attempted to manually sanitize the bytes before sending them. This
was initially done to avoid invalid characters in json; however, go
should handle this for us. But this sanitization broke
internationalization because it excluded characters required for unicode
in other languages. Because of that, it has been removed.

* properly decode non-ascii on frontend

The functions atob and btoa do not convert base 64 to strings in the
expected way. The base64ToArray function handles it properly but other
cases do not. These other cases have been replaced with a helper
function that makes use of the base64-js package. This package has
already been included as a dependency of another package we use, but it
was added to the package.json file to make the inclusion explicit.

* automatically set/share LANG var with waveshell

Waveterm previously did not set the LANG environment variable which
caused problems for international users. On Linux, this is done
automatically, but it needs to be done manually on macos.

Even on linux, the wavesrv LANG variable is shared with waveshell to
ensure the same one is used on remotes.

* only set the lang var if not previously set

In order to prevent waveterm from overriding the lang var entirely, this
ensures that it is only manually determined if it hasn't previously been
set.

* use envMap instead of os to determine var

This is slightly more performant and relies more directly on our code
instead of external code.
2024-01-08 18:31:17 -08:00
sawka 0bb80b6a74 run both mac builds 2024-01-08 00:35:38 -08:00
sawka 631a0867aa fix go cache dependency 2024-01-08 00:28:54 -08:00
sawka 5bd7f73746 updates to build workflow 2024-01-08 00:12:07 -08:00
sawka ed1dff320d upload build artifact 2024-01-07 23:58:46 -08:00
Mike Sawka 7f91efc314 working on a macos x86 build workflow (#216)
must check in to main to test
2024-01-07 23:48:10 -08:00
sawka f737c2af86 add autofocus prop to button 2024-01-07 00:30:25 -08:00
Sylvie Crowe 8cbee1e1c3 Allow dots in alias and add port to canonical name (#209)
* allow numerical start and allow dots in ssh alias

We previously restricted the ssh alias to start with an
alphabetic character and did not allow dots within it. This caused
problems with users wanting to use an ip address as an alias. This lifts
that restriction so both can freely be used.

Note that while it is common to use the hostname as the alias, hostnames
are not allowed to use the underscore character. However, we do allow
the alias to contain an underscore. I do not think we can remove this
from aliases now but it is something to watch out for in the future.

* allow backslash in username

This involved converting the regexp string into a raw string to able to
use the backslash character. this is important.

* Revert "allow backslash in username"

This reverts commit cafe2812411cfba15b7ece1250a6def29d092366. Upon
reflection, more time is needed to evaluate that this actually corrects
the issue. It will be performed with proper diligence at a later time.

* add port to end of canoncial names when not 22

The canonical name is the identifying key in the database, so it causes
problems if another remote entry has the same canonical name. By adding
the port number to the end of this, it is possible to differentiate the
two.

* add db migrations for adding port to canonicalname

The up migration adds the port to the existing canonical id if it exists
and is not 22. The down migration strips the port off the canonical name
and deletes extra remotes with the same canonical name. If all remotes
with that canonical name have been archived, it keeps the first one
added to the database. If any have not been archived, it keeps the first
added to the database from the non-archived group.

* remove ability to edit port number via ssh import

Previously, ssh imports could edit the port number since it was possible
to change them in the config file without changin the canonical name.
Now that the canonical name contains the port, a change in the port will
simply create a new database entry. For this reason, the ability to
modify the ssh port is dead code and has been removed.

* allow backslash in username

This involved converting the regexp string into a raw string to able to
use the backslash character. this is important.

* simplify up migration logic

The previous up migration was suboptimal because it was accounting for a
corner case not found in production. That case no longer needs to be
considered, so the procedure was simplified.
2024-01-04 10:16:26 -08:00
Red J Adaya b2a1bb3818 When client is disconnected change log to show last 50 lines of wavesrv.log (#210)
* improved disconnected modal

* wrap pre with div

* make number of a lines param a constant

* revert app.tsx

* use tail command and capture the output instead

* reset TabSwitcherModal
2024-01-04 10:13:40 -08:00
Sylvie Crowe d1319c0a2c Fix Commands that Require Quoted Paths (#198)
* fix commands that require quoted paths

Several commands did not wrap the path in quotes which caused problems
when attempting to store the waveterm installation in a place that had a
space in the path. This corrects this in the particular case where the
username does not have spaces but the path to the executable does.

Note: the case of a user name having spaces has not been tested but
likely does not work.

* fix logging problem for wavesrv

A previous fix replaced the getWaveSrvCmd with getWaveSrvPath. This
needs to be getWaveSrvCmd to enable logging.

* fix variable name
2023-12-30 22:52:30 -08:00
Red J Adaya 2c9272e3a7 fix tabs scrollbar jump (#203) 2023-12-30 22:42:46 -08:00
Red J Adaya 452836bffc Cmd-P feature -- Quick Tab Selector (#200)
* register cmd+p shortcut

* tab switcher modal

* initial implementation

* tab switcher modal content

* fix styles

* fix scroll bugs

* set selected index when clicking option

* hover effect for options

* switch when Enter key is pressed

* remove fuse.js

* only use switchscreen for switching sessions and tabs

* var naming changes

* fix multiple focused options on mouse hover

* fix duplicate focused options and scrollbar

* clean imports

* fix wrong function name

* merge color styles in app.less

* remove debugging code

* use For component when iterating thru options

* minor style fix

* remove mouse interaction, keep focusedIdx in bounds, increase max number of tabs shown, small layout adjustment for big tab names (and more space for icon)
2023-12-30 22:34:05 -08:00
Sylvie Crowe 8d88e2cf94 ssh config import (#156)
* create migrations for required database change

This is a first attempt that does not appear to be working properly. It
requires review.

* fix errors in db migrations

The previous commit had an extra json call that broke the update and did
not remove the imported interies during a downgrade.

* change migrations to use column instead of json

It makes more sense to associate the source of a config with the remote
type than the sshopts type. This change makes that clear in the database
structure.

* ensure adding a remote manually tags correctly

Using the usual way of adding a remote should result in a sshconfigsrc
of "waveterm-manual". This will be important for filtering out remotes
installed manually and remotes installed via import

* create basic structure for parsing ssh config

This entails creating a new command, making it possible to query only
the imported remotes from the database, and implementing the logic to
handle all of the updates needed.

This needs improvements in a few areas:
- the /etc/ssh/config needs to be parsed as well
- the logic for editing exisiting imported remotes needs to be written
- error handling needs to be improved
- update packet responses need to be provided

* add sshkey support and implement editing

We now search for the ssh identity keyfile and add it if it is found.
Additionally, the logic to edit previously imported ssh hosts has been
added.

* combine hosts from user and system ssh config

We now check both the user ~/.ssh/config as well as the /etc/ssh/config
for hosts. This loops through each file starting with the user one. For
each host, it selects the first pattern without a wildcard and chooses
that to be the alias. If any future hosts are found to have the same
alias, they are skipped. Errors are raised if neither config file can be
opened or no aliases were found.

* improve logging and error reporting

Error reporting is now shortcircuited in cases of individual remotes in
order to allow the other remotes to continue. These errors are now
printed to logs instead.

* allow imports to edit ssh port

Previously, ssh ports could not be edited after the fact. Unfortunately,
this can cause problems since the port can be changed in an ssh config
file. To address this, we allow imports to change the port if a host
with the same canonical name had previously been imported.

* fix response to parse command

* fix error handline for alias parsing

Small mistake of checking for equality instead of inequality

* fix the ability to overwrite hostName with alias

if ssh_config does not find Hostname, it won't output an error. Now we
compare against the result instead of looking for an error.

* fix the error catching for User and Port

This fixes the same problem where parsing the config doesn't give an
error in the case when nothing is found. As before, this checks for a
blank result instead.

* remove unused code

* remove repeated canonical name check

The logic that checks for an existing canonical name already exists in
the AddRemote function, so it is not needed here.

Secondly, we now only allow edits of previously created remotes if they
have not been archived. If they have, the usual logic for creating a new
remote takes precedence.

Lastly, there is no need to archive a remote that has already been
archived so an additional check has been added.

* allow archives to preserve the SSHConfigSrc

* add log message for archiving of imported remotes

* create variables for string variants

Matches existing code style

* add cleanup for opened files

* move migration 25 to migration 26 (already merged a migration 25)

* fix RemoteRuntimeState in ModelUpdate by moving type to sstore.go.  Fix some bugs in remote:parse.  Fix key/identityfile, return value, and remote editing (should go through msh).  remote sudo.  add info messages around parse status

* fix issue with archiving the sshconfigsrc

A bug in RemoteType's FromMap caused the loss of sshconfigsrc during the
conversion. This has been corrected and the schema has been updated.

* fix order of archiving removed imported remotes

Previously, if the canonical name changed, the code would try to create
a new remote before archiving the old one. This did not work if the
alias didn't change. Now we archive first and add a new remote after.

* fix ability to change port when importing config

Importing from sshconfig needs to allow the port to change. This was not
happening because of a bug that has been corrected.

* always use host in place of hostname

Since host is the key actually searched for in the ssh config file,
searching for user@hostName may not actually work. To avoid this, we now
always use user@host instead.

* automatically determine ConnectMode

This aims to select a connection mode based off what is provided in the
ssh config file. It aims for auto connections when possible but will
fall back to manual if we can't easily support it

* remove sshkeysource migration number confilict

Previously had conflicting migration numbers of 26. The change not in
the main branch has been moved to 27 to remove the conflict.

* move sshkeysource migration to migration 28

* add WaveOptions flag parsing for ssh config

This is currently being used to allow users to force manual connect mode
if desired. It will also be used to force skipping options in the future
but that is not complete in this commit.

* implement ignore flag for ssh config parsing

The ignore flag will now archive an imported remote if it previously
existed and not create a new remote in its place.

* fix discovery of identity file

Previously, a ~ in the identity file's path was not expanded to the home
dir. Because of this, files with a ~ were previously identified as
invalid files. By expanding it during the search, this is no longer the
case.

* disable frontend edit button for imported remotes

Imported Remotes should not be editable in waveterm by users. This edit
makes it clear that the button will not work for those cases. Further
edits may be needed to explain why it doesn't work and what to do
instead.

* add backend rejection of updating imported remote

As before, we don't want manual editing of an imported remote inside the
app. This ensures that it can't happen on the backend.

* create tooltips for sshconfig edit/delete buttons

For remotes that are imported, edits are not allowed. This adds a
tooltip that explains what to do instead.

Deleting remotes that are imported is allowed, but they will come back
if the user imports again. The tooltip explains a way to avoid this.

* add logo after name for imported remotes

In the connections screen, there previously was not a way to tell
imported connections from manually created connections. This change adds
a logo after the imported ones to differentiate them.

* small formatting updates

* add import tooltip to connection modal

Added the logo for an imported config to the connection modal. It also
provides a short description when it the mouse hovers over it.

* add button to import ssh config

Make the command into a button for a simple gui interface.

Also ran prettier to clean up some syntax.

* remove strict casing on WaveOptions

WaveOptions was previously very specific about the casing of the ignore
and connectmode subcommands. With this update, the casing is
automatically converted to lowercase and can be ignored.

* add status dot before name in connections screen

* add space and tooltip to connection imported icon

* re-prettier
2023-12-28 11:09:41 -08:00
Mike Sawka 2f7cce294c big update to screen/session delete, and clear (#199)
* sync schema.sql with running schema

* remove incognito field from history table. also don't add empty FeState vars

* history updates, add festate, durationms, exitcode, status, and tags into history table

* update screen/session delete, and clear to no longer purge history items.  move deleted screens/sessions into a tombstone table.

* update schema

* fix alias -> fn

* quiet the security warning about an unchecked byte conversion. no real security issue here, but add a range check for good measure.
2023-12-27 13:11:53 -08:00
sawka 01074af129 fix warnings in waveshell 2023-12-26 15:03:17 -08:00
Mike Sawka 6a1b2c8bd4 Screen MemStore (#197)
* working on an in-memory store for screen information

* nostrpos sentinel

* textareainput now tracks selection (to update backend)

* make websocket connections much safer.  add a defer/panic handler for each ws message handled on backend.  don't allow client to reconnect to backend ws handler more than once per second (handles issue with lots of fast fails)

* use onSelect to have frontend textarea sync state to backend ScreenMem store

* restore cmdline when switching screens

* prettier
2023-12-26 12:59:25 -08:00
Evan Simkowitz 9980a6b204 Display open-source license acknowledgements (#193)
* Add script to generate license disclaimers for all dependencies

* update readme

* Upload current acknowledgements

* Add acknowledgements link to about, remove unnecessary width setting

* revert gitignore

* update readme wording

* i was wrong, we can output for both backend mods at the same time

* update wording

* remove license button in about modal (replaced with acknowledgements)
2023-12-24 11:41:51 -08:00
Red J Adaya 019eaecdaa Immediately hide modal when deleting workspace (#187)
* immediately hide modal when deleting workspace

* only pop modal when purging is successful
2023-12-23 12:31:11 -08:00
Red J Adaya de9c029ba8 ScreenTabs refactor (#182)
* inital implementation

* cleanup

* ui jump fix

* fix wrong first tab top right border radius

* add comment

* remove react.fragment.  only do initial screens populate on componentDidMount, rename this.scrollIntoViewTimeout (add Id to distinguish from state.scrollIntoViewTimeout).

* clean up some imports

* use single tabRef
2023-12-22 19:14:48 -08:00
Evan Simkowitz e7725e0e11 Clean up cirfile and cirfile_tests, ensure we are using contexts with cancellation signals (#183)
* Fix unvalidated path warning in cirfile.go

* Adding test

* move dir path vars into global scope, set wave home in test if not set already

* separate validation code into own testable func

* do removal of cir file in cleanup

* rename test file names

* flock should return err if waiting without done fn

* update comment

* use timeout context

* remove redundant validation

* add more error messages

* use filepath.join instead

* validate when creating cirfile too

* support .ptyout.cf, etc.

* remove validation as cirfile is "trusted", since it only accepts pre-validated input

* revert to passing nil context for flock in the Create file case
2023-12-22 18:07:58 -08:00
Evan Simkowitz 092a8de715 Escape error output in main-server to quiet security alert (#185) 2023-12-22 17:55:20 -08:00
sawka c56ee23843 add lines to ignored variables 2023-12-21 14:32:27 -08:00
148 changed files with 36229 additions and 6092 deletions
+100
View File
@@ -0,0 +1,100 @@
name: "Build Helper"
on: workflow_dispatch
env:
WAVETERM_VERSION: 0.6.1
GO_VERSION: "1.21.5"
NODE_VERSION: "21.5.0"
jobs:
runbuild-darwin-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@v4
with:
name: waveterm-build-darwin-x64
path: out/make/zip/darwin/x64/*.zip
retention-days: 2
runbuild-darwin-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@v4
with:
name: waveterm-build-darwin-arm64
path: out/make/zip/darwin/arm64/*.zip
retention-days: 2
runbuild-linux:
name: "Build Linux x64"
runs-on: ubuntu-latest
needs: [runbuild-darwin-x64, runbuild-darwin-arm64]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: scripthaus-dev/scripthaus
path: scripthaus
- uses: actions/setup-go@v4
with:
go-version: ${{env.GO_VERSION}}
cache-dependency-path: |
wavesrv/go.sum
waveshell/go.sum
scripthaus/go.sum
- run: |
go work use ./scripthaus;
cd scripthaus;
go get ./...;
CGO_ENABLED=1 go build -o scripthaus cmd/main.go
- uses: actions/setup-node@v4
with:
node-version: ${{env.NODE_VERSION}}
cache: "yarn"
- run: yarn --frozen-lockfile
- run: ./scripthaus/scripthaus run build-package-linux
- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: buildtemp
- run: |
mv out/make/zip/linux/x64/Wave-linux-x64-$WAVETERM_VERSION.zip buildtemp/waveterm-linux-x64-v$WAVETERM_VERSION.zip
- run: (cd buildtemp; zip ../waveterm-builds.zip *)
- run: aws s3 cp waveterm-builds.zip s3://waveterm-github-artifacts/
env:
AWS_ACCESS_KEY_ID: "${{ secrets.S3_USERID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets.S3_SECRETKEY }}"
AWS_DEFAULT_REGION: us-west-2
- uses: actions/upload-artifact@v4
with:
name: waveterm-builds
path: buildtemp
retention-days: 2
+3 -3
View File
@@ -49,7 +49,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -63,7 +63,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -76,6 +76,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
+3
View File
@@ -0,0 +1,3 @@
{
"recommendations": ["esbenp.prettier-vscode", "golang.go", "dbaeumer.vscode-eslint"]
}
+21
View File
@@ -0,0 +1,21 @@
{
"editor.formatOnSave": true,
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[less]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
+20
View File
@@ -0,0 +1,20 @@
# 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:
- [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 three disclaimer files linked above will be periodically regenerated to reflect new dependencies.
The [`scripthaus.md` file](../scripthaus.md) contains scripts to genrate the disclaimers and package them. To manually generate the disclaimers, run the following from the repository root directory:
```bash
scripthaus run generate-license-disclaimers
```
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+16
View File
@@ -0,0 +1,16 @@
# 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 }}
+14 -3
View File
@@ -1,12 +1,21 @@
#!/bin/bash
# assumes we have Wave-darwin-x64-[version].zip and Wave-darwin-arm64-[version].zip in current directory
VERSION=0.5.3
VERSION=0.6.1
rm -rf temp
rm -rf builds
mkdir temp
mkdir temp/x64
X64_ZIP="Wave-darwin-x64-$VERSION.zip"
ARM64_ZIP="Wave-darwin-arm64-$VERSION.zip"
aws s3 cp s3://waveterm-github-artifacts/waveterm-builds.zip .
BUILDS_ZIP=waveterm-builds.zip
if ! [ -f $BUILDS_ZIP ]; then
echo "no $BUILDS_ZIP found";
exit 1;
fi
echo "unzipping $BUILDS_ZIP"
unzip -q $BUILDS_ZIP -d builds
X64_ZIP="builds/Wave-darwin-x64-$VERSION.zip"
ARM64_ZIP="builds/Wave-darwin-arm64-$VERSION.zip"
if ! [ -f $X64_ZIP ]; then
echo "no $X64_ZIP found";
exit 1;
@@ -48,4 +57,6 @@ DMG_NAME="waveterm-macos-universal-${DMG_VERSION}.dmg"
$DMG_NAME \
"temp/Wave.app"
echo "success, created $DMG_NAME"
mv $DMG_NAME builds/
rm builds/Wave-darwin-*.zip
spctl -a -vvv -t install temp/Wave.app/
+4 -4
View File
@@ -7,10 +7,10 @@ signAsync({
app: "temp/Wave.app",
binaries: [
waveAppPath + "/Contents/Resources/app/bin/wavesrv",
waveAppPath + "/Contents/Resources/app/bin/mshell/mshell-v0.3-linux.amd64",
waveAppPath + "/Contents/Resources/app/bin/mshell/mshell-v0.3-linux.arm64",
waveAppPath + "/Contents/Resources/app/bin/mshell/mshell-v0.3-darwin.amd64",
waveAppPath + "/Contents/Resources/app/bin/mshell/mshell-v0.3-darwin.arm64",
waveAppPath + "/Contents/Resources/app/bin/mshell/mshell-v0.4-linux.amd64",
waveAppPath + "/Contents/Resources/app/bin/mshell/mshell-v0.4-linux.arm64",
waveAppPath + "/Contents/Resources/app/bin/mshell/mshell-v0.4-darwin.amd64",
waveAppPath + "/Contents/Resources/app/bin/mshell/mshell-v0.4-darwin.arm64",
],
}).then(() => {
console.log("signing success");
+4
View File
@@ -1,4 +1,8 @@
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=
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=
+13 -12
View File
@@ -2,7 +2,7 @@
"name": "waveterm",
"author": "Command Line Inc",
"productName": "Wave",
"version": "0.5.3",
"version": "0.6.1",
"main": "dist/emain.js",
"license": "Apache-2.0",
"dependencies": {
@@ -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",
+24 -12
View File
@@ -44,10 +44,10 @@ rm -rf bin/
rm -rf build/
node_modules/.bin/webpack --env prod
GO_LDFLAGS="-s -w -X main.BuildTime=$(date +'%Y%m%d%H%M')"
(cd waveshell; CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-darwin.amd64 main-waveshell.go)
(cd waveshell; CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-darwin.arm64 main-waveshell.go)
(cd waveshell; CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-linux.amd64 main-waveshell.go)
(cd waveshell; CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-linux.arm64 main-waveshell.go)
(cd waveshell; CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-darwin.amd64 main-waveshell.go)
(cd waveshell; CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-darwin.arm64 main-waveshell.go)
(cd waveshell; CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-linux.amd64 main-waveshell.go)
(cd waveshell; CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-linux.arm64 main-waveshell.go)
(cd wavesrv; CGO_ENABLED=1 go build -tags "osusergo,netgo,sqlite_omit_load_extension" -ldflags "-X main.BuildTime=$(date +'%Y%m%d%H%M')" -o ../bin/wavesrv ./cmd)
node_modules/.bin/electron-forge make
```
@@ -60,10 +60,10 @@ rm -rf bin/
rm -rf build/
node_modules/.bin/webpack --env prod
GO_LDFLAGS="-s -w -X main.BuildTime=$(date +'%Y%m%d%H%M')"
(cd waveshell; CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-darwin.amd64 main-waveshell.go)
(cd waveshell; CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-darwin.arm64 main-waveshell.go)
(cd waveshell; CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-linux.amd64 main-waveshell.go)
(cd waveshell; CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-linux.arm64 main-waveshell.go)
(cd waveshell; CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-darwin.amd64 main-waveshell.go)
(cd waveshell; CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-darwin.arm64 main-waveshell.go)
(cd waveshell; CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-linux.amd64 main-waveshell.go)
(cd waveshell; CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-linux.arm64 main-waveshell.go)
# adds -extldflags=-static, *only* on linux (macos does not support fully static binaries) to avoid a glibc dependency
(cd wavesrv; CGO_ENABLED=1 go build -tags "osusergo,netgo,sqlite_omit_load_extension" -ldflags "-linkmode 'external' -extldflags=-static $GO_LDFLAGS" -o ../bin/wavesrv ./cmd)
node_modules/.bin/electron-forge make
@@ -86,10 +86,10 @@ CGO_ENABLED=1 go build -tags "osusergo,netgo,sqlite_omit_load_extension" -ldflag
set -e
cd waveshell
GO_LDFLAGS="-s -w -X main.BuildTime=$(date +'%Y%m%d%H%M')"
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-linux.amd64 main-waveshell.go
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-linux.arm64 main-waveshell.go
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-darwin.amd64 main-waveshell.go
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-darwin.arm64 main-waveshell.go
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-linux.amd64 main-waveshell.go
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-linux.arm64 main-waveshell.go
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-darwin.amd64 main-waveshell.go
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.4-darwin.arm64 main-waveshell.go
```
```bash
@@ -100,3 +100,15 @@ scripthaus run fullbuild-waveshell
echo building wavesrv
scripthaus run build-wavesrv
```
```bash
# @scripthaus command generate-license-disclaimers
DISCLAIMER_DIR="./acknowledgements"
DISCLAIMER_OUTPUT_DIR="$DISCLAIMER_DIR/disclaimers"
if [ -d "$DISCLAIMER_OUTPUT_DIR" ]; then
rm -rf "$DISCLAIMER_OUTPUT_DIR"
fi
mkdir "$DISCLAIMER_OUTPUT_DIR"
go run github.com/google/go-licenses@latest report ./wavesrv/... ./waveshell/... --template "$DISCLAIMER_DIR/go_licenses_report.tpl" --ignore github.com/wavetermdev/waveterm > "$DISCLAIMER_OUTPUT_DIR/backend.md"
yarn licenses generate-disclaimer > "$DISCLAIMER_OUTPUT_DIR/frontend.md"
```
+96 -13
View File
@@ -99,9 +99,6 @@ body a {
body code {
font-family: @terminal-font;
}
body code {
background-color: transparent;
}
@@ -123,11 +120,19 @@ svg.icon {
}
.hideScrollbarUntillHover {
overflow: hidden;
&:hover,
&:focus,
&:focus-within {
overflow: auto;
overflow: scroll;
&::-webkit-scrollbar-thumb,
&::-webkit-scrollbar-track {
display: none;
}
&::-webkit-scrollbar-corner {
display: none;
}
&:hover::-webkit-scrollbar-thumb {
display: block;
}
}
@@ -476,17 +481,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 +509,10 @@ a.a-block {
circle {
fill: @tab-orange;
}
i {
color: @tab-orange;
}
}
.icon.color-blue {
@@ -502,6 +520,10 @@ a.a-block {
circle {
fill: @tab-blue;
}
i {
color: @tab-blue;
}
}
.icon.color-yellow {
@@ -509,6 +531,10 @@ a.a-block {
circle {
fill: @tab-yellow;
}
i {
color: @tab-yellow;
}
}
.icon.color-pink {
@@ -516,6 +542,10 @@ a.a-block {
circle {
fill: @tab-pink;
}
i {
color: @tab-pink;
}
}
.icon.color-mint {
@@ -523,6 +553,10 @@ a.a-block {
circle {
fill: @tab-mint;
}
i {
color: @tab-mint;
}
}
.icon.color-cyan {
@@ -530,6 +564,10 @@ a.a-block {
circle {
fill: @tab-cyan;
}
i {
color: @tab-cyan;
}
}
.icon.color-violet {
@@ -537,6 +575,10 @@ a.a-block {
circle {
fill: @tab-violet;
}
i {
color: @tab-violet;
}
}
.icon.color-white {
@@ -544,6 +586,10 @@ a.a-block {
circle {
fill: @tab-white;
}
i {
color: @tab-white;
}
}
.status-icon.status-connected {
@@ -581,3 +627,40 @@ a.a-block {
.text-selectable {
user-select: text;
}
.spin {
animation: infiniteRotate 2s linear infinite;
@keyframes infiniteRotate {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
}
.view {
background-color: @background-session;
flex-grow: 1;
display: flex;
flex-direction: column;
position: relative;
overflow: auto;
margin-bottom: 10px;
margin-right: 10px;
border-radius: 8px;
border: 1px solid rgba(241, 246, 243, 0.08);
.header {
margin: 24px 18px;
display: flex;
justify-content: space-between;
align-items: center;
.close-div {
font-size: 1.5em;
}
}
}
+16 -12
View File
@@ -16,14 +16,10 @@ 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 { ClientSettingsView } from "./clientsettings/clientsettings";
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";
@@ -34,6 +30,7 @@ type OV<V> = mobx.IObservableValue<V>;
@mobxReact.observer
class App extends React.Component<{}, {}> {
dcWait: OV<boolean> = mobx.observable.box(false, { name: "dcWait" });
mainContentRef: React.RefObject<HTMLDivElement> = React.createRef();
constructor(props: any) {
super(props);
@@ -74,12 +71,18 @@ 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();
let dcWait = this.dcWait.get();
let platform = GlobalModel.getPlatform();
let clientData = GlobalModel.clientData.get();
// 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) {
return null;
}
if (disconnected || hasClientStop) {
if (!dcWait) {
@@ -87,8 +90,8 @@ class App extends React.Component<{}, {}> {
}
return (
<div id="main" className={"platform-" + platform} onContextMenu={this.handleContextMenu}>
<div className="main-content">
<MainSideBar />
<div ref={this.mainContentRef} className="main-content">
<MainSideBar parentRef={this.mainContentRef} clientData={clientData} />
<div className="session-view" />
</div>
<If condition={dcWait}>
@@ -107,14 +110,15 @@ class App extends React.Component<{}, {}> {
}
return (
<div id="main" className={"platform-" + platform} onContextMenu={this.handleContextMenu}>
<div className="main-content">
<MainSideBar />
<div ref={this.mainContentRef} className="main-content">
<MainSideBar parentRef={this.mainContentRef} clientData={clientData} />
<ErrorBoundary>
<PluginsView />
<WorkspaceView />
<HistoryView />
<BookmarksView />
<ConnectionsView model={remotesModel} />
<ClientSettingsView model={remotesModel} />
</ErrorBoundary>
</div>
<ModalsProvider />
+5
View File
@@ -7,7 +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;
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg width="440" height="440" version="1.1" viewBox="0 0 116.42 116.42" xmlns="http://www.w3.org/2000/svg">
<circle id="indicator" cx="58.266" cy="58.266" r="28.311" stroke-width=".19016"/>
<path id="spinner" d="m107.2 58.21a48.988 48.988 0 0 1-48.988 48.988" fill="none" stroke="#000" stroke-width="16.856" style="paint-order:normal"/>
</svg>

After

Width:  |  Height:  |  Size: 443 B

+200
View File
@@ -0,0 +1,200 @@
@import "../../app/common/themes/themes.less";
.clientsettings-view {
background-color: @background-session;
flex-grow: 1;
display: flex;
flex-direction: column;
position: relative;
overflow: auto;
margin-bottom: 10px;
margin-right: 10px;
border-radius: 8px;
border: 1px solid rgba(241, 246, 243, 0.08);
background: rgba(13, 13, 13, 0.85);
.header {
margin: 24px 18px;
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 20px;
border-bottom: 1px solid white;
}
.content {
padding: 0 18px 0 30px;
}
// just marked these as important since we're keeping the
// settings-field styles below this intact until we figure out what do with them
.settings-field {
&:not(:first-child) {
margin-top: 15px !important;
}
.settings-label {
width: 250px !important;
}
}
// @TODO: These styles are duplicated in the settings modals
.settings-field {
display: flex;
flex-direction: row;
align-items: center;
&.settings-field.sub-field {
.settings-label {
font-weight: normal;
text-align: right;
padding-right: 20px;
}
}
&.settings-error {
color: @term-red;
margin-top: 20px;
padding: 10px;
border-radius: 5px;
background-color: #200707;
border: 1px solid @term-red;
font-weight: bold;
.error-dismiss {
padding: 2px;
cursor: pointer;
}
}
.settings-label {
font-weight: bold;
width: 12em;
display: flex;
flex-direction: row;
align-items: center;
margin-right: 10px;
.info-message {
margin-left: 5px;
}
}
.settings-input {
display: flex;
flex-direction: row;
align-items: center;
&.settings-clickable {
cursor: pointer;
}
&.inline-edit.edit-active {
input.input {
padding: 0;
height: 20px;
}
.button {
height: 20px;
}
}
input {
padding: 4px;
border-radius: 3px;
}
.control {
.icon {
width: 1.5em;
height: 1.5em;
margin: 0;
}
}
.tab-color-icon.color-default path {
fill: @tab-green;
}
.tab-color-icon.color-green path {
fill: @tab-green;
}
.tab-color-icon.color-orange path {
fill: @tab-orange;
}
.tab-color-icon.color-red path {
fill: @tab-red;
}
.tab-color-icon.color-yellow path {
fill: @tab-yellow;
}
.tab-color-icon.color-blue path {
fill: @tab-blue;
}
.tab-color-icon.color-mint path {
fill: @tab-mint;
}
.tab-color-icon.color-cyan path {
fill: @tab-cyan;
}
.tab-color-icon.color-white path {
fill: @tab-white;
}
.tab-color-icon.color-violet path {
fill: @tab-violet;
}
.tab-color-icon.color-pink path {
fill: @tab-pink;
}
.tab-colors,
.tab-icons {
display: flex;
flex-direction: row;
align-items: center;
.tab-color-sep,
.tab-icon-sep {
padding-left: 10px;
padding-right: 10px;
font-weight: bold;
}
.tab-color-icon,
.tab-icon-icon {
width: 1.1em;
vertical-align: middle;
}
.tab-color-name,
.tab-icon-name {
margin-left: 1em;
}
.tab-color-select,
.tab-icon-select {
cursor: pointer;
margin: 5px;
&:hover {
outline: 2px solid white;
}
}
}
.action-text {
margin-left: 20px;
color: @term-red;
}
.settings-share-link {
width: 160px;
}
}
&:not(:first-child) {
margin-top: 10px;
}
}
}
+222
View File
@@ -0,0 +1,222 @@
// Copyright 2023, Command Line Inc.
// SPDX-License-Identifier: Apache-2.0
import * as React from "react";
import * as mobxReact from "mobx-react";
import * as mobx from "mobx";
import { boundMethod } from "autobind-decorator";
import cn from "classnames";
import { GlobalModel, GlobalCommandRunner, MinFontSize, MaxFontSize, RemotesModel } from "../../model/model";
import { Toggle, InlineSettingsTextEdit, SettingsError, Dropdown } from "../common/common";
import { CommandRtnType, ClientDataType } from "../../types/types";
import { commandRtnHandler, isBlank } from "../../util/util";
import "./clientsettings.less";
type OV<V> = mobx.IObservableValue<V>;
// @ts-ignore
const VERSION = __WAVETERM_VERSION__;
// @ts-ignore
const BUILD = __WAVETERM_BUILD__;
@mobxReact.observer
class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hoveredItemId: string }> {
fontSizeDropdownActive: OV<boolean> = mobx.observable.box(false, { name: "clientSettings-fontSizeDropdownActive" });
errorMessage: OV<string> = mobx.observable.box(null, { name: "ClientSettings-errorMessage" });
@boundMethod
dismissError(): void {
mobx.action(() => {
this.errorMessage.set(null);
})();
}
@boundMethod
handleChangeFontSize(fontSize: string): void {
let newFontSize = Number(fontSize);
this.fontSizeDropdownActive.set(false);
if (GlobalModel.termFontSize.get() == newFontSize) {
return;
}
let prtn = GlobalCommandRunner.setTermFontSize(newFontSize, false);
commandRtnHandler(prtn, this.errorMessage);
}
@boundMethod
togglefontSizeDropdown(): void {
mobx.action(() => {
this.fontSizeDropdownActive.set(!this.fontSizeDropdownActive.get());
})();
}
@boundMethod
handleChangeTelemetry(val: boolean): void {
let prtn: Promise<CommandRtnType> = null;
if (val) {
prtn = GlobalCommandRunner.telemetryOn(false);
} else {
prtn = GlobalCommandRunner.telemetryOff(false);
}
commandRtnHandler(prtn, this.errorMessage);
}
@boundMethod
handleChangeReleaseCheck(val: boolean): void {
let prtn: Promise<CommandRtnType> = null;
if (val) {
prtn = GlobalCommandRunner.releaseCheckAutoOn(false);
} else {
prtn = GlobalCommandRunner.releaseCheckAutoOff(false);
}
commandRtnHandler(prtn, this.errorMessage);
}
getFontSizes(): any {
let availableFontSizes: { label: string; value: number }[] = [];
for (let s = MinFontSize; s <= MaxFontSize; s++) {
availableFontSizes.push({ label: s + "px", value: s });
}
return availableFontSizes;
}
@boundMethod
inlineUpdateOpenAIModel(newModel: string): void {
let prtn = GlobalCommandRunner.setClientOpenAISettings({ model: newModel });
commandRtnHandler(prtn, this.errorMessage);
}
@boundMethod
inlineUpdateOpenAIToken(newToken: string): void {
let prtn = GlobalCommandRunner.setClientOpenAISettings({ apitoken: newToken });
commandRtnHandler(prtn, this.errorMessage);
}
@boundMethod
inlineUpdateOpenAIMaxTokens(newMaxTokensStr: string): void {
let prtn = GlobalCommandRunner.setClientOpenAISettings({ maxtokens: newMaxTokensStr });
commandRtnHandler(prtn, this.errorMessage);
}
@boundMethod
setErrorMessage(msg: string): void {
mobx.action(() => {
this.errorMessage.set(msg);
})();
}
@boundMethod
handleClose(): void {
GlobalModel.clientSettingsViewModel.closeView();
}
render() {
let isHidden = GlobalModel.activeMainView.get() != "clientsettings";
if (isHidden) {
return null;
}
let cdata: ClientDataType = GlobalModel.clientData.get();
let openAIOpts = cdata.openaiopts ?? {};
let apiTokenStr = isBlank(openAIOpts.apitoken) ? "(not set)" : "********";
let maxTokensStr = String(
openAIOpts.maxtokens == null || openAIOpts.maxtokens == 0 ? 1000 : openAIOpts.maxtokens
);
let curFontSize = GlobalModel.termFontSize.get();
return (
<div className={cn("view clientsettings-view")}>
<header className="header">
<div className="clientsettings-title text-primary">Client Settings</div>
<div className="close-div hoverEffect" title="Close (Escape)" onClick={this.handleClose}>
<i className="fa-sharp fa-solid fa-xmark"></i>
</div>
</header>
<div className="content">
<div className="settings-field">
<div className="settings-label">Term Font Size</div>
<div className="settings-input">
<Dropdown
className="font-size-dropdown"
options={this.getFontSizes()}
defaultValue={`${curFontSize}px`}
onChange={this.handleChangeFontSize}
/>
</div>
</div>
<div className="settings-field">
<div className="settings-label">Client ID</div>
<div className="settings-input">{cdata.clientid}</div>
</div>
<div className="settings-field">
<div className="settings-label">Client Version</div>
<div className="settings-input">
{VERSION} {BUILD}
</div>
</div>
<div className="settings-field">
<div className="settings-label">DB Version</div>
<div className="settings-input">{cdata.dbversion}</div>
</div>
<div className="settings-field">
<div className="settings-label">Basic Telemetry</div>
<div className="settings-input">
<Toggle checked={!cdata.clientopts.notelemetry} onChange={this.handleChangeTelemetry} />
</div>
</div>
<div className="settings-field">
<div className="settings-label">Check for Updates</div>
<div className="settings-input">
<Toggle
checked={!cdata.clientopts.noreleasecheck}
onChange={this.handleChangeReleaseCheck}
/>
</div>
</div>
<div className="settings-field">
<div className="settings-label">OpenAI Token</div>
<div className="settings-input">
<InlineSettingsTextEdit
placeholder=""
text={apiTokenStr}
value={""}
onChange={this.inlineUpdateOpenAIToken}
maxLength={100}
showIcon={true}
/>
</div>
</div>
<div className="settings-field">
<div className="settings-label">OpenAI Model</div>
<div className="settings-input">
<InlineSettingsTextEdit
placeholder="gpt-3.5-turbo"
text={isBlank(openAIOpts.model) ? "gpt-3.5-turbo" : openAIOpts.model}
value={openAIOpts.model ?? ""}
onChange={this.inlineUpdateOpenAIModel}
maxLength={100}
showIcon={true}
/>
</div>
</div>
<div className="settings-field">
<div className="settings-label">OpenAI MaxTokens</div>
<div className="settings-input">
<InlineSettingsTextEdit
placeholder=""
text={maxTokensStr}
value={maxTokensStr}
onChange={this.inlineUpdateOpenAIMaxTokens}
maxLength={10}
showIcon={true}
/>
</div>
</div>
<SettingsError errorMessage={this.errorMessage} />
</div>
</div>
);
}
}
export { ClientSettingsView };
+16 -12
View File
@@ -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,11 @@
background-color: @markdown-highlight;
margin: 4px 10px 4px 10px;
padding: 6px 6px 6px 10px;
border-radius: 4px;
}
pre.selected {
outline: 2px solid @term-green;
}
.title.is-1 {
@@ -608,7 +609,6 @@
.wave-dropdown {
position: relative;
background-color: transparent;
height: 44px;
min-width: 150px;
width: 100%;
@@ -714,9 +714,7 @@
top: 100%;
left: 0;
right: 0;
z-index: 0;
margin-top: 2px;
padding: 0;
max-height: 200px;
overflow-y: auto;
padding: 6px;
@@ -774,7 +772,6 @@
min-width: 412px;
gap: 6px;
border: 1px solid var(--element-separator, rgba(241, 246, 243, 0.15));
border-radius: 6px;
background: var(--element-hover-2, rgba(255, 255, 255, 0.06));
box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.4), 0px 0px 0.5px 0px rgba(0, 0, 0, 0.5),
0px 0px 0.5px 0px rgba(255, 255, 255, 0.5) inset, 0px 0.5px 0px 0px rgba(255, 255, 255, 0.2) inset;
@@ -837,6 +834,14 @@
}
}
}
&.no-label {
height: 34px;
input {
height: 32px;
}
}
}
.wave-input-decoration {
@@ -922,7 +927,6 @@
background: none;
color: inherit;
border: none;
padding: 0;
font: inherit;
cursor: pointer;
outline: inherit;

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