@rancher/shell 0.3.4 → 0.3.6

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 (289) hide show
  1. package/assets/images/providers/outscale.svg +19 -0
  2. package/assets/styles/app.scss +1 -1
  3. package/assets/styles/base/_basic.scss +18 -0
  4. package/assets/styles/base/_mixins.scss +0 -11
  5. package/assets/styles/base/_variables.scss +2 -4
  6. package/assets/styles/fonts/_fontstack.scss +11 -11
  7. package/assets/styles/global/_button.scss +12 -2
  8. package/assets/styles/vendor/vue-js-modal.scss +3 -3
  9. package/assets/translations/en-us.yaml +113 -22
  10. package/assets/translations/zh-hans.yaml +113 -24
  11. package/babel.config.js +13 -0
  12. package/chart/gatekeeper.vue +78 -0
  13. package/chart/istio.vue +135 -112
  14. package/chart/logging/index.vue +13 -4
  15. package/chart/monitoring/index.vue +15 -5
  16. package/chart/monitoring/steps/uninstall-v1.vue +2 -2
  17. package/chart/rancher-backup/index.vue +10 -3
  18. package/cloud-credential/aws.vue +1 -1
  19. package/cloud-credential/digitalocean.vue +1 -1
  20. package/cloud-credential/gcp.vue +1 -1
  21. package/cloud-credential/generic.vue +2 -2
  22. package/cloud-credential/linode.vue +1 -1
  23. package/cloud-credential/pnap.vue +1 -1
  24. package/components/ActionMenu.vue +3 -4
  25. package/components/AssignTo.vue +1 -1
  26. package/components/AsyncButton.vue +1 -1
  27. package/components/BannerGraphic.vue +1 -1
  28. package/components/BrandImage.vue +1 -4
  29. package/components/ButtonDropdown.vue +2 -3
  30. package/components/Carousel.vue +85 -37
  31. package/components/ChartPsp.vue +76 -0
  32. package/components/CruResource.vue +6 -2
  33. package/components/DashboardMetrics.vue +12 -10
  34. package/components/DetailText.vue +1 -1
  35. package/components/DisableAuthProviderModal.vue +1 -1
  36. package/components/EmberPage.vue +1 -1
  37. package/components/EtcdInfoBanner.vue +12 -7
  38. package/components/ExplorerMembers.vue +101 -6
  39. package/components/ExplorerProjectsNamespaces.vue +46 -3
  40. package/components/FileDiff.vue +6 -7
  41. package/components/GrafanaDashboard.vue +27 -23
  42. package/components/LazyImage.vue +10 -12
  43. package/components/LogItem.vue +1 -1
  44. package/components/Markdown.vue +1 -1
  45. package/components/PromptRemove.vue +2 -2
  46. package/components/PromptRestore.vue +1 -1
  47. package/components/ResourceDetail/Masthead.vue +16 -0
  48. package/components/ResourceDetail/index.vue +21 -4
  49. package/components/ResourceList/index.vue +1 -1
  50. package/components/ResourceTable.vue +4 -1
  51. package/components/SingleClusterInfo.vue +2 -2
  52. package/components/SortableTable/THead.vue +1 -1
  53. package/components/SortableTable/index.vue +28 -13
  54. package/components/SortableTable/selection.js +58 -50
  55. package/components/Wizard.vue +4 -2
  56. package/components/__tests__/AsyncButton.test.ts +3 -1
  57. package/components/__tests__/ChartPsp.test.ts +75 -0
  58. package/components/__tests__/CruResource.test.ts +3 -1
  59. package/components/auth/Principal.vue +1 -1
  60. package/components/auth/RoleDetailEdit.vue +2 -2
  61. package/components/fleet/FleetBundles.vue +3 -1
  62. package/components/fleet/FleetClusters.vue +1 -2
  63. package/components/fleet/FleetIntro.vue +9 -1
  64. package/components/fleet/FleetNoWorkspaces.vue +62 -0
  65. package/components/fleet/FleetSummary.vue +7 -1
  66. package/components/form/HookOption.vue +14 -10
  67. package/components/form/LabeledSelect.vue +14 -11
  68. package/components/form/Labels.vue +32 -27
  69. package/components/form/MatchExpressions.vue +19 -4
  70. package/components/form/Members/ClusterPermissionsEditor.vue +32 -7
  71. package/components/form/NameNsDescription.vue +32 -46
  72. package/components/form/ProjectMemberEditor.vue +46 -21
  73. package/components/form/ResourceSelector.vue +1 -1
  74. package/components/form/SecretSelector.vue +5 -1
  75. package/components/form/ServiceNameSelect.vue +1 -1
  76. package/components/form/SimpleSecretSelector.vue +9 -9
  77. package/components/form/Tolerations.vue +4 -1
  78. package/components/form/ValueFromResource.vue +14 -9
  79. package/components/form/WorkloadPorts.vue +2 -2
  80. package/components/form/__tests__/LabeledSelect.test.ts +138 -0
  81. package/components/form/__tests__/NameNsDescription.ts +59 -0
  82. package/components/formatter/InternalExternalIP.vue +6 -0
  83. package/components/formatter/InvolvedObjectLink.vue +54 -0
  84. package/components/formatter/Link.vue +20 -4
  85. package/components/formatter/LinkName.vue +6 -1
  86. package/components/formatter/ServiceTargets.vue +1 -1
  87. package/components/formatter/WorkloadHealthScale.vue +8 -2
  88. package/components/nav/Group.vue +2 -2
  89. package/components/nav/NamespaceFilter.vue +23 -11
  90. package/components/nav/TopLevelMenu.vue +2 -4
  91. package/components/nav/Type.vue +1 -1
  92. package/components/nav/WorkspaceSwitcher.vue +46 -5
  93. package/components/nuxt/nuxt-build-indicator.vue +143 -0
  94. package/components/nuxt/nuxt-child.js +122 -0
  95. package/components/nuxt/nuxt-error.vue +98 -0
  96. package/components/nuxt/nuxt-link.client.js +98 -0
  97. package/components/nuxt/nuxt-link.server.js +16 -0
  98. package/components/nuxt/nuxt-loading.vue +154 -0
  99. package/components/nuxt/nuxt.js +101 -0
  100. package/config/labels-annotations.js +17 -0
  101. package/config/middleware.js +12 -0
  102. package/config/product/auth.js +3 -2
  103. package/config/product/explorer.js +34 -6
  104. package/config/product/fleet.js +2 -0
  105. package/config/query-params.js +1 -0
  106. package/config/router.js +414 -0
  107. package/config/store.js +181 -0
  108. package/config/table-headers.js +54 -12
  109. package/config/types.js +18 -8
  110. package/config/uiplugins.js +30 -0
  111. package/content/docs/en-us/whats-new.md +10 -0
  112. package/content/docs/zh-hans/whats-new.md +11 -1
  113. package/core/plugin-routes.ts +23 -0
  114. package/core/plugin.ts +4 -2
  115. package/core/types.ts +258 -1
  116. package/creators/app/app.package.json +2 -1
  117. package/creators/app/files/.eslintrc.js +1 -1
  118. package/creators/app/files/babel.config.js +1 -18
  119. package/creators/app/files/tsconfig.json +0 -1
  120. package/creators/app/files/vue.config.js +6 -0
  121. package/creators/app/init +5 -5
  122. package/creators/pkg/files/.github/workflows/build-extension.yml +110 -0
  123. package/creators/pkg/files/tsconfig.json +0 -1
  124. package/creators/pkg/init +35 -4
  125. package/creators/pkg/pkg.package.json +3 -3
  126. package/creators/update/init +1 -1
  127. package/detail/constraints.gatekeeper.sh.constraint.vue +34 -17
  128. package/detail/fleet.cattle.io.clustergroup.vue +7 -1
  129. package/detail/fleet.cattle.io.gitrepo.vue +19 -11
  130. package/detail/harvesterhci.io.management.cluster.vue +3 -3
  131. package/detail/provisioning.cattle.io.cluster.vue +54 -12
  132. package/detail/workload/index.vue +3 -3
  133. package/dialog/AddClusterMemberDialog.vue +1 -1
  134. package/dialog/AddProjectMemberDialog.vue +2 -2
  135. package/dialog/AddonConfigConfirmationDialog.vue +27 -15
  136. package/dialog/DiagnosticTimingsDialog.vue +1 -1
  137. package/dialog/ForceMachineRemoveDialog.vue +1 -1
  138. package/dialog/GenericPrompt.vue +18 -6
  139. package/dialog/RotateEncryptionKeyDialog.vue +1 -1
  140. package/dialog/SaveAsRKETemplateDialog.vue +1 -1
  141. package/dialog/ScaleMachineDownDialog.vue +1 -1
  142. package/edit/auth/github.vue +8 -8
  143. package/edit/auth/googleoauth.vue +5 -5
  144. package/edit/auth/ldap/index.vue +1 -1
  145. package/edit/auth/oidc.vue +1 -1
  146. package/edit/auth/saml.vue +1 -1
  147. package/edit/cis.cattle.io.clusterscan.vue +1 -1
  148. package/edit/fleet.cattle.io.clustergroup.vue +6 -4
  149. package/edit/fleet.cattle.io.gitrepo.vue +32 -4
  150. package/edit/helm.cattle.io.projecthelmchart.vue +5 -1
  151. package/edit/logging.banzaicloud.io.output/index.vue +18 -5
  152. package/edit/logging.banzaicloud.io.output/providers/loki.vue +1 -0
  153. package/edit/management.cattle.io.fleetworkspace.vue +141 -6
  154. package/edit/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +4 -1
  155. package/edit/management.cattle.io.setting.vue +1 -1
  156. package/edit/monitoring.coreos.com.alertmanagerconfig/types/webhook.vue +2 -2
  157. package/edit/monitoring.coreos.com.receiver/tls.vue +18 -18
  158. package/edit/monitoring.coreos.com.receiver/types/webhook.banner.vue +4 -4
  159. package/edit/monitoring.coreos.com.receiver/types/webhook.vue +1 -1
  160. package/edit/namespace.vue +14 -10
  161. package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +126 -45
  162. package/edit/networking.k8s.io.networkpolicy/index.vue +1 -1
  163. package/edit/provisioning.cattle.io.cluster/MachinePool.vue +21 -4
  164. package/edit/provisioning.cattle.io.cluster/RegistryConfigs.vue +1 -0
  165. package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +202 -2
  166. package/edit/provisioning.cattle.io.cluster/import.vue +23 -25
  167. package/edit/provisioning.cattle.io.cluster/rke2.vue +344 -102
  168. package/edit/resources.cattle.io.backup.vue +1 -1
  169. package/edit/service.vue +1 -1
  170. package/edit/storage.k8s.io.storageclass/provisioners/driver.harvesterhci.io.vue +2 -2
  171. package/edit/workload/__tests__/Job.test.ts +3 -1
  172. package/edit/workload/index.vue +8 -3
  173. package/edit/workload/mixins/workload.js +22 -7
  174. package/edit/workload/storage/Mount.vue +3 -3
  175. package/initialize/App.js +206 -0
  176. package/initialize/client.js +863 -0
  177. package/initialize/index.js +364 -0
  178. package/layouts/default.vue +7 -3
  179. package/layouts/standalone.vue +13 -0
  180. package/list/catalog.cattle.io.clusterrepo.vue +1 -0
  181. package/list/fleet.cattle.io.bundle.vue +6 -3
  182. package/list/fleet.cattle.io.clusterregistrationtoken.vue +3 -1
  183. package/list/fleet.cattle.io.gitrepo.vue +44 -5
  184. package/list/management.cattle.io.fleetworkspace.vue +45 -0
  185. package/list/node.vue +69 -16
  186. package/list/provisioning.cattle.io.cluster.vue +30 -1
  187. package/list/rbac.authorization.k8s.io.clusterrolebinding.vue +48 -0
  188. package/list/workload.vue +6 -4
  189. package/machine-config/azure.vue +97 -38
  190. package/middleware/authenticated.js +34 -0
  191. package/mixins/chart.js +101 -2
  192. package/mixins/fetch.client.js +95 -0
  193. package/mixins/fetch.server.js +73 -0
  194. package/mixins/labeled-form-element.ts +2 -2
  195. package/mixins/resource-fetch.js +2 -2
  196. package/models/apps.statefulset.js +28 -0
  197. package/models/cluster/node.js +23 -2
  198. package/models/cluster.x-k8s.io.machine.js +4 -2
  199. package/models/clusterroletemplatebinding.js +7 -0
  200. package/models/constraints.gatekeeper.sh.constraint.js +46 -0
  201. package/models/fleet.cattle.io.cluster.js +19 -10
  202. package/models/fleet.cattle.io.gitrepo.js +7 -2
  203. package/models/management.cattle.io.cluster.js +1 -1
  204. package/models/management.cattle.io.fleetworkspace.js +12 -0
  205. package/models/management.cattle.io.gitreporestriction.js +5 -0
  206. package/models/management.cattle.io.podsecurityadmissionconfigurationtemplate.js +3 -0
  207. package/models/pod.js +4 -0
  208. package/models/provisioning.cattle.io.cluster.js +7 -5
  209. package/models/rbac.authorization.k8s.io.clusterrolebinding.js +16 -0
  210. package/models/rbac.authorization.k8s.io.rolebinding.js +16 -0
  211. package/package.json +13 -21
  212. package/pages/auth/setup.vue +2 -2
  213. package/pages/c/_cluster/apps/charts/__tests__/install.helper.test.ts +33 -0
  214. package/pages/c/_cluster/apps/charts/chart.vue +4 -4
  215. package/pages/c/_cluster/apps/charts/install.helpers.js +26 -0
  216. package/pages/c/_cluster/apps/charts/install.vue +98 -102
  217. package/pages/c/_cluster/explorer/EventsTable.vue +5 -19
  218. package/pages/c/_cluster/explorer/index.vue +29 -25
  219. package/pages/c/_cluster/explorer/tools/index.vue +8 -8
  220. package/pages/c/_cluster/fleet/index.vue +95 -34
  221. package/pages/c/_cluster/gatekeeper/index.vue +1 -1
  222. package/pages/c/_cluster/istio/index.vue +5 -5
  223. package/pages/c/_cluster/manager/cloudCredential/index.vue +1 -1
  224. package/pages/c/_cluster/monitoring/index.vue +7 -0
  225. package/pages/c/_cluster/uiplugins/InstallDialog.vue +8 -8
  226. package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +20 -7
  227. package/pages/c/_cluster/uiplugins/index.vue +49 -17
  228. package/pages/diagnostic.vue +32 -25
  229. package/pages/home.vue +9 -4
  230. package/pages/index.vue +10 -1
  231. package/pages/rio/mesh.vue +1 -2
  232. package/pkg/tsconfig.json +0 -1
  233. package/plugins/clean-html-directive.js +34 -0
  234. package/plugins/dashboard-store/actions.js +32 -9
  235. package/plugins/dashboard-store/index.js +1 -1
  236. package/plugins/dashboard-store/mutations.js +5 -2
  237. package/plugins/dashboard-store/resource-class.js +8 -1
  238. package/plugins/plugin.js +0 -14
  239. package/plugins/portal-vue.js +4 -0
  240. package/plugins/steve/mutations.js +3 -2
  241. package/plugins/steve/steve-description-class.js +5 -1
  242. package/plugins/steve/subscribe.js +63 -54
  243. package/plugins/steve-create-worker.js +14 -0
  244. package/promptRemove/management.cattle.io.globalrole.vue +2 -2
  245. package/promptRemove/management.cattle.io.project.vue +2 -2
  246. package/promptRemove/management.cattle.io.roletemplate.vue +2 -2
  247. package/promptRemove/pod.vue +1 -1
  248. package/public/index.html +65 -0
  249. package/rancher-components/components/Banner/Banner.test.ts +7 -1
  250. package/rancher-components/components/Banner/Banner.vue +2 -1
  251. package/rancher-components/components/Form/Checkbox/Checkbox.vue +2 -0
  252. package/rancher-components/components/Form/Radio/RadioButton.test.ts +31 -0
  253. package/rancher-components/components/Form/Radio/RadioButton.vue +14 -3
  254. package/scripts/build-pkg.sh +1 -0
  255. package/scripts/clean +6 -0
  256. package/scripts/extension/bundle +58 -0
  257. package/scripts/extension/helmpatch +89 -0
  258. package/scripts/extension/publish +333 -0
  259. package/scripts/serve-pkgs +6 -2
  260. package/scripts/test-plugins-build.sh +4 -0
  261. package/store/__tests__/index.test.ts +110 -0
  262. package/store/index.js +145 -58
  263. package/store/type-map.js +6 -2
  264. package/tsconfig.default.json +36 -0
  265. package/tsconfig.json +23 -0
  266. package/types/rancher/index.d.ts +2 -0
  267. package/types/shell/index.d.ts +466 -320
  268. package/utils/__tests__/grafana.test.ts +44 -0
  269. package/utils/__tests__/string.test.ts +12 -0
  270. package/utils/auth.js +65 -0
  271. package/utils/axios.js +190 -0
  272. package/utils/cookie-universal-nuxt.js +10 -0
  273. package/utils/dom.js +15 -0
  274. package/utils/grafana.js +35 -16
  275. package/utils/monitoring.js +2 -1
  276. package/utils/nuxt.js +659 -0
  277. package/utils/position.js +5 -8
  278. package/utils/router.scrollBehavior.js +80 -0
  279. package/utils/select.js +1 -3
  280. package/utils/socket.js +1 -0
  281. package/utils/string.js +13 -0
  282. package/utils/time.js +9 -0
  283. package/vue.config.js +690 -0
  284. package/chart/rancher-alerting-drivers.vue +0 -53
  285. package/chart/rancher-gatekeeper.vue +0 -37
  286. package/creators/app/files/nuxt.config.js +0 -6
  287. package/models/management.cattle.io.podsecurityadmissionconfigurationtemplate.ts +0 -4
  288. package/nuxt.config.js +0 -798
  289. package/plugins/dashboard-store/extensions.js +0 -22
