@rancher/shell 2.0.1 → 2.0.2-rc.1

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 (89) hide show
  1. package/assets/translations/en-us.yaml +51 -26
  2. package/assets/translations/zh-hans.yaml +1 -0
  3. package/components/AssignTo.vue +2 -0
  4. package/components/Questions/index.vue +2 -2
  5. package/components/auth/RoleDetailEdit.vue +5 -4
  6. package/components/form/Members/ClusterPermissionsEditor.vue +1 -1
  7. package/components/form/ProjectMemberEditor.vue +1 -1
  8. package/components/form/ResourceLabeledSelect.vue +11 -3
  9. package/components/form/labeled-select-utils/labeled-select.utils.ts +1 -1
  10. package/config/pagination-table-headers.js +5 -4
  11. package/config/roles.ts +34 -19
  12. package/config/router/navigation-guards/attempt-first-login.js +1 -1
  13. package/config/router/navigation-guards/authentication.js +1 -1
  14. package/config/router/navigation-guards/i18n.js +1 -1
  15. package/config/router/navigation-guards/index.js +2 -1
  16. package/config/router/navigation-guards/load-initial-settings.js +1 -1
  17. package/config/router/navigation-guards/runtime-extension-route.js +31 -0
  18. package/config/router/routes.js +10 -1
  19. package/config/uiplugins.js +130 -61
  20. package/core/plugin.ts +5 -0
  21. package/core/plugins.js +7 -1
  22. package/edit/provisioning.cattle.io.cluster/__tests__/Basics.test.ts +86 -13
  23. package/edit/provisioning.cattle.io.cluster/__tests__/DirectoryConfig.test.ts +3 -134
  24. package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +209 -0
  25. package/edit/provisioning.cattle.io.cluster/index.vue +8 -4
  26. package/edit/provisioning.cattle.io.cluster/rke2.vue +115 -17
  27. package/edit/provisioning.cattle.io.cluster/tabs/AddOnAdditionalManifest.vue +50 -0
  28. package/edit/provisioning.cattle.io.cluster/tabs/AddOnConfig.vue +29 -64
  29. package/edit/provisioning.cattle.io.cluster/tabs/Basics.vue +42 -3
  30. package/edit/provisioning.cattle.io.cluster/tabs/DirectoryConfig.vue +22 -86
  31. package/edit/provisioning.cattle.io.cluster/tabs/registries/RegistryConfigs.vue +8 -2
  32. package/edit/provisioning.cattle.io.cluster/tabs/registries/__tests__/RegistryConfigs.test.ts +61 -0
  33. package/initialize/entry-helpers.js +4 -21
  34. package/mixins/__tests__/chart.test.ts +4 -1
  35. package/mixins/chart.js +30 -14
  36. package/models/__tests__/apps.deployment.test.ts +93 -0
  37. package/models/apps.deployment.js +18 -4
  38. package/models/management.cattle.io.cluster.js +2 -2
  39. package/models/management.cattle.io.user.js +3 -3
  40. package/models/nodedriver.js +5 -0
  41. package/models/provisioning.cattle.io.cluster.js +4 -0
  42. package/package.json +1 -1
  43. package/pages/404.vue +15 -0
  44. package/pages/auth/login.vue +4 -1
  45. package/pages/auth/setup.vue +4 -1
  46. package/pages/c/_cluster/explorer/index.vue +5 -0
  47. package/pages/c/_cluster/manager/jwt.authentication/index.vue +10 -4
  48. package/pages/c/_cluster/settings/performance.vue +2 -2
  49. package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +7 -10
  50. package/pages/c/_cluster/uiplugins/index.vue +24 -16
  51. package/pages/home.vue +1 -13
  52. package/plugins/dashboard-store/actions.js +1 -1
  53. package/plugins/dashboard-store/getters.js +1 -1
  54. package/plugins/steve/__tests__/getters.test.ts +5 -5
  55. package/plugins/steve/getters.js +6 -4
  56. package/plugins/steve/hybrid-class.js +1 -5
  57. package/scripts/extension/helm/charts/ui-plugin-server/Chart.yaml +1 -1
  58. package/scripts/publish-shell.sh +53 -55
  59. package/scripts/test-plugins-build.sh +45 -39
  60. package/shell/types/shell/index.d.ts +2 -0
  61. package/store/type-map.js +4 -2
  62. package/types/store/pagination.types.ts +1 -1
  63. package/utils/cluster.js +9 -0
  64. package/utils/settings.ts +3 -1
  65. package/creators/app/app.package.json +0 -14
  66. package/creators/app/files/.eslintignore +0 -16
  67. package/creators/app/files/.eslintrc.js +0 -173
  68. package/creators/app/files/.gitignore +0 -70
  69. package/creators/app/files/.gitlab-ci.yml +0 -14
  70. package/creators/app/files/.vscode/settings.json +0 -21
  71. package/creators/app/files/babel.config.js +0 -1
  72. package/creators/app/files/tsconfig.json +0 -42
  73. package/creators/app/files/vue.config.js +0 -6
  74. package/creators/app/init +0 -120
  75. package/creators/app/package.json +0 -25
  76. package/creators/pkg/files/.github/workflows/build-extension-catalog.yml +0 -24
  77. package/creators/pkg/files/.github/workflows/build-extension-charts.yml +0 -22
  78. package/creators/pkg/files/babel.config.js +0 -1
  79. package/creators/pkg/files/index.ts +0 -14
  80. package/creators/pkg/files/tsconfig.json +0 -53
  81. package/creators/pkg/files/vue.config.js +0 -1
  82. package/creators/pkg/init +0 -286
  83. package/creators/pkg/package.json +0 -19
  84. package/creators/pkg/pkg.package.json +0 -21
  85. package/creators/pkg/vue-shim.ts +0 -4
  86. package/creators/update/init +0 -56
  87. package/creators/update/package.json +0 -20
  88. package/creators/update/upgrade +0 -56
  89. package/types/shell/index.d.ts +0 -4585
