Skip to main content
Version: v2

Common Types - LocationConfig

Where

The where defines which area of the UI the extension method will apply to and they depend on which method they are applied to. This means that each method will only accept a given subset of the the following list (documented per each method).

The admissable string values for the where are:

KeyTypeDescription
ActionLocation.HEADERStringLocation for an action on the Header of Rancher Dashboard. Check screenshot for location.
ActionLocation.TABLEStringLocation for an action on a List View Table of Rancher Dashboard. Check screenshot for location.
TabLocation.RESOURCE_DETAILStringLocation for a Tab on a Resource Detail page. Check screenshot for location.
PanelLocation.DETAILS_MASTHEADStringLocation for a panel on the Details Masthead area of a Resource Detail page. Check screenshot for location.
PanelLocation.DETAIL_TOPStringLocation for a panel on the Detail Top area of a Resource Detail page. Check screenshot for location.
PanelLocation.RESOURCE_LISTStringLocation for a panel on a Resource List View page (above the table area). Check screenshot for location.
CardLocation.CLUSTER_DASHBOARD_CARDStringLocation for a card on the Cluster Dashboard page. Check screenshot for location.
TableColumnLocation.RESOURCEStringLocation for a table column on a Resource List View page. Check screenshot for location.

LocationConfig

The LocationConfig object defines when (product, resource, cluster...) these UI enhancement methods are applied on the UI. The when is based on the current routing system employed on Rancher Dashboard. Let's take on a simple example to try and understand the routing structure.

Example URL:

<INSTANCE-BASE-URL>/dashboard/c/local/explorer/apps.deployment/cattle-system/rancher-webhook

How to recognize the URL structure on the example above:

<INSTANCE-BASE-URL>/dashboard/c/<CLUSTER-ID>/<PRODUCT-ID>/<RESOURCE-ID>/<NAMESPACE-ID>/<ID>

Note: There are Kubernetes resources that aren't namespaced, such as catalog.cattle.io.clusterrepo, and in those cases the following structure applies:

<INSTANCE-BASE-URL>/dashboard/c/<CLUSTER-ID>/<PRODUCT-ID>/<RESOURCE-ID>/<ID>

There is another different routing pattern for "extensions as products" which follows a slightly different convention of the core Rancher Dashboard routes. An example of this would be:

<INSTANCE-BASE-URL>/dashboard/elemental/c/local/elemental.cattle.io.machineinventory/nvxml-6mtga

which translates to:

<INSTANCE-BASE-URL>/dashboard/<PRODUCT-ID>/c/<CLUSTER-ID>/<RESOURCE-ID>/<ID>

With this it's then possible to easily identify the parameters needed to populate the LocationConfig and add the UI enhancements to the areas that you like. YES, it's also possible to enhance other extensions!

The admissible parameters for the LocationConfig object are:

KeyCompatible VersionTypeDescription
productv2.7.2ArrayArray of the product identifier. Ex: fleet, manager (Cluster Management), harvesterManager (Virtualization Management), explorer (Cluster Explorer) or home (Homepage)
resourcev2.7.2 + v2.8.0ArrayArray of the identifier of the kubernetes resource to be bound to. Ex: apps.deployment, storage.k8s.io.storageclass or secret (v2.7.2). You can also define a wildcard, ex: ['*'], which will match any resource page (v2.8.0)
namespacev2.7.2ArrayArray of the namespace identifier. Ex: kube-system, cattle-global-data or cattle-system
pathv2.7.7ArrayArray of objects that does matching for the path part of the url. Admissable properties for the object are: urlPath (string), exact (boolean, default or omission: true, which defines the type of match it does) and endsWith (boolean, defaults to false) .Ex: { urlPath: '/c/local/explorer/projectsnamespaces', exact: true } or { urlPath: 'explorer/projectsnamespaces', endsWith: true }
clusterv2.7.2ArrayArray of the cluster identifier. Ex: local
idv2.7.2ArrayArray of the identifier for a given resource. Ex: deployment-unt6xmz
modev2.7.2 + v2.7.7ArrayArray of modes which relates to the type of view on which the given enhancement should be applied. Admissible values are: edit (v2.7.2), config (v2.7.2), detail (v2.7.2), list (v2.7.2) and create (v2.7.7)
contextv2.7.2ObjectRequirements set by the context itself. This is a key value object that must match the object provided where the feature is used. For instance if a ResourceTab should only include a tab given specific information where the ResourceTab is used. Ex { provider: "digitalocean" }
queryParamv2.7.2ObjectThis is a key value object that must match the url's query param key values
hashv2.8.0ArrayArray of strings for url hash identifiers, commonly used in Tabs Ex: On a details view of a provisioning.cattle.io.cluster, you have several tabs identified in the hash portion of the url such as node-pools, conditions and related

LocationConfig Examples

Example 1:

{}

Passing an empty object as a LocationObject will apply a given extension enhancement to all locations where it can be apllied.

Example 2:

{ product: ['home'] }

Extension enhancement will be applied on the homepage of rancher dashboard (if applicable).

Example 3:

{ resource: ['pod'], id: ['pod-nxr5vm'] }

Extension enhancement will be applied on the resource pod with id pod-nxr5vm (if applicable).

Example 4:

{ 
cluster: ['local'],
resource: ['catalog.cattle.io.clusterrepo'],
mode: ['edit']
}

Extension enhancement will be applied on the edit view/mode of the resource catalog.cattle.io.clusterrepo inside the local cluster (if applicable).