Commit Graph
30 Commits
Author SHA1 Message Date
Rafał Cieślak 6578af1efd Connect: Remove resource cache (#21964)
* Connect: Remove resource cache

This commit refactors parts of the Electron app which still depend on
the resource cache, that is cluster sync and `tsh ssh` executed from the
command bar.

A number of adjustments has been made to executing `tsh ssh` from the
command bar, namely the logic of resolving the hostname has been moved
from the command launcher to useDocumentTerminal. The UI was also
adjusted to allow the user to reconnect to an SSH server if resolving
the hostname fails. This has a nice benefit of also allowing them to
retry if the PTY couldn't be created for some reason.

---

Before gravitational/webapps#1307, Connect was pulling all resources
from the cluster on app start and cluster login. Then it'd show them to
you in tables if you opened a new tab with cluster resources. There were
at least two problems with this approach:

1. It was slow for big clusters as pagination, filtering and sorting
   were all done client-side and blocked the main thread.
2. It wasn't possible to implement advanced search unless we copied the
   implementation from the backend to tshd.

gravitational/webapps#1307 made it so that instead of depending on that
resource cache to show resource tables, Connect would pull paginated
resources from the backend.

However, the resource tables were not the only part of the app depending
on that cache. Due to time constraints, we weren't able to refactor all
of them. We managed to refactor autocomplete (gravitational/webapps#1406)
and the remaining places are listed in #21800.

This PR refactors those remaining places to not use the cache by either
not depending on resource details or by making a call to the proxy
instead.

* Add missing license
2023-02-27 15:32:19 +00:00
Jeff Pihach 3f75acb163 Add license headers to web files that were missing it. (#21315)
* Lint the web files but not node_modules or vendored files.

* Add license headers to web files that were missing it.

* Add missing licenses.
2023-02-07 16:27:31 +00:00
Michael cfa7941f34 [Connect] Async autocomplete (#1406) 2022-12-08 10:38:19 -06:00
Rafał Cieślak c6be949085 useAsync: Add support for abort signal (#1377) 2022-12-01 16:47:50 -06:00
Michael 48fa737a78 [Connect] Use server side search in resource tables (Advanced Search) (#1307)
Adds serverside search and pagination to the resource tables in Connect
2022-11-24 10:04:45 +09:00
Isaiah Becker-Mayer b0b5c3c930 Adds support for TDP Notifications, shows "warning" level notifications in a dismissible dropdown rather than a fullscreen modal (#1333) 2022-11-16 04:16:13 +00:00
Lisa Kim a1187d146a [Discover] Refactor SetupAccess Screens (#1310)
* Create user trait hook and setup access wrapper
- create a reusable hook related to setup access and user traits
- create a setup access wrapper that dedups repeated logic
- rename and added more yaml readers

* Create SetupAccess screen for database
* Refactor SetupAccess for kube
* Refactor SetupAccess for server
* Add database json vals and prevent infinite rendering from 
  dependency array
2022-11-08 16:23:49 +00:00
Grzegorz Zdunek 985bda8d58 Assumed roles bar improvements (#1274) 2022-10-21 15:12:09 +02:00
Grzegorz Zdunek 6d26558262 Move focus to active document (#1070) 2022-08-03 17:04:06 +02:00
Jeff Pihach 991856e137 Added eslint rule to enforce the order of file imports (#1030)
* add import order lint rule.
* auto fix import order and spacing.
* prettier fix.
* manual fix of import order.
* update failing snapshots.
* bump e submodule for import order fixes.
2022-07-25 16:21:23 -06:00
Lisa Kim b86c9bcdfe [2/3] Prettify shared, build, and teleport packages (#955)
* Update prettier ignore
2022-07-06 14:57:40 +00:00
Grzegorz Zdunek fb8d6e6ee4 Add ability to change db name for db proxy (#883) 2022-06-27 15:54:19 +02:00
Rafał Cieślak 7a4296733b Retry with relogin on errors related to expired certs (#846)
* useAsync: Handle rejections with non-Errors

* Add initial implementation of retryWithRelogin

* Add missing properties to IAppContext

* Make ClustersService.syncCluster propagate errors

* ClustersService: Improve notification titles
2022-06-03 10:13:37 +00:00
Jeff Pihach 4417d755cb Create a LabelPicker component (#823)
* Create Pill component for Label manager component.

* Fixed some styling issues when using the Pill component.

* Initial layout for the Label Selector component.

* Add basic new label input scaffold

* Added label format validation and error message.

* When hitting enter or clicking add, add a label to the list.

* Added tooltip to add labels header.

* Support dismissing labels and focus the input when opening.

* Create clickoutside hook and use it in the label picker.

* Create and use a onescape hook in the label picker.

* Remove the temp ability to pass in existing labels.

* added tests for LabelSelector component

* fix validation regex to allow numbers hyphens and periods.

* remove incorrectly added component instance.

* do not use default imports and other tweaks.

* use flexbox instead of floats for label input labels.

* use utility methods for tests to make it easier to understand.

* remove remaining floats and some review cleanup.

* added missing license messages.

* Move useCallback usage into parent component from hook.
2022-05-24 10:02:29 -06:00
Rafał CieślakandGrzegorz Zdunek 6f48403327 Show database username suggestions in Teleport Connect (#754)
* Move useAsync to the shared package, add docs

* Add async variant of MenuLogin

* Add Teleport Connect version of MenuLogin to its story

* Update gRPC files

* Show database username suggestions

* Use JSdoc in useAsync

Co-authored-by: Grzegorz Zdunek <gzdunek@users.noreply.github.com>

* Convert useAsync to a named export

* Refactor MenuLogin to use useAsync underneath

* Rewrite useAsync to use a promise instead of async

The Web UI currently doesn't support `async`. To do this, we'd need to
configure polyfills there, but we don't have time for that right now.

* Replace async with promise in MenuLogin

Co-authored-by: Grzegorz Zdunek <gzdunek@users.noreply.github.com>
2022-04-22 12:56:33 +02:00
Alexey Kontsevoy 06d0515d49 Remove unused code (#517) 2021-12-17 12:43:15 -05:00
Yassine Bounekhla eb45d98b61 Add Account Recovery Flows (#398) 2021-09-29 00:36:43 +02:00
Lisa Kim 23a7df5a2f Update renew session response and renew URL (#261)
- Renew session endpoint is modified so that we no longer send
request ID in param but as a json object.
- This endpoint now returns a new field sessionExpires. 
This is the absolute time the web session will expire for the most 
recently consumed access request and is the value used in the 
switchback countdown.
- Refactored how bearer token is being set (used type instead of class)
- Update e-ref
2021-04-19 19:16:30 -07:00
Alexey Kontsevoy ff940c6ebc Fix error handling on the Delete Role Dialog (#231) 2021-02-23 14:45:18 -05:00
Alexey Kontsevoy 43d2a39a21 Teleport V5 (#185)
* New Top Nav (#136)
* Moves AuthConnectors/TrustedClusters/Roles to the Dashboard Top Nav
* Add feature to allow user in context to perform operations on other users (#137)
* Added List/Create/Update/Delete/Reset user functionality
* Added enterprise api endpoint to OSS config
Co-authored-by: Alexey Kontsevoy <biz.kovoy@gmail.com>

* Fix handling of feature flags (#138)
* Prevent closing when there is an error with deleting user (#142)
* Alexey/v5nav (#155)
* Touch Ups (#157)
* Create a story for Teleport App (#158)
* Add Application Launcher (AAP) (#162)
* use publicAddr and clusterName URL parameters to launch apps. (#169)
* Update sideNav styles and ssh input box (#170)
* [teleport] Implement add node dialog (#165)
* [teleport] Change NodeJoinToken prop expires to expiry (#176)
* Remove empty state from NodesList (#179)
* [teleport] Add -f flag to add node curl command (#180)
* [teleport] Add app session chunk and start events (#181)
* Add Application Dialog
* Delete Force
Co-authored-by: Lisa Kim <lisa@gravitational.com>
2020-11-09 17:02:33 -05:00
Lisa KimandAlexey Kontsevoy 9ea19761b3 Typescript conversion mostly in shared package (#120)
ButtonSso/*, services/enums.js, FieldInput/*, FieldSelect/*, FormInvite/*,
FormLogin/*, FormPassword/*, MenuAction/*, Select/*, design/utils/testing.js,
TwoFaInfo, enums to types

Co-authored-by: Alexey Kontsevoy <biz.kovoy@gmail.com>
2020-07-14 10:32:57 -07:00
Alexey KontsevoyandAlexander Wolfe 389b83a1fb Alexey/updateddesign (#98)
* Updates design components
* Updates popover styles
* Updates FeatureHeader component including the title, tabs, and date selector.
* Updates the Side Navigation component to match new design updates
* Updates font size for error card
* Updates offline text
* Updates loading spinner
* Updates to tables and colors for components and buttons to match with new designs
* Updates dialog header size
* Updates cluster nodes table
* Updates top bar
* Updates the cluster table rows, search, and title styles
* Updated shared components FormInvite and FormLogin with updated designs.
* Updates size for outlined button to be consistent with button component
* Update terminal tabs
* Updates blankstate for console
* Updates to events list and ranger picker
* Updates help and support
* Updates session icon
* Updates login page with SSO
* Fixes router error in menu ssh login
* Success for login and small input field adjustments
* Tags with states update
* Updates to menu and icons menu
* Updates cluster info box
* Addresses design-system changes
* Adds missing events
* Fixes unit-tests
* Updates e-ref

Co-authored-by: Alexander Wolfe <alexanderwolfe@Alexanders-MacBook-Air.local>
2020-06-09 11:15:54 -04:00
Alexey Kontsevoy 7f14d7bfcc JS to TS migration (#55)
* JS to TS migration
* Address CR comments
2020-03-30 16:20:51 -04:00
Alexey Kontsevoy a6c8fb8954 Do not rerender in-active document (#47) 2020-03-13 15:13:47 -04:00
Alexey Kontsevoy a6b280eb90 New Terminal (#46)
* New Terminal
* Update e-ref
2020-03-11 17:34:37 -04:00
Lisa Kim d7cef21cd6 Unit test FormPassword (#36) 2020-02-27 13:00:25 -08:00
Lisa Kim b5301e351a Prettify package shared (#27)
* Prettify *.js, *.jsx, *.json except bpf.*.json
* Remove unnecessary space in Expired.jsx
2020-02-19 09:07:57 -08:00
Lisa Kim 1c8738afa6 Snapshot Test package/gravity/login Story (#9)
* Update jest.config.js to map jquery path
* Remove leftovers in hooks/withState
* Create render helper for jest tests
* Convert Login story to CSF
* Renamed TopNav.test to TopNav.story.test and edited to use render helper
* Add eslint-plugin-jest pkg for enforcing testing best practices
* Add react-test-renderer pkg for use with snapshot tests
* Add prettier required by snapshot
* Edit eslintrc to include jest lint
* Update testing.js to include helper to convert component to JSON
* Snapshot Login.story

Refers to issue: https://github.com/gravitational/webapps/issues/3
2020-01-29 16:53:43 -08:00
Alexey Kontsevoy e69d4e2042 Add initial BPF viewer implementation 2019-11-21 13:07:16 -05:00
Alexey Kontsevoy 5e0a948f19 Move code to this repo 2019-09-12 19:37:15 -04:00