Skip to main content
Version: v3

Panels

A Panel is a defined area in the Rancher UI where custom UI components can be shown.

Panels are added to Rancher via the addPanel method.

addPanel​

(From Rancher version v2.7.2)

This method adds a panel/content to the UI.

Method:

plugin.addPanel(where: String, when: LocationConfig, options: Object);

Arguments

where string parameter admissable values for this method:

KeyTypeRancher VersionDescription
PanelLocation.DETAILS_MASTHEADStringv2.7.2Location for a panel on the Details Masthead area of a Resource Detail page (only for modes detail, edit, config and create (v2.7.7))
PanelLocation.DETAIL_TOPStringv2.7.2Location for a panel on the Detail Top area of a Resource Detail page (only for modes detail, edit, config and create (v2.7.7))
PanelLocation.RESOURCE_LISTStringv2.7.2Location for a panel on a Resource List View page (above the table area - only for mode list (v2.7.2))
PanelLocation.ABOUT_TOPStringv2.13.0Location for a panel on the About page of Rancher Dashboard

when Object admissable values:

LocationConfig as described above for the LocationConfig object.



PanelLocation.DETAILS_MASTHEAD options​

(From Rancher version v2.7.2)

Details Masthead

options config object. Admissable parameters for the options with 'PanelLocation.DETAILS_MASTHEAD' are:

KeyTypeDescription
componentFunctionComponent to be rendered as content on the "detail view" Masthead component
weight (From Rancher version v2.17.0)NumberOptional. Order of the panel amongst the other extension panels in the same location, highest first. Defaults to 0. Panels of equal weight registered by the same extension keep the order they were added in; across extensions the tie falls back to extension load order, so give a panel a distinct weight to place it relative to another extension's panel

Usage example for 'PanelLocation.DETAILS_MASTHEAD':

plugin.addPanel(
PanelLocation.DETAILS_MASTHEAD,
{ resource: ['catalog.cattle.io.clusterrepo'] },
{ component: () => import('./MastheadDetailsComponent.vue') }
);


PanelLocation.DETAIL_TOP options​

(From Rancher version v2.7.2)

DetailTop

options config object. Admissable parameters for the options with 'PanelLocation.DETAIL_TOP' are:

KeyTypeDescription
componentFunctionComponent to be rendered as content on the "detail view" detailTop component
weight (From Rancher version v2.17.0)NumberOptional. Order of the panel amongst the other extension panels in the same location, highest first. Defaults to 0. Panels of equal weight registered by the same extension keep the order they were added in; across extensions the tie falls back to extension load order, so give a panel a distinct weight to place it relative to another extension's panel

Usage example for 'PanelLocation.DETAIL_TOP':

plugin.addPanel(
PanelLocation.DETAIL_TOP,
{ resource: ['catalog.cattle.io.clusterrepo'] },
{
component: () => import('./DetailTopComponent.vue'),
weight: 100
}
);


PanelLocation.RESOURCE_LIST options​

(From Rancher version v2.7.2)

List View

options config object. Admissable parameters for the options with 'PanelLocation.RESOURCE_LIST' are:

KeyTypeRancher VersionDescription
componentFunctionv2.7.2Component to be rendered as content above a table on a "list view"
weight (From Rancher version v2.17.0)Numberv2.17.0Optional. Order of the panel amongst the other extension panels in the same location, highest first. Defaults to 0. Panels of equal weight registered by the same extension keep the order they were added in; across extensions the tie falls back to extension load order, so give a panel a distinct weight to place it relative to another extension's panel

Usage example for 'PanelLocation.RESOURCE_LIST':

plugin.addPanel(
PanelLocation.RESOURCE_LIST,
{ resource: ['catalog.cattle.io.app'] },
{ component: () => import('./BannerComponent.vue') }
);


PanelLocation.ABOUT_TOP options​

(From Rancher version v2.13.0)

List View

NOTE: this Panel will only appear on the area designated in the screenshot in the About page of Rancher UI

options config object. Admissable parameters for the options with 'PanelLocation.ABOUT_TOP' are:

KeyTypeDescription
componentFunctionComponent to be rendered as content above a table on a "list view"
weight (From Rancher version v2.17.0)NumberOptional. Order of the panel amongst the other extension panels in the same location, highest first. Defaults to 0. Panels of equal weight registered by the same extension keep the order they were added in; across extensions the tie falls back to extension load order, so give a panel a distinct weight to place it relative to another extension's panel

Usage example for 'PanelLocation.ABOUT_TOP':

plugin.addPanel(
PanelLocation.ABOUT_TOP,
{},
{ component: () => import('./BannerComponent.vue') }
);