@rancher/shell 3.0.0-rc.3 → 3.0.0-rc.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. package/assets/styles/base/_variables.scss +12 -4
  2. package/assets/styles/global/_layout.scss +1 -1
  3. package/assets/styles/global/_tooltip.scss +1 -1
  4. package/assets/translations/en-us.yaml +61 -26
  5. package/assets/translations/zh-hans.yaml +6 -5
  6. package/chart/istio.vue +2 -0
  7. package/chart/monitoring/ClusterSelector.vue +2 -0
  8. package/chart/monitoring/StorageClassSelector.vue +4 -1
  9. package/chart/monitoring/index.vue +2 -0
  10. package/chart/rancher-backup/S3.vue +2 -0
  11. package/chart/rancher-backup/index.vue +2 -0
  12. package/cloud-credential/aws.vue +2 -0
  13. package/cloud-credential/azure.vue +2 -0
  14. package/cloud-credential/digitalocean.vue +2 -0
  15. package/cloud-credential/gcp.vue +2 -0
  16. package/cloud-credential/generic.vue +2 -0
  17. package/cloud-credential/harvester.vue +2 -0
  18. package/cloud-credential/linode.vue +2 -0
  19. package/cloud-credential/pnap.vue +2 -0
  20. package/cloud-credential/s3.vue +2 -0
  21. package/cloud-credential/vmwarevsphere.vue +2 -0
  22. package/components/ActionMenu.vue +4 -1
  23. package/components/AppModal.vue +4 -1
  24. package/components/ButtonDropdown.vue +3 -0
  25. package/components/ButtonGroup.vue +2 -0
  26. package/components/ButtonMultiAction.vue +41 -0
  27. package/components/Carousel.vue +3 -0
  28. package/components/CodeMirror.vue +6 -4
  29. package/components/Collapse.vue +4 -1
  30. package/components/CollapsibleCard.vue +4 -1
  31. package/components/ContainerResourceLimit.vue +2 -0
  32. package/components/CopyCode.vue +8 -4
  33. package/components/CopyToClipboardText.vue +2 -0
  34. package/components/CruResource.vue +2 -0
  35. package/components/CruResourceFooter.vue +2 -0
  36. package/components/Dialog.vue +2 -0
  37. package/components/DisableAuthProviderModal.vue +4 -1
  38. package/components/EmberPage.vue +2 -0
  39. package/components/ExplorerProjectsNamespaces.vue +11 -8
  40. package/components/GlobalRoleBindings.vue +2 -0
  41. package/components/Import.vue +2 -0
  42. package/components/InputOrDisplay.vue +23 -18
  43. package/components/Loading.vue +4 -1
  44. package/components/Markdown.vue +2 -0
  45. package/components/ModalWithCard.vue +2 -0
  46. package/components/MoveModal.vue +2 -0
  47. package/components/PodSecurityAdmission.vue +2 -0
  48. package/components/Questions/Array.vue +2 -0
  49. package/components/Questions/Boolean.vue +2 -0
  50. package/components/Questions/CloudCredential.vue +2 -0
  51. package/components/Questions/Enum.vue +2 -0
  52. package/components/Questions/Float.vue +2 -0
  53. package/components/Questions/Int.vue +2 -0
  54. package/components/Questions/QuestionMap.vue +4 -1
  55. package/components/Questions/Radio.vue +2 -0
  56. package/components/Questions/Reference.vue +2 -0
  57. package/components/Questions/String.vue +2 -0
  58. package/components/Questions/Yaml.vue +2 -0
  59. package/components/Questions/index.vue +2 -0
  60. package/components/ResourceCancelModal.vue +2 -0
  61. package/components/ResourceDetail/Masthead.vue +4 -3
  62. package/components/ResourceDetail/index.vue +17 -15
  63. package/components/ResourceTable.vue +2 -0
  64. package/components/ResourceYaml.vue +2 -0
  65. package/components/SelectIconGrid.vue +2 -0
  66. package/components/SimpleBox.vue +2 -0
  67. package/components/SortableTable/THead.vue +2 -0
  68. package/components/SortableTable/index.vue +15 -19
  69. package/components/StatusTable.vue +2 -0
  70. package/components/Tabbed/Tab.vue +2 -0
  71. package/components/Tabbed/index.vue +2 -0
  72. package/components/Wizard.vue +2 -0
  73. package/components/YamlEditor.vue +2 -0
  74. package/components/__tests__/ButtonMultiAction.test.ts +31 -0
  75. package/components/auth/RoleDetailEdit.vue +2 -0
  76. package/components/auth/SelectPrincipal.vue +2 -0
  77. package/components/auth/login/ldap.vue +2 -0
  78. package/components/fleet/FleetStatus.vue +3 -2
  79. package/components/form/ArrayList.vue +16 -1
  80. package/components/form/ArrayListSelect.vue +2 -0
  81. package/components/form/ChangePassword.vue +2 -0
  82. package/components/form/ColorInput.vue +2 -0
  83. package/components/form/Command.vue +2 -0
  84. package/components/form/FileImageSelector.vue +2 -0
  85. package/components/form/FileSelector.vue +2 -0
  86. package/components/form/Footer.vue +2 -0
  87. package/components/form/GitPicker.vue +1 -0
  88. package/components/form/HealthCheck.vue +5 -3
  89. package/components/form/HookOption.vue +22 -18
  90. package/components/form/InputWithSelect.vue +3 -1
  91. package/components/form/KeyValue.vue +2 -0
  92. package/components/form/LabeledSelect.vue +13 -3
  93. package/components/form/LifecycleHooks.vue +2 -0
  94. package/components/form/MatchExpressions.vue +2 -0
  95. package/components/form/Members/ClusterPermissionsEditor.vue +2 -0
  96. package/components/form/Members/MembershipEditor.vue +2 -0
  97. package/components/form/NameNsDescription.vue +4 -1
  98. package/components/form/Networking.vue +2 -0
  99. package/components/form/NodeAffinity.vue +4 -1
  100. package/components/form/Password.vue +2 -0
  101. package/components/form/PlusMinus.vue +2 -0
  102. package/components/form/PodAffinity.vue +4 -1
  103. package/components/form/Ports.vue +2 -0
  104. package/components/form/Probe.vue +8 -4
  105. package/components/form/ResourceQuota/NamespaceRow.vue +2 -0
  106. package/components/form/ResourceQuota/Project.vue +2 -0
  107. package/components/form/ResourceQuota/ProjectRow.vue +2 -0
  108. package/components/form/RuleSelector.vue +2 -0
  109. package/components/form/SecretSelector.vue +1 -0
  110. package/components/form/Security.vue +5 -2
  111. package/components/form/Select.vue +2 -1
  112. package/components/form/SelectOrCreateAuthSecret.vue +2 -0
  113. package/components/form/ServiceNameSelect.vue +2 -0
  114. package/components/form/ServicePorts.vue +2 -0
  115. package/components/form/ShellInput.vue +2 -0
  116. package/components/form/SimpleSecretSelector.vue +2 -0
  117. package/components/form/Taints.vue +2 -0
  118. package/components/form/Tolerations.vue +2 -0
  119. package/components/form/ValueFromResource.vue +2 -0
  120. package/components/form/WorkloadPorts.vue +5 -3
  121. package/components/form/__tests__/HookOption.test.ts +28 -0
  122. package/components/form/__tests__/LabeledSelect.test.ts +42 -0
  123. package/components/form/__tests__/Probe.test.ts +12 -0
  124. package/components/nav/Header.vue +26 -128
  125. package/components/nav/HeaderPageActionMenu.vue +151 -0
  126. package/components/nav/Jump.vue +2 -0
  127. package/components/nav/NamespaceFilter.vue +5 -1
  128. package/components/nav/Type.vue +28 -2
  129. package/components/nav/WindowManager/ContainerShell.vue +6 -12
  130. package/components/nav/WindowManager/index.vue +2 -0
  131. package/components/nav/__tests__/Type.test.ts +68 -24
  132. package/composables/useClickOutside.ts +81 -0
  133. package/config/product/cis.js +4 -3
  134. package/config/product/manager.js +1 -0
  135. package/config/router/routes.js +1 -1
  136. package/config/table-headers.js +0 -10
  137. package/config/uiplugins.js +186 -143
  138. package/config/version.js +10 -0
  139. package/detail/autoscaling.horizontalpodautoscaler/index.vue +2 -0
  140. package/detail/configmap.vue +2 -0
  141. package/detail/fleet.cattle.io.cluster.vue +2 -0
  142. package/detail/fleet.cattle.io.clustergroup.vue +2 -0
  143. package/detail/fleet.cattle.io.gitrepo.vue +2 -0
  144. package/detail/harvesterhci.io.management.cluster.vue +2 -0
  145. package/detail/management.cattle.io.roletemplate.vue +4 -4
  146. package/detail/management.cattle.io.user.vue +2 -0
  147. package/detail/namespace.vue +2 -0
  148. package/detail/networking.k8s.io.ingress.vue +1 -0
  149. package/detail/node.vue +2 -0
  150. package/detail/provisioning.cattle.io.cluster.vue +2 -0
  151. package/detail/secret.vue +2 -0
  152. package/detail/service.vue +2 -0
  153. package/detail/workload/index.vue +1 -1
  154. package/dialog/AddClusterMemberDialog.vue +2 -0
  155. package/dialog/AddCustomBadgeDialog.vue +3 -1
  156. package/dialog/AddProjectMemberDialog.vue +2 -0
  157. package/dialog/AddonConfigConfirmationDialog.vue +2 -0
  158. package/dialog/DeactivateDriverDialog.vue +2 -0
  159. package/dialog/DiagnosticTimingsDialog.vue +2 -0
  160. package/dialog/DrainNode.vue +2 -0
  161. package/dialog/ForceMachineRemoveDialog.vue +2 -0
  162. package/dialog/GenericPrompt.vue +2 -0
  163. package/dialog/RollbackWorkloadDialog.vue +2 -0
  164. package/dialog/RotateCertificatesDialog.vue +2 -0
  165. package/dialog/RotateEncryptionKeyDialog.vue +2 -0
  166. package/dialog/SaveAsRKETemplateDialog.vue +2 -0
  167. package/dialog/ScaleMachineDownDialog.vue +2 -0
  168. package/dialog/ScalePoolDownDialog.vue +2 -0
  169. package/dialog/SloDialog.vue +2 -0
  170. package/edit/auth/ldap/config.vue +2 -0
  171. package/edit/autoscaling.horizontalpodautoscaler/hpa-scaling-rule.vue +3 -3
  172. package/edit/autoscaling.horizontalpodautoscaler/index.vue +4 -2
  173. package/edit/catalog.cattle.io.clusterrepo.vue +2 -0
  174. package/edit/cis.cattle.io.clusterscan.vue +38 -18
  175. package/edit/cloudcredential.vue +2 -0
  176. package/edit/constraints.gatekeeper.sh.constraint/MatchKinds.vue +2 -0
  177. package/edit/constraints.gatekeeper.sh.constraint/NamespaceList.vue +2 -0
  178. package/edit/constraints.gatekeeper.sh.constraint/Scope.vue +2 -0
  179. package/edit/constraints.gatekeeper.sh.constraint/index.vue +2 -0
  180. package/edit/fleet.cattle.io.cluster.vue +2 -0
  181. package/edit/fleet.cattle.io.clustergroup.vue +4 -1
  182. package/edit/fleet.cattle.io.gitrepo.vue +2 -0
  183. package/edit/k8s.cni.cncf.io.networkattachmentdefinition.vue +2 -0
  184. package/edit/logging-flow/Match.vue +2 -0
  185. package/edit/logging-flow/index.vue +10 -8
  186. package/edit/logging.banzaicloud.io.output/providers/elasticsearch.vue +1 -1
  187. package/edit/logging.banzaicloud.io.output/providers/opensearch.vue +1 -1
  188. package/edit/logging.banzaicloud.io.output/providers/redis.vue +3 -3
  189. package/edit/management.cattle.io.fleetworkspace.vue +4 -1
  190. package/edit/management.cattle.io.project.vue +2 -0
  191. package/edit/management.cattle.io.roletemplate.vue +1 -1
  192. package/edit/monitoring.coreos.com.alertmanagerconfig/index.vue +1 -0
  193. package/edit/monitoring.coreos.com.alertmanagerconfig/types/email.vue +2 -0
  194. package/edit/monitoring.coreos.com.receiver/types/email.vue +1 -0
  195. package/edit/namespace.vue +1 -0
  196. package/edit/networking.k8s.io.ingress/Certificate.vue +2 -0
  197. package/edit/networking.k8s.io.ingress/DefaultBackend.vue +2 -1
  198. package/edit/networking.k8s.io.ingress/Rule.vue +1 -0
  199. package/edit/networking.k8s.io.ingress/RulePath.vue +20 -23
  200. package/edit/networking.k8s.io.ingress/index.vue +1 -0
  201. package/edit/networking.k8s.io.networkpolicy/PolicyRulePort.vue +1 -1
  202. package/edit/networking.k8s.io.networkpolicy/index.vue +1 -0
  203. package/edit/node.vue +2 -0
  204. package/edit/persistentvolumeclaim.vue +1 -0
  205. package/edit/policy.poddisruptionbudget.vue +3 -1
  206. package/edit/provisioning.cattle.io.cluster/CustomCommand.vue +2 -0
  207. package/edit/provisioning.cattle.io.cluster/Labels.vue +2 -0
  208. package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +2 -0
  209. package/edit/provisioning.cattle.io.cluster/import.vue +2 -0
  210. package/edit/provisioning.cattle.io.cluster/index.vue +2 -2
  211. package/edit/provisioning.cattle.io.cluster/rke2.vue +38 -13
  212. package/edit/provisioning.cattle.io.cluster/tabs/AddOnAdditionalManifest.vue +49 -0
  213. package/edit/provisioning.cattle.io.cluster/tabs/AddOnConfig.vue +32 -65
  214. package/edit/provisioning.cattle.io.cluster/tabs/AgentConfiguration.vue +2 -0
  215. package/edit/provisioning.cattle.io.cluster/tabs/Basics.vue +2 -0
  216. package/edit/provisioning.cattle.io.cluster/tabs/MachinePool.vue +2 -0
  217. package/edit/provisioning.cattle.io.cluster/tabs/etcd/S3Config.vue +2 -0
  218. package/edit/provisioning.cattle.io.cluster/tabs/etcd/index.vue +2 -0
  219. package/edit/provisioning.cattle.io.cluster/tabs/networking/index.vue +2 -0
  220. package/edit/provisioning.cattle.io.cluster/tabs/registries/RegistryConfigs.vue +2 -0
  221. package/edit/provisioning.cattle.io.cluster/tabs/registries/index.vue +1 -0
  222. package/edit/provisioning.cattle.io.cluster/tabs/upgrade/DrainOptions.vue +2 -0
  223. package/edit/resources.cattle.io.backup.vue +2 -2
  224. package/edit/secret/index.vue +2 -0
  225. package/edit/service.vue +2 -1
  226. package/edit/ui.cattle.io.navlink.vue +1 -0
  227. package/edit/workload/Job.vue +3 -2
  228. package/edit/workload/Upgrading.vue +1 -0
  229. package/edit/workload/index.vue +18 -7
  230. package/edit/workload/storage/ContainerMountPaths.vue +37 -97
  231. package/edit/workload/storage/awsElasticBlockStore.vue +1 -1
  232. package/edit/workload/storage/azureDisk.vue +1 -1
  233. package/edit/workload/storage/csi/driver.longhorn.io.vue +2 -0
  234. package/edit/workload/storage/ephemeralVolume/index.vue +2 -0
  235. package/edit/workload/storage/gcePersistentDisk.vue +1 -1
  236. package/edit/workload/storage/index.vue +38 -22
  237. package/edit/workload/storage/persistentVolumeClaim/index.vue +2 -0
  238. package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +1 -0
  239. package/edit/workload/storage/vsphereVolume.vue +1 -1
  240. package/initialize/install-components.js +0 -12
  241. package/initialize/install-plugins.js +4 -5
  242. package/machine-config/azure.vue +2 -0
  243. package/machine-config/generic.vue +2 -0
  244. package/machine-config/vmwarevsphere.vue +2 -0
  245. package/mixins/resource-manager.js +1 -1
  246. package/models/cis.cattle.io.clusterscan.js +17 -16
  247. package/models/cis.cattle.io.clusterscanprofile.js +17 -0
  248. package/models/management.cattle.io.cluster.js +1 -1
  249. package/models/management.cattle.io.user.js +3 -3
  250. package/models/provisioning.cattle.io.cluster.js +2 -1
  251. package/models/steve-schema.ts +1 -1
  252. package/models/workload.js +2 -1
  253. package/package.json +5 -7
  254. package/pages/c/_cluster/apps/charts/chart.vue +3 -1
  255. package/pages/c/_cluster/apps/charts/install.vue +5 -56
  256. package/pages/c/_cluster/fleet/index.vue +0 -1
  257. package/pages/c/_cluster/monitoring/alertmanagerconfig/_alertmanagerconfigid/receiver.vue +1 -0
  258. package/pages/c/_cluster/settings/DefaultLinksEditor.vue +2 -0
  259. package/pages/c/_cluster/settings/performance.vue +2 -2
  260. package/pages/c/_cluster/uiplugins/AddExtensionRepos.vue +11 -16
  261. package/pages/c/_cluster/uiplugins/CatalogList/CatalogLoadDialog.vue +2 -0
  262. package/pages/c/_cluster/uiplugins/CatalogList/CatalogUninstallDialog.vue +2 -0
  263. package/pages/c/_cluster/uiplugins/CatalogList/index.vue +2 -0
  264. package/pages/c/_cluster/uiplugins/DeveloperInstallDialog.vue +6 -3
  265. package/pages/c/_cluster/uiplugins/InstallDialog.vue +2 -0
  266. package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +7 -17
  267. package/pages/c/_cluster/uiplugins/UninstallDialog.vue +2 -0
  268. package/pages/c/_cluster/uiplugins/__tests__/AddExtensionRepos.test.ts +3 -6
  269. package/pages/c/_cluster/uiplugins/index.vue +93 -92
  270. package/pkg/vue.config.js +2 -0
  271. package/plugins/plugin.js +27 -19
  272. package/plugins/version.js +3 -13
  273. package/promptRemove/pod.vue +2 -0
  274. package/rancher-components/Form/LabeledInput/LabeledInput.vue +14 -8
  275. package/rancher-components/Form/Radio/RadioButton.vue +0 -1
  276. package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +17 -9
  277. package/rancher-components/StringList/StringList.vue +6 -15
  278. package/scripts/extension/bundle +1 -1
  279. package/scripts/extension/publish +174 -99
  280. package/scripts/publish-shell.sh +3 -4
  281. package/scripts/typegen.sh +1 -1
  282. package/store/catalog.js +0 -26
  283. package/store/growl.js +8 -5
  284. package/types/shell/index.d.ts +22 -0
  285. package/utils/cluster.js +9 -0
  286. package/utils/versions.ts +39 -0
  287. package/vue.config.js +5 -0
  288. package/components/form/PodSecurity.vue +0 -168
  289. package/components/formatter/Weight.vue +0 -147
  290. package/components/nuxt/nuxt-build-indicator.vue +0 -170
  291. package/components/nuxt/nuxt-child.js +0 -52
  292. package/components/nuxt/nuxt-error.vue +0 -128
  293. package/components/nuxt/nuxt-link.client.js +0 -17
  294. package/components/nuxt/nuxt-loading.vue +0 -165
  295. package/shell/types/shell/index.d.ts +0 -2
