Commit Graph

66 Commits

Author SHA1 Message Date
Nancy 4584890499
Remove what's new page and link to release notes instead (#9327)
* update release notes url and whats-new test

* link to latest release notes for rc builds

* fix home page e2e test; update release notes version check to use existing util
2023-07-14 10:50:06 -07:00
Richard Cox 0245a8cb93 Merge remote-tracking branch 'upstream/master' into epinio/resolve-conflicts-with-master 2023-06-23 18:00:14 +01:00
Giuseppe Leo 01eeb0548f
Add recommended lint rules globally (#8997)
* Update configuration

* Create default config for eslint

* Restore plugin:vue/recommended

* Add exceptions and overrides

* Correct manually remaining issues

* Adding further picked exceptions groupped up

* Fix or disable specific cases manually and singularly

* Add naming linting exception

* Remove unused variable in component

* Move rules to default

* Autocorrect rancher/components linting issues

* Configure VSCode to use multiple files, to display linting for rancher components

* Disable jest lint hook restriction for string list component

* Autofix
2023-06-23 17:02:55 +02:00
Richard Cox 48f1114006 Merge remote-tracking branch 'upstream/master' into epinio-dev 2023-06-19 15:40:07 +01:00
wujun 717a2b2c14
HARVESTER: add bare-metal container and mcm support (#8754)
* HARVESTER: add bare-metal container and mcm support

* Harvester: Fix re-render old route component

* HARVESTER: fix services and hide repositories

* HARVESTER: add svg icon

* HARVESTER: add harvester version in explorer page

* HARVESTER: change openRancherManagerSupport => isRancherInHarvester

* HARVESTER: move method to models type

* HARVESTER: enhancement TopLevelMenu when use embedded rancher

* HARVESTER: polish harvester mode judgment

* HARVESTER: Add namespace resource quota help text

* HARVESTER: remove service filter

* HARVESTER: set harvester-baremetal-container-workload to false

* HARVESTER: fix svg & namespace component

---------

Co-authored-by: n313893254 <n313893254@126.com>
2023-06-15 13:28:08 -07:00
Richard Cox db8ba0188a Fix NS filter 2023-05-26 15:19:48 +01:00
Richard Cox ceeca96527 Fix ns filter (with TODO) 2023-05-25 17:18:03 +01:00
Richard Cox d90ba881a6 Merge remote-tracking branch 'upstream/master' into merge-master-2 2023-05-25 16:51:00 +01:00
Qingyang Nong 4cc7087b98
HARVESTER: isMultiCluster is still false after import a cluster (#8724) 2023-05-22 15:28:55 -07:00
Richard Cox 281fb6672c Simplify forced filtering setting
- Given forced filtering is now not resource dependent have a high level utils function to determine if enabled
- This should have opened up the door to setting a nicer default then ALL_USER, however it's actually initially applied somewhere other than ns filter
- Fixed a bug where the all option [] was valid
2023-05-18 14:28:28 +01:00
Richard Cox 7e5ad5de34 Expand enforced namespace filtering to multiple namespaces and projects
> This uses a new endpoint that has yet to merge. See https://github.com/rancher/rancher/issues/40140

WIP
- Contains console.warns (via custom logger, can be disabled)
- Waiting for final BE endpoint changes to merge
- Contains TODOs to resolve on final enpoint changes delivered

Pertinent Points
- Incompatible with incremental loading / manual refresh
  - Harder to get counts (need to sum up from different namespaces)
  - Requires use of new steve pagination
- Enforced NS threshold has been removed
  - The threshold only applies to the primary resource. This has issues when loading a low count primary (daemon sets) which depends on a very high count secondary (pods)
  - Fixing this would involve knowing all secondary resources a list uses, which isn't currently possible (each resource is requested individually, need to know them all first)
- There is no way to subscribe to multiple namespaces (one or all)
  - We mock this in subscribe by only persisting changes to resources from within target namespaces
- Everything should work with Advanced Worker enabled
2023-05-18 14:28:28 +01:00
Sean-McQ e256669e74
cluster and rancher stores now use advanced worker (#8717)
* cluster and rancher stores now use advanced worker

* Addressing feedback

* addressing PR feedback and unit tests

* Fixed sticky footer in Helm Chart Install Yaml (#8497)

* Remove dependency: nuxt

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>

* Remove dependency @nuxt/types

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>

* fix lint

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>

* Remove dependency: @nuxt/typescript-build

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>

* Remove dependency: @nuxtjs/eslint-module
Remove dependency: @nuxtjs/proxy
Remove dependency: @nuxtjs/style-resources

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>

* align package.log

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>

* Storybook, add vue-loader dependency

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>

* Added placeholder in url input (#8036)

* Added placeholder in url input

* Added format checker for Url input

* Update test

* Fixed lint

* Fixed breaking for other providers

* Fixed lint

* Update vue options to preserve whitespace (#8742)

* Update vue options to preserve whitespace

* Bug fix with tidy-up

* Fix response times for multiple clusters (#8720)

* Update extensions publish workflow for assets in gh-pages branch (#8618)

* Update extensions workflow to move assets into gh-pages branch

Fix gh-pages check

* Move bundle execution - add default basename and ext version

* Fix basename op

* PR changes

* [v2.7] Update Chinese translation (#8731)

* Upgrade to Vue 2.7 (#8654)

* upgrade @vue/cli-xxx

* Update Vue to latest 2.7

* Update eslint-plugin-vue

* Disable new linting rules

* Remove linting issue

* Pin Dom purify library version

* Add resolution to avoid conflicts with packages

* Update yarn/lock after the enforced resolution

* Exclude node 16 types resolution

* Fixed extra space bug in the generic cluster-page (#8626)

* Fixed extra space bug in the generic cluster-page

* Fixed space issue in banner

* Revert changes

* Removed extra div

* Fixed selected rows counter (#8419)

* Fixed selected rows counter

* Fixed lint

* Fixed counter in selection.js

* Small fix in toAdd condition

* Lints

* Fixed condition for selected row counter

* Changes in focusAdjacent function

* Fixed lints

* Improve OPA Gatekeeper constraint detail page (#8586)

This adds the following functionality to the violations list on the OPA Gatekeeper constraint detail page:

* Add a namespace column to the violations
* Make the violations list searchable
* Allow to download the violations as a CSV, similar to CIS scanner violations

Signed-off-by: Bastian Hofmann <mail@bastianhofmann.de>

* Increase memory on build (#8751)

* Remove extension autoLoad functionality (#8700)

* fix(BrandImage): remove async fetch method (#8432)

* Removed hasClass method (#8752)

* Removed hasClass method

* Clean code

* Two minor tweaks
- supported store types now a const
- WORKERMODES --> WORKER_MODES

* Fix two bugs
- Ensure advanced worker runs in cluster manager with no current cluster context
- Ensure `resource.stop` from advanced worker successfully kicks off watch


Also
- make rancher, managment and cluster store names a const

* Tweaks
- Fix some comments (jsdoc --> standard, todos)
- Made the web worker redispatch requirement clearer

* Fix unit tests

* Fix resource.stop / resource.error TOO_OLD bugs

- Persist watcher error state after resource.stop
  - this will ensure the resource.stop given alongside the resource.error TOO_OLD is ignored
- Ensure any errors are cleared when we succesfully connect (given above)
  - Should fix the next resource.stop being ignored after recovering from TOO_OLD
- Fix resync watch params
  - these weren't correct, so the resync after TOO_OLD never worked
  - the format could be slimmer, but i thinkg it matches how other socket's data works

Note - I manufactored the TOO_OLD by setting a revision of 1 in subscribe resource.stop if it came from the advanced worker

---------

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
Signed-off-by: Bastian Hofmann <mail@bastianhofmann.de>
Co-authored-by: richa <richa.bisht@suse.com>
Co-authored-by: Francesco Torchia <francesco.torchia@suse.com>
Co-authored-by: Neil MacDougall <nwmac@users.noreply.github.com>
Co-authored-by: Jordon Leach <40806497+jordojordo@users.noreply.github.com>
Co-authored-by: vickyhella <vickyhella@hotmail.com>
Co-authored-by: Giuseppe Leo <giuseppe.leo@suse.com>
Co-authored-by: Bastian Hofmann <mail@bastianhofmann.de>
Co-authored-by: LiuYan <361112237@qq.com>
Co-authored-by: Richard Cox <richard.cox@suse.com>
2023-05-17 03:48:10 -04:00
Sorin 5777e105b2
Inactivity Modal (#8775)
* feat: inactivity modal 

---------

Co-authored-by: Richard Cox <richard.cox@suse.com>
2023-05-05 19:33:53 +02:00
Giuseppe Leo 6f102d0bff
When creating a resource, limit the namespace options based on filters in top nav (#8308)
* Add tests to namespace picker for resources

* Get namespaces from state and map to options

* Add comment to the Namespace getter logic in the store

* Hide Rancher System namespaces

* Update existing test

* Add tests for namespaces getter

* Create getter to retrieve readonly namespaces

* Split active namespaces function

* Add fleet filtering logic

* Correct mode for NS component

* Add comment information about restriction for read only
2023-03-23 18:08:49 +01:00
wujun bcfeb79d98 enhancement use dynamic store 2023-02-28 21:09:30 +08:00
Shavindra e12939115e
Allow basic fleet user to manage fleet without cluster permissions. (#7446)
* Allow basic fleet user to manage fleet without cluster permissions.

* Handle no workspaces.

* Add Fleet bundle namespace mapping - fleet.cattle.io.bundlenamespacemapping

* Add git repo restrictions.

* Handle auth errors for checkSchemasForFindAllHash.

* Fix workspace switcher and handle fleetworkspaces 401 issues.

* Update workspace switcher.

* Fix Gitrepo restriction creation from the Workspace create

* Disable workspace creation
* Fix workspace loading after creation

* Fix Bundle creation error.

* Remove redudant FLEET.TOKEN request.
2023-02-23 14:15:32 +00:00
wujun dce47f6d4a
polish namespace (#7915)
* polish namespace

* fix no getter.filterNamespace case

* add notFilterNamespace document

* HARVESTER: fix review comment

* add changeAllNamespaces comment
2023-02-13 16:52:06 -07:00
Nancy 14afb83a72
Revert "get docs base url version from getVersionInfo (#7436)" (#7863)
This reverts commit 129568d991.
2023-01-10 11:12:13 -07:00
Nancy 129568d991
get docs base url version from getVersionInfo (#7436)
*update docs links in translation file

*update chinese translation doc links

* fetch latest rancher version tag to determine doc url versioning

* fix hardcoded links to 2.6-only documentation

* update doc base url
2023-01-04 09:09:26 -07:00
wujun 3cffb67294
fix filter namespace (#7768) 2022-12-21 12:21:53 -07:00
Richard Cox 762b3e4163 Updates following review
- Tweak settings text
- Use new filter icon
- Tweak "too many" text
- Allow only selecting a single namespace when in 'too many' mode
2022-12-02 12:37:35 +00:00
Richard Cox 75aa51fab9 Enforce Namespace Filter
- When there are over a configurable amount of resources to display in a list force the user to select a single namespace and use it to fetch resources related to the list
- Disabled by default, this can be enabled via the usual Global Settings --> Performance setting as usual

Functional Comments
- Gates for forcing the filter (count, resource type is namespaced, etc) apply only to the resources shown in the list.
  - For example PV's aren't namespaced, so no enforced filtering. However they fetch PVC's which are namespaced
  - For example we could have 10 resources to show in the list, but the resource types list component fetches 10000 other resources. The secondary resources are not taken in to account
- If we're under the threshold and have fetched all resources, if in that session we go over the threshold we won't fetch NS specific resources (because we have them all already)
- If we're over the threshold and have fetched namespaced resources, if in that session we go under the threshold we will fetch all resources
- If we're over the threshold and have fetched namespaced resources, going to a page that needs them all will result in us fetching them all (for instance from `events` to `cluster dashboard`)
- Deselecting a namespace and selecting it again should not kick off another http request

General Commit Comments
- The threshold to enforce the filter is set at 1500 as per manual fresh and incremental loading
- Optimised some code in ResourceList, resource-fetch and $loadingResources
2022-12-02 12:30:13 +00:00
Richard Cox 33561db8e0 Merge remote-tracking branch 'upstream/master' into epinio-dev 2022-11-29 12:32:10 +00:00
Phillip Rak 3d410d0974 Apply linter auto-fixes
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2022-11-16 18:38:20 -07:00
Richard Cox 8f477f0a68 Fix two issues affected NS filtering
1) getter of currentCluster will always be false in epinio, this was blocking updating the ns cache
2) getter was incorrect, brought in by bad merge https://github.com/rancher/dashboard/commit/b3f13843dda3450d218
  - spent a lot of time working out why this wasn't causing issues in master, but given where/when it's called it doesn't currently make a change
  - it might have been different if the cache was fully used though
2022-10-18 16:28:39 +01:00
Richard Cox 64dd1e9512 Refactor
- Don't cache gc state in store (avoids any chance of prompting change detection when update type accessed time)
- use TS instead of JS where possible
- split out two prompts into own file (on interval and on route change)
2022-10-10 17:08:43 +01:00
Richard Cox 694310352b Garbage Collect Stale Resources
Remove resources from the store if they meet certain criteria. This will reduce the memory footprint of the dashboard and load on the backend (less watchers for large collections)

- GC is disabled by default and can be enabled via the Global Settings --> Performance tab
  - User can configure
    - The age in milliseconds in which a resource has to exceed in order to be gc'd
    - The count which a resource has to exceed in order to be gc'd
- GC occures in stores that have it enabled
  - ATM this is just the `cluster` store... but could be enabled for dashboard-store's such as the harvester one (one liner plus optional `gcIgnoreTypes` override for ignoring types)
- GC will be kicked off in two cases
  - Route Change for a logged in state
  - At a given interval

- Resource type _not_ GC'd if
  - The store is ignoring the type
    - For example the `cluster` store doesn't want to gc things like `schema` and `count`
  - We're going to a page for that resource (list, detail, etc)
    - For example don't GC pods if we're going to a pods page
  - The last time the resource was accessed was recently
    - We store the resource accessed time via hooking into actions and getters
    - Setting the last accessed time will cause watchers of that type to trigger (only an issue for duplicate watchers)... but importantly not watchers of other types
  - The resource is being used in the current page/context
    - We store the route changed time and compare it to the resource accessed time
  - There's too few resources
    - We might as well keep them to avoid a network request to re-populate

// TODO:
- Should additional features be added to preferences
  - if GC on route change is enabled
  - if GC on interval is enabled, and how often it runs
- Sensible default preferences
- Remove some logging
2022-10-10 17:08:43 +01:00
Richard Cox 7ecfe879c0 Merge remote-tracking branch 'upstream/master' into test-pluginize-rc-2 2022-09-09 13:19:15 +01:00
richa 4134c1a9dd
Locale preference login page (#6597)
* Created LocaleSelector component

* Updated backend on lacal changes

* Hide none option in language list

* Fixed hovered state and added down arrow to dropdown list

* Fixed preferences error on login screen

* Corrected order of check

* Added variable to stor value before login

* Fix locale saving when not logged in

* Removed commented code and add comments for variable

* Added loginc in commit for settign user Preference

Co-authored-by: Neil MacDougall <nmacdougall@suse.com>
2022-09-07 18:01:09 +02:00
Richard Cox 18b6eac18e Re-instate simpler route change handler
- my custom way no longer worked
  - for some reason checkClusterChanging wasn't firing quick enough anymore
  - the order of things looked correct (it should have disabled the outlets via clusterChanging before the auth middleware runs)
  - however the old explorer page errored when navigating to something outside of the explorer product
- beef up the simpler route change handler
  - add something to try to catch the change of product as well
  - uses similar approach, don't show anything until the store is up to date with the route
2022-09-02 17:06:02 +01:00
Richard Cox 43d338fac2
Harvester Plugin (#6729)
* routing maybe

* remove nested edit views

* harvester custom routes

* fix loading imported dev cluster

* move harvester-manager hci.cluster type out of harvester pkg

* fixes for build-pkg

* fix harvester custom dialogs

* fix harvester pkg routing

* generateDynamicTypeImport hyphenated dirs

rename cloud_credential and machine_config back to cloud-credential and machine-config

* Appease linting

* Fix epinio pkg build
- Includes fixes for some dashboard component references

* Revert "Receiver credential secrets are deleted when secret is set to none"

This reverts commit 836460e2998959bcda0b14a9f6511f248980b7b5.

* Fix plugin modal cancel button in dark mode

* Ensure correct components loaded when a new version of a plugin is loaded
- The route matcher was never updated with new route-->component values
- This was due to `this.router.options.routes` not containing the result of `router.add`
- See https://github.com/vuejs/vue-router/issues/2280

* Revert "Revert "Receiver credential secrets are deleted when secret is set to none""

This reverts commit e524bb3d40ea7adfe35c38ec7870560625965d25.

* fix harvester manager->harvester routing

* rename dialogs

* move harvester-manager files out of harvester pkg

* Revert "remove nested edit views"

This reverts commit e835835943d63e74c50942884fec3706f8703047.

* plugin validators dynamic import - not working

* fix merge conflict

* fix harvester members

* fix conflict

* custom validators

* harvester table formatters

* members routing

* import path fixes

* harvester mutli load

* Port across tweaks made during dynamic plugin work
- harvester plugin can be bundled with the dashboard until dynamic work has been completed
- Nav directly to virt cluster dashboard instead of via /harvester-c-cluster
- Fix missing bottom border on virt cluster list, hide actions (as they're never populated)

* move config/settings and config/harvester-map

fix hci setting custom components

* fix harvester setting import path

* Move over SerialConsole and Novnc, remove harvester.notifications
- These components were so 1-1 with harvester in the end i moved them over
- Also removed the like-for-like generic.notification `harvester.notification` strings

* Remove isSingleVirtualCluster, most of isMultiVirtualCluster

* Fix two nav issues
- harv cluster members --> prefs --> click on-screen back
- dashboard --> prefs --> click on-screen back

Both of these would be better fixed by an incoming change to the default layout (don't show old content before switching page)

* Fix reload of project/namespace page

* Split out project namespace into it's own component (1 or 2)

* Split out project namespace into it's own component (2 or 2)

* use product hideSystemResources opt instead of isVirtual/product===virtual

* fix missing prop in header

* Move FilterLabel and CloudInitType to harv pkg + two other references

* Move Harvester Upgrade components to harv pkg
- Needs a review with Neil regarding generics

* rebase build+load not working

* fix harvester route in authenticated

* Experimental Changes

* Fix merge conflicts

* WIP Fix routing
- includes project/namespace and namespace pages

* Tidying up

* Move harvester core store to plugin, remove harvester code from authenticated flow
- harvester store is a steve store that now lives in the plugin
- harvester `loadVirtual` replaced with a shortened `loadCluster` in it's own store
- Also fix xterm css import

* Fix three routing related bugs
- Fix project/namespace create/edit/cancel/done flows
- Update harvester's loadCluster to better match loadCluster
- Make edit namespace page project resource agnostic

* Build fixes

* Fix create namespace button and other tweaks

* fix two issues with nav out of imported harvester cluster

* Fix alignment of action menu button
- Used in many places
  - all generic table action menus
  - global settings --> settings
  - rke1 cluster detail page machine pool group actions
  - project/namespace list project group actions
  - resource detail page action menu

* Revert changes to app and pkg creators
- This should fix `check-plugins-build` gate
- It does hide the underlying issue, but that won't have been brought in by this PR?

Co-authored-by: Nancy Butler <42977925+mantis-toboggan-md@users.noreply.github.com>
2022-09-01 08:57:05 -07:00
Richard Cox b3f13843dd Merge remote-tracking branch 'origin/harvester-plugin-rebased' into test-pluginize-rc-2 2022-09-01 13:57:18 +01:00
Richard Cox 3f6df623e0 Move harvester core store to plugin, remove harvester code from authenticated flow
- harvester store is a steve store that now lives in the plugin
- harvester `loadVirtual` replaced with a shortened `loadCluster` in it's own store
- Also fix xterm css import
2022-08-25 12:26:39 +01:00
Richard Cox 29fb3c603e Move Harvester Upgrade components to harv pkg
- Needs a review with Neil regarding generics
2022-08-19 12:35:31 -07:00
Nancy Butler 877d6815c9 use product hideSystemResources opt instead of isVirtual/product===virtual 2022-08-19 12:35:03 -07:00
Richard Cox 2d85cecd42 Remove isSingleVirtualCluster, most of isMultiVirtualCluster 2022-08-19 12:31:14 -07:00
Nancy Butler 03c1bb8b0f harvester mutli load 2022-08-19 12:30:47 -07:00
Nancy Butler 11d6a4b3e5 fix conflict 2022-08-19 12:29:30 -07:00
Nancy Butler 3c35f40f20 fix loading imported dev cluster 2022-08-19 12:20:53 -07:00
Nancy Butler e10cccaf8a harvester custom routes 2022-08-19 12:20:53 -07:00
Nancy Butler a88ea801c9 routing maybe 2022-08-19 12:18:48 -07:00
Richard Cox f1f4e25707 Fix namespace detail page when a namespace filter is applied
- Caused by `filteredRows` running causing `getActiveNamespaces` to run.. which in tern triggers other table's `filteredRows`, etc
- Fix is to only update `activeNamespaceCache` if there were actual changes
- Tested
  - ns detail page
  - project/namespaces list
  - fleet resources
  - fleet resources where there are only 1 entry in two workspaces
2022-08-05 12:41:29 +01:00
Richard Cox 47401bd736 Fix flicking between fleet workspaces with equal resources
- fleet workspace switch toggles straight between 2 selections
- this results in the case that the row count doesn't change
- the `activeNamespaceCacheKey` cache is used to cover this case
- this was broken given in original pr and after my suggested edit
2022-08-03 15:05:29 +01:00
Catherine Luse 53d72ac54a Refactor namespace caching and filtering 2022-08-03 03:21:57 -07:00
Catherine Luse adf8c473bf Namespace filters apply on first page load 2022-08-03 01:22:17 -07:00
Richard Cox 0d6a31d966 Take NS filter into account when updating SortableTable's `arrangedRows` inside ResourceTables 2022-07-29 14:00:25 +01:00
Richard Cox 0fdfd1e7f6 Fix workspace filtering
- This was broken by https://github.com/rancher/dashboard/pull/6261
- The `activeNamespaceCache` depends on the product (fleet requires workspaces, everything else namespaces)
- This needs updating when going to or from fleet

NOTE - On `head` (but not `ui-dashboard-index` `latest`) refreshing on the explorer pods page does not show the correct namespace filtered pods

Small tidyup for `activeNamespaceCache` and `activeNamespaceFilters` getters
2022-07-27 16:14:49 +01:00
Catherine Luse 4d90d3e73c Revert debug code in updateNamespaces mutation 2022-07-21 14:20:44 -07:00
Catherine Luse bd966a061c Merge branch 'master' into cache 2022-07-21 02:40:14 -07:00
Richard Cox 412f93bf53 Fix case where the plugin is built in - also fixed some linting 2022-07-13 18:30:49 +01:00