@rancher/shell 0.1.2 → 0.1.3

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 (258) hide show
  1. package/assets/translations/en-us.yaml +27 -769
  2. package/assets/translations/zh-hans.yaml +8 -769
  3. package/components/ActionMenu.vue +3 -3
  4. package/components/CodeMirror.vue +6 -8
  5. package/components/CommunityLinks.vue +1 -1
  6. package/components/ContainerResourceLimit.vue +14 -0
  7. package/components/ExplorerMembers.vue +123 -0
  8. package/components/ExplorerProjectsNamespaces.vue +405 -0
  9. package/components/GrafanaDashboard.vue +17 -2
  10. package/components/LocaleSelector.vue +81 -0
  11. package/components/PromptModal.vue +2 -3
  12. package/components/ResourceList/index.vue +1 -1
  13. package/components/ResourceTable.vue +3 -6
  14. package/components/SingleClusterInfo.vue +1 -1
  15. package/components/SortableTable/index.vue +23 -20
  16. package/components/SortableTable/selection.js +1 -0
  17. package/components/auth/AzureWarning.vue +5 -1
  18. package/components/auth/Principal.vue +1 -1
  19. package/components/auth/RoleDetailEdit.vue +18 -11
  20. package/components/fleet/FleetRepos.vue +0 -2
  21. package/components/form/NameNsDescription.vue +4 -6
  22. package/components/form/NodeScheduling.vue +1 -1
  23. package/components/form/WorkloadPorts.vue +1 -1
  24. package/components/formatter/WorkloadHealthScale.vue +1 -1
  25. package/components/nav/Header.vue +9 -9
  26. package/components/nav/NamespaceFilter.vue +7 -4
  27. package/components/nav/TopLevelMenu.vue +6 -43
  28. package/components/nav/WindowManager/ContainerLogs.vue +1 -1
  29. package/config/product/harvester-manager.js +64 -2
  30. package/config/product/manager.js +9 -0
  31. package/config/settings.js +17 -71
  32. package/config/table-headers.js +0 -1
  33. package/config/types.js +5 -25
  34. package/core/plugin-routes.ts +34 -22
  35. package/core/plugin.ts +15 -3
  36. package/core/plugins-loader.js +2 -0
  37. package/core/plugins.js +79 -36
  38. package/core/types.ts +7 -1
  39. package/detail/provisioning.cattle.io.cluster.vue +13 -0
  40. package/detail/workload/index.vue +11 -5
  41. package/{components/dialog → dialog}/AddClusterMemberDialog.vue +0 -0
  42. package/{components/dialog → dialog}/AddCustomBadgeDialog.vue +0 -0
  43. package/{components/dialog → dialog}/AddProjectMemberDialog.vue +0 -0
  44. package/{components/dialog → dialog}/AddonConfigConfirmationDialog.vue +0 -0
  45. package/{components/dialog → dialog}/DrainNode.vue +0 -0
  46. package/{components/dialog → dialog}/ForceMachineRemoveDialog.vue +0 -0
  47. package/{components/dialog → dialog}/GenericPrompt.vue +0 -0
  48. package/{components/dialog → dialog}/RollbackWorkloadDialog.vue +0 -0
  49. package/{components/dialog → dialog}/RotateCertificatesDialog.vue +0 -0
  50. package/{components/dialog → dialog}/RotateEncryptionKeyDialog.vue +0 -0
  51. package/{components/dialog → dialog}/SaveAsRKETemplateDialog.vue +0 -0
  52. package/{components/dialog → dialog}/ScaleMachineDownDialog.vue +0 -0
  53. package/edit/auth/azuread.vue +20 -1
  54. package/edit/management.cattle.io.project.vue +2 -2
  55. package/edit/namespace.vue +17 -10
  56. package/edit/persistentvolumeclaim.vue +1 -0
  57. package/edit/provisioning.cattle.io.cluster/CustomCommand.vue +1 -1
  58. package/edit/provisioning.cattle.io.cluster/MachinePool.vue +33 -5
  59. package/edit/service.vue +1 -1
  60. package/edit/workload/index.vue +363 -15
  61. package/edit/workload/mixins/workload.js +62 -7
  62. package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +1 -0
  63. package/layouts/default.vue +52 -27
  64. package/layouts/error.vue +5 -1
  65. package/layouts/home.vue +6 -2
  66. package/list/harvesterhci.io.management.cluster.vue +74 -33
  67. package/list/namespace.vue +3 -5
  68. package/machine-config/amazonec2.vue +2 -0
  69. package/machine-config/harvester.vue +96 -49
  70. package/middleware/authenticated.js +56 -52
  71. package/mixins/form-validation.js +1 -1
  72. package/mixins/resource-fetch.js +3 -1
  73. package/models/fleet.cattle.io.bundle.js +26 -19
  74. package/models/harvesterhci.io.management.cluster.js +194 -5
  75. package/models/management.cattle.io.cluster.js +1 -1
  76. package/models/management.cattle.io.clusterroletemplatebinding.js +9 -0
  77. package/models/management.cattle.io.project.js +23 -2
  78. package/models/namespace.js +19 -3
  79. package/models/pod.js +19 -2
  80. package/models/provisioning.cattle.io.cluster.js +4 -0
  81. package/models/workload.js +4 -243
  82. package/models/workload.service.js +314 -0
  83. package/nuxt.config.js +11 -9
  84. package/package.json +3 -3
  85. package/pages/auth/login.vue +11 -2
  86. package/pages/auth/setup.vue +1 -1
  87. package/pages/c/_cluster/_product/members/index.vue +3 -93
  88. package/pages/c/_cluster/_product/projectsnamespaces.vue +6 -403
  89. package/pages/c/_cluster/settings/performance.vue +19 -16
  90. package/pages/fail-whale.vue +1 -10
  91. package/pages/index.vue +18 -4
  92. package/pages/plugins.vue +2 -2
  93. package/pages/prefs.vue +8 -6
  94. package/pkg/auto-import.js +44 -7
  95. package/pkg/dynamic-plugin-loader.js +28 -0
  96. package/pkg/import.js +2 -2
  97. package/pkg/model-loader-require.lib.js +3 -0
  98. package/pkg/vue.config.js +9 -6
  99. package/plugins/dashboard-store/model-loader-require.js +12 -0
  100. package/plugins/dashboard-store/model-loader.js +4 -1
  101. package/plugins/dashboard-store/resource-class.js +10 -3
  102. package/plugins/steve/actions.js +1 -1
  103. package/plugins/steve/index.js +6 -4
  104. package/plugins/steve/subscribe.js +34 -23
  105. package/rancher-components/Form/Checkbox/Checkbox.test.ts +77 -0
  106. package/rancher-components/Form/Checkbox/Checkbox.vue +12 -2
  107. package/scripts/build-pkg.sh +48 -2
  108. package/scripts/drone-build-pkg.sh +31 -0
  109. package/scripts/publish-shell.sh +10 -11
  110. package/scripts/serve-pkgs +17 -10
  111. package/store/catalog.js +3 -1
  112. package/store/i18n.js +16 -11
  113. package/store/index.js +4 -181
  114. package/store/prefs.js +30 -2
  115. package/store/type-map.js +16 -29
  116. package/utils/cluster.js +1 -1
  117. package/utils/custom-validators.js +1 -12
  118. package/utils/dynamic-importer.js +1 -1
  119. package/utils/validators/setting.js +0 -35
  120. package/components/FilterLabel.vue +0 -254
  121. package/components/HarvesterUpgradeProgressBarList.vue +0 -109
  122. package/components/VMConsoleBar.vue +0 -87
  123. package/components/dialog/harvester/AddHotplugModal.vue +0 -159
  124. package/components/dialog/harvester/BackupModal.vue +0 -117
  125. package/components/dialog/harvester/CloneTemplate.vue +0 -125
  126. package/components/dialog/harvester/EjectCDROMDialog.vue +0 -157
  127. package/components/dialog/harvester/ExportImageDialog.vue +0 -152
  128. package/components/dialog/harvester/MaintenanceDialog.vue +0 -94
  129. package/components/dialog/harvester/MigrationDialog.vue +0 -154
  130. package/components/dialog/harvester/RestoreDialog.vue +0 -153
  131. package/components/dialog/harvester/SupportBundle.vue +0 -217
  132. package/components/dialog/harvester/UnplugVolume.vue +0 -108
  133. package/components/form/SerialConsole/index.vue +0 -267
  134. package/components/formatter/AttachVMWithName.vue +0 -46
  135. package/components/formatter/CloudInitType.vue +0 -27
  136. package/components/formatter/HarvesterBackupTargetValidation.vue +0 -43
  137. package/components/formatter/HarvesterCPUUsed.vue +0 -122
  138. package/components/formatter/HarvesterDiskState.vue +0 -66
  139. package/components/formatter/HarvesterHostName.vue +0 -66
  140. package/components/formatter/HarvesterIpAddress.vue +0 -90
  141. package/components/formatter/HarvesterMemoryUsed.vue +0 -140
  142. package/components/formatter/HarvesterMigrationState.vue +0 -85
  143. package/components/formatter/HarvesterNodeName.vue +0 -49
  144. package/components/formatter/HarvesterStorageUsed.vue +0 -194
  145. package/components/formatter/HarvesterVmState.vue +0 -123
  146. package/components/nav/HarvesterUpgrade.vue +0 -232
  147. package/components/novnc/NovncConsole.vue +0 -93
  148. package/components/novnc/NovncConsoleItem.vue +0 -89
  149. package/components/novnc/NovncConsoleWrapper.vue +0 -243
  150. package/config/harvester-map.js +0 -44
  151. package/config/harvester-table-headers.js +0 -27
  152. package/config/product/harvester.js +0 -305
  153. package/detail/harvesterhci.io.host/HarvesterHostBasic.vue +0 -364
  154. package/detail/harvesterhci.io.host/HarvesterHostDisk.vue +0 -200
  155. package/detail/harvesterhci.io.host/HarvesterHostNetwork.vue +0 -89
  156. package/detail/harvesterhci.io.host/VirtualMachineInstance.vue +0 -134
  157. package/detail/harvesterhci.io.host/index.vue +0 -243
  158. package/detail/harvesterhci.io.virtualmachinebackup/index.vue +0 -221
  159. package/detail/harvesterhci.io.virtualmachineimage.vue +0 -118
  160. package/detail/kubevirt.io.virtualmachine/VirtualMachineTabs/VirtualMachineBasics.vue +0 -279
  161. package/detail/kubevirt.io.virtualmachine/VirtualMachineTabs/VirtualMachineEvents.vue +0 -75
  162. package/detail/kubevirt.io.virtualmachine/VirtualMachineTabs/VirtualMachineKeypairs.vue +0 -114
  163. package/detail/kubevirt.io.virtualmachine/VirtualMachineTabs/VirtualMachineMigration.vue +0 -79
  164. package/detail/kubevirt.io.virtualmachine/index.vue +0 -213
  165. package/edit/harvesterhci.io.cloudtemplate.vue +0 -123
  166. package/edit/harvesterhci.io.host/HarvesterDisk.vue +0 -262
  167. package/edit/harvesterhci.io.host/index.vue +0 -533
  168. package/edit/harvesterhci.io.keypair.vue +0 -112
  169. package/edit/harvesterhci.io.managedchart/index.vue +0 -25
  170. package/edit/harvesterhci.io.managedchart/rancher-monitoring.vue +0 -172
  171. package/edit/harvesterhci.io.networkattachmentdefinition.vue +0 -210
  172. package/edit/harvesterhci.io.setting/additional-ca.vue +0 -36
  173. package/edit/harvesterhci.io.setting/backup-target.vue +0 -182
  174. package/edit/harvesterhci.io.setting/http-proxy.vue +0 -79
  175. package/edit/harvesterhci.io.setting/index.vue +0 -201
  176. package/edit/harvesterhci.io.setting/overcommit-config.vue +0 -94
  177. package/edit/harvesterhci.io.setting/ssl-certificates.vue +0 -117
  178. package/edit/harvesterhci.io.setting/ssl-parameters.vue +0 -161
  179. package/edit/harvesterhci.io.setting/support-bundle-image.vue +0 -134
  180. package/edit/harvesterhci.io.setting/support-bundle-namespaces.vue +0 -73
  181. package/edit/harvesterhci.io.setting/vip-pools.vue +0 -244
  182. package/edit/harvesterhci.io.setting/vm-force-reset-policy.vue +0 -81
  183. package/edit/harvesterhci.io.virtualmachinebackup.vue +0 -256
  184. package/edit/harvesterhci.io.virtualmachineimage.vue +0 -364
  185. package/edit/harvesterhci.io.virtualmachinetemplateversion.vue +0 -340
  186. package/edit/harvesterhci.io.volume.vue +0 -195
  187. package/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/AccessCredentialsUsers.vue +0 -190
  188. package/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/index.vue +0 -212
  189. package/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/type/basicAuth.vue +0 -94
  190. package/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/type/sshkey.vue +0 -85
  191. package/edit/kubevirt.io.virtualmachine/VirtualMachineCloudConfig/DataTemplate.vue +0 -153
  192. package/edit/kubevirt.io.virtualmachine/VirtualMachineCloudConfig/index.vue +0 -279
  193. package/edit/kubevirt.io.virtualmachine/VirtualMachineCpuMemory.vue +0 -113
  194. package/edit/kubevirt.io.virtualmachine/VirtualMachineNetwork/__tests__/HarvesterEditNetwork.test.ts +0 -41
  195. package/edit/kubevirt.io.virtualmachine/VirtualMachineNetwork/base.vue +0 -281
  196. package/edit/kubevirt.io.virtualmachine/VirtualMachineNetwork/index.vue +0 -142
  197. package/edit/kubevirt.io.virtualmachine/VirtualMachineReserved.vue +0 -54
  198. package/edit/kubevirt.io.virtualmachine/VirtualMachineSSHKey.vue +0 -256
  199. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/index.vue +0 -391
  200. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/__tests__/HarvesterEditContainer.test.ts +0 -40
  201. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/__tests__/HarvesterEditExisting.test.ts +0 -102
  202. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/__tests__/HarvesterEditVMImage.test.ts +0 -117
  203. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/__tests__/HarvesterEditVolume.test.ts +0 -74
  204. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/container.vue +0 -132
  205. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/existing.vue +0 -303
  206. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/vmImage.vue +0 -285
  207. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/volume.vue +0 -188
  208. package/edit/kubevirt.io.virtualmachine/index.vue +0 -642
  209. package/edit/network.harvesterhci.io.clusternetwork/index.vue +0 -19
  210. package/edit/network.harvesterhci.io.clusternetwork/vlan.vue +0 -134
  211. package/edit/workload/types/Deployment.vue +0 -377
  212. package/edit/workload/types/Generic.vue +0 -295
  213. package/list/harvesterhci.io.cloudtemplate.vue +0 -78
  214. package/list/harvesterhci.io.dashboard/HarvesterUpgrade.vue +0 -211
  215. package/list/harvesterhci.io.dashboard/UpgradeInfo.vue +0 -40
  216. package/list/harvesterhci.io.dashboard/index.vue +0 -752
  217. package/list/harvesterhci.io.host/index.vue +0 -186
  218. package/list/harvesterhci.io.networkattachmentdefinition.vue +0 -167
  219. package/list/harvesterhci.io.setting.vue +0 -241
  220. package/list/harvesterhci.io.virtualmachinebackup.vue +0 -172
  221. package/list/harvesterhci.io.virtualmachineimage.vue +0 -80
  222. package/list/harvesterhci.io.virtualmachinetemplateversion.vue +0 -173
  223. package/list/harvesterhci.io.volume.vue +0 -122
  224. package/list/kubevirt.io.virtualmachine.vue +0 -193
  225. package/mixins/harvester-vm/impl.js +0 -267
  226. package/mixins/harvester-vm/index.js +0 -1357
  227. package/models/harvester/configmap.js +0 -32
  228. package/models/harvester/harvesterhci.io.blockdevice.js +0 -55
  229. package/models/harvester/harvesterhci.io.keypair.js +0 -12
  230. package/models/harvester/harvesterhci.io.setting.js +0 -127
  231. package/models/harvester/harvesterhci.io.supportbundle.js +0 -35
  232. package/models/harvester/harvesterhci.io.upgrade.js +0 -226
  233. package/models/harvester/harvesterhci.io.virtualmachinebackup.js +0 -116
  234. package/models/harvester/harvesterhci.io.virtualmachineimage.js +0 -255
  235. package/models/harvester/harvesterhci.io.virtualmachinerestore.js +0 -43
  236. package/models/harvester/harvesterhci.io.virtualmachinetemplate.js +0 -69
  237. package/models/harvester/harvesterhci.io.virtualmachinetemplateversion.js +0 -227
  238. package/models/harvester/k8s.cni.cncf.io.networkattachmentdefinition.js +0 -32
  239. package/models/harvester/kubevirt.io.virtualmachine.js +0 -850
  240. package/models/harvester/kubevirt.io.virtualmachineinstance.js +0 -142
  241. package/models/harvester/management.cattle.io.managedchart.js +0 -191
  242. package/models/harvester/management.cattle.io.setting.js +0 -40
  243. package/models/harvester/network.harvesterhci.io.clusternetwork.js +0 -100
  244. package/models/harvester/network.harvesterhci.io.nodenetwork.js +0 -34
  245. package/models/harvester/node.js +0 -255
  246. package/models/harvester/persistentvolumeclaim.js +0 -166
  247. package/models/harvester/pod.js +0 -185
  248. package/pages/c/_cluster/harvester/airgapupgrade/index.vue +0 -309
  249. package/pages/c/_cluster/harvester/console/_uid/serial.vue +0 -51
  250. package/pages/c/_cluster/harvester/console/_uid/vnc.vue +0 -52
  251. package/pages/c/_cluster/harvester/index.vue +0 -24
  252. package/pages/c/_cluster/harvester/support/index.vue +0 -154
  253. package/pkg/model-loader.lib.js +0 -3
  254. package/promptRemove/kubevirt.io.virtualmachine.vue +0 -164
  255. package/store/harvester-common.js +0 -126
  256. package/utils/validators/vm-datavolumes.js +0 -38
  257. package/utils/validators/vm-image.js +0 -32
  258. package/utils/validators/vm.js +0 -221