@@ -3,44 +3,36 @@ import semver from 'semver';
3
3
  // Version of the plugin API supported
4
4
  // here we inject the current shell version that we read in vue.config
5
5
  export const UI_EXTENSIONS_API_VERSION = process.env.UI_EXTENSIONS_API_VERSION;
6
+
6
7
  export const UI_PLUGIN_HOST_APP = 'rancher-manager';
7
8
 
8
9
  export const UI_PLUGIN_BASE_URL = '/v1/uiplugins';
9
-
10
10
  export const UI_PLUGIN_NAMESPACE = 'cattle-ui-plugin-system';
11
11
 
12
12
  // Annotation name and value that indicate a chart is a UI plugin
13
- export const UI_PLUGIN_ANNOTATION_NAME = 'catalog.cattle.io/ui-component';
14
- export const UI_PLUGIN_ANNOTATION_VALUE = 'plugins';
15
-
16
- export const UI_PLUGIN_OPERATOR_CRD_CHART_NAME = 'ui-plugin-operator-crd';
17
- export const UI_PLUGIN_OPERATOR_CHART_NAME = 'ui-plugin-operator';
18
-
19
- export const UI_PLUGIN_CHARTS = [
20
- UI_PLUGIN_OPERATOR_CHART_NAME,
21
- UI_PLUGIN_OPERATOR_CRD_CHART_NAME,
22
- ];
23
-
24
- // Expected chart repo name for the UI Plugins operator
25
- export const UI_PLUGIN_OPERATOR_REPO_NAME = 'rancher-charts';
26
-
27
- // Info for the Helm Chart Repository that we will add
28
- export const UI_PLUGINS_REPO_NAME = 'rancher-ui-plugins';
29
-
30
- export const UI_PLUGINS_REPO_URL = 'https://github.com/rancher/ui-plugin-charts';
31
- export const UI_PLUGINS_REPO_BRANCH = 'main';
32
-
33
- // Info for the Helm Chart Repo for Partner Extensions
34
- export const UI_PLUGINS_PARTNERS_REPO_NAME = 'partner-extensions';
35
-
36
- export const UI_PLUGINS_PARTNERS_REPO_URL = 'https://github.com/rancher/partner-extensions';
37
- export const UI_PLUGINS_PARTNERS_REPO_BRANCH = 'main';
38
-
39
- // Info for the Helm Chart Repo for Community Extensions
40
- export const UI_PLUGINS_COMMUNITY_REPO_NAME = 'community-extensions';
13
+ export const UI_PLUGIN_ANNOTATION = {
14
+ NAME: 'catalog.cattle.io/ui-component',
15
+ VALUE: 'plugins',
16
+ };
41
17
 
