@rancher/shell 0.1.1 → 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 (294) hide show
  1. package/assets/translations/en-us.yaml +33 -769
  2. package/assets/translations/zh-hans.yaml +153 -781
  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 +32 -12
  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/ResourceTabs/index.vue +27 -18
  24. package/components/form/WorkloadPorts.vue +1 -1
  25. package/components/formatter/ClusterLink.vue +13 -0
  26. package/components/formatter/PodImages.vue +11 -1
  27. package/components/formatter/RKETemplateName.vue +37 -0
  28. package/components/formatter/WorkloadHealthScale.vue +1 -1
  29. package/components/nav/Header.vue +9 -9
  30. package/components/nav/NamespaceFilter.vue +7 -4
  31. package/components/nav/TopLevelMenu.vue +6 -43
  32. package/components/nav/WindowManager/ContainerLogs.vue +1 -1
  33. package/config/product/harvester-manager.js +64 -2
  34. package/config/product/manager.js +9 -0
  35. package/config/settings.js +17 -71
  36. package/config/table-headers.js +0 -1
  37. package/config/types.js +8 -26
  38. package/core/plugin-routes.ts +34 -22
  39. package/core/plugin.ts +15 -3
  40. package/core/plugins-loader.js +2 -0
  41. package/core/plugins.js +79 -36
  42. package/core/types.ts +7 -1
  43. package/creators/app/tsconfig.json +6 -1
  44. package/creators/pkg/init +3 -0
  45. package/creators/pkg/tsconfig.json +7 -2
  46. package/detail/provisioning.cattle.io.cluster.vue +23 -0
  47. package/detail/workload/index.vue +11 -5
  48. package/{components/dialog → dialog}/AddClusterMemberDialog.vue +0 -0
  49. package/{components/dialog → dialog}/AddCustomBadgeDialog.vue +0 -0
  50. package/{components/dialog → dialog}/AddProjectMemberDialog.vue +0 -0
  51. package/{components/dialog → dialog}/AddonConfigConfirmationDialog.vue +0 -0
  52. package/{components/dialog → dialog}/DrainNode.vue +0 -0
  53. package/{components/dialog → dialog}/ForceMachineRemoveDialog.vue +0 -0
  54. package/{components/dialog → dialog}/GenericPrompt.vue +0 -0
  55. package/{components/dialog → dialog}/RollbackWorkloadDialog.vue +0 -0
  56. package/{components/dialog → dialog}/RotateCertificatesDialog.vue +0 -0
  57. package/{components/dialog → dialog}/RotateEncryptionKeyDialog.vue +0 -0
  58. package/{components/dialog → dialog}/SaveAsRKETemplateDialog.vue +0 -0
  59. package/{components/dialog → dialog}/ScaleMachineDownDialog.vue +0 -0
  60. package/edit/auth/azuread.vue +20 -1
  61. package/edit/cloudcredential.vue +7 -1
  62. package/edit/management.cattle.io.project.vue +2 -2
  63. package/edit/namespace.vue +17 -10
  64. package/edit/networking.k8s.io.ingress/index.vue +2 -1
  65. package/edit/persistentvolumeclaim.vue +33 -2
  66. package/edit/provisioning.cattle.io.cluster/CustomCommand.vue +1 -1
  67. package/edit/provisioning.cattle.io.cluster/MachinePool.vue +34 -6
  68. package/edit/provisioning.cattle.io.cluster/index.vue +1 -1
  69. package/edit/provisioning.cattle.io.cluster/rke2.vue +21 -6
  70. package/edit/service.vue +1 -1
  71. package/edit/workload/index.vue +363 -15
  72. package/edit/workload/mixins/workload.js +62 -7
  73. package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +1 -0
  74. package/layouts/default.vue +52 -27
  75. package/layouts/error.vue +5 -1
  76. package/layouts/home.vue +6 -2
  77. package/list/harvesterhci.io.management.cluster.vue +74 -33
  78. package/list/namespace.vue +3 -5
  79. package/list/provisioning.cattle.io.cluster.vue +6 -0
  80. package/machine-config/amazonec2.vue +2 -0
  81. package/machine-config/harvester.vue +96 -49
  82. package/middleware/authenticated.js +56 -52
  83. package/mixins/brand.js +3 -4
  84. package/mixins/create-edit-view/impl.js +0 -8
  85. package/mixins/form-validation.js +1 -1
  86. package/mixins/resource-fetch.js +3 -1
  87. package/models/chart.js +1 -1
  88. package/models/cluster/node.js +12 -1
  89. package/models/fleet.cattle.io.bundle.js +26 -19
  90. package/models/harvesterhci.io.management.cluster.js +194 -5
  91. package/models/management.cattle.io.cluster.js +1 -1
  92. package/models/management.cattle.io.clusterroletemplatebinding.js +9 -0
  93. package/models/management.cattle.io.globalrole.js +0 -19
  94. package/models/management.cattle.io.project.js +23 -2
  95. package/models/management.cattle.io.roletemplate.js +2 -21
  96. package/models/namespace.js +19 -3
  97. package/models/pod.js +19 -2
  98. package/models/provisioning.cattle.io.cluster.js +71 -0
  99. package/models/service.js +5 -1
  100. package/models/workload.js +4 -243
  101. package/models/workload.service.js +314 -0
  102. package/nuxt.config.js +14 -12
  103. package/package.json +3 -3
  104. package/pages/auth/login.vue +11 -2
  105. package/pages/auth/setup.vue +1 -1
  106. package/pages/c/_cluster/_product/members/index.vue +3 -93
  107. package/pages/c/_cluster/_product/projectsnamespaces.vue +6 -403
  108. package/pages/c/_cluster/apps/charts/install.vue +0 -6
  109. package/pages/c/_cluster/settings/performance.vue +19 -16
  110. package/pages/fail-whale.vue +1 -10
  111. package/pages/index.vue +18 -4
  112. package/pages/plugins.vue +2 -2
  113. package/pages/prefs.vue +8 -6
  114. package/pkg/auto-import.js +44 -7
  115. package/pkg/dynamic-plugin-loader.js +28 -0
  116. package/pkg/import.js +2 -2
  117. package/pkg/model-loader-require.lib.js +3 -0
  118. package/pkg/vue.config.js +9 -6
  119. package/plugins/console.js +10 -5
  120. package/plugins/dashboard-store/actions.js +8 -3
  121. package/plugins/dashboard-store/getters.js +7 -2
  122. package/plugins/dashboard-store/model-loader-require.js +12 -0
  123. package/plugins/dashboard-store/model-loader.js +4 -1
  124. package/plugins/dashboard-store/resource-class.js +10 -3
  125. package/plugins/steve/actions.js +1 -1
  126. package/plugins/steve/index.js +6 -4
  127. package/plugins/steve/steve-description-class.js +32 -0
  128. package/plugins/steve/subscribe.js +34 -23
  129. package/rancher-components/Banner/Banner.vue +2 -2
  130. package/rancher-components/Form/Checkbox/Checkbox.test.ts +77 -0
  131. package/rancher-components/Form/Checkbox/Checkbox.vue +12 -2
  132. package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +0 -2
  133. package/rancher-components/Form/LabeledInput/LabeledInput.vue +2 -0
  134. package/rancher-components/Form/Radio/RadioButton.vue +14 -1
  135. package/rancher-components/Form/ToggleSwitch/ToggleSwitch.test.ts +107 -0
  136. package/{components/form → rancher-components/Form/ToggleSwitch}/ToggleSwitch.vue +18 -8
  137. package/rancher-components/Form/ToggleSwitch/index.ts +1 -0
  138. package/rancher-components/Form/index.ts +1 -0
  139. package/scripts/build-pkg.sh +48 -2
  140. package/scripts/drone-build-pkg.sh +31 -0
  141. package/scripts/publish-shell.sh +10 -11
  142. package/scripts/serve-pkgs +17 -10
  143. package/scripts/test-plugins-build.sh +18 -1
  144. package/store/catalog.js +3 -1
  145. package/store/i18n.js +16 -11
  146. package/store/index.js +4 -181
  147. package/store/prefs.js +30 -2
  148. package/store/type-map.js +16 -29
  149. package/types/{index.d.ts → rancher/index.d.ts} +0 -0
  150. package/utils/cluster.js +1 -1
  151. package/utils/custom-validators.js +1 -12
  152. package/utils/dynamic-importer.js +1 -1
  153. package/utils/validators/setting.js +0 -35
  154. package/components/FilterLabel.vue +0 -254
  155. package/components/HarvesterUpgradeProgressBarList.vue +0 -109
  156. package/components/VMConsoleBar.vue +0 -87
  157. package/components/dialog/harvester/AddHotplugModal.vue +0 -159
  158. package/components/dialog/harvester/BackupModal.vue +0 -117
  159. package/components/dialog/harvester/CloneTemplate.vue +0 -125
  160. package/components/dialog/harvester/EjectCDROMDialog.vue +0 -157
  161. package/components/dialog/harvester/ExportImageDialog.vue +0 -152
  162. package/components/dialog/harvester/MaintenanceDialog.vue +0 -94
  163. package/components/dialog/harvester/MigrationDialog.vue +0 -154
  164. package/components/dialog/harvester/RestoreDialog.vue +0 -153
  165. package/components/dialog/harvester/SupportBundle.vue +0 -217
  166. package/components/dialog/harvester/UnplugVolume.vue +0 -108
  167. package/components/form/SerialConsole/index.vue +0 -267
  168. package/components/formatter/AttachVMWithName.vue +0 -46
  169. package/components/formatter/CloudInitType.vue +0 -27
  170. package/components/formatter/HarvesterBackupTargetValidation.vue +0 -43
  171. package/components/formatter/HarvesterCPUUsed.vue +0 -122
  172. package/components/formatter/HarvesterDiskState.vue +0 -66
  173. package/components/formatter/HarvesterHostName.vue +0 -66
  174. package/components/formatter/HarvesterIpAddress.vue +0 -90
  175. package/components/formatter/HarvesterMemoryUsed.vue +0 -140
  176. package/components/formatter/HarvesterMigrationState.vue +0 -85
  177. package/components/formatter/HarvesterNodeName.vue +0 -49
  178. package/components/formatter/HarvesterStorageUsed.vue +0 -194
  179. package/components/formatter/HarvesterVmState.vue +0 -123
  180. package/components/nav/HarvesterUpgrade.vue +0 -232
  181. package/components/novnc/NovncConsole.vue +0 -93
  182. package/components/novnc/NovncConsoleItem.vue +0 -89
  183. package/components/novnc/NovncConsoleWrapper.vue +0 -243
  184. package/config/harvester-map.js +0 -44
  185. package/config/harvester-table-headers.js +0 -27
  186. package/config/product/harvester.js +0 -305
  187. package/detail/harvesterhci.io.host/HarvesterHostBasic.vue +0 -364
  188. package/detail/harvesterhci.io.host/HarvesterHostDisk.vue +0 -200
  189. package/detail/harvesterhci.io.host/HarvesterHostNetwork.vue +0 -89
  190. package/detail/harvesterhci.io.host/VirtualMachineInstance.vue +0 -134
  191. package/detail/harvesterhci.io.host/index.vue +0 -243
  192. package/detail/harvesterhci.io.virtualmachinebackup/index.vue +0 -221
  193. package/detail/harvesterhci.io.virtualmachineimage.vue +0 -118
  194. package/detail/kubevirt.io.virtualmachine/VirtualMachineTabs/VirtualMachineBasics.vue +0 -279
  195. package/detail/kubevirt.io.virtualmachine/VirtualMachineTabs/VirtualMachineEvents.vue +0 -75
  196. package/detail/kubevirt.io.virtualmachine/VirtualMachineTabs/VirtualMachineKeypairs.vue +0 -114
  197. package/detail/kubevirt.io.virtualmachine/VirtualMachineTabs/VirtualMachineMigration.vue +0 -79
  198. package/detail/kubevirt.io.virtualmachine/index.vue +0 -213
  199. package/edit/harvesterhci.io.cloudtemplate.vue +0 -123
  200. package/edit/harvesterhci.io.host/HarvesterDisk.vue +0 -262
  201. package/edit/harvesterhci.io.host/index.vue +0 -533
  202. package/edit/harvesterhci.io.keypair.vue +0 -112
  203. package/edit/harvesterhci.io.managedchart/index.vue +0 -25
  204. package/edit/harvesterhci.io.managedchart/rancher-monitoring.vue +0 -172
  205. package/edit/harvesterhci.io.networkattachmentdefinition.vue +0 -210
  206. package/edit/harvesterhci.io.setting/additional-ca.vue +0 -36
  207. package/edit/harvesterhci.io.setting/backup-target.vue +0 -182
  208. package/edit/harvesterhci.io.setting/http-proxy.vue +0 -79
  209. package/edit/harvesterhci.io.setting/index.vue +0 -201
  210. package/edit/harvesterhci.io.setting/overcommit-config.vue +0 -94
  211. package/edit/harvesterhci.io.setting/ssl-certificates.vue +0 -117
  212. package/edit/harvesterhci.io.setting/ssl-parameters.vue +0 -161
  213. package/edit/harvesterhci.io.setting/support-bundle-image.vue +0 -134
  214. package/edit/harvesterhci.io.setting/support-bundle-namespaces.vue +0 -73
  215. package/edit/harvesterhci.io.setting/vip-pools.vue +0 -244
  216. package/edit/harvesterhci.io.setting/vm-force-reset-policy.vue +0 -81
  217. package/edit/harvesterhci.io.virtualmachinebackup.vue +0 -256
  218. package/edit/harvesterhci.io.virtualmachineimage.vue +0 -364
  219. package/edit/harvesterhci.io.virtualmachinetemplateversion.vue +0 -340
  220. package/edit/harvesterhci.io.volume.vue +0 -195
  221. package/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/AccessCredentialsUsers.vue +0 -190
  222. package/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/index.vue +0 -212
  223. package/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/type/basicAuth.vue +0 -94
  224. package/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/type/sshkey.vue +0 -85
  225. package/edit/kubevirt.io.virtualmachine/VirtualMachineCloudConfig/DataTemplate.vue +0 -153
  226. package/edit/kubevirt.io.virtualmachine/VirtualMachineCloudConfig/index.vue +0 -279
  227. package/edit/kubevirt.io.virtualmachine/VirtualMachineCpuMemory.vue +0 -113
  228. package/edit/kubevirt.io.virtualmachine/VirtualMachineNetwork/__tests__/HarvesterEditNetwork.test.ts +0 -41
  229. package/edit/kubevirt.io.virtualmachine/VirtualMachineNetwork/base.vue +0 -281
  230. package/edit/kubevirt.io.virtualmachine/VirtualMachineNetwork/index.vue +0 -142
  231. package/edit/kubevirt.io.virtualmachine/VirtualMachineReserved.vue +0 -54
  232. package/edit/kubevirt.io.virtualmachine/VirtualMachineSSHKey.vue +0 -256
  233. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/index.vue +0 -391
  234. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/__tests__/HarvesterEditContainer.test.ts +0 -40
  235. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/__tests__/HarvesterEditExisting.test.ts +0 -102
  236. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/__tests__/HarvesterEditVMImage.test.ts +0 -117
  237. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/__tests__/HarvesterEditVolume.test.ts +0 -74
  238. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/container.vue +0 -132
  239. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/existing.vue +0 -303
  240. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/vmImage.vue +0 -285
  241. package/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/volume.vue +0 -188
  242. package/edit/kubevirt.io.virtualmachine/index.vue +0 -642
  243. package/edit/network.harvesterhci.io.clusternetwork/index.vue +0 -19
  244. package/edit/network.harvesterhci.io.clusternetwork/vlan.vue +0 -134
  245. package/edit/workload/types/Deployment.vue +0 -377
  246. package/edit/workload/types/Generic.vue +0 -295
  247. package/list/harvesterhci.io.cloudtemplate.vue +0 -78
  248. package/list/harvesterhci.io.dashboard/HarvesterUpgrade.vue +0 -211
  249. package/list/harvesterhci.io.dashboard/UpgradeInfo.vue +0 -40
  250. package/list/harvesterhci.io.dashboard/index.vue +0 -752
  251. package/list/harvesterhci.io.host/index.vue +0 -186
  252. package/list/harvesterhci.io.networkattachmentdefinition.vue +0 -167
  253. package/list/harvesterhci.io.setting.vue +0 -241
  254. package/list/harvesterhci.io.virtualmachinebackup.vue +0 -172
  255. package/list/harvesterhci.io.virtualmachineimage.vue +0 -80
  256. package/list/harvesterhci.io.virtualmachinetemplateversion.vue +0 -173
  257. package/list/harvesterhci.io.volume.vue +0 -122
  258. package/list/kubevirt.io.virtualmachine.vue +0 -193
  259. package/mixins/harvester-vm/impl.js +0 -267
  260. package/mixins/harvester-vm/index.js +0 -1357
  261. package/models/harvester/configmap.js +0 -32
  262. package/models/harvester/harvesterhci.io.blockdevice.js +0 -55
  263. package/models/harvester/harvesterhci.io.keypair.js +0 -12
  264. package/models/harvester/harvesterhci.io.setting.js +0 -127
  265. package/models/harvester/harvesterhci.io.supportbundle.js +0 -35
  266. package/models/harvester/harvesterhci.io.upgrade.js +0 -226
  267. package/models/harvester/harvesterhci.io.virtualmachinebackup.js +0 -116
  268. package/models/harvester/harvesterhci.io.virtualmachineimage.js +0 -255
  269. package/models/harvester/harvesterhci.io.virtualmachinerestore.js +0 -43
  270. package/models/harvester/harvesterhci.io.virtualmachinetemplate.js +0 -69
  271. package/models/harvester/harvesterhci.io.virtualmachinetemplateversion.js +0 -227
  272. package/models/harvester/k8s.cni.cncf.io.networkattachmentdefinition.js +0 -32
  273. package/models/harvester/kubevirt.io.virtualmachine.js +0 -850
  274. package/models/harvester/kubevirt.io.virtualmachineinstance.js +0 -142
  275. package/models/harvester/management.cattle.io.managedchart.js +0 -191
  276. package/models/harvester/management.cattle.io.setting.js +0 -40
  277. package/models/harvester/network.harvesterhci.io.clusternetwork.js +0 -100
  278. package/models/harvester/network.harvesterhci.io.nodenetwork.js +0 -34
  279. package/models/harvester/node.js +0 -255
  280. package/models/harvester/persistentvolumeclaim.js +0 -166
  281. package/models/harvester/pod.js +0 -185
  282. package/pages/c/_cluster/harvester/airgapupgrade/index.vue +0 -309
  283. package/pages/c/_cluster/harvester/console/_uid/serial.vue +0 -51
  284. package/pages/c/_cluster/harvester/console/_uid/vnc.vue +0 -52
  285. package/pages/c/_cluster/harvester/index.vue +0 -24
  286. package/pages/c/_cluster/harvester/support/index.vue +0 -154
  287. package/pkg/model-loader.lib.js +0 -3
  288. package/plugins/lookup.js +0 -50
  289. package/promptRemove/kubevirt.io.virtualmachine.vue +0 -164
  290. package/store/harvester-common.js +0 -126
  291. package/utils/validators/vm-datavolumes.js +0 -38
  292. package/utils/validators/vm-image.js +0 -32
  293. package/utils/validators/vm.js +0 -221
  294. package/yarn-error.log +0 -196