@@ -481,6 +481,14 @@ export const REASON = {
481
481
  value: 'reason',
482
482
  sort: ['reason']
483
483
  };
484
+ export const OBJECT = {
485
+ name: 'object',
486
+ labelKey: 'tableHeaders.object',
487
+ value: 'involvedObject',
488
+ sort: ['involvedObject.kind', 'involvedObject.name'],
489
+ canBeVariable: true,
490
+ formatter: 'InvolvedObjectLink',
491
+ };
484
492
  export const RECLAIM_POLICY = {
485
493
  name: 'reclaimPolicy',
486
494
  labelKey: 'tableHeaders.reclaimPolicy',
@@ -710,7 +718,7 @@ export const APP_SUMMARY = {
710
718
 
711
719
  export const CONSTRAINT_VIOLATION_CONSTRAINT_LINK = {
712
720
  name: 'Constraint',
713
- label: 'Constraint',
721
+ labelKey: 'tableHeaders.constraint',
714
722
  value: 'constraintLink',
715
723
  sort: `constraintLink.text`,
716
724
  formatter: 'Link',
@@ -719,30 +727,39 @@ export const CONSTRAINT_VIOLATION_CONSTRAINT_LINK = {
719
727
 
720
728
  export const CONSTRAINT_VIOLATION_RESOURCE_LINK = {
721
729
  name: 'Name',
722
- label: 'Name',
730
+ labelKey: 'tableHeaders.name',
723
731
  value: 'resourceLink',
724
732
  sort: `resourceLink.text`,
733
+ search: `resourceLink.text`,
725
734
  formatter: 'Link',
726
735
  formatterOpts: { options: { internal: true } },
727
736
  };
728
737
 
729
738
  export const CONSTRAINT_VIOLATION_TYPE = {
730
- name: 'Type',
731
- label: 'Type',
732
- value: `constraint.kind`,
733
- sort: `constraint.kind`
739
+ name: 'Type',
740
+ labelKey: 'tableHeaders.type',
741
+ value: `kind`,
742
+ sort: `kind`
743
+ };
744
+
745
+ export const CONSTRAINT_VIOLATION_NAMESPACE = {
746
+ name: 'Namespace',
747
+ labelKey: 'tableHeaders.namespace',
748
+ value: `namespace`,
749
+ sort: `namespace`,
750
+ search: `namespace`,
734
751
  };
735
752
 
736
753
  export const CONSTRAINT_VIOLATION_MESSAGE = {
737
- name: 'Message',
738
- label: 'Message',
739
- value: `message`,
740
- sort: `message`
754
+ name: 'Message',
755
+ labelKey: 'tableHeaders.message',
756
+ value: `message`,
757
+ sort: `message`
741
758
  };
742
759
 
743
760
  export const CONSTRAINT_VIOLATION_TEMPLATE_LINK = {
744
761
  name: 'TemplateLink',
745
- label: 'Template',
762
+ labelKey: 'tableHeaders.template',
746
763
  value: `templateLink`,
747
764
  sort: `templateLink.text`,
748
765
  formatter: 'Link',
@@ -751,7 +768,7 @@ export const CONSTRAINT_VIOLATION_TEMPLATE_LINK = {
751
768
 
752
769
  export const CONSTRAINT_VIOLATION_COUNT = {
753
770
  name: 'Count',
754
- label: 'Count',
771
+ labelKey: 'tableHeaders.count',
755
772
  value: `count`,
756
773
  sort: `count`,
757
774
  formatter: 'QualityText',
@@ -952,3 +969,28 @@ export const FLEET_BUNDLE_TYPE = {
952
969
  sort: ['bundleType'],
953
970
  width: 100,
954
971
  };
972
+
973
+ // export const RBAC_ROLE = {
974
+ // name: 'role',
975
+ // value: 'roleRef.name',
976
+ // sort: ['roleRef.name'],
977
+ // };
978
+
979
+ export const RBAC_USERS = {
980
+ name: 'users',
981
+ sort: ['users'],
982
+ getValue: row => row.users?.map(({ name }) => name),
983
+ };
984
+
985
+ export const RBAC_GROUPS = {
986
+ name: 'groups',
987
+ sort: ['groups'],
988
+
989
+ getValue: row => row.groups?.map(({ name }) => name),
990
+ };
991
+
992
+ export const RBAC_SERVICE_ACCOUNTS = {
993
+ name: 'serviceAccount',
994
+ sort: ['serviceAccount'],
995
+ getValue: row => row.serviceAccounts?.map(({ name }) => name),
996
+ };
package/config/types.js CHANGED
@@ -54,6 +54,7 @@ export const NETWORK_POLICY = 'networking.k8s.io.networkpolicy';
54
54
  export const POD = 'pod';
55
55
  export const POD_DISRUPTION_BUDGET = 'policy.poddisruptionbudget';
56
56
  export const PSP = 'policy.podsecuritypolicy';
57
+ export const PSPS = 'policy.podsecuritypolicies';
57
58
  export const PV = 'persistentvolume';
58
59
  export const PVC = 'persistentvolumeclaim';
59
60
  export const RESOURCE_QUOTA = 'resourcequota';
@@ -65,6 +66,8 @@ export const STORAGE_CLASS = 'storage.k8s.io.storageclass';
65
66
  export const CSI_DRIVER = 'storage.k8s.io.csidriver';
66
67
  export const OBJECT_META = 'io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta';
67
68
  export const NETWORK_ATTACHMENT = 'k8s.cni.cncf.io.networkattachmentdefinition';
69
+ export const USER = 'user';
70
+ export const GROUP = 'group';
68
71
 
69
72
  export const RBAC = {
70
73
  ROLE: 'rbac.authorization.k8s.io.role',
@@ -92,6 +95,11 @@ const {
92
95
 
93
96
  export const SCALABLE_WORKLOAD_TYPES = scalableWorkloads;
94
97
 
98
+ export const LIST_WORKLOAD_TYPES = {
99
+ ...WORKLOAD_TYPES,
100
+ POD
101
+ };
102
+
95
103
  export const METRIC = {
96
104
  NODE: 'metrics.k8s.io.nodemetrics',
97
105
  POD: 'metrics.k8s.io.podmetrics',
@@ -197,14 +205,16 @@ export const CAPI = {
197
205
  // Base: /k8s/clusters/<id>/v1/
198
206
 
199
207
  export const FLEET = {
200
- BUNDLE: 'fleet.cattle.io.bundle',
201
- BUNDLE_DEPLOYMENT: 'fleet.cattle.io.bundledeployment',
202
- CLUSTER: 'fleet.cattle.io.cluster',
203
- CLUSTER_GROUP: 'fleet.cattle.io.clustergroup',
204
- DASHBOARD: 'fleet.cattle.io.dashboard',
205
- GIT_REPO: 'fleet.cattle.io.gitrepo',
206
- WORKSPACE: 'management.cattle.io.fleetworkspace',
207
- TOKEN: 'fleet.cattle.io.clusterregistrationtoken',
208
+ BUNDLE: 'fleet.cattle.io.bundle',
209
+ BUNDLE_DEPLOYMENT: 'fleet.cattle.io.bundledeployment',
210
+ CLUSTER: 'fleet.cattle.io.cluster',
211
+ CLUSTER_GROUP: 'fleet.cattle.io.clustergroup',
212
+ DASHBOARD: 'fleet.cattle.io.dashboard',
213
+ GIT_REPO: 'fleet.cattle.io.gitrepo',
214
+ WORKSPACE: 'management.cattle.io.fleetworkspace',
215
+ TOKEN: 'fleet.cattle.io.clusterregistrationtoken',
216
+ BUNDLE_NAMESPACE_MAPPING: 'fleet.cattle.io.bundlenamespacemapping',
217
+ GIT_REPO_RESTRICTION: 'fleet.cattle.io.gitreporestriction'
208
218
  };
209
219
 
210
220
  export const GATEKEEPER = {
@@ -33,6 +33,7 @@ export const UI_PLUGINS_REPO_BRANCH = 'main';
33
33
  export const UI_PLUGIN_CHART_ANNOTATIONS = {
34
34
  RANCHER_VERSION: 'catalog.cattle.io/rancher-version',
35
35
  EXTENSIONS_VERSION: 'catalog.cattle.io/ui-extensions-version',
36
+ UI_VERSION: 'catalog.cattle.io/ui-version',
36
37
  EXTENSIONS_HOST: 'catalog.cattle.io/ui-extensions-host',
37
38
  DISPLAY_NAME: 'catalog.cattle.io/display-name',
38
39
  };
@@ -128,3 +129,32 @@ export function isSupportedChartVersion(chartVersion, rancherVersion) {
128
129
 
129
130
  return true;
130
131
  }
132
+
133
+ export function isChartVersionAvailableForInstall(version, rancherVersion, returnObj = false) {
134
+ const parsedRancherVersion = rancherVersion.split('-')?.[0];
135
+ const regexHashString = new RegExp('^[A-Za-z0-9]{9}$');
136
+ const isRancherVersionHashString = regexHashString.test(rancherVersion);
137
+ const requiredUiVersion = version.annotations?.[UI_PLUGIN_CHART_ANNOTATIONS.UI_VERSION];
138
+ const versionObj = { ...version };
139
+
140
+ versionObj.isCompatibleWithUi = true;
141
+
142
+ // if it's a head version of Rancher, then we skip the validation and enable them all
143
+ if (!isRancherVersionHashString && requiredUiVersion && !semver.satisfies(parsedRancherVersion, requiredUiVersion)) {
144
+ if (!returnObj) {
145
+ return false;
146
+ }
147
+ versionObj.isCompatibleWithUi = false;
148
+ versionObj.requiredUiVersion = requiredUiVersion;
149
+ }
150
+
151
+ if (returnObj) {
152
+ return versionObj;
153
+ }
154
+
155
+ return true;
156
+ }
157
+
158
+ export function isChartVersionHigher(versionA, versionB) {
159
+ return semver.gt(versionA, versionB);
160
+ }
@@ -2,6 +2,16 @@
2
2
  title: What's New in 2.7
3
3
  ---
4
4
 
5
+ ## New in 2.7.2
6
+
7
+ ### Kubernetes 1.25 and PSAs
8
+
9
+ - Kubernetes 1.25 GA takes PSAs (Pod Security Admissions) out of beta. PSAs replace the former PSP (Pod Security Policy) setup, which is a major change that impacts upgrades of Kubernetes.
10
+
11
+ ## New in 2.7.1
12
+
13
+ - This was a security release to address a few CVEs and other bugs. Please see https://github.com/rancher/rancher/releases/tag/v2.7.1 for the full list of what was addressed.
14
+
5
15
  ## New in 2.7.0
6
16
 
7
17
  ### k3s provisioning is GA (x86 Only)
@@ -2,6 +2,16 @@
2
2
  title: 2.7 的新功能
3
3
  ---
4
4
 
5
+ ## 2.7.2 的新功能
6
+
7
+ ### Kubernetes 1.25 和 PSA
8
+
9
+ - Kubernetes 1.25 GA 让 PSA(Pod Security Admissions)不再只是测试功能。PSA 取代了以前的 PSP(Pod 安全策略),这是 Kubernetes 升级的重大变化。
10
+
11
+ ## 2.7.2 的新功能
12
+
13
+ - 这是一个安全版本,旨在修复 CVE 和其他错误。如需查看所有已解决的问题,请前往 https://github.com/rancher/rancher/releases/tag/v2.7.1。
14
+
5
15
  ## 2.7.0 的新功能
6
16
 
7
17
  ### K3s 配置已 GA(仅限 x86)
@@ -14,5 +24,5 @@ title: 2.7 的新功能
14
24
 
15
25
  ### OCI 对 Helm Fleet 的支持
16
26
 
17
- - 现在支持对基于 OCI 的镜像仓库进行身份验证。请注意,fleet.yaml 的结构是相同的,并且凭证作为 Kubernetes Secret 提供(Repo Structure 文档的 Private Helm Repo 框中已进行了描述)。
27
+ - 现在支持对基于 OCI 的镜像仓库进行认证。请注意,fleet.yaml 的结构是相同的,并且凭证作为 Kubernetes Secret 提供(Repo Structure 文档的 Private Helm Repo 框中已进行了描述)。
18
28
 
@@ -89,6 +89,29 @@ export class PluginRoutes {
89
89
  // Despite what the docs say, routes are not replaced, so we use a workaround
90
90
  // Remove all routes that are being replaced
91
91
  routes.forEach((r: RouteInfo) => {
92
+ // Patch colliding legacy routes that start /:product
93
+ if (r.route.path?.startsWith('/:product')) {
94
+ // Legacy pattern used by extensions - routes may collide, so modify them not to
95
+ let productName;
96
+
97
+ // If the route has a name (which is always the case for the extensions we have written), use it to get the product name
98
+ if (r.route.name) {
99
+ const nameParts = r.route.name.split('-');
100
+
101
+ // First part of the route name is the product name
102
+ productName = nameParts[0];
103
+ }
104
+
105
+ // Use the plugin name as the product, if the route does not have a name
106
+ productName = productName || plugin.name;
107
+
108
+ // Replace the path - removing :product and using the actual product name instead - this avoids route collisions
109
+ r.route.path = `/${ productName }${ r.route.path.substr(9) }`;
110
+ r.route.meta = r.route.meta || {};
111
+
112
+ r.route.meta.product = r.route.meta.product || productName;
113
+ }
114
+
92
115
  // See if the route exists
93
116
  let existing: any;
94
117
 
package/core/plugin.ts CHANGED
@@ -16,13 +16,15 @@ import {
16
16
  PluginRouteConfig, RegisterStore, UnregisterStore, CoreStoreSpecifics, CoreStoreConfig, OnNavToPackage, OnNavAwayFromPackage, OnLogOut
17
17
  } from '@shell/core/types';
18
18
 
19
+ export type ProductFunction = (plugin: IPlugin, store: any) => void;
20
+
19
21
  export class Plugin implements IPlugin {
20
22
  public id: string;
21
23
  public name: string;
22
24
  public types: any = {};
23
25
  public l10n: { [key: string]: Function[] } = {};
24
26
  public locales: { locale: string, label: string}[] = [];
25
- public products: Function[] = [];
27
+ public products: ProductFunction[] = [];
26
28
  public productNames: string[] = [];
27
29
  public routes: { parent?: string, route: RouteConfig }[] = [];
28
30
  public stores: { storeName: string, register: RegisterStore, unregister: UnregisterStore }[] = [];
@@ -83,7 +85,7 @@ export class Plugin implements IPlugin {
83
85
  return storeDSL;
84
86
  }
85
87
 
86
- addProduct(product: Function): void {
88
+ addProduct(product: ProductFunction): void {
87
89
  this.products.push(product);
88
90
  }
89
91
 
package/core/types.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { ProductFunction } from './plugin';
1
2
  import { RouteConfig } from 'vue-router';
2
3
 
3
4
  // package.json metadata
@@ -136,6 +137,255 @@ export type LocationConfig = {
136
137
  mode?: string[]
137
138
  };
138
139
 
140
+ export interface ProductOptions {
141
+ /**
142
+ * The category this product belongs under. i.e. 'config'
143
+ */
144
+ category?: string;
145
+
146
+ /**
147
+ * Hide the Copy KubeConfig button in the header
148
+ */
149
+ hideCopyConfig?: boolean;
150
+
151
+ /**
152
+ * Hide the Download KubeConfig button in the header
153
+ */
154
+ hideKubeConfig?: boolean;
155
+
156
+ /**
157
+ * Hide the Kubectl Shell button in the header
158
+ */
159
+ hideKubeShell?: boolean;
160
+
161
+ /**
162
+ * Hide the Namespace location
163
+ */
164
+ hideNamespaceLocation?: boolean;
165
+
166
+ /**
167
+ * Hide the system resources
168
+ */
169
+
170
+ hideSystemResources?: boolean;
171
+ /**
172
+ * The icon that should be displayed beside this item in the navigation.
173
+ */
174
+ icon?: string,
175
+
176
+ /**
177
+ * Only load the product if the feature is present
178
+ */
179
+ ifFeature?: string | RegExp;
180
+
181
+ /**
182
+ * Only load the product if the type is present
183
+ */
184
+ ifHave?: string;
185
+
186
+ /**
187
+ * Only load the product if the group is present
188
+ */
189
+ ifHaveGroup?: string | RegExp;
190
+
191
+ /**
192
+ * Only load the product if the type is present
193
+ */
194
+ ifHaveType?: string | RegExp;
195
+
196
+ /**
197
+ * The vuex store that this product should use by default i.e. 'management'
198
+ */
199
+ inStore?: string;
200
+
201
+ /**
202
+ * Show the cluster switcher in the navigation
203
+ */
204
+ showClusterSwitcher?: boolean;
205
+
206
+ /**
207
+ * Show the namespace filter in the header
208
+ */
209
+ showNamespaceFilter?: boolean;
210
+
211
+ /**
212
+ * A number used to determine where in navigation this item will be placed. The highest number will be at the top of the list.
213
+ */
214
+ weight?: number;
215
+
216
+ /**
217
+ * Leaving these here for completeness but I don't think these should be advertised as useable to plugin creators.
218
+ */
219
+ // ifHaveVerb: string | RegExp;
220
+ // removable: string;
221
+ // showWorkspaceSwitcher: boolean;
222
+ // supportRoute: string;
223
+ // to: string;
224
+ // typeStoreMap: string;
225
+ }
226
+
227
+ export interface HeaderOptions {
228
+ /**
229
+ * Name of the header. This should be unique.
230
+ */
231
+ name?: string;
232
+
233
+ /**
234
+ * A translation key where the resulting string will show in the table column
235
+ */
236
+ labelKey?: string;
237
+
238
+ /**
239
+ * A string which represents the path to access the value from the row object i.e. `row.meta.value`.
240
+ */
241
+ value?: string;
242
+
243
+ /**
244
+ * A string which represents the path to access the value from the row object which we'll use to sort i.e. `row.meta.value`
245
+ */
246
+ sort?: string;
247
+
248
+ /**
249
+ * A string which represents the path to access the value from the row object which we'll use to search i.e. `row.meta.value`
250
+ */
251
+ search?: string;
252
+
253
+ /**
254
+ * Number of pixels the column should be in the table
255
+ */
256
+ width?: number;
257
+
258
+ /**
259
+ * The name of a custom formatter. The available formatters can bee seen in `@rancher/shell/components/formatter`
260
+ */
261
+ formatter?: string;
262
+
263
+ /**
264
+ * These options are dependent on the formatter that's chosen. Examples can be seen in `@rancher/shell/components/formatter` and `@rancher/shell/config/table-headers`
265
+ */
266
+ formatterOpts?: any;
267
+
268
+ /**
269
+ * Provide a function which accets a row and returns the value that should be displayed in the column
270
+ * @param row This can be any value which represents the row
271
+ * @returns Can return {@link string | number | null | undefined} to display in the column
272
+ */
273
+ getValue?: (row: any) => string | number | null | undefined;
274
+ }
275
+
276
+ export interface ConfigureTypeOptions {
277
+ /**
278
+ * The resource can edit/show yaml
279
+ */
280
+ canYaml?: boolean;
281
+
282
+ /**
283
+ * Modify the way the name looks when displayed
284
+ */
285
+ displayName?: string;
286
+
287
+ /**
288
+ * New resources can be created of this type
289
+ */
290
+ isCreatable?: boolean;
291
+
292
+ /**
293
+ * Resources of this type can be deleted/removed
294
+ */
295
+ isRemovable?: boolean;
296
+
297
+ /**
298
+ * This type should be grouped by namespaces when displayed in a table
299
+ */
300
+ namespaced?: boolean;
301
+
302
+ /**
303
+ * Show the age column in when displaying this type in a table
304
+ */
305
+ showAge?: boolean;
306
+
307
+ /**
308
+ * Show the masthead at the top of the list view of this type
309
+ */
310
+ showListMasthead?: boolean;
311
+
312
+ /**
313
+ * Show the state column in when displaying this type in a table
314
+ */
315
+ showState?: boolean;
316
+
317
+ /**
318
+ * Leaving these here for completeness but I don't think these should be advertised as useable to plugin creators.
319
+ */
320
+ // alias
321
+ // customRoute
322
+ // customRoute
323
+ // depaginate
324
+ // graphConfig
325
+ // hasGraph
326
+ // isEditable
327
+ // limit
328
+ // listGroups
329
+ // localOnly
330
+ // location
331
+ // match
332
+ // realResource
333
+ // resource
334
+ // resourceDetail
335
+ // resourceEdit
336
+ // showConfigView
337
+ }
338
+
339
+ export interface DSLReturnType {
340
+ /**
341
+ * Register multiple types by name and place them all in a group if desired. Primarily used for grouping things in the cluster explorer navigation.
342
+ * @param types A list of types that are going to be registered
343
+ * @param group Conditionally a group you want to places all the types in
344
+ * @returns {@link void}
345
+ */
346
+ basicType: (types: string[], group?: string) => void;
347
+
348
+ /**
349
+ * Configure a myriad of options for the specified type
350
+ * @param type The type to be configured
351
+ * @param options {@link ConfigureTypeOptions}
352
+ * @returns {@link void}
353
+ */
354
+ configureType: (type: string, options: ConfigureTypeOptions) => void;
355
+
356
+ /**
357
+ * Register the headers/columns that should be used when rendering a table for the specified type.
358
+ * @param type The type you'd like to register headers/columns for.
359
+ * @param headers {@link HeaderOptions[]}
360
+ * @returns {@link void}
361
+ */
362
+ headers: (type: string, headers: HeaderOptions[]) => void;
363
+
364
+ /**
365
+ * Create and register a new product
366
+ * @param options {@link ProductOptions}
367
+ * @returns {@link void}
368
+ */
369
+ product: (options: ProductOptions) => void;
370
+
371
+ /**
372
+ * Leaving these here for completeness but I don't think these should be advertised as useable to plugin creators.
373
+ */
374
+ // componentForType: (type: string, replacementType: string)
375
+ // groupBy: (type: string, field: string)
376
+ // hideBulkActions: (type: string, field)
377
+ // ignoreGroup: (regexOrString)
378
+ // ignoreType: (regexOrString)
379
+ // mapGroup: (match, replace)
380
+ // mapType: (match, replace)
381
+ // moveType: (match, group)
382
+ // setGroupDefaultType: (input, defaultType)
383
+ // spoofedType: (obj)
384
+ // virtualType: (obj)
385
+ // weightGroup: (input, weight, forBasic)
386
+ // weightType: (input, weight, forBasic)
387
+ }
388
+
139
389
  /**
140
390
  * Interface for a Dashboard plugin
141
391
  */
@@ -144,7 +394,7 @@ export interface IPlugin {
144
394
  * Add a product
145
395
  * @param importFn Function that will import the module containing a product definition
146
396
  */
147
- addProduct(importFn: Function): void;
397
+ addProduct(importFn: ProductFunction): void;
148
398
 
149
399
  /**
150
400
  * Add a locale to the i18n store
@@ -249,4 +499,11 @@ export interface IPlugin {
249
499
  * @param {Function} fn function that dynamically loads the module for the thing being registered
250
500
  */
251
501
  register(type: string, name: string, fn: Function): void;
502
+
503
+ /**
504
+ * Will return all of the configuration functions used for creating a new product.
505
+ * @param store The store that was passed to the function that's passed to `plugin.addProduct(function)`
506
+ * @param productName The name of the new product. This name is displayed in the navigation.
507
+ */
508
+ DSL(store: any, productName: string): DSLReturnType;
252
509
  }
@@ -7,6 +7,7 @@
7
7
  },
8
8
  "dependencies": {},
9
9
  "resolutions": {
10
- "**/webpack": "4"
10
+ "**/webpack": "4",
11
+ "@types/node": "^16"
11
12
  }
12
13
  }
@@ -30,7 +30,7 @@ module.exports = {
30
30
  'unicorn/no-new-buffer': 'off',
31
31
  'vue/html-self-closing': 'off',
32
32
  'vue/no-unused-components': 'warn',
33
- 'vue/no-v-html': 'off',
33
+ 'vue/no-v-html': 'error',
34
34
  'wrap-iife': 'off',
35
35
 
36
36
  'array-bracket-spacing': 'warn',
@@ -1,18 +1 @@
1
- module.exports = {
2
- env: {
3
- test: {
4
- plugins: [
5
- [
6
- 'module-resolver',
7
- {
8
- root: ['.'],
9
- alias: {
10
- '@': '.',
11
- '~': '.',
12
- },
13
- },
14
- ],
15
- ],
16
- },
17
- },
18
- };
1
+ module.exports = require('@rancher/shell/babel.config.js');
@@ -31,7 +31,6 @@
31
31
  ],
32
32
  "types": [
33
33
  "@types/node",
34
- "@nuxt/types",
35
34
  "cypress",
36
35
  "rancher",
37
36
  "shell"
@@ -0,0 +1,6 @@
1
+ const config = require('@rancher/shell/vue.config');
2
+
3
+ module.exports = config(__dirname, {
4
+ excludes: [],
5
+ // excludes: ['fleet', 'example']
6
+ });
package/creators/app/init CHANGED
@@ -4,14 +4,14 @@ const path = require('path');
4
4
  const fs = require('fs-extra');
5
5
 
6
6
  const targets = {
7
- dev: './node_modules/.bin/nuxt dev',
8
- nuxt: './node_modules/.bin/nuxt',
9
- build: './node_modules/.bin/nuxt build'
7
+ dev: 'NODE_ENV=dev ./node_modules/.bin/vue-cli-service serve',
8
+ build: './node_modules/.bin/vue-cli-service build',
9
+ clean: './node_modules/@rancher/shell/scripts/clean'
10
10
  };
11
11
 
12
12
  const files = [
13
13
  'tsconfig.json',
14
- 'nuxt.config.js',
14
+ 'vue.config.js',
15
15
  '.eslintignore',
16
16
  '.eslintrc.js',
17
17
  'babel.config.js',
@@ -24,7 +24,7 @@ console.log('Creating Skeleton Application');
24
24
  const args = process.argv;
25
25
  let appFolder = path.resolve('.');
26
26
 
27
- if (args.length == 3) {
27
+ if (args.length === 3) {
28
28
  const name = args[2];
29
29
  const folder = path.resolve('.');
30
30