Skip to main content
Version: 3.x.x

Cards

Cards present information with a bordered box.

Cards are added to Rancher via the addCard method.

addCard

(Rancher version v2.7.2)

This method adds a card element to the UI.

Method:

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

Arguments

where string parameter admissable values for this method:

KeyTypeDescription
CardLocation.CLUSTER_DASHBOARD_CARDStringLocation for a card on the Cluster Dashboard page

when Object admissable values:

LocationConfig as described above for the LocationConfig object.



CardLocation.CLUSTER_DASHBOARD_CARD options

Cluster Dashboard Card

options config object. Admissable parameters for the options with 'CardLocation.CLUSTER_DASHBOARD_CARD' are:

KeyTypeDescription
labelStringCard title
labelKeyStringSame as "label" but allows for translation. Will superseed "label"
componentFunctionComponent to be rendered aas content of a "Cluster Dashboard Card"

Usage example for 'CardLocation.CLUSTER_DASHBOARD_CARD':

plugin.addCard(
CardLocation.CLUSTER_DASHBOARD_CARD,
{ cluster: ['local'] },
{
label: 'some-label',
labelKey: 'generic.comingSoon',
component: () => import('./MastheadDetailsComponent.vue')
}
);