@@ -1186,17 +1186,39 @@ cluster:
1186
1186
  banner: "Service Account access with JWT authentication can be configured after cluster creation from <br>
1187
1187
  <code>Cluster Management > Advanced > JWT Authentication</code>"
1188
1188
  addonChart:
1189
- rancher-vsphere-cpi: vSphere CPI Configuration
1190
- rancher-vsphere-csi: vSphere CSI Configuration
1191
- rke2-calico: Calico Configuration
1192
- rke2-calico-crd: Calico Configuration
1193
- rke2-canal: Canal Configuration
1194
- rke2-cilium: Cilium Configuration
1195
- rke2-coredns: CoreDNS Configuration
1196
- rke2-ingress-nginx: NGINX Ingress Configuration
1197
- rke2-kube-proxy: Kube Proxy Configuration
1198
- rke2-metrics-server: Metrics Server Configuration
1199
- rke2-multus: Multus Configuration
1189
+ rancher-vsphere-cpi:
1190
+ label: vSphere CPI
1191
+ configuration: vSphere CPI Configuration
1192
+ rancher-vsphere-csi:
1193
+ label: vSphere CSI
1194
+ configuration: vSphere CSI Configuration
1195
+ rke2-calico:
1196
+ label: Calico
1197
+ configuration: Calico Configuration
1198
+ rke2-calico-crd:
1199
+ label: Calico
1200
+ configuration: Calico Configuration
1201
+ rke2-canal:
1202
+ label: Canal
1203
+ configuration: Canal Configuration
1204
+ rke2-cilium:
1205
+ label: Cilium
1206
+ configuration: Cilium Configuration
1207
+ rke2-coredns:
1208
+ label: CoreDNS
1209
+ configuration: CoreDNS Configuration
1210
+ rke2-ingress-nginx:
1211
+ label: NGINX
1212
+ configuration: NGINX Ingress Configuration
1213
+ rke2-kube-proxy:
1214
+ label: Kube Proxy
1215
+ configuration: Kube Proxy Configuration
1216
+ rke2-metrics-server:
1217
+ label: Metrics Server
1218
+ configuration: Metrics Server Configuration
1219
+ rke2-multus:
1220
+ label: Multus
1221
+ configuration: Multus Configuration
1200
1222
  agentEnvVars:
1201
1223
  label: Agent Environment
1202
1224
  detail: Add additional environment variables to the agent container. This is most commonly useful for configuring a HTTP proxy.
@@ -1443,10 +1465,6 @@ cluster:
1443
1465
  placeholder: A unique name for the cluster
1444
1466
  directoryConfig:
1445
1467
  title: Data directory configuration
1446
- checkboxText: Use the same path for System-agent, Provisioning and K8s Distro data directories configuration
1447
- common:
1448
- label: Data directory configuration path
1449
- tooltip: Data directory configuration for System-agent, Provisioning and K8s Distro
1450
1468
  systemAgent:
1451
1469
  label: System-agent directory path
1452
1470
  tooltip: Data directory for the system-agent connection info and plans