@@ -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
 
@@ -146,7 +151,6 @@ export default {
146
151
  },
147
152
 
148
153
  computed: {
149
-
150
154
  label() {
151
155
  return this.t(`rbac.roletemplate.subtypes.${ this.value.subtype }.label`);
152
156
  },
@@ -300,6 +304,9 @@ export default {
300
304
  isDetail() {
301
305
  return this.as === _DETAIL;
302
306
  },
307
+ isBuiltin() {
308
+ return this.value.builtin;
309
+ },
303
310
  doneLocationOverride() {
304
311
  return this.value.listLocation;
305
312
  },
@@ -576,6 +583,9 @@ export default {
576
583
  <ArrayList
577
584
  v-model="value.rules"
578
585
  label="Resources"
586
+ :disabled="isBuiltin"
587
+ :remove-allowed="!isBuiltin"
588
+ :add-allowed="!isBuiltin"
579
589
  :default-add-value="defaultRule"
580
590
  :initial-empty-row="true"
581
591
  :show-header="true"
@@ -612,6 +622,7 @@ export default {
612
622
  <Select
613
623
  :value="props.row.value.verbs"
614
624
  class="lg"
625
+ :disabled="isBuiltin"
615
626
  :taggable="true"
616
627
  :searchable="true"
617
628
  :options="verbOptions"
@@ -623,6 +634,7 @@ export default {
623
634
  <div :class="ruleClass">
624
635
  <Select
625
636
  :value="getRule('resources', props.row.value)"
637
+ :disabled="isBuiltin"
626
638
  :options="resourceOptions"
627
639
  :searchable="true"
628
640
  :taggable="true"
@@ -634,6 +646,7 @@ export default {
634
646
  <div :class="ruleClass">
635
647
  <LabeledInput
636
648
  :value="getRule('apiGroups', props.row.value)"
649
+ :disabled="isBuiltin"
637
650
  :mode="mode"
638
651
  @input="setRule('apiGroups', props.row.value, $event)"
639
652
  />
@@ -641,6 +654,7 @@ export default {
641
654
  <div v-if="!isNamespaced" :class="ruleClass">
642
655
  <LabeledInput
643
656
  :value="getRule('nonResourceURLs', props.row.value)"
657
+ :disabled="isBuiltin"
644
658
  :mode="mode"
645
659
  @input="setRule('nonResourceURLs', props.row.value, $event)"
646
660
  />
@@ -657,6 +671,9 @@ export default {
657
671
  >
658
672
  <ArrayList
659
673
  v-model="value.roleTemplateNames"
674
+ :disabled="isBuiltin"
675
+ :remove-allowed="!isBuiltin"
676
+ :add-allowed="!isBuiltin"
660
677
  label="Resources"
661
678
  add-label="Add Resource"
662
679
  :mode="mode"
@@ -668,11 +685,14 @@ export default {
668
685
  v-model="props.row.value"
669
686
  class="lg"
670
687
  :taggable="false"
688
+ :disabled="isBuiltin"
671
689
  :searchable="true"
672
- :options="templateOptions"
690
+ :options="selectFocused === props.i ? templateOptions : [keyedTemplateOptions[props.row.value]]"
673
691
  option-key="value"
674
692
  option-label="label"
675
693
  :mode="mode"
694
+ @on-focus="selectFocused = props.i"
695
+ @on-blur="selectFocused = null"
676
696
  />
677
697
  </div>
678
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';
@@ -66,22 +66,21 @@ export default {
66
66
  }
67
67
  },
68
68
 
69
- async fetch() {
69
+ data() {
70
70
  const inStore = this.$store.getters['currentStore'](EVENT);
71
71
 
72
- if ( this.$store.getters[`${ inStore }/schemaFor`](EVENT) ) {
73
- this.hasEvents = true; // @TODO be smarter about which ones actually ever have events
74
- this.allEvents = await this.$store.dispatch(`${ inStore }/findAll`, { type: EVENT });
75
- }
76
- },
77
-
78
- data() {
79
72
  return {
80
- hasEvents: null,
81
- allEvents: []
73
+ hasEvents: this.$store.getters[`${ inStore }/schemaFor`](EVENT), // @TODO be smarter about which resources actually ever have events
74
+ allEvents: [],
75
+ selectedTab: this.defaultTab,
76
+ didLoadEvents: false,
82
77
  };
83
78
  },
84
79
 
80
+ beforeDestroy() {
81
+ this.$store.dispatch('cluster/forgetType', EVENT);
82
+ },
83
+
85
84
  computed: {
86
85
  showConditions() {
87
86
  const inStore = this.$store.getters['currentStore'](this.value.type);
@@ -89,10 +88,10 @@ export default {
89
88
  return this.isView && this.needConditions && this.value?.type && this.$store.getters[`${ inStore }/pathExistsInSchema`](this.value.type, 'status.conditions');
90
89
  },
91
90
  showEvents() {
92
- return this.isView && this.needEvents && !this.$fetchState.pending && this.hasEvents && (this.events.length || this.alwaysShowEvents);
91
+ return this.isView && this.needEvents && this.hasEvents && (this.events.length || this.alwaysShowEvents);
93
92
  },
94
93
  showRelated() {
95
- return this.isView && this.needRelated && !this.$fetchState.pending;
94
+ return this.isView && this.needRelated;
96
95
  },
97
96
  eventHeaders() {
98
97
  return [
@@ -146,17 +145,26 @@ export default {
146
145
  }
147
146
  },
148
147
 
149
- mounted() {
150
- // For easy access debugging...
151
- if ( typeof window !== 'undefined' ) {
152
- window.v = this.value;
148
+ methods: {
149
+ // Ensures we only fetch events and show the table when the events tab has been activated
150
+ tabChange(neu) {
151
+ this.selectedTab = neu?.selectedName;
152
+
153
+ if (!this.didLoadEvents && this.selectedTab === 'events') {
154
+ const inStore = this.$store.getters['currentStore'](EVENT);
155
+
156
+ this.$store.dispatch(`${ inStore }/findAll`, { type: EVENT }).then((events) => {
157
+ this.allEvents = events;
158
+ this.didLoadEvents = true;
159
+ });
160
+ }
153
161
  }
154
- },
162
+ }
155
163
  };
156
164
  </script>
157
165
 
158
166
  <template>
159
- <Tabbed v-bind="$attrs" :default-tab="defaultTab">
167
+ <Tabbed v-bind="$attrs" :default-tab="defaultTab" @changed="tabChange">
160
168
  <slot />
161
169
 
162
170
  <Tab v-if="showConditions" label-key="resourceTabs.conditions.tab" name="conditions" :weight="-1" :display-alert-icon="conditionsHaveIssues">
@@ -165,6 +173,7 @@ export default {
165
173
 
166
174
  <Tab v-if="showEvents" label-key="resourceTabs.events.tab" name="events" :weight="-2">
167
175
  <SortableTable
176
+ v-if="selectedTab === 'events'"
168
177
  :rows="events"
169
178
  :headers="eventHeaders"
170
179
  key-field="id"
@@ -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 {
@@ -63,6 +63,11 @@ export default {
63
63
  {{ value }}
64
64
  </n-link>
65
65
  <span v-else>{{ value }}</span>
66
+ <i
67
+ v-if="row.rkeTemplateUpgrade"
68
+ v-tooltip="t('cluster.rkeTemplateUpgrade', { name: row.rkeTemplateUpgrade })"
69
+ class="template-upgrade-icon icon-alert icon"
70
+ />
66
71
  <i
67
72
  v-if="clusterHasIssues"
68
73
  v-tooltip="{ content: `<div>${formattedConditions}</div>`, html: true }"
@@ -93,4 +98,12 @@ export default {
93
98
  .mytooltip ul {
94
99
  outline: 1px dashed red;
95
100
  }
101
+ .template-upgrade-icon {
102
+ border: 1px solid var(--warning);
103
+ border-radius: 50%;
104
+ color: var(--warning);
105
+ margin-left: 4px;
106
+ font-size: 14px;
107
+ padding: 2px;
108
+ }
96
109
  </style>
@@ -1,6 +1,10 @@
1
1
  <script>
2
2
  import { mapGetters } from 'vuex';
3
3
 
4
+ // For the main image hat we show, use these to ignore istio proxy images so that
5
+ // we are more likely to show the important main iamge and not the istio sidecar
6
+ const IGNORE_IMAGES = ['istio/proxy', 'gcr.io/istio-release/proxy', 'mirrored-istio-proxy'];
7
+
4
8
  export default {
5
9
  props: {
6
10
  value: {
@@ -38,6 +42,12 @@ export default {
38
42
  }
39
43
 
40
44
  return null;
45
+ },
46
+ mainImage() {
47
+ const images = this.images;
48
+ const filter = images.filter(image => !IGNORE_IMAGES.find(i => image.includes(i)));
49
+
50
+ return filter.length > 0 ? filter[0] : images[0];
41
51
  }
42
52
  }
43
53
 
@@ -46,7 +56,7 @@ export default {
46
56
 
47
57
  <template>
48
58
  <span>
49
- <span>{{ images[0] }}</span><br>
59
+ <span>{{ mainImage }}</span><br>
50
60
  <span
51
61
  v-if="images.length-1>0"
52
62
  v-tooltip.bottom="imageLabels"
@@ -0,0 +1,37 @@
1
+ <script>
2
+ export default {
3
+ props: {
4
+ value: {
5
+ type: Object,
6
+ required: true
7
+ },
8
+ }
9
+ };
10
+ </script>
11
+
12
+ <template>
13
+ <div class="rke-template">
14
+ <span>{{ value.displayName }}</span>
15
+ <i
16
+ v-if="value.upgrade"
17
+ v-tooltip="t('cluster.rkeTemplateUpgrade', { name: value.upgrade })"
18
+ class="template-upgrade-icon icon-alert icon"
19
+ />
20
+ </div>
21
+ </template>
22
+
23
+ <style lang="scss" scoped>
24
+ .rke-template {
25
+ align-items: center;
26
+ display: inline-flex;
27
+
28
+ .template-upgrade-icon {
29
+ border: 1px solid var(--warning);
30
+ border-radius: 50%;
31
+ color: var(--warning);
32
+ margin-left: 4px;
33
+ font-size: 14px;
34
+ padding: 2px;
35
+ }
36
+ }
37
+ </style>
@@ -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);