Compare commits

..

85 Commits

Author SHA1 Message Date
sawka 19e856a3be bump version to 0.5.3 2023-12-21 12:31:54 -08:00
sawka 8246f8118e bump to v0.5.3 to fix #174 2023-12-21 12:30:57 -08:00
Red J Adaya 75d1a435ae fix missing session ID (#178) 2023-12-19 16:18:44 -08:00
Mike Sawka 426f9546e5 fix connection edit modal (#170)
* fix connection edit modal

* apply prettier
2023-12-18 23:28:49 -08:00
sawka d410e5d07f add keys to force new components whenever workspaces changes 2023-12-18 21:47:01 -08:00
sawka e66f34c9b5 upgrade go crypto library 2023-12-18 20:45:00 -08:00
sawka 58e971276e minor fixes 2023-12-18 20:41:15 -08:00
Cole Lashley 2d08037782 Fixed open ai renderer not scrolling correctly (#165)
* added scrolling to open ai renderer css

* fixed max width

* small fixes - added max width - added padding - fixed flex issue
2023-12-18 17:20:13 -08:00
Evan Simkowitz 226699732d Run release check in the background when toggling the setting (#169)
* Run release check in the background when toggling the setting

* change var name

* use new err variable
2023-12-18 17:19:11 -08:00
Evan Simkowitz 03b1e410e7 Small tweak to the checkbox toggle slider (#168) 2023-12-18 16:41:35 -08:00
Mike Sawka 38c784bf8e sidebar render delay of 0.5s, and a 0.5s transition on main window width (#167)
* sidebar render delay of 0.5s, and a 0.5s transition on main window width

* fix width calculation and how we apply the buffer width for sidebar

* also add the model.ts change
2023-12-18 16:40:26 -08:00
Sylvie Crowe 40af311e5b remove handleKeyDown for NumberField (#166)
handleKeyDown was a method that filtered out specific keypresses if they
weren't specific keycodes. This did not play well with all keyboards
which made it impossible to enter port numbers. furthermore,
handleInputChange should already filter out non-numeric characters, so
the filtering still works properly with this removal.
2023-12-18 16:03:51 -08:00
Evan Simkowitz 112fda912f Modify "Check for Updates" setting name (#164) 2023-12-18 15:28:35 -08:00
sawka f2eb383cc3 add special case for conda activate/deactivate as well to rtnstate detection 2023-12-18 15:07:13 -08:00
sawka 8d71f5538c update rtnstate detection, support blocks, and binary expressions 2023-12-18 15:02:55 -08:00
sawka 7a37fdb942 create new contexts for goroutine calls 2023-12-18 14:41:53 -08:00
sawka 80f7162691 dont scroll main view when selecting line in sidebar 2023-12-18 14:11:04 -08:00
Mike Sawka a639d72e30 Packetparser Ignore Spurious Invalid Input at Beginning of Stream (#140)
* take a stab at fixing #99. ignore invalid output before we see a real packet.  the complication here was ensuring we always output a real packet in every flow so we don't actually lose valid errors.

* add ping packets to prime the parser (when in ignoreUntilValid mode)
2023-12-18 12:42:40 -08:00
sawka ce252d479b fix id issue -- must use a unique id for tabs so we don't get collisions on real elements in the CSS 2023-12-18 00:16:57 -08:00
sawka d8d19ea035 bump to version v0.5.2 2023-12-17 23:58:09 -08:00
Mike Sawka 21ab82e2e2 Implement a Sidebar for Tabs (#157)
* work on basic sidebar layout

* fix more golang warnings

* sidebar open/close

* add ability to set width of split

* sidebar add and remove, set width, etc.

* almost working sidebar implementation -- still needs height/width, input control, and bug with initial add, but getting there

* add isSidebarOpen() method

* fix resize jump -- must set width in error handler as well (before window is loaded)

* sidebar UI touchups and help

* more sidebar progress, render more like regular lines, just in the right column

* merge

* move migration to 26

* simplify sidebar types

* checkpoint

* proxy things through parent screen object for sidebar

* checkpoint, add/remove from sidebar

* work on add/remove icons for sidebar

* fix height calculation, remove close button

* bring back close button when no line is selected

* add sidebar flag to run command to run new command output in sidebar

* implement 'sidebar' kwarg in eval.  this lets sidebar work for slashcommands as well that produce lines (codeedit, mdview, etc.)

* prettier

* minor fixes

* working on resizing.  must exclude sidebar entries and send separate resize events based on size of sidebar (implement exclude / include for resize)

* fix sidebar terminal command resizing

* add sidebar header (toggles for half/partial width and close).  add hotkey to open/close sidebar (Cmd-Ctrl-S).  more robust calculation for sidebar width. add width validation.  minimum sidebar width is 200px.  other fixes, etc.
2023-12-17 23:46:53 -08:00
sawka 781ebe8154 add checking for latestversion (avoid potential error in semver.compareLoose) 2023-12-16 11:36:38 -08:00
sawka ad225ed28a fix some ts errors in emain.ts 2023-12-16 10:59:30 -08:00
Mike Sawka 633cb8fbd0 fix openai packets to be PacketType. better compatibility with backend (#154)
also pass clientid to openapi cloud service
2023-12-15 22:43:59 -08:00
Cole Lashley 4ccd62f12a Add support for proxying open AI chat completion through cloud (#148)
* wrote client code for communicating with lambda cloud

* Added timeout functionality, added check for telemetry enabled for clouod completion, added capability to unset token, other small fixes

* removed stale prints and comments, readded non stream completion for now

* changed json encode to json marshal, also testing my new commit author

* added no telemetry error message and removed check for model in cloud completion

* added defer conn.close() to doOpenAIStreamCompletion, so websocket is always closed

* made a constant for the long telemetry error message

* added endpoint getter, made errors better

* updated scripthaus file to include dev ws endpoint

* added error check for open ai errors

* changed bool condition for better readability

* update some error messages (use error message from server if returned)

* dont blow up the whole response if the server times out.  just write a timeout message

* render streaming errors with a new prompt in openai.tsx (show content and error).  render cmd status 'error' with red x as well.  show exitcode in tooltip of 'x'

* set hadError for errors.  update timeout error to work with new frontend code

* bump client timeout to 5 minutes (longer than server timeout)

---------

Co-authored-by: sawka
2023-12-15 22:20:03 -08:00
Evan Simkowitz b733724c7d Add sidebar banner when new release is available (#147)
* Server impl

* add update check setting

* add commands

* fix capitalization of commands

* apply suggestions

* add migration and fix backend bugs

* Add sidebar banner

* remove installedversion, add 5s timeout

* add icon, capture and log errors from release check

* missing return nil

* remove highlight

* remove commented less

* do not fail releasecheckoncommand if release check operation fails

* remove debug condition

* fix update on auto check, move banner display logic into frontend

* remove unnecessary import

* simplify null check

* clean up the invoking of the releasechecker
2023-12-15 17:43:54 -08:00
Red J Adaya 4ff5dcf1e0 fix mouse scroll (#151) 2023-12-15 16:15:45 -08:00
Red J Adaya f9d0e63d0c delete screen immediately when there are no lines in it (#152) 2023-12-15 15:40:34 -08:00
Red J Adaya ea9cb37de1 drag and drop support for tabs (#146)
* back-end implementation. initial ui implementation

* rough implementation of drag and drop

* wrap with AnimatePresence

* persist screen order

* cleanup

* return all screens when updating indices

* remove y axis anitation

* remove debugging code

* chain filtering and sorting logic

* remove unused var

* fix issue where tabs shift to left on hover

* fix tabElem scroll into view regression

* clear scrollIntoViewTimeout when component unmounts

* remove borken style prop

* completely remove animation related props

* scroll into view only when there's a new tab

* minor comment fix

* resolvePosInt() to resolve index

* move tab width const to magiclayout.ts

* move back scroll into view code as it was before

* clear timout

* refactor setTimeout

* remov debugging codes

* format cmdrunner.go

* move clearTimeout

* remove wheel event listener
2023-12-14 21:50:47 -08:00
Mike Sawka 8200a312b9 On MacOS allow UserShell to override /bin/bash (#137)
* switch emain to using the bash from PATH, not defaulting to /bin/bash.  not convinced this fixes #132 yet because the PATH set for MacOS applications is not set from .bash_profile or .zprofile.  those seem to be set with launchctl setenv.

* move MacUserShell() func to shexec.  use dscl UserShell output as bash path on MacOS when present.  fixes #132
2023-12-14 21:45:27 -08:00
Evan Simkowitz 3b65e9941a Clean up potentially unsafe external links (#139)
* Clean up potentially unsafe external links

* fix broken imports

* fix error in conditional

* fix one more typo
2023-12-13 17:43:30 -08:00
Cole Lashley 535fd0d7d9 added openaibaseurl parameter to client:set (#141) 2023-12-13 14:03:22 -08:00
Evan Simkowitz 96980b2f83 Merge pull request #138 from wavetermdev/evan/codescan-fixes
Fix potential overflow in promptenc arithmetic
2023-12-12 21:01:09 -08:00
sawka b6c880c6ff add 'cmd' parameter to /api/run-command for debugging purposes (easier filtering and visual inspection of run-command calls) 2023-12-12 20:37:00 -08:00
Evan Simkowitz 1feffc8a11 address comment, clean up tests 2023-12-12 20:36:16 -08:00
sawka f442236679 fix performance issue where cmdinput was causing additional loading of screenlines 2023-12-12 20:36:11 -08:00
Evan Simkowitz 414937911e remove nolint 2023-12-12 17:40:05 -08:00
Evan Simkowitz 5d39815dea refactor a bit 2023-12-12 17:39:19 -08:00
Evan Simkowitz 96f636c2da Fix potential overflow in promptenc arithmetic 2023-12-12 16:51:19 -08:00
Evan Simkowitz 112d002c2a Merge pull request #136 from wavetermdev/esimkowitz/codeql
Configuring CodeQL scanning workflow
2023-12-12 15:53:24 -08:00
Mike Sawka 4adcf6d92e pass flexrows through to packet.TermOpts so it gets back to the FE correctly. this fixes wterm overrides and github issue #116 (#134) 2023-12-12 14:24:09 -08:00
Sylvie Crowe e79dcaf910 fix ability to log into ssh with key and password (#130)
* fix ability to log into ssh with key and password

A previous refactor to the ssh password system broke the ability to use
key+password to log in. This change handles key+password as a special
case allowing it to be handled separately.

* clean up unnecessary print

My last change left in a debug print that wasn't necessary in the code.
This has been removed.
2023-12-12 14:17:53 -08:00
Evan Simkowitz e6186cd694 Fixing linting errors in unused keygen function (#135)
* Fixing missing parameter error in unused keygen function

* applying error formatting linter suggestions

* fixing more linting suggestions
2023-12-12 14:17:03 -08:00
Evan Simkowitz 58551d6a2a Configuring CodeQL scanning workflow
Configuring the default CodeQL scanning workflow. This will automatically scan our code for known vulnerabilities.
2023-12-12 10:17:55 -08:00
Mike Sawka 2b8adfe40e add homebrew instructions to readme 2023-12-10 13:33:06 -08:00
sawka ce4b6d413c fix remaining warnings in workspace 2023-12-08 13:39:13 -08:00
Red J Adaya 8a938744f7 migrate modals to new modals system (#124)
* migrate screen settings modal to new modals system

* use screen member var in the methods

* migrate session settings modal to new modal system

* use Modal component in session settings modal

* migrate line settings modal to new modals system

* use Modal component in line settings modal

* migrate client settings modal to new modals framework

* set alert modal width to 500px

* remove screen settings modal after deletion

* use Dropdown component for connnections dropdown

* use Dropdown component for connections dropdown in new tab flow

* replace InfoMessage with Tooltip

* use Dropdown for fontsize dropdown

* use Dropdown for renderer dropdown

* fix dropdown width issue on new tab container

* fix class names concatenation

* fix dropdown width issue in screen settings modal
2023-12-07 22:51:46 -08:00
Sylvie Crowe 87bf3f7a65 allow @ symbol in user for ssh connections (#129)
* allow @ symbol in user for ssh connections

Previously, the @ symbol was only used as a way to either:
- separate the user from the host
- separate "sudo" from the user

This change expands this to allow the username part of
sudo@username@host or username@host to contain any number of @ symbols
in addition to the ones previously allowed. Host is not allowed to
contain an @ symbol as per the usual definition.

* clean up regex changes

Moved the dash in the regex pattern to the end to make it explicitly
clear that it isn't part of a range.

Removed the hostNameRe regex as it is unused.
2023-12-07 18:33:16 -08:00
sawka 800fda2e14 we use yarn, so remove package-lock.json 2023-12-05 20:54:12 -08:00
sawka 3c30eb4e08 upgrade some outdated packages 2023-12-05 17:44:44 -08:00
sawka 32a825aea1 move force install to main connection screen, remove edit/delete from edit screen 2023-12-05 17:42:43 -08:00
sawka 0ece51e690 remove more go warnings 2023-12-05 10:49:30 -08:00
sawka 724a68393a fix some go errors/warnings 2023-12-05 10:43:57 -08:00
Sylvie Crowe 6791d874e3 Add Waveterm Icon to Linux (#120)
* add icon for Linux

The app icon previously did not show up in Linux. This change fixes that
by providing the wave-logo-dark.png to the electron Browser Window.

* set the icon to only use the direct path on linux

The previous change was only required on linux and not on mac. This
ensures the old behavior will continue to be done on mac while using the
new behavior on linux.
2023-12-04 22:47:01 -08:00
Alan Hanafy a3187a1235 Fix typo in command history button label (#115) 2023-12-04 18:40:20 -08:00
Red J Adaya 9ebd5bda8f TOS Modal (#123)
* register tos modal and fix its styles

* hard-code render TOS modal in ModalsProvider

* cleanup

* remove tos const
2023-12-04 18:29:21 -08:00
sawka c8485ad80c upload dark background logo, bump version in build-universal to v0.5.1 2023-12-04 10:27:08 -08:00
sawka dbde4b58df bump package.json to v0.5.1 2023-12-04 10:09:47 -08:00
sawka 7280bbf9d9 update outdated packages 2023-12-04 10:04:48 -08:00
Mike Sawka 08762fdfc3 Merge pull request #119 from wavetermdev/dev-0.5.1
pull dev-0.5.1 branch to main
2023-12-04 09:55:11 -08:00
Red J Adaya 0c756838e0 Tab Settings (#117)
* use Modal component

* icons selector

* do not limit icons in the backend
2023-12-04 09:52:59 -08:00
Sylvie Crowe 7310481383 Add a button to filter out non-running commands (#113)
* add filter button to the command input box

This will become a button that temporarily filters out the non-running
commands from your screen. At the moment it is only a placeholder design
that will likely change with more feedback. It does not have any
functionality at the moment.

* add view indication of active filter

This will become a clickable notification to let users know that a
filter is being applied. It displays the number of lines that are being
filtered. The plan is for it to be clickable to remove the filter. The
current version is a placeholder that is likely to change. It has no
functionality at the moment.

* add basic state to the filtering buttons

The filtering buttons up until this point haven't done anything. Now
they can be clicked and unclick causing them to render differently
depending on if they're selected. They still have no functionality
outside of their own appearance.

* add filtering functionality to filter button

The filter button now hides all non-running commands. And pressing it
again or pressing the other filter button will bring
back the hidden commands.

There are currently some formatting issues with the second button as it
jumps to the top of the screen if the filter is on and no running
commands are present.

An additional change was made to remove a variable accidentally
introduced in the last commit.

* add count for number of lines filtered out

The secondary filter button now lists the number of non-running commands
that have been filtered out. This count is added to the screen model in
case it is needed elsewhere.

* fix the style on the secondary buttons

This fixes the margin an the button to bring it in line with the line
items. It also fixes empty window screen to use a different css class.
Previously, the window-view class being used would cover the button. It
is now using the window-empty class instead.

* change formatting for secondary filter button

The button is now yellow with a border style instead of red with a solid
style. The border-radius has been changed to give the button a pill
shape.

Additionally, a style tab has been added to the button component to
provide it with custom styling. It should be changed to a custom class
design in the future.

* update style on primary filter button

This is being changed to simpler hover text in line with other text in
the cmd box.

* add number display as text for first filter button

The main filter button originally displayed a somewhat vague message.
Now it displays the number of running tasks with the rotating arrow
symbol.

* remove numLinesHidden count from model

This numLineHidden count is no longer needed with the new button design.
Furthermore, it created several warnings in react due to its
implementation. For both of these reasons, it has been removed.

* update filter functionality to better utilize mobx

This consisted of a few changes. The first was to move the filter state
from the GlobalModel to ScreenLines in order to track state separately
for each screen. Then several of the functions had to be rewritten to
wrap setting variables in the mobx.action wrapper.

As is, there are still a few issues with this design:
- the filter is not remembered when switching tabs
- if all running tasks expire, the second filter button is still present

* move filtering observable to Screen model

The previous observable did not persist when changing tabs because
ScreenLines did not persist. By moving it to Screen, the ovservable now
persists after changing tabs.
2023-12-01 20:54:49 -08:00
Red J Adaya 23b6bb29e7 modals system (#106)
* init

* connections table

* view styles

* new components. header and status.

* action buttons

* use Button component in other modals

* hook add connection button

* RemoteConnDetailModal component

* refactor remotes model. read connection modal.

* remote conn detail modal layout and styles

* fix xterm styles

* use correct status message in xterm

* tone down color of settings input

* clean up

* edit remote conn modal

* fix buttons gap

* change button label

* archive and force install features

* use classnames

* add some class names and also set some widths / maxwidth for the table.  too hard to read on large screens.

* small style updates

* fix some typescript errors, other small fixups

* fix type error

* move add button to the bottom of the table

* more improvements

* adjust layout, behavior, and style accrdg to mike's feedback

* set table max-width in css

* open detail modal after creation of new remote

* new modal component. migrate about modal to new modal component.

* migrate create remote conn modal to modal component

* working modals stack

* update some working (remote -> connection).  fix typescript error in connections.  remove some console.logs

* fix a couple of mobx warnings (need to wrap in action)

* register create conn modal

* follow model naming convention

* register edit remote conn modal

* reset

* reset

* reset

* reset

* use remotes model methods and wrap pushModal calls in mobx action

* only close connect modal after update for remotes returns

* register alert modal

* fix type error in app.tsx

* migrate remote detail and alert modal to base modal component

* Revert "fix conflicts"

This reverts commit 962da77918b97c09e0b85532915df374fec16d42, reversing
changes made to 34cbe34ba58f0b32dedddf6a292de6c9fef09e2e.

* only wrapper ModalProvider with mobx provider

* change archive label to delete

* fix error where isOpen method does not exist

* remove registry modal

* rename ModalStoreModel to ModalsModal

* fix issue where edit remote conn modal doesn't show

* simplify modal component

* grab remoteModel from within the remote modals

* fix edit modal

* minor change

* cleanup

* more cleanup

* change confirm wording to 'delete' instead of 'archive'.  remove or-equals since isBlank is designed to check for exactly that.

* undo some of the strict typescript fixes

* undo more typescript fixes

* cleanup

* fix import

* revert build.md change
2023-12-01 20:04:59 -08:00
sawka fc79da776c merge main into dev-0.5.1 2023-12-01 19:58:59 -08:00
sawka 24499cb0b5 change pterm variable name to wterm 2023-12-01 15:21:24 -08:00
sawka b9e12b2623 bump version to v0.5.1 2023-11-30 10:06:06 -08:00
Sylvie Crowe 86a86bc756 Update clear so it no longer archives Running Commands (#110)
* fix clear so it doesn't archive running commands

Clear previously archived every command that existed in the current tab.
This change alters this behavior so the commands with a status of running
or detached are not archived by clear.  As things currently stand,
detached is not used so the only immediate effect will be with running
commands. As before, the clear command only affects the current tab.

* remove unnecessary print

A print statement for debug still existed in the ArchiveScreenLines
function. It has been removed.

* remove isWebShare from ArchiveScreenLines

The isWebShare feature is currently unused and there is not a plan to
add it back soon. For this reason, it has been removed from the
ArchiveScreenLines function.

* clean up query formatting
2023-11-29 18:29:44 -08:00
sawka 1c9c470fec update typecheck to use tsconfig.json 2023-11-29 18:27:31 -08:00
sawka 75c3c42750 updated tsconfig.json 2023-11-29 18:23:47 -08:00
Sylvie Crowe ebf356417d add link to terms of service (#105)
* add link to terms of service

The welcome page previously referenced the terms of service without
providing a link to them. This change adds a hyperlink which allows
users to easily navigate to them.

* remove the tos checkbox

Additionally, small cleanups have been made to the formatting of the
source code.

* update color name from prompt-green to wave-green

Previously, the name prompt-green was used for the green color
associated with the branding. It has now been changed to wave-green.
This is in response to the terminal being renamed from prompt to
waveterm.

As a part of this, change the css class is-prompt-green has also been
changed. It is renamed to is-wave-green.

* update anchor tags to use wave-green color

Previously, anchor tags used the blue color that comes as default with
bulma css. They are now changed to be the wave-green color that matches
the rest of the branding.

This also involved updating the hover text to be the same color.
Note that hover links had to be specified but focus links did not. I
imagine this is because of bulma css defaults. Regardless, the previous
.content overwrite that we used for hovering hyperlinks was removed as
it is no longer necessary.
2023-11-29 00:27:54 -08:00
sawka 4ef8dd5a98 try to build a static wavesrv binary on linux to avoid glibc dependency issues (use go build tags, external linking, and -static) 2023-11-29 00:10:21 -08:00
sawka 0fbc800685 always set cgo_enabled to 0 for waveshell/mshell (everywhere now). fixes glibc dependency issue. confusing because when *not* cross-compiling on linux cgo_enabled defaults to 1. which was causing 3 statically linked binaries and 1 non-static. also remove broken build-waveshell scripthaus command (defaulted to mac.amd64 which was wrong) 2023-11-28 22:49:49 -08:00
sawka 5a147dc887 always set cgo_enabled to 0 for waveshell/mshell. fixes glibc dependency issue. confusing because when *not* cross-compiling on linux cgo_enabled defaults to 1. which was causing 3 statically linked binaries and 1 non-static. 2023-11-28 22:44:27 -08:00
sawka b250cc2042 update directories and color in BUILD.md text 2023-11-28 15:09:11 -08:00
Red J Adaya e95934e2df connections screen and modals (#69)
* init

* connections table

* view styles

* new components. header and status.

* action buttons

* use Button component in other modals

* hook add connection button

* RemoteConnDetailModal component

* refactor remotes model. read connection modal.

* remote conn detail modal layout and styles

* fix xterm styles

* use correct status message in xterm

* tone down color of settings input

* clean up

* edit remote conn modal

* fix buttons gap

* change button label

* archive and force install features

* use classnames

* add some class names and also set some widths / maxwidth for the table.  too hard to read on large screens.

* small style updates

* fix some typescript errors, other small fixups

* fix type error

* move add button to the bottom of the table

* more improvements

* adjust layout, behavior, and style accrdg to mike's feedback

* set table max-width in css

* open detail modal after creation of new remote

* update some working (remote -> connection).  fix typescript error in connections.  remove some console.logs

* fix a couple of mobx warnings (need to wrap in action)
2023-11-27 16:22:15 -08:00
Luke (Zgroza) Klimek 98b373d401 Adjust the username regex - '_' character (#94)
* adjust the username regex - '_' character

* also allow dot in username regex (sawka)
2023-11-27 12:44:53 -08:00
sawka 64203e7823 update username regex to include dots and underscores 2023-11-25 11:30:42 -08:00
sawka 7d8f811228 fix typo 2023-11-24 00:15:09 -08:00
sawka ebdc1ff524 fix ctrl-w functionality 2023-11-20 22:03:56 -08:00
sawka 3f57ee8c46 drop visible map recomputation time to 100ms (from 1000ms). lines fill in much faster when scrolling 2023-11-16 23:57:36 -08:00
sawka d9c7b61c91 also add nvm and virtualenv 2023-11-16 23:54:27 -08:00
sawka 0017946bbb add asdf to default rtnstate commands 2023-11-16 23:51:02 -08:00
sawka e15558690f make ctrl-shift-v work in the terminal (paste text) 2023-11-16 23:40:20 -08:00
sawka bf03ff2591 add ctrl-shift-c handler for terminal (to copy text) 2023-11-16 23:11:42 -08:00
sawka ad0f11c097 allow terminal font sizes up to 24px 2023-11-16 22:49:59 -08:00
83 changed files with 8007 additions and 15276 deletions
+81
View File
@@ -0,0 +1,81 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '36 5 * * 5'
jobs:
analyze:
name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'go', 'javascript-typescript' ]
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# 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
# ℹ️ 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
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
+1 -1
View File
@@ -5,7 +5,7 @@ If you're developing on Linux please use the [Linux Build Instructions](./build-
## Running the Development Version of Wave
If you install the production version of Wave, you'll see a semi-transparent sidebar, and the data for Wave is stored in the directory ~/prompt. The development version has a red/brown sidebar and stores its data in ~/prompt-dev. This allows the production and development versions to be run simultaneously with no conflicts. If the dev database is corrupted by development bugs, or the schema changes in development it will not affect the production copy.
If you install the production version of Wave, you'll see a semi-transparent sidebar, and the data for Wave is stored in the directory ~/.waveterm. The development version has a blue sidebar and stores its data in ~/.waveterm-dev. This allows the production and development versions to be run simultaneously with no conflicts. If the dev database is corrupted by development bugs, or the schema changes in development it will not affect the production copy.
## Prereqs and Tools
+5
View File
@@ -25,6 +25,11 @@ Wave Terminal works with MacOS and Linux (preliminary).
Install Wave Terminal from: [www.waveterm.dev/download](https://www.waveterm.dev/download)
Also available as a homebrew cask for MacOS:
```
brew install --cask wave
```
## Links
* Homepage — https://www.waveterm.dev
+1 -1
View File
@@ -1,7 +1,7 @@
#!/bin/bash
# assumes we have Wave-darwin-x64-[version].zip and Wave-darwin-arm64-[version].zip in current directory
VERSION=0.5.0
VERSION=0.5.3
rm -rf temp
mkdir temp
mkdir temp/x64
+1
View File
@@ -1,3 +1,4 @@
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
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=
-11314
View File
File diff suppressed because it is too large Load Diff
+11 -9
View File
@@ -2,7 +2,7 @@
"name": "waveterm",
"author": "Command Line Inc",
"productName": "Wave",
"version": "0.5.0",
"version": "0.5.3",
"main": "dist/emain.js",
"license": "Apache-2.0",
"dependencies": {
@@ -11,12 +11,14 @@
"@table-nav/react": "^0.0.7",
"@tanstack/match-sorter-utils": "^8.8.4",
"@tanstack/react-table": "^8.10.3",
"@types/semver": "^7.5.6",
"autobind-decorator": "^2.4.0",
"classnames": "^2.3.1",
"dayjs": "^1.11.3",
"dompurify": "^3.0.2",
"electron-squirrel-startup": "^1.0.0",
"mobx": "^6.6.0",
"framer-motion": "^10.16.16",
"mobx": "6.12",
"mobx-react": "^7.5.0",
"monaco-editor": "^0.44.0",
"mustache": "^4.2.0",
@@ -43,9 +45,9 @@
"@babel/plugin-proposal-private-methods": "^7.18.6",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@babel/plugin-transform-react-jsx": "^7.17.12",
"@babel/plugin-transform-runtime": "^7.18.2",
"@babel/plugin-transform-runtime": "^7.23.4",
"@babel/preset-env": "^7.18.2",
"@babel/preset-react": "^7.17.12",
"@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",
@@ -53,22 +55,22 @@
"@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/rebuild": "^3.3.0",
"@electron/rebuild": "^3.4.0",
"@svgr/webpack": "^8.1.0",
"@types/classnames": "^2.3.1",
"@types/electron": "^1.6.10",
"@types/node": "^20.4.0",
"@types/node": "20.10.3",
"@types/papaparse": "^5.3.10",
"@types/react": "^18.0.12",
"@types/sprintf-js": "^1.1.3",
"@types/throttle-debounce": "^5.0.1",
"@types/uuid": "9.0.6",
"@types/uuid": "9.0.7",
"@types/webpack-env": "^1.18.3",
"babel-loader": "^9.1.3",
"babel-plugin-jsx-control-statements": "^4.1.2",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.7.1",
"electron": "27.0.3",
"electron": "27.1.3",
"file-loader": "^6.2.0",
"http-server": "^14.1.1",
"less": "^4.1.2",
@@ -81,7 +83,7 @@
"style-loader": "^3.3.1",
"typescript": "^4.7.3",
"webpack": "^5.73.0",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-bundle-analyzer": "^4.10.1",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.9.1",
"webpack-merge": "^5.8.0"
Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

+18 -25
View File
@@ -27,13 +27,13 @@ node_modules/.bin/electron-rebuild
```bash
# @scripthaus command electron
# @scripthaus cd :playbook
WAVETERM_DEV=1 PCLOUD_ENDPOINT="https://ot2e112zx5.execute-api.us-west-2.amazonaws.com/dev" node_modules/.bin/electron dist-dev/emain.js
WAVETERM_DEV=1 PCLOUD_ENDPOINT="https://ot2e112zx5.execute-api.us-west-2.amazonaws.com/dev" PCLOUD_WS_ENDPOINT="wss://5lfzlg5crl.execute-api.us-west-2.amazonaws.com/dev/" node_modules/.bin/electron dist-dev/emain.js
```
```bash
# @scripthaus command typecheck
# @scripthaus cd :playbook
node_modules/.bin/tsc --jsx preserve --noEmit --esModuleInterop --target ES5 --experimentalDecorators --downlevelIteration src/index.ts src/types/custom.d.ts
node_modules/.bin/tsc --noEmit
```
```bash
@@ -44,11 +44,11 @@ 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; GOOS=darwin GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-darwin.amd64 main-waveshell.go)
(cd waveshell; GOOS=darwin GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-darwin.arm64 main-waveshell.go)
(cd waveshell; GOOS=linux GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-linux.amd64 main-waveshell.go)
(cd waveshell; GOOS=linux GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-linux.arm64 main-waveshell.go)
(cd wavesrv; CGO_ENABLED=1 go build -ldflags="$GO_LDFLAGS" -o ../bin/wavesrv ./cmd)
(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 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,11 +60,12 @@ 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; GOOS=darwin GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-darwin.amd64 main-waveshell.go)
(cd waveshell; GOOS=darwin GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-darwin.arm64 main-waveshell.go)
(cd waveshell; GOOS=linux GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-linux.amd64 main-waveshell.go)
(cd waveshell; GOOS=linux GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-linux.arm64 main-waveshell.go)
(cd wavesrv; CGO_ENABLED=1 go build -ldflags="$GO_LDFLAGS" -o ../bin/wavesrv ./cmd)
(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)
# 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
```
@@ -77,14 +78,7 @@ open out/Wave-darwin-x64/Wave.app
```bash
# @scripthaus command build-wavesrv
cd wavesrv
CGO_ENABLED=1 go build -ldflags "-X main.BuildTime=$(date +'%Y%m%d%H%M')" -o ../bin/wavesrv ./cmd
```
```bash
# @scripthaus command build-waveshell
cd waveshell
GO_LDFLAGS="-s -w -X main.BuildTime=$(date +'%Y%m%d%H%M')"
go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-darwin.amd64 main-waveshell.go
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
```
```bash
@@ -92,11 +86,10 @@ go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-darwin.amd64 main-w
set -e
cd waveshell
GO_LDFLAGS="-s -w -X main.BuildTime=$(date +'%Y%m%d%H%M')"
go build -ldflags="$GO_LDFLAGS" -o ~/.mshell/mshell-v0.2 main-waveshell.go
GOOS=linux GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-linux.amd64 main-waveshell.go
GOOS=linux GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-linux.arm64 main-waveshell.go
GOOS=darwin GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-darwin.amd64 main-waveshell.go
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.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
```
```bash
+49 -23
View File
@@ -49,6 +49,14 @@ textarea {
}
}
.text-primary {
font-size: 15px;
font-weight: 500;
line-height: 20px;
font-family: @text-s1-font;
color: @text-primary;
}
.text-standard {
font-size: 12.5px;
font-weight: 300;
@@ -80,6 +88,15 @@ textarea {
height: 16px;
}
body a {
color: @wave-green;
cursor: pointer;
text-decoration: none;
&:hover {
color: @wave-green;
}
}
body code {
font-family: @terminal-font;
}
@@ -148,10 +165,10 @@ svg.icon {
border-radius: 5px;
cursor: pointer;
background-color: @button-background !important;
color: @prompt-green;
color: @wave-green;
.hoverEffect;
&:hover {
color: @prompt-green;
color: @wave-green;
}
&.disabled {
color: fade(@disabled-color, 60%);
@@ -176,12 +193,6 @@ svg.icon {
left: 0;
}
.content {
a:hover {
color: #485fc7;
}
}
input[type="checkbox"] {
cursor: pointer;
}
@@ -219,7 +230,8 @@ a.a-block {
.history-view,
.bookmarks-view,
.plugins-view {
.plugins-view,
.connections-view {
flex-grow: 1;
display: flex;
flex-direction: column;
@@ -465,85 +477,99 @@ a.a-block {
}
.icon.color-red {
path, circle {
path,
circle {
fill: @tab-red;
}
}
.icon.color-green {
path, circle {
path,
circle {
fill: @tab-green;
}
}
.icon.color-orange {
path, circle {
path,
circle {
fill: @tab-orange;
}
}
.icon.color-blue {
path, circle {
path,
circle {
fill: @tab-blue;
}
}
.icon.color-yellow {
path, circle {
path,
circle {
fill: @tab-yellow;
}
}
.icon.color-pink {
path, circle {
path,
circle {
fill: @tab-pink;
}
}
.icon.color-mint {
path, circle {
path,
circle {
fill: @tab-mint;
}
}
.icon.color-cyan {
path, circle {
path,
circle {
fill: @tab-cyan;
}
}
.icon.color-violet {
path, circle {
path,
circle {
fill: @tab-violet;
}
}
.icon.color-white {
path, circle {
path,
circle {
fill: @tab-white;
}
}
.status-icon.status-connected {
path, circle {
path,
circle {
fill: @status-connected;
}
}
.status-icon.status-connecting {
path, circle {
path,
circle {
fill: @status-connecting;
}
}
.status-icon.status-disconnected {
path, circle {
path,
circle {
fill: @status-disconnected;
}
}
.status-icon.status-error {
path, circle {
path,
circle {
fill: @status-error;
}
}
+7 -47
View File
@@ -15,22 +15,15 @@ import { WorkspaceView } from "./workspace/workspaceview";
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 { RemotesModal } from "./connections/connections";
import { TosModal } from "./common/modals/modals";
import { MainSideBar } from "./sidebar/sidebar";
import {
DisconnectedModal,
ClientStopModal,
AlertModal,
AboutModal,
CreateRemoteConnModal,
} from "./common/modals/modals";
import { DisconnectedModal, ClientStopModal, ModalsProvider } from "./common/modals/modals";
import { ErrorBoundary } from "./common/error/errorboundary";
import "./app.less";
@@ -64,7 +57,7 @@ class App extends React.Component<{}, {}> {
opts.showCut = true;
}
let sel = window.getSelection();
if (!isBlank(sel.toString())) {
if (!isBlank(sel?.toString())) {
GlobalModel.contextEditMenu(e, opts);
} else {
if (isInNonTermInput) {
@@ -81,18 +74,13 @@ class App extends React.Component<{}, {}> {
}
render() {
let screenSettingsModal = GlobalModel.screenSettingsModal.get();
let sessionSettingsModal = GlobalModel.sessionSettingsModal.get();
let lineSettingsModal = GlobalModel.lineSettingsModal.get();
let clientSettingsModal = GlobalModel.clientSettingsModal.get();
let remotesModel = GlobalModel.remotesModalModel;
let remotesModal = remotesModel.isOpen();
let selectedRemoteId = remotesModel.selectedRemoteId.get();
let remoteEdit = remotesModel.remoteEdit.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();
if (disconnected || hasClientStop) {
if (!dcWait) {
setTimeout(() => this.updateDcWait(true), 1500);
@@ -117,7 +105,6 @@ class App extends React.Component<{}, {}> {
if (dcWait) {
setTimeout(() => this.updateDcWait(false), 0);
}
//console.log(`GlobalModel.activeMainView.get() = ${GlobalModel.activeMainView.get()}`); // @mike - if I remove this, I cant see plugins
return (
<div id="main" className={"platform-" + platform} onContextMenu={this.handleContextMenu}>
<div className="main-content">
@@ -127,37 +114,10 @@ class App extends React.Component<{}, {}> {
<WorkspaceView />
<HistoryView />
<BookmarksView />
<ConnectionsView model={remotesModel} />
</ErrorBoundary>
</div>
<AlertModal />
<If condition={GlobalModel.needsTos()}>
<TosModal />
</If>
<If condition={GlobalModel.aboutModalOpen.get()}>
<AboutModal />
</If>
<If condition={remoteEdit !== null && !remoteEdit.old}>
<CreateRemoteConnModal model={remotesModel} remoteEdit={remoteEdit} />
</If>
<If condition={screenSettingsModal != null}>
<ScreenSettingsModal
key={screenSettingsModal.sessionId + ":" + screenSettingsModal.screenId}
sessionId={screenSettingsModal.sessionId}
screenId={screenSettingsModal.screenId}
/>
</If>
<If condition={sessionSettingsModal != null}>
<SessionSettingsModal key={sessionSettingsModal} sessionId={sessionSettingsModal} />
</If>
<If condition={lineSettingsModal != null}>
<LineSettingsModal key={String(lineSettingsModal)} linenum={lineSettingsModal} />
</If>
<If condition={clientSettingsModal}>
<ClientSettingsModal />
</If>
<If condition={remotesModal}>
<RemotesModal model={GlobalModel.remotesModalModel} />
</If>
<ModalsProvider />
</div>
);
}
+13
View File
@@ -0,0 +1,13 @@
export const ABOUT = "about";
export const CREATE_REMOTE = "createRemote";
export const VIEW_REMOTE = "viewRemote";
export const EDIT_REMOTE = "editRemote";
export const ALERT = "alert";
export const SCREEN_SETTINGS = "screenSettings";
export const SESSION_SETTINGS = "sessionSettings";
export const LINE_SETTINGS = "lineSettings";
export const CLIENT_SETTINGS = "clientSettings";
export const LineContainer_Main = "main";
export const LineContainer_History = "history";
export const LineContainer_Sidebar = "sidebar";
+251 -35
View File
@@ -134,7 +134,7 @@
position: relative;
display: inline-block;
width: 40px;
height: 23px;
height: 22px;
input {
opacity: 0;
@@ -160,8 +160,8 @@
content: "";
height: 18px;
width: 18px;
left: 3px;
bottom: 3px;
left: 2px;
bottom: 2px;
background-color: @term-white;
transition: 0.5s;
border-radius: 50%;
@@ -247,7 +247,7 @@
}
}
.button.is-prompt-green {
.button.is-wave-green {
background-color: #222;
color: @term-white;
@@ -257,33 +257,6 @@
}
}
.wave-button {
display: flex;
padding: 6px 16px !important;
color: @term-white !important;
align-items: center;
gap: 4px;
border-radius: 6px !important;
height: auto !important;
&:hover {
color: @term-white !important;
}
}
.wave-button.is-wave-green {
color: @term-bright-white !important;
background: @term-green !important;
&:hover {
background-color: @term-green;
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.8) inset, 0px 0.5px 0px 0px rgba(255, 255, 255, 0.6) inset;
color: @term-bright-white !important;
box-shadow: none;
}
}
.button.is-plain,
.button.is-prompt-cancel {
background-color: #222;
@@ -637,13 +610,18 @@
position: relative;
background-color: transparent;
height: 44px;
width: 412px;
min-width: 150px;
width: 100%;
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;
&.no-label {
height: 34px;
}
&-label {
position: absolute;
left: 16px;
@@ -801,10 +779,18 @@
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;
&:hover {
cursor: text;
}
&.focused {
border-color: @term-green;
}
&.disabled {
opacity: 0.75;
}
&.error {
border-color: @term-red;
}
@@ -859,7 +845,7 @@
justify-content: center;
i {
font-size: 16px;
font-size: 13px;
}
}
@@ -883,11 +869,11 @@
background-color: #444;
border-radius: 5px;
overflow: hidden;
max-width: 300px;
width: 300px;
i {
display: inline;
font-size: 16px;
font-size: 13px;
fill: @base-color;
padding-top: 0.2em;
}
@@ -931,3 +917,233 @@
}
}
}
.wave-button {
background: none;
color: inherit;
border: none;
padding: 0;
font: inherit;
cursor: pointer;
outline: inherit;
display: flex;
padding: 6px 16px;
align-items: center;
gap: 4px;
border-radius: 6px;
height: auto;
&:hover {
color: @term-white;
}
i {
fill: rgba(255, 255, 255, 0.12);
}
&.primary {
color: @term-green;
background: none;
i {
fill: @term-green;
}
&.solid {
color: @term-bright-white;
background: @term-green;
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.8) inset, 0px 0.5px 0px 0px rgba(255, 255, 255, 0.6) inset;
i {
fill: @term-white;
}
}
&.outlined {
border: 1px solid @term-green;
}
&.ghost {
// Styles for .ghost are already defined above
}
&:hover {
color: @term-bright-white;
}
}
&.secondary {
color: @term-white;
background: none;
&.solid {
background: rgba(255, 255, 255, 0.09);
box-shadow: none;
}
&.outlined {
border: 1px solid rgba(255, 255, 255, 0.09);
}
&.ghost {
padding: 6px 10px;
i {
fill: @term-green;
}
}
}
&.color-yellow {
&.solid {
border-color: @warning-yellow;
background-color: mix(@warning-yellow, @term-white, 50%);
box-shadow: none;
}
&.outlined {
color: @warning-yellow;
border-color: @warning-yellow;
&:hover {
color: @term-white;
border-color: @term-white;
}
}
&.ghost {
}
}
&.color-red {
&.solid {
border-color: @term-red;
background-color: mix(@term-red, @term-white, 50%);
box-shadow: none;
}
&.outlined {
color: @term-red;
border-color: @term-red;
}
&.ghost {
}
}
&.disabled {
opacity: 0.5;
}
&.link-button {
cursor: pointer;
}
}
.wave-status-container {
display: flex;
align-items: center;
.dot {
height: 6px;
width: 6px;
border-radius: 50%;
display: inline-block;
margin-right: 8px;
}
.dot.green {
background-color: @status-connected;
}
.dot.red {
background-color: @status-error;
}
.dot.gray {
background-color: @status-disconnected;
}
.dot.yellow {
background-color: @status-connecting;
}
}
.wave-modal-container {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: flex;
justify-content: center;
align-items: center;
z-index: 500;
.wave-modal-backdrop {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(21, 23, 21, 0.7);
z-index: 1;
}
}
.wave-modal {
z-index: 2;
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 16px;
border-radius: 10px;
background: #151715;
box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.35), 0px 10px 24px 0px rgba(0, 0, 0, 0.45),
0px 0px 0.5px 0px rgba(255, 255, 255, 0.5) inset, 0px 0.5px 0px 0px rgba(255, 255, 255, 0.2) inset;
.wave-modal-content {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
.wave-modal-header {
width: 100%;
display: flex;
align-items: center;
padding: 12px 14px 12px 20px;
justify-content: space-between;
line-height: 20px;
border-bottom: 1px solid rgba(250, 250, 250, 0.1);
.wave-modal-title {
color: #eceeec;
font-size: 15px;
}
button {
i {
font-size: 18px;
}
}
}
.wave-modal-body {
width: 100%;
padding: 0px 20px;
}
.wave-modal-footer {
display: flex;
justify-content: flex-end;
width: 100%;
padding: 0 20px 20px;
button:last-child {
margin-left: 8px;
}
}
}
}
+233 -47
View File
@@ -99,7 +99,7 @@ class Toggle extends React.Component<{ checked: boolean; onChange: (value: boole
}
class Checkbox extends React.Component<
{ checked: boolean; onChange: (value: boolean) => void; label: string; id: string },
{ checked: boolean; onChange: (value: boolean) => void; label: React.ReactNode; id: string },
{}
> {
render() {
@@ -150,6 +150,7 @@ interface TooltipProps {
message: React.ReactNode;
icon?: React.ReactNode; // Optional icon property
children: React.ReactNode;
className?: string;
}
interface TooltipState {
@@ -185,8 +186,8 @@ class Tooltip extends React.Component<TooltipProps, TooltipState> {
if (iconElement) {
const rect = iconElement.getBoundingClientRect();
return {
top: `${rect.bottom + window.scrollY - 29.5}px`,
left: `${rect.left + window.scrollX + rect.width / 2 - 19}px`,
top: `${rect.bottom + window.scrollY - 29}px`,
left: `${rect.left + window.scrollX + rect.width / 2 - 17.5}px`,
};
}
return {};
@@ -199,7 +200,7 @@ class Tooltip extends React.Component<TooltipProps, TooltipState> {
const style = this.calculatePosition();
return ReactDOM.createPortal(
<div className="wave-tooltip" style={style}>
<div className={cn("wave-tooltip", this.props.className)} style={style}>
{this.props.icon && <div className="wave-tooltip-icon">{this.props.icon}</div>}
<div className="wave-tooltip-message">{this.props.message}</div>
</div>,
@@ -217,6 +218,115 @@ class Tooltip extends React.Component<TooltipProps, TooltipState> {
}
}
type ButtonVariantType = "outlined" | "solid" | "ghost";
type ButtonThemeType = "primary" | "secondary";
interface ButtonProps {
theme?: ButtonThemeType;
children: React.ReactNode;
onClick?: () => void;
disabled?: boolean;
variant?: ButtonVariantType;
leftIcon?: React.ReactNode;
rightIcon?: React.ReactNode;
color?: string;
style?: React.CSSProperties;
}
class Button extends React.Component<ButtonProps> {
static defaultProps = {
theme: "primary",
variant: "solid",
color: "",
style: {},
};
@boundMethod
handleClick() {
if (this.props.onClick && !this.props.disabled) {
this.props.onClick();
}
}
render() {
const { leftIcon, rightIcon, theme, children, disabled, variant, color, style } = this.props;
return (
<button
className={cn("wave-button", theme, variant, color, { disabled: disabled })}
onClick={this.handleClick}
disabled={disabled}
style={style}
>
{leftIcon && <span className="icon-left">{leftIcon}</span>}
{children}
{rightIcon && <span className="icon-right">{rightIcon}</span>}
</button>
);
}
}
class IconButton extends Button {
render() {
const { children, theme, variant = "solid", ...rest } = this.props;
const className = `wave-button icon-button ${theme} ${variant}`;
return (
<button {...rest} className={className}>
{children}
</button>
);
}
}
export default IconButton;
interface LinkButtonProps extends ButtonProps {
href: string;
target?: string;
}
class LinkButton extends IconButton {
render() {
// @ts-ignore
const { href, target, leftIcon, rightIcon, children, theme, variant }: LinkButtonProps = this.props;
return (
<a href={href} target={target} className={`wave-button link-button`}>
<button {...this.props} className={`icon-button ${theme} ${variant}`}>
{leftIcon && <span className="icon-left">{leftIcon}</span>}
{children}
{rightIcon && <span className="icon-right">{rightIcon}</span>}
</button>
</a>
);
}
}
interface StatusProps {
status: "green" | "red" | "gray" | "yellow";
text: string;
}
class Status extends React.Component<StatusProps> {
@boundMethod
renderDot() {
const { status } = this.props;
return <div className={`dot ${status}`} />;
}
render() {
const { text } = this.props;
return (
<div className="wave-status-container">
{this.renderDot()}
<span>{text}</span>
</div>
);
}
}
interface TextFieldDecorationProps {
startDecoration?: React.ReactNode;
endDecoration?: React.ReactNode;
@@ -232,6 +342,7 @@ interface TextFieldProps {
required?: boolean;
maxLength?: number;
autoFocus?: boolean;
disabled?: boolean;
}
interface TextFieldState {
@@ -242,7 +353,6 @@ interface TextFieldState {
hasContent: boolean;
}
@mobxReact.observer
class TextField extends React.Component<TextFieldProps, TextFieldState> {
inputRef: React.RefObject<HTMLInputElement>;
state: TextFieldState;
@@ -267,6 +377,22 @@ class TextField extends React.Component<TextFieldProps, TextFieldState> {
}
}
// Method to handle focus at the component level
@boundMethod
handleComponentFocus() {
if (this.inputRef.current && !this.inputRef.current.contains(document.activeElement)) {
this.inputRef.current.focus();
}
}
// Method to handle blur at the component level
@boundMethod
handleComponentBlur() {
if (this.inputRef.current?.contains(document.activeElement)) {
this.inputRef.current.blur();
}
}
@boundMethod
handleFocus() {
this.setState({ focused: true });
@@ -311,14 +437,23 @@ class TextField extends React.Component<TextFieldProps, TextFieldState> {
}
render() {
const { label, value, placeholder, decoration, className, maxLength, autoFocus } = this.props;
const { label, value, placeholder, decoration, className, maxLength, autoFocus, disabled } = this.props;
const { focused, internalValue, error } = this.state;
// Decide if the input should behave as controlled or uncontrolled
const inputValue = value !== undefined ? value : internalValue;
const inputValue = value ?? internalValue;
return (
<div className={cn(`wave-textfield ${className || ""}`, { focused: focused, error: error })}>
<div
className={cn(`wave-textfield ${className || ""}`, {
focused: focused,
error: error,
disabled: disabled,
})}
onFocus={this.handleComponentFocus}
onBlur={this.handleComponentBlur}
tabIndex={-1}
>
{decoration?.startDecoration && <>{decoration.startDecoration}</>}
<div className="wave-textfield-inner">
<label
@@ -341,6 +476,7 @@ class TextField extends React.Component<TextFieldProps, TextFieldState> {
placeholder={placeholder}
maxLength={maxLength}
autoFocus={autoFocus}
disabled={disabled}
/>
</div>
{decoration?.endDecoration && <>{decoration.endDecoration}</>}
@@ -372,34 +508,10 @@ class NumberField extends TextField {
}
}
@boundMethod
handleKeyDown(event: React.KeyboardEvent<HTMLInputElement>) {
// Allow backspace, delete, tab, escape, and enter
if (
[46, 8, 9, 27, 13].includes(event.keyCode) ||
// Allow: Ctrl+A, Ctrl+C, Ctrl+X
((event.keyCode === 65 || event.keyCode === 67 || event.keyCode === 88) && event.ctrlKey === true) ||
// Allow: home, end, left, right
(event.keyCode >= 35 && event.keyCode <= 39)
) {
return; // let it happen, don't do anything
}
// Ensure that it is a number and stop the keypress
if (
(event.shiftKey || event.keyCode < 48 || event.keyCode > 57) &&
(event.keyCode < 96 || event.keyCode > 105)
) {
event.preventDefault();
}
}
render() {
// Use the render method from TextField but add the onKeyDown handler
const renderedTextField = super.render();
return React.cloneElement(renderedTextField, {
onKeyDown: this.handleKeyDown,
});
return React.cloneElement(renderedTextField);
}
}
@@ -437,7 +549,7 @@ class PasswordField extends TextField {
render() {
const { decoration, className, placeholder, maxLength, label } = this.props;
const { focused, internalValue, error, passwordVisible } = this.state;
const inputValue = this.props.value !== undefined ? this.props.value : internalValue;
const inputValue = this.props.value ?? internalValue;
// The input should always receive the real value
const inputProps = {
@@ -617,7 +729,7 @@ class InlineSettingsTextEdit extends React.Component<
<div
onClick={this.confirmChange}
title="Confirm (Enter)"
className="button is-prompt-green is-outlined is-small"
className="button is-wave-green is-outlined is-small"
>
<span className="icon is-small">
<i className="fa-sharp fa-solid fa-check" />
@@ -662,7 +774,7 @@ class InfoMessage extends React.Component<{ width: number; children: React.React
function LinkRenderer(props: any): any {
let newUrl = "https://extern?" + encodeURIComponent(props.href);
return (
<a href={newUrl} target="_blank">
<a href={newUrl} target="_blank" rel={"noopener"}>
{props.children}
</a>
);
@@ -729,7 +841,7 @@ interface DropdownDecorationProps {
}
interface DropdownProps {
label: string;
label?: string;
options: { value: string; label: string }[];
value?: string;
className?: string;
@@ -896,7 +1008,7 @@ class Dropdown extends React.Component<DropdownProps, DropdownState> {
const { label, options, value, placeholder, decoration, className, required } = this.props;
const { isOpen, internalValue, highlightedIndex, isTouched } = this.state;
const currentValue = value !== undefined ? value : internalValue;
const currentValue = value ?? internalValue;
const selectedOptionLabel =
options.find((option) => option.value === currentValue)?.label || placeholder || internalValue;
@@ -916,7 +1028,7 @@ class Dropdown extends React.Component<DropdownProps, DropdownState> {
{options.map((option, index) => (
<div
key={option.value}
className={cn("wave-dropdown-item", {
className={cn("wave-dropdown-item unselectable", {
"wave-dropdown-item-highlighted": index === highlightedIndex,
})}
onClick={(e) => this.handleSelect(option.value, e)}
@@ -933,8 +1045,9 @@ class Dropdown extends React.Component<DropdownProps, DropdownState> {
return (
<div
className={cn(`wave-dropdown ${className || ""}`, {
className={cn("wave-dropdown", className, {
"wave-dropdown-error": isError,
"no-label": !label,
})}
ref={this.wrapperRef}
tabIndex={0}
@@ -943,15 +1056,19 @@ class Dropdown extends React.Component<DropdownProps, DropdownState> {
onFocus={this.handleFocus}
>
{decoration?.startDecoration && <>{decoration.startDecoration}</>}
<If condition={label}>
<div
className={cn("wave-dropdown-label unselectable", {
float: shouldLabelFloat,
"offset-left": decoration?.startDecoration,
})}
>
{label}
</div>
</If>
<div
className={cn("wave-dropdown-label", {
float: shouldLabelFloat,
"offset-left": decoration?.startDecoration,
})}
className={cn("wave-dropdown-display unselectable", { "offset-left": decoration?.startDecoration })}
>
{label}
</div>
<div className={cn("wave-dropdown-display", { "offset-left": decoration?.startDecoration })}>
{selectedOptionLabel}
</div>
<div className={cn("wave-dropdown-arrow", { "wave-dropdown-arrow-rotate": isOpen })}>
@@ -964,6 +1081,70 @@ class Dropdown extends React.Component<DropdownProps, DropdownState> {
}
}
interface ModalHeaderProps {
onClose: () => void;
title: string;
}
const ModalHeader: React.FC<ModalHeaderProps> = ({ onClose, title }) => (
<div className="wave-modal-header">
{<div className="wave-modal-title">{title}</div>}
<IconButton theme="secondary" variant="ghost" onClick={onClose}>
<i className="fa-sharp fa-solid fa-xmark"></i>
</IconButton>
</div>
);
interface ModalFooterProps {
onCancel?: () => void;
onOk?: () => void;
cancelLabel?: string;
okLabel?: string;
}
const ModalFooter: React.FC<ModalFooterProps> = ({ onCancel, onOk, cancelLabel = "Cancel", okLabel = "Ok" }) => (
<div className="wave-modal-footer">
{onCancel && (
<Button theme="secondary" onClick={onCancel}>
{cancelLabel}
</Button>
)}
{onOk && <Button onClick={onOk}>{okLabel}</Button>}
</div>
);
interface ModalProps {
className?: string;
children?: React.ReactNode;
onClickBackdrop?: () => void;
}
class Modal extends React.Component<ModalProps> {
static Header = ModalHeader;
static Footer = ModalFooter;
renderBackdrop(onClick: (() => void) | undefined) {
return <div className="wave-modal-backdrop" onClick={onClick}></div>;
}
renderModal() {
const { className, children } = this.props;
return (
<div className="wave-modal-container">
{this.renderBackdrop(this.props.onClickBackdrop)}
<div className={`wave-modal ${className}`}>
<div className="wave-modal-content">{children}</div>
</div>
</div>
);
}
render() {
return ReactDOM.createPortal(this.renderModal(), document.getElementById("app") );
}
}
export {
CmdStrCode,
Toggle,
@@ -980,4 +1161,9 @@ export {
NumberField,
PasswordField,
Tooltip,
Button,
IconButton,
LinkButton,
Status,
Modal,
};
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+27
View File
@@ -0,0 +1,27 @@
// Copyright 2023, Command Line Inc.
// SPDX-License-Identifier: Apache-2.0
import * as React from "react";
import {
AboutModal,
CreateRemoteConnModal,
ViewRemoteConnDetailModal,
EditRemoteConnModal,
AlertModal,
} from "./modals";
import { ScreenSettingsModal, SessionSettingsModal, LineSettingsModal, ClientSettingsModal } from "./settings";
import * as constants from "../../appconst";
const modalsRegistry: { [key: string]: () => React.ReactElement } = {
[constants.ABOUT]: () => <AboutModal />,
[constants.CREATE_REMOTE]: () => <CreateRemoteConnModal />,
[constants.VIEW_REMOTE]: () => <ViewRemoteConnDetailModal />,
[constants.EDIT_REMOTE]: () => <EditRemoteConnModal />,
[constants.ALERT]: () => <AlertModal />,
[constants.SCREEN_SETTINGS]: () => <ScreenSettingsModal />,
[constants.SESSION_SETTINGS]: () => <SessionSettingsModal />,
[constants.LINE_SETTINGS]: () => <LineSettingsModal />,
[constants.CLIENT_SETTINGS]: () => <ClientSettingsModal />,
};
export { modalsRegistry };
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -7,7 +7,7 @@
vertical-align: middle;
width: 1.2em;
height: 1.2em;
fill: @prompt-green;
fill: @wave-green;
}
.term-prompt-branch {
+1 -1
View File
@@ -6,7 +6,7 @@
@background-session: rgba(13, 13, 13, 0.85);
@background-session-components: rgba(48, 49, 48, 0.6);
@background-session-components-solid: rgb(33, 34, 33);
@prompt-green: rgb(88, 193, 66);
@wave-green: rgb(88, 193, 66);
@disabled-background: rgba(76, 81, 75, 1);
@disabled-color: #adadad;
@scrollbar-background: rgba(21, 23, 21, 1);

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