@@ -0,0 +1,81 @@
1
+ <script>
2
+ import { mapGetters } from 'vuex';
3
+
4
+ export default {
5
+ name: 'LocalSelector',
6
+
7
+ computed: {
8
+ ...mapGetters('i18n', ['selectedLocaleLabel', 'availableLocales']),
9
+
10
+ showLocale() {
11
+ return (this.availableLocales && Object.keys(this.availableLocales).length > 1) || this.dev;
12
+ },
13
+
14
+ showNone() {
15
+ return !!process.env.dev && this.dev;
16
+ },
17
+ },
18
+
19
+ methods: {
20
+ switchLocale(locale) {
21
+ this.$store.dispatch('i18n/switchTo', locale);
22
+ },
23
+ }
24
+ };
25
+ </script>
26
+
27
+ <template>
28
+ <div v-if="showLocale">
29
+ <v-popover
30
+ popover-class="localeSelector"
31
+ placement="top"
32
+ trigger="click"
33
+ >
34
+ <a
35
+ data-testid="locale-selector"
36
+ class="locale-chooser"
37
+ >
38
+ {{ selectedLocaleLabel }}
39
+ <i class="icon icon-fw icon-sort-down" />
40
+ </a>
41
+
42
+ <template slot="popover">
43
+ <ul class="list-unstyled dropdown" style="margin: -1px;">
44
+ <li v-if="showNone" v-t="'locale.none'" class="hand" @click="switchLocale('none')" />
45
+ <li
46
+ v-for="(label, name) in availableLocales"
47
+ :key="name"
48
+ class="hand"
49
+ @click="switchLocale(name)"
50
+ >
51
+ {{ label }}
52
+ </li>
53
+ </ul>
54
+ </template>
55
+ </v-popover>
56
+ </div>
57
+ </template>
58
+
59
+ <style lang="scss" scoped>
60
+ .advanced {
61
+ user-select: none;
62
+ padding: 0 5px;
63
+ line-height: 40px;
64
+ font-size: 15px;
65
+ font-weight: 500;
66
+ }
67
+ .content {
68
+ background: var(--nav-active);
69
+ padding: 10px;
70
+ margin-top: 6px;
71
+ border-radius: 4px;
72
+ }
73
+
74
+ .locale-chooser {
75
+ cursor: pointer;
76
+
77
+ &:hover {
78
+ text-decoration: none;
79
+ }
80
+ }
81
+ </style>
@@ -1,7 +1,6 @@
1
1
  <script>