@@ -1782,7 +1800,9 @@ cluster:
1782
1800
  rke2-k3-reprovisioning: 'Making changes to cluster configuration may result in nodes reprovisioning. For more information see the <a href="{docsBase}/how-to-guides/new-user-guides/launch-kubernetes-with-rancher/rke1-vs-rke2-differences#cluster-api" target="_blank" rel="noopener nofollow">documentation</a>.'
1783
1801
  desiredNodeGroupWarning: There are 0 nodes available to run the cluster agent. The cluster will not become active until at least one node is available.
1784
1802
  haveArgInfo: Configuration information is not available for the selected Kubernetes version. The options available on this screen will be limited; you may want to use the YAML editor.
1785
- cloudProviderAddConfig: 'On Kubernetes 1.27 or greater, the Amazon Cloud Provider requires additional configuration. See <a href="https://ranchermanager.docs.rancher.com/how-to-guides/new-user-guides/kubernetes-clusters-in-rancher-setup/set-up-cloud-providers/amazon" target="_blank" rel="noopener noreferrer nofollow">the documentation</a> for more information.'
1803
+ cloudProviderAddConfig: 'On Kubernetes 1.27 or greater, the <b>Amazon</b> Cloud Provider requires additional configuration. See <a href="https://ranchermanager.docs.rancher.com/how-to-guides/new-user-guides/kubernetes-clusters-in-rancher-setup/set-up-cloud-providers/amazon" target="_blank" rel="noopener noreferrer nofollow">the documentation</a> for more information.'
1804
+ cloudProviderUnsupportedAzure: 'On Kubernetes 1.30 or greater, the <b>Azure</b> Cloud Provider has been removed. See <a href="https://ranchermanager.docs.rancher.com/how-to-guides/new-user-guides/kubernetes-clusters-in-rancher-setup/set-up-cloud-providers/azure" target="_blank" rel="noopener noreferrer nofollow">the documentation</a> for more information.'
1805
+ cloudProviderMigrateAzure: 'On Kubernetes 1.30 or greater, the <b>Azure</b> Cloud Provider has been removed. To upgrade Kubernetes, the cluster should be migrated to External provider first.<br> See <a href="https://ranchermanager.docs.rancher.com/how-to-guides/new-user-guides/kubernetes-clusters-in-rancher-setup/set-up-cloud-providers/azure" target="_blank" rel="noopener noreferrer nofollow">the documentation</a> for more information.'
1786
1806
  machinePoolError: |-