42
- export const UI_PLUGINS_COMMUNITY_REPO_URL = 'https://github.com/rancher/community-extensions';
43
- export const UI_PLUGINS_COMMUNITY_REPO_BRANCH = 'main';
18
+ // Info for the Helm Chart Repositories
19
+ export const UI_PLUGINS_REPOS = {
20
+ OFFICIAL: {
21
+ NAME: 'rancher-ui-plugins',
22
+ URL: 'https://github.com/rancher/ui-plugin-charts',
23
+ BRANCH: 'main',
24
+ },
25
+ PARTNERS: {
26
+ NAME: 'partner-extensions',
27
+ URL: 'https://github.com/rancher/partner-extensions',
28
+ BRANCH: 'main',
29
+ },
30
+ COMMUNITY: {
31
+ NAME: 'community-extensions',
32
+ URL: 'https://github.com/rancher/community-extensions',
33
+ BRANCH: 'main',
34
+ },
35
+ };
44
36
 
45
37
  // Chart annotations
46
38
  export const UI_PLUGIN_CHART_ANNOTATIONS = {
@@ -57,171 +49,222 @@ export const UI_PLUGIN_CHART_ANNOTATIONS = {
57
49
  export const UI_PLUGIN_LABELS = {
58
50
  CATALOG_IMAGE: 'catalog.cattle.io/ui-extensions-catalog-image',
59
51
  REPOSITORY: 'catalog.cattle.io/ui-extensions-repository',
60
- CATALOG: 'catalog.cattle.io/ui-extensions-catalog'
52
+ CATALOG: 'catalog.cattle.io/ui-extensions-catalog',
53
+ };
54
+
55
+ export const EXTENSIONS_INCOMPATIBILITY_TYPES = {
56
+ UI: 'uiVersion',
57
+ EXTENSIONS_API_MISSING: 'extensionsApiVersionMissing',
58
+ EXTENSIONS_API: 'extensionsApiVersion',
59
+ KUBE: 'kubeVersion',
60
+ HOST: 'host',
61
61
  };
62
62
 
63
- // Plugin Metadata properties
64
- export const UI_PLUGIN_METADATA = {
65
- RANCHER_VERSION: 'rancherVersion',
66
- EXTENSION_VERSION: 'extVersion',
67
- EXTENSIONS_HOST: 'host',
68
- DISPLAY_NAME: 'displayName',
63
+ export const EXTENSIONS_INCOMPATIBILITY_DATA = {
64
+ UI: {
65
+ type: EXTENSIONS_INCOMPATIBILITY_TYPES.UI,
66
+ cardMessageKey: 'plugins.incompatibleRancherVersion',
67
+ tooltipKey: 'plugins.info.requiresRancherVersion',
68
+ },
69
+ EXTENSIONS_API_MISSING: {
70
+ type: EXTENSIONS_INCOMPATIBILITY_TYPES.EXTENSIONS_API_MISSING,
71
+ cardMessageKey: 'plugins.incompatibleUiExtensionsApiVersionMissing',
72
+ tooltipKey: 'plugins.info.requiresExtensionApiVersionMissing',
73
+ },
74
+ EXTENSIONS_API: {
75
+ type: EXTENSIONS_INCOMPATIBILITY_TYPES.EXTENSIONS_API,
76
+ cardMessageKey: 'plugins.incompatibleUiExtensionsApiVersion',
77
+ tooltipKey: 'plugins.info.requiresExtensionApiVersion',
78
+ },
79
+ KUBE: {
80
+ type: EXTENSIONS_INCOMPATIBILITY_TYPES.KUBE,
81
+ cardMessageKey: 'plugins.incompatibleKubeVersion',
82
+ tooltipKey: 'plugins.info.requiresKubeVersion',
83
+ },
84
+ HOST: {
85
+ type: EXTENSIONS_INCOMPATIBILITY_TYPES.HOST,
86
+ cardMessageKey: 'plugins.incompatibleHost',
87
+ tooltipKey: 'plugins.info.requiresHost',
88
+ mainHost: UI_PLUGIN_HOST_APP,
89
+ },
69
90
  };
70
91
 
71
92
  export function isUIPlugin(chart) {
72
- return !!chart?.versions.find((v) => {
73
- return v.annotations && v.annotations[UI_PLUGIN_ANNOTATION_NAME] === UI_PLUGIN_ANNOTATION_VALUE;
74
- });
93
+ return !!chart?.versions.find((v) => v.annotations?.[UI_PLUGIN_ANNOTATION.NAME] === UI_PLUGIN_ANNOTATION.VALUE);
75
94
  }
76
95
 
77
96
  export function uiPluginHasAnnotation(chart, name, value) {
78
- return !!chart?.versions.find((v) => {
79
- return v.annotations && v.annotations[name] === value;
80
- });
97
+ return !!chart?.versions.find((v) => v.annotations?.[name] === value);
81
98
  }
82
99
 
83
100
  /**
84
- * Get value of the annotation from teh latest version for a chart
101
+ * Get value of the annotation from the latest version for a chart
85
102
  */
86
103
  export function uiPluginAnnotation(chart, name) {
87
- if (chart?.versions?.length > 0) {
88
- return chart.versions[0].annotations?.[name];
104
+ return chart?.versions?.[0]?.annotations?.[name];
105
+ }
106
+
107
+ /**
108
+ * Parse the Rancher version string
109
+ */
110
+ function parseRancherVersion(v) {
111
+ let parsedVersion = semver.coerce(v)?.version;
112
+ const splitArr = parsedVersion?.split('.');
113
+
114
+ // this is a scenario where we are on a "head" version of some sort... we can't infer the patch version from it
115
+ // so we apply a big patch version number to make sure we follow through with the minor
116
+ if (v.includes('-') && splitArr?.length === 3) {
117
+ parsedVersion = `${ splitArr[0] }.${ splitArr[1] }.999`;
89
118
  }
90
119
 
91
- return undefined;
120
+ return parsedVersion;
92
121
  }
93
122
 
94
- // i18n-uses plugins.error.generic, plugins.error.api, plugins.error.host
123
+ /**
124
+ * Check if a version is incompatible with the current environment
125
+ */
126
+ function checkIncompatibility(currentVersion, requiredVersion, incompatibilityData, returnObj, versionObj) {
127
+ if ((incompatibilityData.type === EXTENSIONS_INCOMPATIBILITY_TYPES.EXTENSIONS_API_MISSING && !requiredVersion) || (requiredVersion && !semver.satisfies(currentVersion, requiredVersion))) {
128
+ if (!returnObj) {
129
+ return false;
130
+ }
131
+ versionObj.isVersionCompatible = false;
132
+ versionObj.versionIncompatibilityData = { ...incompatibilityData, required: requiredVersion };
133
+
134
+ return versionObj;
135
+ }
95
136
 
96
- // Should we load a plugin, based on the metadata returned by the backend?
97
- // Returns error key string or false
98
- export function shouldNotLoadPlugin(plugin, rancherVersion, loadedPlugins) {
99
- if (!plugin.name || !plugin.version || !plugin.endpoint) {
137
+ return true;
138
+ }
139
+
140
+ // i18n-uses plugins.error.generic, plugins.error.api, plugins.error.host, plugins.error.kubeVersion, plugins.error.version, plugins.error.developerPkg, plugins.error.apiAnnotationMissing
141
+
142
+ /**
143
+ * Whether an extension should be loaded based on the metadata returned by the backend in the UIPlugins resource instance
144
+ * The output will be used to PREVENT loading of an extension that is already installed but isn't compatible with the system
145
+ *
146
+ * String output will display a message on the extension card to notify users on why the extension was not loaded
147
+ *
148
+ * @returns String | Boolean
149
+ */
150
+ export function shouldNotLoadPlugin(UIPluginResource, { rancherVersion, kubeVersion }, loadedPlugins) {
151
+ if (!UIPluginResource.name || !UIPluginResource.version || !UIPluginResource.endpoint) {
100
152
  return 'plugins.error.generic';
101
153
  }
102
154
 
103
- // Plugin specified a required extension API version
155
+ // Extension chart specified a required extension API version
104
156
  // we are propagating the annotations in pkg/package.json for any extension
105
157
  // inside the "spec.plugin.metadata" property of UIPlugin resource
106
- const requiredAPI = plugin.spec?.plugin?.metadata?.[UI_PLUGIN_CHART_ANNOTATIONS.EXTENSIONS_VERSION];
107
-
108
- if (requiredAPI && !semver.satisfies(UI_EXTENSIONS_API_VERSION, requiredAPI)) {
158
+ const requiredUiExtensionsVersion = UIPluginResource.metadata?.[UI_PLUGIN_CHART_ANNOTATIONS.EXTENSIONS_VERSION];
159
+ // semver.coerce will get rid of any suffix on the version numbering (-rc, -head, etc)
160
+ const parsedUiExtensionsApiVersion = semver.coerce(UI_EXTENSIONS_API_VERSION)?.version;
161
+ const parsedRancherVersion = rancherVersion ? parseRancherVersion(rancherVersion) : '';
162
+ const parsedKubeVersion = kubeVersion ? semver.coerce(kubeVersion)?.version : '';
163
+
164
+ if (!requiredUiExtensionsVersion) {
165
+ return 'plugins.error.apiAnnotationMissing';
166
+ } else if (requiredUiExtensionsVersion && !semver.satisfies(parsedUiExtensionsApiVersion, requiredUiExtensionsVersion)) {
109
167
  return 'plugins.error.api';
110
168
  }
111
169
 
112
170
  // Host application
113
- const requiredHost = plugin.metadata?.[UI_PLUGIN_METADATA.EXTENSIONS_HOST];
171
+ const requiredHost = UIPluginResource.metadata?.[UI_PLUGIN_CHART_ANNOTATIONS.EXTENSIONS_HOST];
114
172
 
115
173
  if (requiredHost && requiredHost !== UI_PLUGIN_HOST_APP) {
116
174
  return 'plugins.error.host';
117
175
  }
118
176
 
177
+ // Kube version
178
+ if (parsedKubeVersion) {
179
+ const requiredKubeVersion = UIPluginResource.metadata?.[UI_PLUGIN_CHART_ANNOTATIONS.KUBE_VERSION];
180
+
181
+ if (requiredKubeVersion && !semver.satisfies(parsedKubeVersion, requiredKubeVersion)) {
182
+ return 'plugins.error.kubeVersion';
183
+ }
184
+ }
185
+
119
186
  // Rancher version
120
- if (rancherVersion) {
121
- const requiredRancherVersion = plugin.metadata?.[UI_PLUGIN_METADATA.RANCHER_VERSION];
187
+ if (parsedRancherVersion) {
188
+ const requiredRancherVersion = UIPluginResource.metadata?.[UI_PLUGIN_CHART_ANNOTATIONS.RANCHER_VERSION];
122
189
 
123
- if (requiredRancherVersion && !semver.satisfies(rancherVersion, requiredRancherVersion)) {
190
+ if (requiredRancherVersion && !semver.satisfies(parsedRancherVersion, requiredRancherVersion)) {
124
191
  return 'plugins.error.version';
125
192
  }
126
193
  }
127
194
 
128
195
  // check if a builtin extension has been loaded before - improve developer experience
129
- const checkLoaded = loadedPlugins.find((p) => p?.name === plugin?.name);
196
+ const checkLoaded = loadedPlugins.find((p) => p?.name === UIPluginResource?.name);
130
197
 
131
198
  if (checkLoaded && checkLoaded.builtin) {
132
199
  return 'plugins.error.developerPkg';
133
200
  }
134
201
 
135
- if (plugin.metadata?.[UI_PLUGIN_LABELS.CATALOG]) {
202
+ if (UIPluginResource.metadata?.[UI_PLUGIN_LABELS.CATALOG]) {
136
203
  return true;
137
204
  }
138
205
 
139
206
  return false;
140
207
  }
141
208
 
142
- // Can a chart version be used for this Rancher (based on the annotations on the chart)?
143
- export function isSupportedChartVersion(versionsData) {
144
- const { version, rancherVersion, kubeVersion } = versionsData;
145
-
146
- // Plugin specified a required extension API version
147
- const requiredAPI = version.annotations?.[UI_PLUGIN_CHART_ANNOTATIONS.EXTENSIONS_VERSION];
148
-
149
- if (requiredAPI && !semver.satisfies(UI_EXTENSIONS_API_VERSION, requiredAPI)) {
150
- return false;
151
- }
152
-
153
- // Host application
154
- const requiredHost = version.annotations?.[UI_PLUGIN_CHART_ANNOTATIONS.EXTENSIONS_HOST];
155
-
156
- if (requiredHost && requiredHost !== UI_PLUGIN_HOST_APP) {
157
- return false;
158
- }
159
-
160
- // Rancher version
161
- if (rancherVersion) {
162
- const requiredRancherVersion = version.annotations?.[UI_PLUGIN_CHART_ANNOTATIONS.RANCHER_VERSION];
163
-
164
- if (requiredRancherVersion && !semver.satisfies(rancherVersion, requiredRancherVersion)) {
165
- return false;
166
- }
167
- }
168
-
169
- // Kube version
170
- if (kubeVersion) {
171
- const requiredKubeVersion = version.annotations?.[UI_PLUGIN_CHART_ANNOTATIONS.KUBE_VERSION];
172
-
173
- if (requiredKubeVersion && !semver.satisfies(kubeVersion, requiredKubeVersion)) {
174
- return false;
175
- }
176
- }
177
-
178
- return true;
179
- }
180
-
181
- export function isChartVersionAvailableForInstall(versionsData, returnObj = false) {
182
- const { version, rancherVersion, kubeVersion } = versionsData;
183
-
184
- const parsedRancherVersion = rancherVersion.split('-')?.[0];
185
- const regexHashString = new RegExp('^[A-Za-z0-9]{9}$');
186
- const isRancherVersionHashStringOrHead = regexHashString.test(rancherVersion) || rancherVersion.includes('head');
187
- const requiredUiVersion = version.annotations?.[UI_PLUGIN_CHART_ANNOTATIONS.UI_VERSION];
188
- const requiredKubeVersion = version.annotations?.[UI_PLUGIN_CHART_ANNOTATIONS.KUBE_VERSION];
189
- const versionObj = { ...version };
190
-
191
- versionObj.isCompatibleWithUi = true;
192
- versionObj.isCompatibleWithKubeVersion = true;
193
-
194
- // if it's a head version of Rancher, then we skip the validation and enable them all
195
- if (!isRancherVersionHashStringOrHead && requiredUiVersion && !semver.satisfies(parsedRancherVersion, requiredUiVersion)) {
196
- if (!returnObj) {
197
- return false;
198
- }
199
- versionObj.isCompatibleWithUi = false;
200
- versionObj.requiredUiVersion = requiredUiVersion;
201
-
202
- if (returnObj) {
203
- return versionObj;
204
- }
205
- }
206
-
207
- // check kube version
208
- if (kubeVersion && requiredKubeVersion && !semver.satisfies(kubeVersion, requiredKubeVersion)) {
209
- if (!returnObj) {
210
- return false;
211
- }
212
- versionObj.isCompatibleWithKubeVersion = false;
213
- versionObj.requiredKubeVersion = requiredKubeVersion;
214
-
215
- if (returnObj) {
216
- return versionObj;
209
+ /**
210
+ * Wether an extension version is available to be installed, based on the annotations present in the Helm chart version
211
+ * backend may not automatically "limit" a particular version but dashboard will disable that version for install with this check
212
+ *
213
+ * The output will be used to display a message on the extension card to notify users if a LATEST version of an extension is available but isn't compatible (cardMessageKey)
214
+ * The output will also disable the buttons in the slide-in panel with extension details, displaying a tooltip message with the reason (tooltipKey)
215
+ *
216
+ * @returns Boolean | Object
217
+ */
218
+ export function isSupportedChartVersion(versionData, returnObj = false) {
219
+ const { version, rancherVersion, kubeVersion } = versionData;
220
+ const versionObj = {
221
+ ...version, isVersionCompatible: true, versionIncompatibilityData: {}
222
+ };
223
+ const parsedRancherVersion = rancherVersion ? parseRancherVersion(rancherVersion) : '';
224
+ const parsedUiExtensionsApiVersion = semver.coerce(UI_EXTENSIONS_API_VERSION)?.version;
225
+
226
+ const checks = [
227
+ {
228
+ currentVersion: kubeVersion,
229
+ requiredVersion: version.annotations?.[UI_PLUGIN_CHART_ANNOTATIONS.KUBE_VERSION],
230
+ incompatibilityData: EXTENSIONS_INCOMPATIBILITY_DATA.KUBE,
231
+ },
232
+ {
233
+ currentVersion: parsedRancherVersion,
234
+ requiredVersion: version.annotations?.[UI_PLUGIN_CHART_ANNOTATIONS.RANCHER_VERSION],
235
+ incompatibilityData: EXTENSIONS_INCOMPATIBILITY_DATA.UI,
236
+ },
237
+ {
238
+ currentVersion: parsedRancherVersion,
239
+ requiredVersion: version.annotations?.[UI_PLUGIN_CHART_ANNOTATIONS.UI_VERSION],
240
+ incompatibilityData: EXTENSIONS_INCOMPATIBILITY_DATA.UI,
241
+ },
242
+ {
243
+ currentVersion: parsedUiExtensionsApiVersion,
244
+ requiredVersion: version.annotations?.[UI_PLUGIN_CHART_ANNOTATIONS.EXTENSIONS_VERSION],
245
+ incompatibilityData: EXTENSIONS_INCOMPATIBILITY_DATA.EXTENSIONS_API_MISSING,
246
+ },
247
+ {
248
+ currentVersion: parsedUiExtensionsApiVersion,
249
+ requiredVersion: version.annotations?.[UI_PLUGIN_CHART_ANNOTATIONS.EXTENSIONS_VERSION],
250
+ incompatibilityData: EXTENSIONS_INCOMPATIBILITY_DATA.EXTENSIONS_API,
251
+ },
252
+ {
253
+ currentVersion: UI_PLUGIN_HOST_APP,
254
+ requiredVersion: version.annotations?.[UI_PLUGIN_CHART_ANNOTATIONS.EXTENSIONS_HOST],
255
+ incompatibilityData: EXTENSIONS_INCOMPATIBILITY_DATA.HOST,
256
+ },
257
+ ];
258
+
259
+ for (const { currentVersion, requiredVersion, incompatibilityData } of checks) {
260
+ const result = checkIncompatibility(currentVersion, requiredVersion, incompatibilityData, returnObj, versionObj);
261
+
262
+ if (result !== true) {
263
+ return result;
217
264
  }
218
265
  }
219
266
 
220
- if (returnObj) {
221
- return versionObj;
222
- }
223
-
224
- return true;
267
+ return returnObj ? versionObj : true;
225
268
  }
226
269
 
227
270
  export function isChartVersionHigher(versionA, versionB) {
package/config/version.js CHANGED
@@ -2,6 +2,7 @@
2
2
  * Store version data retrieved from the backend /rancherversion API
3
3
  */
4
4
  let _versionData = { RancherPrime: 'false' };
5
+ let _kubeVersionData = {};
5
6
 
6
7
  export function isRancherPrime() {
7
8
  return _versionData.RancherPrime?.toLowerCase() === 'true';
@@ -15,3 +16,12 @@ export function setVersionData(v) {
15
16
  // Remove any properties on 'v' we don't want
16
17
  _versionData = JSON.parse(JSON.stringify(v));
17
18
  }
19
+
20
+ export function getKubeVersionData() {
21
+ return _kubeVersionData;
22
+ }
23
+
24
+ export function setKubeVersionData(v) {
25
+ // Remove any properties on 'v' we don't want
26
+ _kubeVersionData = JSON.parse(JSON.stringify(v));
27
+ }
@@ -10,6 +10,8 @@ import { findBy } from '@shell/utils/array';
10
10
  import { get } from '@shell/utils/object';
11
11
 
12
12
  export default {
13
+ emits: ['input'],
14
+
13
15
  components: {
14
16
  InfoBox,
15
17
  ResourceTabs,
@@ -5,6 +5,8 @@ import Tab from '@shell/components/Tabbed/Tab';
5
5
  import { base64Decode } from '@shell/utils/crypto';
6
6
 
7
7
  export default {
8
+ emits: ['input'],
9
+
8
10
  components: {
9
11
  ResourceTabs,
10
12
  DetailText,
@@ -10,6 +10,8 @@ import { FLEET as FLEET_LABELS } from '@shell/config/labels-annotations';
10
10
  export default {
11
11
  name: 'FleetDetailCluster',
12
12
 
13
+ emits: ['input'],
14
+
13
15
  components: {
14
16
  Loading,
15
17
  ResourcesSummary,
@@ -10,6 +10,8 @@ import { allHash } from '@shell/utils/promise';
10
10
  export default {
11
11
  name: 'DetailClusterGroup',
12
12
 
13
+ emits: ['input'],
14
+
13
15
  components: {
14
16
  Loading,
15
17
  ResourceTabs,
@@ -14,6 +14,8 @@ import { checkSchemasForFindAllHash } from '@shell/utils/auth';
14
14
  export default {
15
15
  name: 'DetailGitRepo',
16
16
 
17
+ emits: ['input'],
18
+
17
19
  components: {
18
20
  Loading,
19
21
  FleetResources,
@@ -6,6 +6,8 @@ import Tab from '@shell/components/Tabbed/Tab';
6
6
  import { allHash } from '@shell/utils/promise';
7
7
 
8
8
  export default {
9
+ emits: ['input'],
10
+
9
11
  components: {
10
12
  Loading,
11
13
  ResourceTabs,
@@ -1,11 +1,11 @@
1
1
  <script>
2
2
  import RoleDetailEdit from '@shell/components/auth/RoleDetailEdit';
3
3
 
4
- export default { components: { RoleDetailEdit } };
4
+ export default { emits: ['set-subtype'], components: { RoleDetailEdit } };
5
5
  </script>
6
6
  <template>
7
- <RoleDetailEdit
8
- v-bind="$attrs"
9
- @set-subtype="$emit('set-subtype', $event)"
7
+ <RoleDetailEdit
8
+ v-bind="$attrs"
9
+ @set-subtype="$emit('set-subtype', $event)"
10
10
  />
11
11
  </template>
@@ -8,6 +8,8 @@ import Loading from '@shell/components/Loading';
8
8
  import { NAME } from '@shell/config/table-headers';
9
9
 
10
10
  export default {
11
+ emits: ['input'],
12
+
11
13
  components: {
12
14
  Tab,
13
15
  ResourceTabs,
@@ -15,6 +15,8 @@ import {
15
15
  } from 'lodash';
16
16
 
17
17
  export default {
18
+ emits: ['input'],
19
+
18
20
  components: {
19
21
  ResourcesSummary,
20
22
  ResourceTable,
@@ -10,6 +10,7 @@ import { FilterArgs, PaginationParamFilter } from '@shell/types/store/pagination
10
10
 
11
11
  export default {
12
12
  name: 'CRUIngress',
13
+ emits: ['input'],
13
14
  components: {
14
15
  ResourceTabs,
15
16
  Rules,
package/detail/node.vue CHANGED
@@ -27,6 +27,8 @@ const NODE_METRICS_SUMMARY_URL = '/api/v1/namespaces/cattle-monitoring-system/se
27
27
  export default {
28
28
  name: 'DetailNode',
29
29
 
30
+ emits: ['input'],
31
+
30
32
  components: {
31
33
  Alert,
32
34
  ConsumptionGauge,
@@ -57,6 +57,8 @@ class EmptyCapiMachineDeployment extends CapiMachineDeployment {
57
57
  }
58
58
 
59
59
  export default {
60
+ emits: ['input'],
61
+
60
62
  components: {
61
63
  Loading,
62
64
  Banner,
package/detail/secret.vue CHANGED
@@ -18,6 +18,8 @@ const registryAddresses = [
18
18
  ];
19
19
 
20
20
  export default {
21
+ emits: ['input'],
22
+
21
23
  components: {
22
24
  ResourceTabs,
23
25
  DetailText,
@@ -14,6 +14,8 @@ import { POD } from '@shell/config/types';
14
14
  import { findBy } from '@shell/utils/array';
15
15
 
16
16
  export default {
17
+ emits: ['input'],
18
+
17
19
  components: {
18
20
  ResourceTable,
19
21
  ResourceTabs,
@@ -197,7 +197,7 @@ export default {
197
197
  },
198
198
 
199
199
  podHeaders() {
200
- return this.$store.getters['type-map/headersFor'](this.podSchema).filter((h) => h !== NAMESPACE_COL);
200
+ return this.$store.getters['type-map/headersFor'](this.podSchema).filter((h) => !h.name || h.name !== NAMESPACE_COL.name);
201
201
  },
202
202
 
203
203
  graphVarsWorkload() {
@@ -3,6 +3,8 @@ import { Card } from '@components/Card';
3
3
  import ClusterPermissionsEditor from '@shell/components/form/Members/ClusterPermissionsEditor';
4
4
 
5
5
  export default {
6
+ emits: ['close'],
7
+
6
8
  components: {
7
9
  Card,
8
10
  ClusterPermissionsEditor
@@ -17,7 +17,9 @@ import { _CREATE, _EDIT } from '@shell/config/query-params';
17
17
  import ClusterIconMenu from '@shell/components/ClusterIconMenu';
18
18
 
19
19
  export default {
20
- name: 'AddCustomBadgeDialog',
20
+ name: 'AddCustomBadgeDialog',
21
+ emits: ['close'],
22
+
21
23
  components: {
22
24
  Card,
23
25
  AsyncButton,
@@ -6,6 +6,8 @@ import Banner from '@components/Banner/Banner.vue';
6
6
  import { NORMAN } from '@shell/config/types';
7
7
 
8
8
  export default {
9
+ emits: ['close'],
10
+
9
11
  components: {
10
12
  Card,
11
13
  ProjectMemberEditor,
@@ -3,6 +3,8 @@ import AsyncButton from '@shell/components/AsyncButton';
3
3
  import { Card } from '@components/Card';
4
4
 
5
5
  export default {
6
+ emits: ['close'],
7
+
6
8
  components: {
7
9
  Card,
8
10
  AsyncButton,
@@ -7,6 +7,8 @@ import { resourceNames } from '@shell/utils/string';
7
7
  import { mapGetters } from 'vuex';
8
8
 
9
9
  export default {
10
+ emits: ['close'],
11
+
10
12
  components: {
11
13
  Card,
12
14
  AsyncButton,
@@ -6,6 +6,8 @@ import { Card } from '@components/Card';
6
6
  import { Banner } from '@components/Banner';
7
7
 
8
8
  export default {
9
+ emits: ['close'],
10
+
9
11
  components: {
10
12
  Card,
11
13
  AsyncButton,
@@ -9,6 +9,8 @@ import { _EDIT, _VIEW } from '@shell/config/query-params';
9
9
  import { exceptionToErrorsArray } from '@shell/utils/error';
10
10
 
11
11
  export default {
12
+ emits: ['close'],
13
+
12
14
  components: {
13
15
  AsyncButton,
14
16
  Banner,