Commit Graph

59 Commits

Author SHA1 Message Date
Richard Cox eb1c08032f
Project Scoped Secrets (#14772)
* rename variables

* change button names + fix import

* apply pagination to secrets

* Major Changes

- secrets and project scoped secrets are now two pages
  - this fixes the issue where resource-fetch and associated mixins just fail with two of the same type on page
    - incremental loading would have been broken for both
- project scoped secrets
  - now correct lists upstream secrets that a project scoped based and on the target cluster
    - lots of work to get CRUD for management secrets in explore/cluster world
    - also includes a specific page to override the store for create/edit/view
  - these are now correctly grouped by project
  - updated to work with SSP enabled
- secrets list
  - shows if the secrets comes from a project
  - shows if the secret is a project scoped secret (only used on upstream cluster)
  - updated to work with SSP enabled
  - disabled update/delete of secrets created from project scoped (these just reset when sync runs again)
- disabled new detail view
  - this is broken, it ignores both storeOverride and currentStore, always going to `cluster` store


TODO:
- mostly testing
- blocked on some BE issues (bugs, additional indexed field)

* ... progress. will update commit message

* Revert "Merge pull request #14748 from richard-cox/revert-project-secrets"

This reverts commit be3962261d, reversing
changes made to 62d80084d9.

* tidy, and remove e2e

* test fixes

* fix vai group by

* Fix for grouping (secrets --> group by namespace --> pss --> table is incorrectly grouped but toggle is correct

* fix warning

* fix clone/yaml, fix default/system pss

* don't fetch projects, it wipes out header. this means in upstream we won't show project names for pss downstream

* fix lint

* fix ts complain

* Tweak column tooltips

* Add cypress logs for failing tests

* pipe in `inStore`

* tweaks to cypress logs process
- better name
- log http requests
- only create logs if run failed

* Secret selector improvements and test fixes
- don't cache or watch secrets if we're showing multiple selectors on a page
- ensure we classify secrets (make it into an instance of a model)

---------

Co-authored-by: Mo Mesgin <mmesgin@Mos-M2-MacBook-Pro.local>
Co-authored-by: momesgin <mo.mesgin@suse.com>
2025-07-15 08:27:26 +01:00
Richard Cox 3f086247e2 Revert "Project scoped secrets (#13979)"
This reverts commit a35b81cbd3.
2025-07-09 11:16:16 +01:00
Alexandre Alves aebde5c25f
Rancher as an OIDC provider (#14475)
* Rancher as an OIDC provider (interface and flow)

---------

Co-authored-by: Richard Cox <ricox@suse.com>
2025-06-26 10:39:26 +01:00
momesgin a35b81cbd3
Project scoped secrets (#13979)
* projec scoped secrets page

* project-scoped secret creation

* refactor

* use new label + refactor

* refactor

* always local cluster url for project-scoped secrets

* grouping secrets by project name

* fix grouping

* fix namespace value

* fix cancel redirect

* fix done redirect

* e2e tests

* fix e2e test

---------

Co-authored-by: Mo Mesgin <mmesgin@Mos-M2-MacBook-Pro.local>
2025-06-24 12:58:37 -07:00
Alexandre Alves 387891f61f
improve a11y in some of our most used components in Rancher Dashboard (#14343)
* improve a11y in some of our most used components in Rancher Dashboard

* revert changes to roles on keyvalue component
2025-06-04 08:50:48 +01:00
Evgeniya Vashkevich 89dbe1ad2b
Made name optional in NameNSDescription component (#14337) 2025-05-12 14:08:44 -07:00
Phillip Rak c7b2e2e605 NameNsDescription: write unit tests for the name input
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2025-04-01 09:37:28 -07:00
Phillip Rak cc02045dfb NameNsDescription: Set the name using the nameKey prop
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2025-04-01 09:36:26 -07:00
Phillip Rak 594570d37a Fix unit tests
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2025-03-21 15:23:59 -07:00
Phillip Rak 68e046e5ed Use `setup()` to init data in `NameNsDescription.vue`
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2025-03-21 15:23:59 -07:00
Phillip Rak 2a1d334b44 Init component data in `created()` hook
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2025-03-21 15:23:59 -07:00
Cody Jackson 5052c2a8e8 Enabling `vue/require-explicit-emits` linting rule
https://github.com/rancher/dashboard/issues/11961
2024-09-19 09:58:53 -07:00
Cody Jackson 154fcb5b69 Fixing how we set values in NameNsDescription
We weren't calling set anymore which meant we weren't using the correct key when setting the values in some places.
2024-08-22 16:09:55 -07:00
Cody Jackson d47ce13f28 Fixed the remaining lint warnings and errors
The chart.test.ts is likely more broken now than it was. This can be fixed later.
2024-08-22 16:07:04 -07:00
Phillip Rak bb941571e2 Fix reactivity in `NameNsDescription.vue`
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-08-22 16:07:03 -07:00
Phillip Rak 31646c2eae Replace `set()` with assigment
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-08-22 16:07:03 -07:00
Cody Jackson 9b829c55ea Ran `yarn lint --fix` 2024-08-22 16:05:36 -07:00
Cody Jackson d5ce4fff2e Run the vue3 migration script
Commands run:

➤ yarn migrate
➤ git clean -fdx
➤ nvm use 20
➤ yarn
2024-08-22 16:05:36 -07:00
Phillip Rak de3e9517ce Replace `createNamespace` with store in `CruResource`
This replaces the current method of managing the `createNamespace` state with something that will be Vue3 compatible.

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-03-22 15:45:52 -07:00
Sorin 89fecf80d7
9810/follow-up with fixes. (#10638)
* fix: moves AddCustomDialog outside NameNsDescription
---------

Signed-off-by: scures <scurescu@suse.com>
2024-03-20 08:17:45 +01:00
scures 27889b0dbf
feat: cluster abbreviation to 3 chars, shows customisation on cluster creation 2024-03-11 14:43:28 +01:00
Neil MacDougall c9e1a19396
Extension support for custom provisioning (#9246)
* Extension support for custom provisioning

* FIx lint issues

* Discovery / Tweaks
- fix issue where namespacesOverride was lost
- tidy up PROVIDER
- try to handle missing provider=type url param (could be missing extension-params)
- added a few comments to comments to come back to

* Names and typings
- change param --> customParam to make it clearer it's not url params
- add labels-annotations to shell types

* Wire in provider detailTabs
- as per original readme this should be made generic (extension point working directly with ResourceTabs)

* Update IClusterProvisioner & docs

* Improvements / Changes to support proving out DO extension
- cluster hooks optional
- buff up save hook (and pass in cluster when calling apply fn)
- move normalizeName into generic place
- bring back async create machine config
- hack for do extension (map example provider to do provider)

* updates, add optional saveCluster, add missing kube file
- saveCluster complements hooks, doesn't skip handling of addons, etc
- ensure register hooks take the `this` context in all worlds

* Adding docs

* Updates
- location config based changes
  - change customParams to context
  - add query param
- add new extention point to add tabs to cluster create cluster config section
- fixed some typing
- fixed issue where cluster was not passed to before / after hooks (only important if 'this' changes

* Changes following review, fix `t` in plugins

* Fix linting

* Docs updates, pass through more edit/view things

* Conditionally show the namespace grouping in the cluster list
- means users can differentiate between clusters with same name in different namespaces
- useful when clusters created via extension provisioner where ns can be selected

* docs tweaks, actually include the provisioning page in docs

---------

Co-authored-by: Richard Cox <richard.cox@suse.com>
2023-07-11 22:17:57 +01: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 304628bded Ensure cancel when creating a NS sets valid selected option
- In epinio world defaultNamespace isn't valid
- This would be undefined, which was probably handled as a falsy which matched the 'create a ns' option
- So fall back on something sensisble
2023-06-13 16:35:38 +01:00
Richard Cox 4ee014a0f3 Fix namespaceOverride & epinio namespace usage 2023-06-02 15:56:48 +01:00
Richard Cox a5d3b32322 Lint fixes 2023-06-02 14:43:29 +01:00
Richard Cox d90ba881a6 Merge remote-tracking branch 'upstream/master' into merge-master-2 2023-05-25 16:51:00 +01:00
Phillip Rak ade3c9f4e7 Replace all instances of `v-tooltip` with `v-clean-tooltip`
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2023-05-18 15:39:14 -07:00
cnotv 55a1c660c7 Update name according to latest change to options and add tests related to creation 2023-04-11 09:54:27 +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
Shavindra ca67df2d7f
Namespace changes on workload creation are not kept (#8279)
* Ensure namespace is set when creating a workload.
2023-02-28 09:49:30 +00: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
richa c792d21dd9
Fixed icon size (#7557)
* Fixed icon size

* Add node inactive warning indicator (#7548)

* StringList, delete item on editing

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

* Bump @rancher/components version

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

* Add manage button to home page (#7546)

* Add manage button to home page

* Fix button spacing

* Make buttons smaller - looks better with extra button

* Fixed icon size in simplebox

* icon fix in GrowlManager.vue

* Add node inactive warning indicator (#7548)

* StringList, delete item on editing

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

* Bump @rancher/components version

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

* Add manage button to home page (#7546)

* Add manage button to home page

* Fix button spacing

* Make buttons smaller - looks better with extra button

* Fixed close icon size

* Fixed more icons sizes

* Fixed icon size in namespaces filter

* Reverd css changes in LabeledSelect component

* Fix on Header

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
Co-authored-by: Neil MacDougall <nwmac@users.noreply.github.com>
Co-authored-by: Francesco Torchia <francesco.torchia@suse.com>
Co-authored-by: Richa Bisht <RBISHT@Richas-MacBook-Pro.local>
2022-12-08 16:52:53 +01:00
Richard Cox 33561db8e0 Merge remote-tracking branch 'upstream/master' into epinio-dev 2022-11-29 12:32:10 +00:00
Shavindra 91d1e64a39
Fix project name editable. (#7223)
* Fix project name editable.
* Added component name.
2022-11-15 17:26:07 +00:00
richa f2e1ae8ac8
Added blue color only to creation action (#7118)
* Added blue color only to creation action

* Removed test code

* Revert some changes without dummy text

* Fixed names for attribute, color variables for dark and light theme, removed a tag

* Allow /rancherversion endpoint override (#7088)

* Fix KeyValue Component. (#7093)

* Fix KeyValue Component.

* Refactor solution.

* Fix PR comment.

* Adds new logos without Manager to bettr represent all sub-brands and improve readability

* Updates error of HSB colour to HSL

* Remove uneeded check - add custom check for old endpoints (#7058) (#7074)

* Allow to reset ui-brand global setting (#7110)

* Remove negative margin for Tabbed component, causing issues in Network policies (#7108)

* Update script to use newer version of Rancher Docker (#7114)

* Removed files from featured-carousel PR that should not be there at top-level (#7092)

* Allow wildcards in ingress hostnames (#7025)

Wildcards are allowed in ingress hostnames since Kubernetes 1.18: https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/#support-for-hostname-wildcards

Fixes https://github.com/rancher/dashboard/issues/6957

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

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

* Improve PSP deprecated banner
Fixes #7096

Previously...
- a new request for PSPs was made on each page visit
- the request would fail for users without access to the PSP
- failed requests equated to white page dev error (fine in prod)

Now...
- use the `counts` resource to determine if the user can see any PSPs
- move logic to a computed property

* Hide experimental charts from Cluster Tools

Signed-off-by: Bastian Hofmann <mail@bastianhofmann.de>
Co-authored-by: Neil MacDougall <nwmac@users.noreply.github.com>
Co-authored-by: Shavindra <Shavindra@users.noreply.github.com>
Co-authored-by: Kenneth Wimer <wimer@suse.com>
Co-authored-by: Jordon Leach <40806497+jordojordo@users.noreply.github.com>
Co-authored-by: Giuseppe Leo <giuseppe.leo@suse.com>
Co-authored-by: Bastian Hofmann <bashofmann@gmail.com>
Co-authored-by: Richard Cox <richard.cox@suse.com>
2022-11-15 14:31:08 +01:00
richa b39bb589a8
Bug fix namespace value (#7170)
* Fixed namespance clear value bug

* Removed if condition

* Removed extra code

* Corrected the label for create namespace option
2022-11-15 14:17:10 +01:00
Giuseppe Leo d2d4122bc0
Review HTML formatting rules (#6805)
* Prevent ESLint to format generated paths

* Add HTML ESLint Rules

* Format all the Vue HTML templates except Harvester

* Exclude Harvester package from linting HTML, keeping old formatting rules
2022-11-11 17:04:22 +01:00
Richard Cox 3674f1d2b6 Merge remote-tracking branch 'upstream/master' into HEAD 2022-10-17 15:09:50 +01:00
Shavindra e94b5a26ba
Prevent blocking effect secondary resources on workloads (#6860)
* move secondary data requests to a non-blocking ui method + pass loading props to the correct labeled selects

* main data loading procedure for secondary data done

* use pvcs from secondary resource fetch on storage component

* rename loading props to asyncDataLoading for better context

* cleanup

* move secondary resources data loading logic to a mixin

* cleaning up resource-manager mixin

* fix issue where namespace  wasnt being updated on secondary requests

* add doc description for data structure for resourceData

* minor change

* add plural option to resource-manager + remove loading var from workloads for sec resources + optimise persistentvolume edit view

* improve persistentvolumeclaim edit view

* add loading flag

* addressing PR comments

* fix latest PR comments

* doc on classify option for resourceManagerFetchSecondaryResources param

* Ensure reponse for namespace resources mimics non-namespaced
- The resources returned when requesting namespaced types do not contain id, type and links properties.
- This isn't perfect, or universally applicable, but will work for the current set of use cases

* working on merge conflicts

* Remove files from bad merge

* Handle new namespaces
- The secondary resource manager fetches some resources by namespace
- The user however can supply a new namespace
- When in `new namespace` mode we need to
  - avoid trying to fetch namespaced resource
  - clear any cached namespaced resource
- this only currently applies to workloads, PV and PVC pages don't fetch namespaced resources

Co-authored-by: Alexandre Alves <aalves@Alexandres-MBP.lan>
Co-authored-by: Alexandre Alves <aalves@Alexandres-MacBook-Pro.local>
Co-authored-by: Richard Cox <richard.cox@suse.com>
2022-10-09 10:40:32 +01:00
Qingyang Nong 0d5c0c0050
HARVESTER: Fix namespace filter error (#7053) 2022-09-30 12:50:17 -07:00
Qingyang Nong ae5a5ca614
HARVESTER: Hide read only namespaces (#6997) 2022-09-27 13:49:21 -07: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
Giuseppe Leo 698194fea3
Create E2E tests for cluster CRUD operations (#6284)
* Set data test id and allow complex component to have default and inherited values for all the actions

* Create cluster tests with steps; Create cluster E2E test

* Extend command to use selector matchers

* Create test for cluster navigation and deletion

* Extend commands to find by id as in get method

* Extend documentation with guidelines and info about E2E

* Correct cluster delete and details tests to get menu within speciftc cluster row

* Add remaining E2E tests for the cluster

* Add baseUrl to the paths

* Add RKE2 selection on cluster creation for CI

* Add E2E debugging information

* Rename clluster manager E2E for consistency

* Correct data test ID after rebase

* Prevent cluster provider errors if no management parameter is provided

* Prevent accessing objects in mutation if none is provided

* Remove imported cluster sample due discarded logic

* Reset RKE2 switch on cluster creation

* Adjust test naming for cluster manager

* Group tests under scoped cases
2022-08-17 20:48:20 +02:00
Richard Cox d97d94c477 Fix create epinio ns inline 2022-08-08 13:43:35 +01:00
Richard Cox 60baeedbfc Fix simplified create namespace
- NameNsDecsription showed divider even if we weren't creating a namespace
2022-08-08 13:43:26 +01:00
Richard Cox 6ceae93a75 For certain roles hide concept of namespace outside of groups
Users who have no overaching view of the cluster (non-rancher admins, non-cluster owners)
- shouldn't see namespaces outside of their projects
- shouldn't be able to create namespaces outside of their projects (specifically not in a project)
2022-08-04 12:39:03 +01:00
Sean ddab180ecc Adds in form validation mixin, error reporting on inputs, a few examples 2022-07-07 13:18:43 -04:00