2
2
  import { mapState } from 'vuex';
3
3
  import { isArray } from '@shell/utils/array';
4
- import { importDialog } from '@shell/utils/dynamic-importer';
5
4
 
6
5
  /**
7
6
  * @name PromptModal
@@ -32,8 +31,8 @@ export default {
32
31
  return this.modalData?.modalWidth || '600px';
33
32
  },
34
33
  component() {
35
- // Looks for a dialog component by looking up @shell/components/dialog/${name}.
36
- return importDialog(this.modalData?.component);
34
+ // Looks for a dialog component by looking up in plugins and @shell/dialog/${name}.
35
+ return this.$store.getters['type-map/importDialog'](this.modalData?.component);
37
36
  },
38
37
  cssProps() {
39
38
  // this computed property lets us generate a scss var that we can use in the style
@@ -50,7 +50,7 @@ export default {
50
50
 
51
51
  if ( !hasFetch ) {
52
52
  if ( !schema ) {
53
- store.dispatch('loadingError', `Type ${ resource } not found`);
53
+ store.dispatch('loadingError', new Error(`Type ${ resource } not found, unable to display list`));
54
54
 
55
55
  return;
56
56
  }
@@ -6,7 +6,6 @@ import ButtonGroup from '@shell/components/ButtonGroup';
6
6
  import SortableTable from '@shell/components/SortableTable';
7
7
  import { NAMESPACE } from '@shell/config/table-headers';
8
8
  import { findBy } from '@shell/utils/array';
9
- import { NAME as HARVESTER } from '@shell/config/product/harvester';
10
9
 
11
10
  // Default group-by in the case the group stored in the preference does not apply
12
11
  const DEFAULT_GROUP = 'namespace';
@@ -133,7 +132,7 @@ export default {
133
132
  },
134
133
 
135
134
  computed: {
136
- ...mapGetters(['isVirtualCluster']),
135
+ ...mapGetters(['currentProduct']),
137
136
  isNamespaced() {
138
137
  if ( this.namespaced !== null ) {
139
138
  return this.namespaced;
@@ -196,11 +195,9 @@ export default {
196
195
 
197
196
  filteredRows() {
198
197
  const isAll = this.$store.getters['isAllNamespaces'];
199
- const isVirtualProduct = this.$store.getters['currentProduct'].name === HARVESTER;
200
198
 
201
199
  // If the resources isn't namespaced or we want ALL of them, there's nothing to do.
202
- // If this is a harvester list, 'all' must still be filtered
203
- if ( !this.isNamespaced || (isAll && !isVirtualProduct)) {
200
+ if ( !this.isNamespaced || (isAll && !this.currentProduct?.hideSystemResources)) {
204
201
  return this.rows || [];
205
202
  }
206
203
 
@@ -212,7 +209,7 @@ export default {
212
209
  }
213
210
 
214
211
  return this.rows.filter((row) => {
215
- if (this.isVirtualCluster && this.isNamespaced) {
212
+ if (this.currentProduct?.hideSystemResources && this.isNamespaced) {
216
213
  return !!includedNamespaces[row.metadata.namespace] && !row.isSystemResource;
217
214
  } else if (!this.isNamespaced) {
218
215
  return true;
@@ -87,7 +87,7 @@ export default {
87
87
  <template>
88
88
  <div v-if="clusterDetail">
89
89
  <div class="single-cluster-header">
90
- <ClusterProviderIcon class="rancher-icon" width="32" />
90
+ <ClusterProviderIcon :cluster="clusterDetail" class="rancher-icon" width="32" />
91
91
  <h1>{{ t('glance.clusterInfo') }}</h1>
92
92
  </div>
93
93
 
@@ -20,19 +20,6 @@ import actions from './actions';
20
20
  // Uncomment for table performance debugging
21
21
  // import tableDebug from './debug';
22
22
 
23
- // Its quicker to render if we directly supply the components for the formatters
24
- // rather than just the name of a global component - so create a map of the formatter comoponents
25
- const FORMATTERS = {};
26
-
27
- const components = require.context('@shell/components/formatter', false, /[A-Z]\w+\.(vue)$/);
28
-
29
- components.keys().forEach((fileName) => {
30
- const componentConfig = components(fileName);
31
- const componentName = fileName.split('/').pop().split('.')[0];
32
-
33
- FORMATTERS[componentName] = componentConfig.default || componentConfig;
34
- });
35
-
36
23
  export const COLUMN_BREAKPOINTS = {
37
24
  /**
38
25
  * Only show column if at tablet width or wider
@@ -48,6 +35,19 @@ export const COLUMN_BREAKPOINTS = {
48
35
  DESKTOP: 'desktop'
49
36
  };
50
37
 
38
+ // Its quicker to render if we directly supply the components for the formatters
39
+ // rather than just the name of a global component - so create a map of the formatter comoponents
40
+ const FORMATTERS = {};
41
+
42
+ const components = require.context('@shell/components/formatter', false, /[A-Z]\w+\.(vue)$/);
43
+
44
+ components.keys().forEach((fileName) => {
45
+ const componentConfig = components(fileName);
46
+ const componentName = fileName.split('/').pop().split('.')[0];
47
+
48
+ FORMATTERS[componentName] = componentConfig.default || componentConfig;
49
+ });
50
+
51
51
  // @TODO:
52
52
  // Fixed header/scrolling
53
53
 
@@ -370,11 +370,14 @@ export default {
370
370
  },
371
371
 
372
372
  // Ensure we update live and delayed columns on first load
373
- initalLoad(neu, old) {
374
- if (neu && !old) {
375
- this._didinit = true;
376
- this.$nextTick(() => this.updateLiveAndDelayed());
377
- }
373
+ initalLoad: {
374
+ handler(neu) {
375
+ if (neu) {
376
+ this._didinit = true;
377
+ this.$nextTick(() => this.updateLiveAndDelayed());
378
+ }
379
+ },
380
+ immediate: true
378
381
  },
379
382
 
380
383
  isManualRefreshLoading(neu, old) {
@@ -400,7 +403,7 @@ export default {
400
403
  },
401
404
 
402
405
  initalLoad() {
403
- return !this.loading && !this._didinit && this.rows?.length;
406
+ return !!(!this.loading && !this._didinit && this.rows?.length);
404
407
  },
405
408
 
406
409
  fullColspan() {
@@ -863,7 +866,7 @@ export default {
863
866
  <template #button-content>
864
867
  <button ref="actionDropDown" class="btn bg-primary mr-0" :disabled="!selectedRows.length">
865
868
  <i class="icon icon-gear" />
866
- <span>{{ t('harvester.tableHeaders.actions') }}</span>
869
+ <span>{{ t('sortableTable.bulkActions.collapsed.label') }}</span>
867
870
  <i class="ml-10 icon icon-chevron-down" />
868
871
  </button>
869
872
  </template>
@@ -270,6 +270,7 @@ export default {
270
270
  this.$store.commit(`action-menu/show`, {
271
271
  resources,
272
272
  event: e.originalEvent || e, // Handle jQuery event and raw event
273
+ elem: actionElement
273
274
  });
274
275
 
275
276
  return;
@@ -3,6 +3,7 @@
3
3
  import { NORMAN, MANAGEMENT } from '@shell/config/types';
4
4
  import { get } from '@shell/utils/object';
5
5
  import { AZURE_MIGRATED } from '@shell/config/labels-annotations';
6
+ import { BLANK_CLUSTER } from '@shell/store';
6
7
 
7
8
  export default {
8
9
  async fetch() {
@@ -24,7 +25,10 @@ export default {
24
25
  authConfig: null,
25
26
  authConfigRoute: {
26
27
  name: 'c-cluster-auth-config-id',
27
- params: { id: 'azuread' }
28
+ params: {
29
+ cluster: this.$route.params.cluster || BLANK_CLUSTER,
30
+ id: 'azuread'
31
+ }
28
32
  }
29
33
  };
30
34
  },
@@ -119,7 +119,7 @@ export default {
119
119
  "avatar name"
120
120
  "avatar description";
121
121
  grid-template-columns: $size auto;
122
- grid-template-rows: math.div($size, 2) math.div($size, 2);
122
+ grid-template-rows: auto math.div($size, 2);
123
123
  column-gap: 10px;
124
124
 
125
125
  &.showLabels {
@@ -80,11 +80,14 @@ export default {
80
80
  // users to freely type in resources that are not shown in the list.
81
81
 
82
82
  if (this.value.subtype === CLUSTER || this.value.subtype === NAMESPACE) {
83
- this.templateOptions = (await this.$store.dispatch(`management/findAll`, { type: MANAGEMENT.ROLE_TEMPLATE }))
84
- .map(option => ({
85
- label: option.nameDisplay,
86
- value: option.id
87
- }));
83
+ (await this.$store.dispatch(`management/findAll`, { type: MANAGEMENT.ROLE_TEMPLATE })).forEach((template) => {
84
+ // Ensure we have quick access to a specific template. This allows unselected drop downs to show the correct value
85
+ this.keyedTemplateOptions[template.id] = {
86
+ label: template.nameDisplay,
87
+ value: template.id
88
+ };
89
+ });
90
+ this.templateOptions = Object.values(this.keyedTemplateOptions);
88
91
  }
89
92
  },
90
93
 
@@ -97,11 +100,13 @@ export default {
97
100
  resources: [],
98
101
  verbs: []
99
102
  },
100
- verbOptions: VERBS,
101
- templateOptions: [],
102
- resources: this.value.resources,
103
- scopedResources: SCOPED_RESOURCES,
104
- defaultValue: false,
103
+ verbOptions: VERBS,
104
+ templateOptions: [],
105
+ keyedTemplateOptions: {},
106
+ resources: this.value.resources,
107
+ scopedResources: SCOPED_RESOURCES,
108
+ defaultValue: false,
109
+ selectFocused: null,
105
110
  };
106
111
  },
107
112
 
@@ -682,10 +687,12 @@ export default {
682
687
  :taggable="false"
683
688
  :disabled="isBuiltin"
684
689
  :searchable="true"
685
- :options="templateOptions"
690
+ :options="selectFocused === props.i ? templateOptions : [keyedTemplateOptions[props.row.value]]"
686
691
  option-key="value"
687
692
  option-label="label"
688
693
  :mode="mode"
694
+ @on-focus="selectFocused = props.i"
695
+ @on-blur="selectFocused = null"
689
696
  />
690
697
  </div>
691
698
  </div>
@@ -1,5 +1,4 @@
1
1
  <script>
2
- import { mapGetters } from 'vuex';
3
2
  import ResourceTable from '@shell/components/ResourceTable';
4
3
  import Link from '@shell/components/formatter/Link';
5
4
  import Shortened from '@shell/components/formatter/Shortened';
@@ -32,7 +31,6 @@ export default {
32
31
  },
33
32
 
34
33
  computed: {
35
- ...mapGetters(['isVirtualCluster']),
36
34
  filteredRows() {
37
35
  if (!this.rows) {
38
36
  return [];
@@ -208,7 +208,7 @@ export default {
208
208
  },
209
209
 
210
210
  computed: {
211
- ...mapGetters(['isVirtualCluster', 'currentCluster']),
211
+ ...mapGetters(['currentProduct', 'currentCluster']),
212
212
  namespaceReallyDisabled() {
213
213
  return (
214
214
  !!this.forceNamespace || this.namespaceDisabled || this.mode === _EDIT
@@ -224,13 +224,11 @@ export default {
224
224
  const namespaces = this.namespacesOverride || this.$store.getters[`${ currentStore }/all`](this.namespaceType);
225
225
 
226
226
  const filtered = namespaces.filter( this.namespaceFilter || ((namespace) => {
227
- const isSettingSystemNamespace = this.$store.getters['systemNamespaces'].includes(namespace.metadata.name);
228
-
229
- if (this.isVirtualCluster) {
230
- // For virtual clusters, filter out the namespace
227
+ if (this.currentProduct?.hideSystemResources) {
228
+ // Filter out the namespace
231
229
  // if it is a system namespace or if it is managed by
232
230
  // Fleet.
233
- return !namespace.isSystem && !namespace.isFleetManaged && !isSettingSystemNamespace;
231
+ return !namespace.isSystem && !namespace.isFleetManaged;
234
232
  }
235
233
 
236
234
  // By default, include the namespace in the dropdown.
@@ -3,7 +3,7 @@ import { mapGetters } from 'vuex';
3
3
  import { RadioGroup } from '@components/Form/Radio';
4
4
  import LabeledSelect from '@shell/components/form/LabeledSelect';
5
5
  import NodeAffinity from '@shell/components/form/NodeAffinity';
6
- import { NAME as VIRTUAL } from '@shell/config/product/harvester';
6
+ import { HARVESTER_NAME as VIRTUAL } from '@shell/config/product/harvester-manager';
7
7
  import { _VIEW } from '@shell/config/query-params';
8
8
  import { isEmpty } from '@shell/utils/object';
9
9
  import { HOSTNAME } from '@shell/config/labels-annotations';
@@ -8,7 +8,7 @@ import { LabeledInput } from '@components/Form/LabeledInput';
8
8
  import LabeledSelect from '@shell/components/form/LabeledSelect';
9
9
  import { HCI as HCI_LABELS_ANNOTATIONS } from '@shell/config/labels-annotations';
10
10
  import { isHarvesterSatisfiesVersion } from '@shell/utils/cluster';
11
- import { NAME as HARVESTER } from '@shell/config/product/harvester';
11
+ import { HARVESTER_NAME as HARVESTER } from '@shell/config/product/harvester-manager';
12
12
  import { CAPI, SERVICE } from '@shell/config/types';
13
13
 
14
14
  export default {
@@ -2,7 +2,7 @@
2
2
  import Vue from 'vue';
3
3
  import ProgressBarMulti from '@shell/components/ProgressBarMulti';
4
4
  import PlusMinus from '@shell/components/form/PlusMinus';
5
- import { SCALABLE_WORKLOAD_TYPES } from '~shell/config/types';
5
+ import { SCALABLE_WORKLOAD_TYPES } from '@shell/config/types';
6
6
  import { ucFirst } from '@shell/utils/string';
7
7
 
8
8
  const SCALABLE_TYPES = Object.values(SCALABLE_WORKLOAD_TYPES);
@@ -2,7 +2,6 @@
2
2
  import { mapGetters } from 'vuex';
3
3
  import debounce from 'lodash/debounce';
4
4
  import { NORMAN, STEVE } from '@shell/config/types';
5
- import { NAME as VIRTUAL } from '@shell/config/product/harvester';
6
5
  import { ucFirst } from '@shell/utils/string';
7
6
  import { isMac } from '@shell/utils/platform';
8
7
  import Import from '@shell/components/Import';
@@ -13,7 +12,6 @@ import ClusterBadge from '@shell/components/ClusterBadge';
13
12
  import { LOGGED_OUT } from '@shell/config/query-params';
14
13
  import NamespaceFilter from './NamespaceFilter';
15
14
  import WorkspaceSwitcher from './WorkspaceSwitcher';
16
- import HarvesterUpgrade from './HarvesterUpgrade.vue';
17
15
  import TopLevelMenu from './TopLevelMenu';
18
16
  import Jump from './Jump';
19
17
  import { allHash } from '@shell/utils/promise';
@@ -31,7 +29,6 @@ export default {
31
29
  BrandImage,
32
30
  ClusterBadge,
33
31
  ClusterProviderIcon,
34
- HarvesterUpgrade
35
32
  },
36
33
 
37
34
  props: {
@@ -51,14 +48,14 @@ export default {
51
48
  kubeConfigCopying: false,
52
49
  searchShortcut,
53
50
  shellShortcut,
54
- VIRTUAL,
55
51
  LOGGED_OUT,
52
+ navHeaderRight: null
56
53
  };
57
54
  },
58
55
 
59
56
  computed: {
60
57
  ...mapGetters(['clusterReady', 'isExplorer', 'isMultiCluster', 'isRancher', 'currentCluster',
61
- 'currentProduct', 'backToRancherLink', 'backToRancherGlobalLink', 'pageActions', 'isSingleProduct', 'isVirtualCluster']),
58
+ 'currentProduct', 'backToRancherLink', 'backToRancherGlobalLink', 'pageActions', 'isSingleProduct']),
62
59
  ...mapGetters('type-map', ['activeProducts']),
63
60
 
64
61
  appName() {
@@ -94,12 +91,12 @@ export default {
94
91
  },
95
92
 
96
93
  showPreferencesLink() {
97
- return (this.$store.getters['management/schemaFor'](STEVE.PREFERENCE)?.resourceMethods || []).includes('PUT');
94
+ return (this.$store.getters['management/schemaFor'](STEVE.PREFERENCE, false, false)?.resourceMethods || []).includes('PUT');
98
95
  },
99
96
 
100
97
  showAccountAndApiKeyLink() {
101
98
  // Keep this simple for the moment and only check if the user can see tokens... plus the usual isRancher/isSingleProduct
102
- const canSeeTokens = this.$store.getters['rancher/schemaFor'](NORMAN.TOKEN);
99
+ const canSeeTokens = this.$store.getters['rancher/schemaFor'](NORMAN.TOKEN, false, false);
103
100
 
104
101
  return canSeeTokens && (this.isRancher || this.isSingleProduct);
105
102
  },
@@ -152,6 +149,7 @@ export default {
152
149
  }
153
150
  };
154
151
  },
152
+
155
153
  },
156
154
 
157
155
  watch: {
@@ -168,6 +166,8 @@ export default {
168
166
  window.addEventListener('resize', this.debouncedLayoutHeader);
169
167
 
170
168
  this.$nextTick(() => this.layoutHeader(null, true));
169
+
170
+ this.navHeaderRight = this.$plugin?.getDynamic('component', 'NavHeaderRight');
171
171
  },
172
172
 
173
173
  beforeDestroy() {
@@ -329,7 +329,8 @@ export default {
329
329
  <div class="spacer"></div>
330
330
 
331
331
  <div class="rd-header-right">
332
- <HarvesterUpgrade v-if="isVirtualCluster && currentProduct.name === VIRTUAL" />
332
+ <component :is="navHeaderRight" />
333
+
333
334
  <div
334
335
  v-if="(currentCluster || (currentProduct && currentProduct.customNamespaceFilter)) && !simple && (currentProduct.showNamespaceFilter || currentProduct.showWorkspaceSwitcher)"
335
336
  class="top"
@@ -457,7 +458,6 @@ export default {
457
458
  </div>
458
459
 
459
460
  <div class="header-spacer"></div>
460
-
461
461
  <div
462
462
  v-if="showUserMenu"
463
463
  class="user user-menu"
@@ -4,7 +4,6 @@ import { NAMESPACE_FILTERS, DEV } from '@shell/store/prefs';
4
4
  import { NAMESPACE, MANAGEMENT } from '@shell/config/types';
5
5
  import { sortBy } from '@shell/utils/sort';
6
6
  import { isArray, addObjects, findBy, filterBy } from '@shell/utils/array';
7
-
8
7
  import {
9
8
  NAMESPACE_FILTER_SPECIAL as SPECIAL,
10
9
  NAMESPACE_FILTER_ALL_USER as ALL_USER,
@@ -29,7 +28,7 @@ export default {
29
28
  },
30
29
 
31
30
  computed: {
32
- ...mapGetters(['isVirtualCluster', 'isMultiVirtualCluster', 'currentProduct']),
31
+ ...mapGetters(['currentProduct']),
33
32
 
34
33
  hasFilter() {
35
34
  return this.filter.length > 0;
@@ -97,7 +96,7 @@ export default {
97
96
  });
98
97
  }
99
98
 
100
- if (!this.isVirtualCluster) {
99
+ if (!this.currentProduct?.hideSystemResources) {
101
100
  out = [
102
101
  {
103
102
  id: ALL,
@@ -137,12 +136,16 @@ export default {
137
136
 
138
137
  namespaces = this.filterNamespaces(namespaces);
139
138
 
140
- if (this.$store.getters['isRancher'] || this.isMultiVirtualCluster) {
139
+ // isRancher = mgmt schemas are loaded and there's a project schema
140
+ if (this.$store.getters['isRancher']) {
141
141
  const cluster = this.$store.getters['currentCluster'];
142
142
  let projects = this.$store.getters['management/all'](
143
143
  MANAGEMENT.PROJECT
144
144
  );
145
145
 
146
+ projects = projects.filter((p) => {
147
+ return this.currentProduct?.hideSystemResources ? !p.isSystem && p.spec.clusterName === cluster.id : p.spec.clusterName === cluster.id;
148
+ });
146
149
  projects = sortBy(filterBy(projects, 'spec.clusterName', cluster.id), [
147
150
  'nameDisplay',
148
151
  ]);
@@ -1,6 +1,7 @@
1
1
  <script>
2
2
  import BrandImage from '@shell/components/BrandImage';
3
3
  import ClusterProviderIcon from '@shell/components/ClusterProviderIcon';
4
+ import LocaleSelector from '@shell/components/LocaleSelector';
4
5
  import { mapGetters } from 'vuex';
5
6
  import $ from 'jquery';
6
7
  import { CAPI, MANAGEMENT } from '@shell/config/types';
@@ -19,7 +20,9 @@ const UI_COMMIT = process.env.COMMIT || UNKNOWN;
19
20
 
20
21
  export default {
21
22
 
22
- components: { BrandImage, ClusterProviderIcon },
23
+ components: {
24
+ BrandImage, ClusterProviderIcon, LocaleSelector
25
+ },
23
26
 
24
27
  data() {
25
28
  const { displayVersion, fullVersion } = getVersionInfo(this.$store);
@@ -46,7 +49,6 @@ export default {
46
49
  ...mapGetters(['clusterId']),
47
50
  ...mapGetters(['clusterReady', 'isRancher', 'currentCluster', 'currentProduct']),
48
51
  ...mapGetters('type-map', ['activeProducts']),
49
- ...mapGetters('i18n', ['selectedLocaleLabel', 'availableLocales']),
50
52
  ...mapGetters({ features: 'features/get' }),
51
53
 
52
54
  value: {
@@ -108,14 +110,6 @@ export default {
108
110
 
109
111
  maxClustersToShow: mapPref(MENU_MAX_CLUSTERS),
110
112
 
111
- showLocale() {
112
- return Object.keys(this.availableLocales).length > 1 || this.dev;
113
- },
114
-
115
- showNone() {
116
- return !!process.env.dev && this.dev;
117
- },
118
-
119
113
  multiClusterApps() {
120
114
  const options = this.options;
121
115
 
@@ -151,7 +145,7 @@ export default {
151
145
 
152
146
  options() {
153
147
  const cluster = this.clusterId || this.$store.getters['defaultClusterId'];
154
-
148
+ // TODO plugin routes
155
149
  const entries = this.activeProducts.map((p) => {
156
150
  // Try product-specific index first
157
151
  const to = p.to || {
@@ -232,10 +226,6 @@ export default {
232
226
  this.setClusterListHeight(this.maxClustersToShow);
233
227
  });
234
228
  },
235
-
236
- switchLocale(locale) {
237
- this.$store.dispatch('i18n/switchTo', locale);
238
- },
239
229
  }
240
230
  };
241
231
  </script>
@@ -359,34 +349,7 @@ export default {
359
349
  v-html="displayVersion"
360
350
  />
361
351
  </div>
362
- <div v-if="showLocale">
363
- <v-popover
364
- popover-class="localeSelector"
365
- placement="top"
366
- trigger="click"
367
- >
368
- <a
369
- data-testid="locale-selector"
370
- class="locale-chooser"
371
- >
372
- {{ selectedLocaleLabel }}
373
- </a>
374
-
375
- <template slot="popover">
376
- <ul class="list-unstyled dropdown" style="margin: -1px;">
377
- <li v-if="showNone" v-t="'locale.none'" class="hand" @click="switchLocale('none')" />
378
- <li
379
- v-for="(label, name) in availableLocales"
380
- :key="name"
381
- class="hand"
382
- @click="switchLocale(name)"
383
- >
384
- {{ label }}
385
- </li>
386
- </ul>
387
- </template>
388
- </v-popover>
389
- </div>
352
+ <LocaleSelector></LocaleSelector>
390
353
  </div>
391
354
  </div>
392
355
  </transition>
@@ -13,7 +13,7 @@ import Select from '@shell/components/form/Select';
13
13
  import day from 'dayjs';
14
14
 
15
15
  import { escapeHtml, escapeRegex } from '@shell/utils/string';
16
- import { NAME as VIRTUAL } from '@shell/config/product/harvester';
16
+ import { HARVESTER_NAME as VIRTUAL } from '@shell/config/product/harvester-manager';
17
17
 
18
18
  import Socket, {
19
19
  EVENT_CONNECTED,