Commit Graph

84 Commits

Author SHA1 Message Date
Neil MacDougall 1e18d03f4c
Add support for modifying doc links and add support for different links for Rancher Prime (#13020)
* Add support for different doc links

* Adding missing e2e test tags

* Auth page not accessible to standard user (admin tests seem sufficient)

* Ensure types are generated for version file

* Update doc links

* Update to remove plugin remove for builtin extensions

* Change the plugin load status back to how it was

* Fix i18n issue

* Fix translation load for built-in extensions
2025-02-07 10:38:41 +00:00
Neil MacDougall 56fbea3419
Add error handling to extension load (#13204)
* Add error handling to extension load

* Fix formatting following rebase
2025-01-31 15:48:46 +00:00
Neil MacDougall 8001967416
Extensions: Add hooks to support virtual clusters (#11064)
* Add hooks to support virtual clusters

* Fix lint issues

* Refinements

* Update for Vue 3 changes

* Fix import

* Minor tweaks

* Fix bug causing e2e tests to fail

* Fix lint issue

* Rename internal properties and ensure they don't break clone/save

* Ensure we generate types for the plugins package to give us access to mapDriver

* Simpler approach

* Fix lint issues and add type

* Remove unused code

* Revery unnecessary changes

* Bug fix for finding model extension

* Factor out string constant and add provider display method

* Add experimental to API

* Update typegen.sh to use SHELL_DIR var

* Move type def

* Fix lint issue

* Address PR feedback

* Update steve-class.js so we always get an array

* Fix type definition
2025-01-31 08:51:58 +00:00
Cody Jackson d1e2fabe4e Removing unload logic from the plugin load logic
The goal is to simplify the logic while possibly improving performance

fixes https://github.com/rancher/dashboard/issues/8895
2025-01-29 11:38:46 -07:00
Alexandre Alves e6bb53eadd
add missing types for extensions (#12952)
* add mising types for extensions

* add missing type
2025-01-06 12:01:07 +00:00
Alexandre Alves 8698cb8dd1
Fix Unable to add extension tab to Edit Storage Class page (#12886)
* first iteration to improve extension point for tabs (missing default mode = VIEW)

* add default _DETAIL for the extension tabs extension point so that they are not added to EDIT views as well, unless specified otherwise

* revert harvester change
2024-12-26 12:08:12 +00:00
Nancy Butler 1603dec497 add hidden prop to the cluster provisioner interface 2024-12-20 12:37:21 -08:00
Nancy Butler c05cb281dd hide extension cluster provisioners when disabled=true; add disabled getter to eks, aks, and gke provisioners to hide them when the kontainer driver is inactive 2024-12-20 12:37:21 -08:00
Alexandre Alves e1da1994af
Add type for mechanism to allow to register custom pages conditionally (based on resource type) (#12907)
* add ifHave property to types + bump shell

* add ifHaveType as well
2024-12-18 16:37:08 +00:00
Alexandre Alves 2944e1137d
fix type needed for correct build of stackstate extension + bump shell version (#12303) 2024-10-21 14:13:49 +01:00
Alexandre Alves 0e5fc092a4
fix PluginRouteRecordRaw type + bump shell version (#12247) 2024-10-15 16:47:06 +02:00
Francesco Torchia 70313b109a
Fix index route
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2024-09-16 13:45:14 +02:00
Cody Jackson a2a16e1440 Fixes for harvester 2024-09-13 09:43:38 -07:00
cnotv 0447740f2d Convert plugin helper to TS 2024-09-12 15:21:36 +02:00
Phillip Rak 9d0ea19288 Allow for loading dynamic components defined in extensions
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-09-11 13:29:59 -07:00
codyrancher 89829c3ef2
Adding in some fixes for extensions in vue3 (#11863)
* Adding in some fixes for extensions in vue3

The first one we needed a way to include the vue library for the extensions which are built as libraries and therefore do not include vue as a part of the bundle.

The second one was related to routes. The old way that we replaced the router matcher no longer seems to function. I'm guessing that the router methods are closures which are capturing a matcher that we don't actually see. We may want to come up with a faster way to update routes.

* Add types and extended attributes names

* Bump Vue Router

---------

Co-authored-by: cnotv <giuseppe.leo@suse.com>
2024-09-11 14:42:00 +02: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
cnotv ff08d80e0e Lint: Manually fixed issues related to vueApp variable added by the script 2024-08-22 16:07:03 -07:00
Cody Jackson 0b2f8c61f6 hack n slash 2024-08-22 16:05:37 -07:00
Phillip Rak 48869fa982 Resolving router-related warnings
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-08-22 16:05:36 -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
Giuseppe Leo d98ca6bd85
Remove Nuxt reference in extensions and creator (#11420)
* Remove nuxt commands

* Remove vsconfig nuxt mention

* Remove Nuxt path as unused

* Remove Nuxt

* Remove creator scripts

* Remove all the nuxt and nuxt.config references

* Restore existing comment about Nuxt

* Add dependency for check-plugin

* Add more missing dependencies

* Update to comments

* Correct comment based on PR review
2024-08-07 18:42:08 +02:00
Francesco Torchia d221ed9fd6
Remove only OldPlugin from parentElement
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2024-08-01 14:11:03 +02:00
Francesco Torchia 9f45387a20
Remove plugin from parentElement
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2024-08-01 12:51:00 +02:00
Giuseppe Leo 43ef5fc390
Clean up entry logic for vue.config (#11048)
* Cleanup entry for vue configuration

Rename reserved function terms

Correct extendApp initialization by passing Vue attribute

Avoid reserved name Vue

Set more unique and meaningful file names

Remove deprecated code added with rebase

Add vue instance to mountApp

Add comments and references to TODO issue

Restore function declaration over binding issue

Rename apps and correct issue with the render

Rebase residual cleanup

Remove unnecessary env var related to Nuxt

Remove deprecated confit assignment

Revert render function refactoring

* Fix Dashboard version issue
2024-05-29 11:09:43 +02:00
Phillip Rak 1250e41b5a Move inject() into `shell/initialize/plugins.js`
Moving inject into `shell/initialize/plugins.js` helps to better isolate the scoping of variables that are mutated by inject. This change also helps us to better prepare for utilizing `inject()` in Vue3, as the function now accepts a Vue instance. Finally, `inject()` is conceptually related to plugin installation, so it makes more sense to have this function more closely located to the root of the plugin install code.

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-05-14 09:48:34 -07:00
Cody Jackson 5595aeebbf Adding noAuth extension loading
https://github.com/rancher/dashboard/issues/9814
2024-04-22 13:04:00 -07:00
Neil MacDougall 00d23b8d1a
Allow extensions to override node provider icons (#10312)
* Allow extensions to override not provider icons

* Fix merge issues
2024-03-08 15:03:31 +00:00
Richard Cox b464d15ee0
Integrate new schemaDefinitions endpoint (#10141)
* resource edit AS yaml

* fix cruresource (yaml from form)
- lazy load the schemaDefinitions when needed, avoids sync all to createYaml before we have an async chance to fetch schemaDefinitions

* Fix questions
- there are only four places we use questions, none of which use schema, this is just to be safe

* cluster scan, plugins/fieldsForDriver, defaultFor, validationErrors

* pathExistsInSchema
- used to optionally show conditions tab/list in resource detail view
- logs of things in ingress list/edit

* createPopulated / defaultFor
defaultFor requires resourceFields, it's only used by createPopulated in one place to support machine configs without components

* wip

* WIP MONITORING.SPOOFED
- these aren't spoofed types, but secondary schemas
- testing fix blocked, primary schema's have resourceFields

* Move steve specific (resourceField) code to steve models
- create models for steve schemas and apply to cluster and management stores
- move resoureField based validationto steve model
- move pathExistsInSchema to steve store getter
- don't fetch schemaDefinitions on start up when saving prefs (not needed and blocking)

* comments / improvements

* (untested) refactoring

* Fix alertmanager definitions, add retry definition fetch

* Fix pathExistsInSchema for path length > 2

* Fix questions that accept schemas
- tested by adding Questions to random page and the node schema

* Fix to saving configmap part 1
- the save works but doesn't show data. the yaml is the same as before. debug info added

* Validation by resourceFields is a norman specific thing, so make it such

* small refactor

* Tidying up

* Remove rebase junk

* fix linting and unit tests

* fix unit tests

* fix linting from fix for test....

* Tidying up, fix alertmanagerconfig

* Remove unit test todos

* add unit tests for resource fields

* sdssdf

* Add unit tests for pathExistsInSchema

* JS --> TS

* Store schemas in local singleton cache to avoid hitting store

* fix minor changes from review

* cruresource changes following review
- improvement - remove spurious canDiff
- createResourceYaml - pass in resource to use instead of calc in code

* WIP changes to parseType

* Fix generic cloud credential and node driver forms

* handle missing reactivity given schema definitions not in store

* fix and add unit tests for `parseType`

* Fix create-yaml test

* Changes following review
- improved comments
- SchemaDefinitionCache is now per store (and is reset as such)
- typeRef now uses parseType

* Fix dep loop by moving route based helps in auth out to utils file

* fix unit tests

* Changes following review
2024-02-28 17:08:35 +00:00
Nancy c77e402313
Allow cluster provisioning extensions to define cluster-importing support (#10316)
* allow prov extensions to specify cluster importing support, allow prov extensions to overwrite built-in

* remove commented code

* fix e2e test data
2024-01-31 07:58:55 -08:00
Cody Jackson 48e1b0b3bb Layout removal
fixes #10059
2024-01-22 06:30:17 -07:00
Alexandre Alves 6637583874
remove "process." mentions from Dashboard and adjust code (#10119)
* remove process.client and process.server mentions and adjust code

* fix a couple of missing conditions for process.server

* remove commented line

* remove process.static

* fix lint errors

* uncomment code

---------

Co-authored-by: Alexandre Alves <aalves@Alexandres-MacBook-Pro.local>
2023-12-13 08:41:26 +00:00
Richard Cox 79f4cdc0f0 Ensure checkRouteProduct works with route meta object
- getProductFromRoute falls back on product in route meta object
- in checkRouteProduct this was not passed through
2023-11-15 18:33:59 +00:00
Alexandre Alves 6ebbcef87e
Improve Extensions documentation (#9896)
* improve docs + fix types definition to prevent linter issues on getting started examples + bump shell version so that we can release a new version

* address pr comments

---------

Co-authored-by: Alexandre Alves <aalves@Alexandres-MBP.lan>
2023-10-12 17:47:45 +01:00
Neil MacDougall c9341a9b8d
Kubectl explain (#9713)
* Initial Example

* Add toggle expand all

* Add panel resize

* Fix close and open after resize

* Fix expand all

* POC: Kubectl explain interface

* Fix some lint issues

* First version of the kubectl explain UI

* Improvements

* Fix lint

* Tidy up Open API data fetch

* Tidy up code for parsing OpenAPI

* Many tidy ups and simplifications

* Add error message if we can't load Open API Data

* Ensure action appears only when there is a resource

* Fix lint issue

* Test e2e

* e2e

* e2e

* USe canary browser

* Use firefox

* Try chrome version

* Auto accept prompt

* Accept

* Last try

* Install Chrome

* Run as root

* Fix paths

* Add quiet flag, fix paths

* Use browser path

* Try debugging port

* Further attempts

* Set path

* Add debug env var

* Try edge

* Use specific version

* Add allow downgrades

* Use Chrome

* Remove WIP

* Adderss PR feedback

* Fix for no cluster

* Address PR feedback

* Fix lint issue

* Fix position with banners enabled. Restrict products for which this is shown

* Fix lint issue

---------

Co-authored-by: Richard Cox <richard.cox@suse.com>
2023-09-27 22:01:24 +01:00
Alexandre Alves c136e0f81f
locationConfig hash param (#9514)
* add hash param to locationConfig object in extensions to allow fine-tune of application of an extension + change logic around extension table cols to better reflect col location based on page user is browsing

* remove commented line

* update docs

* improve docs with breaking changes warning

* address pr comments

* bump shell version

---------

Co-authored-by: Alexandre Alves <aalves@Alexandres-MBP.lan>
2023-08-25 14:41:38 +01:00
Cody Jackson 804dd2c569 Adding virtual type to our interface since it's in our docs 2023-08-11 17:57:45 -07:00
Alexandre Alves 744e733f2a
Create mode missing from LocationConfig (#9425)
* fix modes for locationConfig + support new mode ´create´

* update docs

---------

Co-authored-by: Alexandre Alves <aalves@Alexandres-MacBook-Pro.local>
2023-07-27 14:40:45 +01:00
Alexandre Alves e5e7fcb46b
improve location config cross-check with path param (#9385)
* improve location config cross-check with path param

* update docs

---------

Co-authored-by: Alexandre Alves <aalves@Alexandres-MBP.lan>
2023-07-26 17:27:07 +01:00
Alexandre Alves 43ca333bdf
Table actions 'enabled' function not working correctly (#9331)
* fix bug

* fix lint issues

* fix lint issues + remove pkg folder

* address PR comments

---------

Co-authored-by: Alexandre Alves <aalves@Alexandres-MBP.lan>
2023-07-17 16:07:24 +01:00
Richard Cox e1839486bb
Merge pull request #8890 from DaiYuzeng/rancher-master
remove plugin accurately
2023-07-14 14:58:03 +01:00
Dai Yuzeng 7147818289 HARVESTER: remove plugin accurately 2023-07-13 15:51:04 +08: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
Cody Jackson 1b1f7dae33 Add the ability to import layouts from extensions
Addresses one facet of https://github.com/rancher/dashboard/issues/9216
2023-07-07 13:53:57 -07:00
Alexandre Alves 1ec3056b74
add support for enabled as a function in table action extension point + update extension docs (#9170)
Co-authored-by: Alexandre Alves <aalves@Alexandres-MBP.lan>
2023-07-07 14:59:43 +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
codyrancher 850521ab8f Updating the types for extensions
Found that these types were necessary for some of our docs and example projects
2023-05-25 21:38:22 +03:00
Alexandre Alves 57c0e699ca
fix route collision with extensions (#8861)
* fix route collision with extensions

* revert type change

---------

Co-authored-by: Alexandre Alves <aalves@Alexandres-MacBook-Pro.local>
2023-05-18 14:12:08 +01:00
Nancy f36b6e499f
Revert "Remove jquery from dependencies" (#8869) 2023-05-15 07:58:34 -07:00