1787
1807
  {count, plural,
1788
1808
  =1 { {pool_name}: The provided value for {fields} was not found in the list of expected values. This can happen with clusters provisioned outside of Rancher or when options for the provider have changed. }
@@ -1920,6 +1940,7 @@ cluster:
1920
1940
  oracleoke: Oracle OKE
1921
1941
  otc: Open Telekom Cloud
1922
1942
  other: Other
1943
+ ovhcloudmks: OVHcloud MKS
1923
1944
  packet: Equinix Metal
1924
1945
  pinganyunecs: Pinganyun ECS
1925
1946
  pnap: phoenixNAP
@@ -2082,7 +2103,7 @@ cluster:
2082
2103
  s3: s3
2083
2104
  tabs:
2084
2105
  ace: Authorized Endpoint
2085
- addons: Add-On Config
2106
+ addOnAdditionalManifest: Additional Manifest
2086
2107
  advanced: Advanced
2087
2108
  agentEnv: Agent Environment Vars
2088
2109
  basic: Basics
@@ -4250,8 +4271,10 @@ inactivity:
4250
4271
 
4251
4272
  # Rancher Extensions
4252
4273
  plugins:
4253
- incompatibleRancherVersion: "The latest version of this extension ({ version }) is not compatible with the current Rancher version ({ rancherVersion })."
4254
- incompatibleKubeVersion: "The latest version of this extension ({ version }) is not compatible with the current Kube version ({ kubeVersion })."
4274
+ incompatibleRancherVersion: "The latest version of this extension ({ version }) is not compatible with the current Rancher version ({ required })."
4275
+ incompatibleKubeVersion: "The latest version of this extension ({ version }) is not compatible with the current Kube version ({ required })."
4276
+ incompatibleUiExtensionsApiVersion: "The latest version of this extension ({ version }) is not compatible with the current Extensions API version ({ required })."
4277
+ incompatibleHost: 'The latest version of this extension ({ version }) has a host of "{ required }" which is not compatible with this application "{ mainHost }".'
4255
4278
  currentInstalledVersionBlockedByKubeVersion: "This version is not compatible with the current Kubernetes version ({ kubeVersion } Vs { kubeVersionToCheck })."
4256
4279
  labels:
4257
4280
  builtin: Built-in
@@ -4289,8 +4312,10 @@ plugins:
4289
4312
  detail: Detail
4290
4313
  versions: Versions
4291
4314
  versionError: Could not load version information
4292
- requiresRancherVersion: "Requires Rancher {version}"
4293
- requiresKubeVersion: "Requires Kube version {version}"
4315
+ requiresRancherVersion: "Requires Rancher {required}"
4316
+ requiresKubeVersion: "Requires Kube version {required}"
4317
+ requiresExtensionApiVersion: "Requires Extensions API version {required}"
4318
+ requiresHost: 'Requires a host that matches "{required}"'
4294
4319
  empty:
4295
4320
  all: Extensions are neither installed nor available
4296
4321
  available: No Extensions available
@@ -7402,7 +7427,7 @@ performance:
7402
7427
  When enabled, resources will appear more quickly, but it may take slightly longer to load the entire set of resources. This setting only applies to resources that come from the Kubernetes API
7403
7428
  checkboxLabel: Enable incremental loading
7404
7429
  inputLabel: Resource Threshold
7405
- incompatibleDescription: "Incremental Loading is incomaptible with Namespace/Project filtering and Server-side Pagination. Enabling this will disable them."
7430
+ incompatibleDescription: "Incremental Loading is incompatible with Namespace/Project filtering and Server-side Pagination. Enabling this will disable them."
7406
7431
  manualRefresh:
7407
7432
  label: Manual Refresh
7408
7433
  setting: You can configure a threshold above which manual refresh will be enabled.
@@ -7411,7 +7436,7 @@ performance:
7411
7436
  When enabled, list data will not auto-update but instead the user must manually trigger a list-view refresh. This setting only applies to resources that come from the Kubernetes API
7412
7437
  checkboxLabel: Enable manual refresh of data for lists
7413
7438
  inputLabel: Resource Threshold
7414
- incompatibleDescription: "Manual Refresh is incomaptible with Namespace/Project filtering and Server-side Pagination. Enabling this will disable them."
7439
+ incompatibleDescription: "Manual Refresh is incompatible with Namespace/Project filtering and Server-side Pagination. Enabling this will disable them."
7415
7440
  websocketNotification:
7416
7441
  label: Websocket Notifications
7417
7442
  description: |-
@@ -7442,7 +7467,7 @@ performance:
7442
7467
  label: Require Namespace / Project Filtering
7443
7468
  description: Require the user to select namespaces and/or projects. This restricts the number of resources fetched when viewing lists and should help the responsiveness of the UI in systems with a lot of resources.
7444
7469
  checkboxLabel: Enable Required Namespace / Project Filtering
7445
- incompatibleDescription: "Required Namespace / Project Filtering is incomaptible with Manual Refresh and Incremental Loading. Enabling this will disable them."
7470
+ incompatibleDescription: "Required Namespace / Project Filtering is incompatible with Manual Refresh and Incremental Loading. Enabling this will disable them."
7446
7471
  advancedWorker:
7447
7472
  label: Websocket Web Worker
7448
7473
  description: Updates to resources pushed to the UI come via WebSocket and are handled in the UI thread. Enable this option to handle cluster WebSocket updates in a Web Worker in a separate thread. This should help the responsiveness of the UI in systems where resources change often.
@@ -7459,7 +7484,7 @@ performance:
7459
7484
  description: By default Lists will fetch all resources and paginate in the browser (create the page given sorting and filtering settings). Change this setting to enable pagination server-side. This should help the responsiveness of the UI in systems with a lot of resources.
7460
7485
  checkboxLabel: Enable Server-side Pagination
7461
7486
  applicable: "This applies to the following resource types"
7462
- incompatibleDescription: "Server-side Pagination is incomaptible with Manual Refresh and Incremental Loading. Enabling this will disable them."
7487
+ incompatibleDescription: "Server-side Pagination is incompatible with Manual Refresh and Incremental Loading. Enabling this will disable them."
7463
7488
  featureFlag: The&nbsp;<a href="{ffUrl}">Feature Flag</a>&nbsp;`ui-sql-cache` must be enabled to use this feature
7464
7489
  resources:
7465
7490
  generic: most resources in the cluster's 'More Resources' section
@@ -7789,4 +7814,4 @@ gitPicker:
7789
7814
 
7790
7815
  networkAttachmentDefinition:
7791
7816
  tabs:
7792
- config: Config
7817
+ config: Config
@@ -1796,6 +1796,7 @@ cluster:
1796
1796
  oracleoke: Oracle OKE
1797
1797
  otc: Open Telekom Cloud
1798
1798
  other: 其他
1799
+ ovhcloudmks: OVHcloud MKS
1799
1800
  packet: Equinix Metal
1800
1801
  pinganyunecs: 平安云 ECS
1801
1802
  pnap: phoenixNAP
@@ -4,6 +4,7 @@ import { FLEET, NORMAN } from '@shell/config/types';
4
4
  import LabeledSelect from '@shell/components/form/LabeledSelect';
5
5
  import KeyValue from '@shell/components/form/KeyValue';
6
6
  import AsyncButton from '@shell/components/AsyncButton';
7
+ import AppModal from '@shell/components/AppModal.vue';
7
8
  import { Card } from '@components/Card';
8
9
  import { Banner } from '@components/Banner';
9
10
  import { exceptionToErrorsArray } from '@shell/utils/error';
@@ -16,6 +17,7 @@ export default {
16
17
  KeyValue,
17
18
  AsyncButton,
18
19
  Banner,
20
+ AppModal
19
21
  },
20
22
 
21
23
  data() {
@@ -45,9 +45,9 @@ export function componentForQuestion(q) {
45
45
 
46
46
  if ( knownTypes[type] ) {
47
47
  return type;
48
- } else if ( type.startsWith('array[') ) { // This only really works for array[string|multiline], but close enough for now.
48
+ } else if ( type.startsWith('array') ) { // This only really works for array[string|multiline], but close enough for now.
49
49
  return ArrayType;
50
- } else if ( type.startsWith('map[') ) { // Same, only works with map[string|multiline]
50
+ } else if ( type.startsWith('map') ) { // Same, only works with map[string|multiline]
51
51
  return MapType;
52
52
  } else if ( type.startsWith('reference[') ) { // Same, only works with map[string|multiline]
53
53
  return ReferenceType;
@@ -14,7 +14,7 @@ import Tabbed from '@shell/components/Tabbed';
14
14
  import { ucFirst } from '@shell/utils/string';
15
15
  import SortableTable from '@shell/components/SortableTable';
16
16
  import { _CLONE, _DETAIL } from '@shell/config/query-params';
17
- import { SCOPED_RESOURCES } from '@shell/config/roles';
17
+ import { SCOPED_RESOURCES, SCOPED_RESOURCE_GROUPS } from '@shell/config/roles';
18
18
  import { Banner } from '@components/Banner';
19
19
 
20
20
  import { SUBTYPE_MAPPING, VERBS } from '@shell/models/management.cattle.io.roletemplate';
@@ -195,16 +195,17 @@ export default {
195
195
  const scopes = Object.keys(this.scopedResources);
196
196
 
197
197
  scopes.forEach((scope) => {
198
- if (scope === 'globalScopedApiGroups' && this.value.type !== MANAGEMENT.GLOBAL_ROLE) {
198
+ if (scope === SCOPED_RESOURCE_GROUPS.GLOBAL && this.value.type !== MANAGEMENT.GLOBAL_ROLE) {
199
199
  // If we are not in the global role creation form,
200
200
  // skip adding the global-scoped resources.
201
201
  return;
202
202
  }
203
- if (scope === 'clusterScopedApiGroups' && (this.value.type === RBAC.ROLE || this.value.subtype === NAMESPACE)) {
203
+ if (scope === SCOPED_RESOURCE_GROUPS.CLUSTER && (this.value.type === RBAC.ROLE || this.value.subtype === NAMESPACE)) {
204
204
  // If we are in a project/namespace role creation form,
205
205
  // additionally skip adding the cluster-scoped resources.
206
206
  return;
207
207
  }
208
+
208
209
  const apiGroupsInScope = this.scopedResources[scope];
209
210
 
210
211
  const apiGroupNames = Object.keys(apiGroupsInScope);
@@ -237,7 +238,7 @@ export default {
237
238
  const labelForNamespaceScoped = this.t('rbac.roletemplate.tabs.grantResources.neuvector.labelNamespaceScoped');
238
239
 
239
240
  apiGroupLabel = scope.includes('cluster') ? labelForClusterScoped : labelForNamespaceScoped;
240
- apiGroupValue = 'api.neuvector.com';
241
+ apiGroupValue = 'permission.neuvector.com';
241
242
  }
242
243
 
243
244
  options.push({
@@ -177,7 +177,7 @@ export default {
177
177
  },
178
178
  customPermissionsUpdate() {
179
179
  return this.customPermissions.reduce((acc, customPermissionsItem) => {
180
- const lockedExist = this.roleTemplates.find((roleTemplateItem) => roleTemplateItem.displayName === customPermissionsItem.label);
180
+ const lockedExist = this.roleTemplates.find((roleTemplateItem) => roleTemplateItem.id === customPermissionsItem.key);
181
181
 
182
182
  if (lockedExist.locked) {
183
183
  customPermissionsItem['locked'] = true;
@@ -192,7 +192,7 @@ export default {
192
192
  },
193
193
  customPermissionsUpdate() {
194
194
  return this.customPermissions.reduce((acc, customPermissionsItem) => {
195
- const lockedExist = this.roleTemplates.find((roleTemplateItem) => roleTemplateItem.displayName === customPermissionsItem.label);
195
+ const lockedExist = this.roleTemplates.find((roleTemplateItem) => roleTemplateItem.id === customPermissionsItem.key);
196
196
 
197
197
  if (lockedExist.locked) {
198
198
  customPermissionsItem['locked'] = true;
@@ -126,11 +126,17 @@ export default defineComponent({
126
126
 
127
127
  computed: {
128
128
  labelSelectAttributes() {
129
+ // This component is a wrapper for LabelSelect, so pass through everything
130
+ const allAttrs = {
131
+ ...this.$attrs, // Attributes (other than props)
132
+ ...this.$props, // Attributes that are props
133
+ };
134
+
129
135
  return this.paginate ? {
130
- ...this.$attrs,
136
+ ...allAttrs,
131
137
  ...this.paginatedResourceSettings?.labelSelectOptions || {}
132
138
  } : {
133
- ...this.$attrs,
139
+ ...allAttrs,
134
140
  ...this.allResourcesSettings?.labelSelectOptions || {}
135
141
  };
136
142
  },
@@ -156,7 +162,9 @@ export default defineComponent({
156
162
  }
157
163
 
158
164
  const { filter } = opts;
159
- const filters = !!filter ? [PaginationParamFilter.createSingleField({ field: 'metadata.name', value: filter })] : [];
165
+ const filters = !!filter ? [PaginationParamFilter.createSingleField({
166
+ field: 'metadata.name', value: filter, exact: false
167
+ })] : [];
160
168
  const defaultOptions: LabelSelectPaginationFunctionOptions = {
161
169
  opts,
162
170
  filters,
@@ -109,7 +109,7 @@ export async function labelSelectPaginationFunction<T>({
109
109
 
110
110
  return {
111
111
  page: resPage,
112
- pages: res.pages,
112
+ pages: res.pages || Math.ceil(res.count / (pageSize || Number.MAX_SAFE_INTEGER)),
113
113
  total: res.count
114
114
  };
115
115
  } catch (err) {
@@ -17,15 +17,16 @@ export const STEVE_ID_COL = {
17
17
  name: 'steve-id',
18
18
  labelKey: 'tableHeaders.id',
19
19
  value: 'id',
20
- sort: ['id'],
21
- search: 'id',
20
+ sort: false, // sort: ['id'], // Pending API support
21
+ search: false, // search: 'id', // Pending API support
22
22
  };
23
23
 
24
24
  export const STEVE_STATE_COL = {
25
25
  ...STATE,
26
- // value: 'metadata.state.name', Use the state as defined by the resource rather than converted via the model.
26
+ // Note, we're show the 'state' as per model, not the 'metadata.state.name' that's available in the model to remotely sort/filter
27
+ // Need to investigate whether we should 'dumb down' the state we show to the native one (tracked via https://github.com/rancher/dashboard/issues/8527)
27
28
  // This means we'll show something different to what we sort and filter on.
28
- sort: [], // ['metadata.state.name'], // Pending API support
29
+ sort: false, // ['metadata.state.name'], // Pending API support
29
30
  search: false, // 'metadata.state.name', // Pending API support
30
31
  };
31
32
 
package/config/roles.ts CHANGED
@@ -1,3 +1,17 @@
1
+ export const enum SCOPED_RESOURCE_GROUPS {
2
+ GLOBAL = 'globalScopedApiGroups', // eslint-disable-line no-unused-vars
3
+ CLUSTER = 'clusterScopedApiGroups', // eslint-disable-line no-unused-vars
4
+ PROJECT_NAMESPACE = 'projectScopedApiGroups', // eslint-disable-line no-unused-vars
5
+ }
6
+
7
+ /**
8
+ * Resources users can select when creating grants when managing global, cluster and project/namespace roles
9
+ *
10
+ * **************NOTE*****************
11
+ * Global roles will show ALL entries
12
+ * Cluster roles will show cluster AND project/namespace entries
13
+ * Project/Namespace roles will show ONLY project/namespace entries
14
+ */
1
15
  export const SCOPED_RESOURCES = {
2
16
  // With this hardcoded list, it will be easier to curate a more useful
3
17
  // and human-understandable list of resources to choose from
@@ -13,7 +27,7 @@ export const SCOPED_RESOURCES = {
13
27
  // the global scoped list, and the project role creation form includes a
14
28
  // subset of the cluster scoped list.
15
29
 
16
- globalScopedApiGroups: {
30
+ [SCOPED_RESOURCE_GROUPS.GLOBAL]: {
17
31
  // Global scoped resources are resources for
18
32
  // Rancher's global apps, mainly Cluster
19
33
  // Management and Continuous Delivery.
@@ -130,9 +144,9 @@ export const SCOPED_RESOURCES = {
130
144
  resources: [
131
145
  'Clusters'
132
146
  ]
133
- }
147
+ },
134
148
  },
135
- clusterScopedApiGroups: {
149
+ [SCOPED_RESOURCE_GROUPS.CLUSTER]: {
136
150
  // Cluster scoped resources are for non-namespaced
137
151
  // resources at the cluster level, for example,
138
152
  // storage resources.
@@ -201,15 +215,16 @@ export const SCOPED_RESOURCES = {
201
215
  },
202
216
  neuvectorApi: {
203
217
  resources: [
204
- 'nv-perm.admctrl',
205
- 'nv-perm.authentication',
206
- 'nv-perm.ci-scan',
207
- 'nv-perm.fed',
208
- 'nv-perm.vulnerability'
218
+ 'AdmissionControl',
219
+ 'Authentication',
220
+ 'CIScan',
221
+ 'Cluster',
222
+ 'Federation',
223
+ 'Vulnerability',
209
224
  ]
210
225
  }
211
226
  },
212
- projectScopedApiGroups: {
227
+ [SCOPED_RESOURCE_GROUPS.PROJECT_NAMESPACE]: {
213
228
  // Project scoped resources include all other namespaced
214
229
  // resources.
215
230
  coreKubernetesApi: {
@@ -378,16 +393,16 @@ export const SCOPED_RESOURCES = {
378
393
  },
379
394
  neuvectorApi: {
380
395
  resources: [
381
- 'nv-perm.all-permissions',
382
- 'nv-perm.audit-events',
383
- 'nv-perm.authorization',
384
- 'nv-perm.compliance',
385
- 'nv-perm.events',
386
- 'nv-perm.reg-scan',
387
- 'nv-perm.rt-policy',
388
- 'nv-perm.rt-scan',
389
- 'nv-perm.security-events',
390
- 'nv-perm.config',
396
+ 'AuditEvents',
397
+ 'Authorization',
398
+ 'Compliance',
399
+ 'Events',
400
+ 'Namespace',
401
+ 'RegistryScan',
402
+ 'RuntimePolicy',
403
+ 'RuntimeScan',
404
+ 'SecurityEvents',
405
+ 'SystemConfig',
391
406
  ]
392
407
  }
393
408
  }
@@ -5,7 +5,7 @@ import { tryInitialSetup } from '@shell/utils/auth';
5
5
  import { routeRequiresAuthentication } from '@shell/utils/router';
6
6
 
7
7
  export function install(router, context) {
8
- router.beforeEach((to, from, next) => attemptFirstLogin(to, from, next, context));
8
+ router.beforeEach(async(to, from, next) => await attemptFirstLogin(to, from, next, context));
9
9
  }
10
10
 
11
11
  export async function attemptFirstLogin(to, from, next, { store }) {
@@ -2,7 +2,7 @@ import { routeRequiresAuthentication } from '@shell/utils/router';
2
2
  import { isLoggedIn, notLoggedIn, noAuth, findMe } from '@shell/utils/auth';
3
3
 
4
4
  export function install(router, context) {
5
- router.beforeEach((to, from, next) => authenticate(to, from, next, context));
5
+ router.beforeEach(async(to, from, next) => await authenticate(to, from, next, context));
6
6
  }
7
7
 
8
8
  export async function authenticate(to, from, next, { store }) {
@@ -1,5 +1,5 @@
1
1
  export function install(router, context) {
2
- router.beforeEach((to, from, next) => loadI18n(to, from, next, context));
2
+ router.beforeEach(async(to, from, next) => await loadI18n(to, from, next, context));
3
3
  }
4
4
 
5
5
  export async function loadI18n(to, from, next, { store }) {
@@ -1,6 +1,7 @@
1
1
  import { install as installLoadInitialSettings } from '@shell/config/router/navigation-guards/load-initial-settings';
2
2
  import { install as installAttemptFirstLogin } from '@shell/config/router/navigation-guards/attempt-first-login';
3
3
  import { install as installAuthentication } from '@shell/config/router/navigation-guards/authentication';
4
+ import { install as installRuntimeExtensionRoute } from '@shell/config/router/navigation-guards/runtime-extension-route';
4
5
  import { install as installI18N } from '@shell/config/router/navigation-guards/i18n';
5
6
 
6
7
  /**
@@ -10,7 +11,7 @@ export function installNavigationGuards(router, context) {
10
11
  // NOTE: the order of the installation matters.
11
12
  // Be intentional when adding, removing or modifying the guards that are installed.
12
13
 
13
- const navigationGuardInstallers = [installLoadInitialSettings, installAttemptFirstLogin, installAuthentication, installI18N];
14
+ const navigationGuardInstallers = [installLoadInitialSettings, installAttemptFirstLogin, installAuthentication, installRuntimeExtensionRoute, installI18N];
14
15
 
15
16
  navigationGuardInstallers.forEach((installer) => installer(router, context));
16
17
  }
@@ -1,7 +1,7 @@
1
1
  import { fetchInitialSettings } from '@shell/utils/settings';
2
2
 
3
3
  export function install(router, context) {
4
- router.beforeEach((to, from, next) => loadInitialSettings(to, from, next, context));
4
+ router.beforeEach(async(to, from, next) => await loadInitialSettings(to, from, next, context));
5
5
  }
6
6
 
7
7
  export async function loadInitialSettings(to, from, next, { store }) {
@@ -0,0 +1,31 @@
1
+ import dynamicPluginLoader from '@shell/pkg/dynamic-plugin-loader';
2
+ import { routeRequiresAuthentication } from '@shell/utils/router';
3
+
4
+ export function install(router, context) {
5
+ router.beforeEach((to, from, next) => runtimeExtensionRoute(to, from, next, context));
6
+ }
7
+
8
+ export async function runtimeExtensionRoute(to, from, next, { store }) {
9
+ if (!routeRequiresAuthentication(to) || to.name !== '404') {
10
+ return next();
11
+ }
12
+
13
+ try {
14
+ // Handle the loading of dynamic plugins (Harvester) because we only want to attempt to load those plugins and routes if we first couldn't find a page.
15
+ // We should probably get rid of this concept entirely and just load plugins at the start.
16
+ await store.dispatch('loadManagement');
17
+ const newLocation = await dynamicPluginLoader.check({ route: { path: window.location.pathname }, store });
18
+
19
+ // If we have a new location, double check that it's actually valid
20
+ const resolvedRoute = newLocation?.path ? store.app.router.resolve({ path: newLocation.path.replace(/^\/{0,1}dashboard/, '') }) : null;
21
+
22
+ if (resolvedRoute?.route.matched.length) {
23
+ // Note - don't use `redirect` or `store.app.route` (breaks feature by failing to run middleware in default layout)
24
+ return next(resolvedRoute.resolved.path);
25
+ }
26
+ } catch (e) {
27
+ console.error('Failed to load harvester', e); // eslint-disable-line no-console
28
+ }
29
+
30
+ next();
31
+ }
@@ -41,6 +41,7 @@ export default [
41
41
  path: '',
42
42
  component: () => interopDefault(import('@shell/components/templates/home.vue')),
43
43
  meta: { requiresAuthentication: true },
44
+ name: 'home_layout',
44
45
  children: [
45
46
  {
46
47
  path: '/home',
@@ -484,4 +485,12 @@ export default [
484
485
  component: () => interopDefault(import('@shell/pages/c/_cluster/_product/_resource/_namespace/_id.vue')),
485
486
  name: 'c-cluster-product-resource-namespace-id'
486
487
  }]
487
- }];
488
+ },
489
+ {
490
+ path: '*',
491
+ name: '404',
492
+ component: () => interopDefault(import('@shell/pages/404.vue')),
493
+ meta: { requiresAuthentication: true },
494
+ },
495
+
496
+ ];