@rancher/shell 0.1.3 → 0.1.21

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 (245) hide show
  1. package/assets/brand/suse/dark/rancher-logo.svg +1 -148
  2. package/assets/brand/suse/favicon.png +0 -0
  3. package/assets/brand/suse/rancher-logo.svg +1 -130
  4. package/assets/images/featured/img1.jpg +0 -0
  5. package/assets/images/featured.jpg +0 -0
  6. package/assets/images/generic-plugin.svg +1 -0
  7. package/assets/styles/themes/_dark.scss +3 -0
  8. package/assets/styles/themes/_light.scss +3 -0
  9. package/assets/styles/themes/_suse.scss +1 -1
  10. package/assets/translations/en-us.yaml +219 -47
  11. package/assets/translations/zh-hans.yaml +21 -24
  12. package/components/AsyncButton.vue +17 -2
  13. package/components/ButtonDropdown.vue +4 -0
  14. package/components/Carousel.vue +291 -0
  15. package/components/CommunityLinks.vue +64 -22
  16. package/components/CruResource.vue +11 -3
  17. package/components/Dialog.vue +102 -0
  18. package/components/ExplorerMembers.vue +2 -4
  19. package/components/ExplorerProjectsNamespaces.vue +25 -9
  20. package/components/IconMessage.vue +9 -1
  21. package/components/LazyImage.vue +21 -8
  22. package/components/LocaleSelector.vue +62 -29
  23. package/components/PromptRemove.vue +2 -2
  24. package/components/ResourceList/Masthead.vue +21 -1
  25. package/components/ResourceList/ResourceLoadingIndicator.vue +0 -8
  26. package/components/ResourceList/index.vue +9 -23
  27. package/components/ResourceTable.vue +7 -2
  28. package/components/SimpleBox.vue +6 -4
  29. package/components/SortableTable/index.vue +18 -25
  30. package/components/Tabbed/Tab.vue +5 -0
  31. package/components/Tabbed/index.vue +54 -9
  32. package/components/TypeDescription.vue +10 -1
  33. package/components/auth/Principal.vue +1 -0
  34. package/components/fleet/FleetBundles.vue +8 -3
  35. package/components/fleet/FleetClusters.vue +6 -0
  36. package/components/fleet/FleetRepos.vue +7 -1
  37. package/components/fleet/FleetSummary.vue +6 -0
  38. package/components/form/Command.vue +5 -0
  39. package/components/form/EnvVars.vue +5 -0
  40. package/components/form/KeyValue.vue +80 -58
  41. package/components/form/NameNsDescription.vue +13 -5
  42. package/components/form/NodeScheduling.vue +6 -1
  43. package/components/form/PodAffinity.vue +5 -0
  44. package/components/form/ResourceTabs/index.vue +5 -1
  45. package/components/form/ServiceNameSelect.vue +5 -0
  46. package/components/form/ValueFromResource.vue +7 -1
  47. package/components/formatter/ClusterLink.vue +3 -7
  48. package/components/nav/NamespaceFilter.vue +3 -3
  49. package/components/nav/TopLevelMenu.vue +12 -29
  50. package/config/home-links.js +155 -0
  51. package/config/labels-annotations.js +2 -1
  52. package/config/private-label.js +1 -1
  53. package/config/product/explorer.js +5 -4
  54. package/config/product/legacy.js +0 -47
  55. package/config/product/manager.js +0 -2
  56. package/config/product/multi-cluster-apps.js +0 -12
  57. package/config/product/settings.js +12 -1
  58. package/config/product/uiplugins.js +17 -0
  59. package/config/settings.js +23 -2
  60. package/config/types.js +5 -1
  61. package/config/uiplugins.js +117 -0
  62. package/config/version.js +17 -0
  63. package/content/docs/en-us/getting-started.md +1 -26
  64. package/core/plugin.ts +12 -0
  65. package/core/plugins.js +38 -2
  66. package/core/types.ts +6 -0
  67. package/creators/app/{.eslintignore → files/.eslintignore} +0 -0
  68. package/creators/app/{.eslintrc.js → files/.eslintrc.js} +0 -0
  69. package/creators/app/{.vscode → files/.vscode}/settings.json +0 -0
  70. package/creators/app/{babel.config.js → files/babel.config.js} +0 -0
  71. package/creators/app/{nuxt.config.js → files/nuxt.config.js} +0 -0
  72. package/creators/app/{tsconfig.json → files/tsconfig.json} +2 -1
  73. package/creators/app/init +16 -17
  74. package/creators/app/package.json +6 -0
  75. package/creators/pkg/{babel.config.js → files/babel.config.js} +0 -0
  76. package/creators/pkg/{index.ts → files/index.ts} +0 -0
  77. package/creators/pkg/{tsconfig.json → files/tsconfig.json} +13 -12
  78. package/creators/pkg/{vue.config.js → files/vue.config.js} +0 -0
  79. package/creators/pkg/init +1 -1
  80. package/creators/update/init +54 -0
  81. package/creators/update/package.json +20 -0
  82. package/creators/update/upgrade +56 -0
  83. package/creators/update/yarn-error.log +54 -0
  84. package/detail/provisioning.cattle.io.cluster.vue +3 -3
  85. package/detail/workload/index.vue +3 -2
  86. package/dialog/DiagnosticTimingsDialog.vue +116 -0
  87. package/dialog/RotateCertificatesDialog.vue +9 -3
  88. package/edit/auth/azuread.vue +28 -9
  89. package/edit/networking.k8s.io.ingress/index.vue +2 -2
  90. package/edit/persistentvolume/index.vue +51 -13
  91. package/edit/persistentvolumeclaim.vue +31 -13
  92. package/edit/pod.vue +27 -0
  93. package/edit/provisioning.cattle.io.cluster/rke2.vue +103 -24
  94. package/edit/service.vue +7 -5
  95. package/edit/workload/__tests__/Upgrading.test.ts +1 -0
  96. package/edit/workload/index.vue +32 -10
  97. package/edit/workload/mixins/workload.js +121 -126
  98. package/edit/workload/storage/ContainerMountPaths.vue +240 -0
  99. package/edit/workload/storage/Mount.vue +1 -0
  100. package/edit/workload/storage/awsElasticBlockStore.vue +20 -1
  101. package/edit/workload/storage/azureDisk.vue +22 -2
  102. package/edit/workload/storage/azureFile.vue +20 -2
  103. package/edit/workload/storage/csi/index.vue +23 -1
  104. package/edit/workload/storage/gcePersistentDisk.vue +20 -2
  105. package/edit/workload/storage/index.vue +33 -65
  106. package/edit/workload/storage/persistentVolumeClaim/index.vue +5 -0
  107. package/edit/workload/storage/secret.vue +6 -1
  108. package/edit/workload/storage/vsphereVolume.vue +11 -1
  109. package/layouts/default.vue +14 -8
  110. package/layouts/home.vue +9 -4
  111. package/layouts/plain.vue +10 -5
  112. package/list/catalog.cattle.io.app.vue +10 -9
  113. package/list/catalog.cattle.io.clusterrepo.vue +6 -61
  114. package/list/cis.cattle.io.clusterscan.vue +12 -12
  115. package/list/fleet.cattle.io.bundle.vue +33 -28
  116. package/list/fleet.cattle.io.cluster.vue +26 -22
  117. package/list/fleet.cattle.io.clustergroup.vue +6 -0
  118. package/list/fleet.cattle.io.clusterregistrationtoken.vue +28 -24
  119. package/list/fleet.cattle.io.gitrepo.vue +25 -14
  120. package/list/helm.cattle.io.projecthelmchart.vue +52 -33
  121. package/list/logging.banzaicloud.io.clusterflow.vue +7 -12
  122. package/list/logging.banzaicloud.io.flow.vue +7 -14
  123. package/list/management.cattle.io.cluster.vue +26 -15
  124. package/list/management.cattle.io.feature.vue +13 -8
  125. package/list/management.cattle.io.setting.vue +3 -3
  126. package/list/management.cattle.io.user.vue +38 -19
  127. package/list/monitoring.coreos.com.alertmanagerconfig.vue +8 -15
  128. package/list/namespace.vue +14 -1
  129. package/list/node.vue +13 -16
  130. package/list/persistentvolume.vue +16 -9
  131. package/list/persistentvolumeclaim.vue +5 -8
  132. package/list/provisioning.cattle.io.cluster.vue +35 -9
  133. package/list/service.vue +24 -12
  134. package/list/ui.cattle.io.navlink.vue +6 -0
  135. package/list/workload.vue +2 -2
  136. package/machine-config/harvester.vue +5 -3
  137. package/middleware/authenticated.js +6 -0
  138. package/mixins/resource-fetch.js +12 -18
  139. package/mixins/resource-manager.js +126 -0
  140. package/models/catalog.cattle.io.uiplugin.js +38 -0
  141. package/models/cluster/node.js +25 -2
  142. package/models/fleet.cattle.io.bundle.js +1 -1
  143. package/models/harvesterhci.io.management.cluster.js +11 -5
  144. package/models/pod.js +15 -5
  145. package/models/provisioning.cattle.io.cluster.js +16 -6
  146. package/models/workload.js +5 -3
  147. package/models/workload.service.js +10 -0
  148. package/nuxt.config.js +70 -25
  149. package/package.json +108 -109
  150. package/pages/auth/login.vue +11 -1
  151. package/pages/auth/verify.vue +9 -0
  152. package/pages/c/_cluster/apps/charts/index.vue +46 -1
  153. package/pages/c/_cluster/apps/charts/install.vue +10 -9
  154. package/pages/c/_cluster/explorer/index.vue +72 -9
  155. package/pages/c/_cluster/explorer/tools/index.vue +12 -5
  156. package/pages/c/_cluster/mcapps/index.vue +1 -1
  157. package/pages/c/_cluster/settings/DefaultLinksEditor.vue +108 -0
  158. package/pages/c/_cluster/settings/brand.vue +0 -40
  159. package/pages/c/_cluster/settings/links.vue +152 -0
  160. package/pages/c/_cluster/settings/performance.vue +90 -7
  161. package/pages/c/_cluster/uiplugins/DeveloperInstallDialog.vue +232 -0
  162. package/pages/c/_cluster/uiplugins/InstallDialog.vue +293 -0
  163. package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +300 -0
  164. package/pages/c/_cluster/uiplugins/RemoveUIPlugins.vue +125 -0
  165. package/pages/c/_cluster/uiplugins/SetupUIPlugins.vue +261 -0
  166. package/pages/c/_cluster/uiplugins/UninstallDialog.vue +122 -0
  167. package/pages/c/_cluster/uiplugins/index.vue +808 -0
  168. package/pages/diagnostic.vue +185 -101
  169. package/pages/docs/_doc.vue +3 -1
  170. package/pages/home.vue +21 -56
  171. package/pages/prefs.vue +108 -88
  172. package/pages/safeMode.vue +17 -0
  173. package/pages/support/index.vue +34 -137
  174. package/pkg/dynamic-importer.lib.js +4 -0
  175. package/plugins/dashboard-store/actions.js +19 -0
  176. package/plugins/dashboard-store/getters.js +20 -3
  177. package/plugins/dashboard-store/mutations.js +13 -7
  178. package/plugins/dashboard-store/resource-class.js +2 -2
  179. package/plugins/formatters.js +15 -0
  180. package/plugins/plugin.js +61 -6
  181. package/plugins/steve/getters.js +12 -0
  182. package/plugins/steve/mutations.js +1 -1
  183. package/plugins/steve/subscribe.js +94 -72
  184. package/plugins/steve/web-worker.steve-sub-worker.js +24 -15
  185. package/plugins/version.js +21 -0
  186. package/promptRemove/management.cattle.io.globalrole.vue +47 -0
  187. package/promptRemove/management.cattle.io.roletemplate.vue +47 -0
  188. package/promptRemove/mixin/roleDeletionCheck.js +97 -0
  189. package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +6 -7
  190. package/rancher-components/components/BadgeState/BadgeState.spec.ts +12 -0
  191. package/rancher-components/components/BadgeState/BadgeState.vue +107 -0
  192. package/rancher-components/components/BadgeState/index.ts +1 -0
  193. package/rancher-components/components/Banner/Banner.test.ts +13 -0
  194. package/rancher-components/components/Banner/Banner.vue +163 -0
  195. package/rancher-components/components/Banner/index.ts +1 -0
  196. package/rancher-components/components/Card/Card.vue +150 -0
  197. package/rancher-components/components/Card/index.ts +1 -0
  198. package/rancher-components/components/Form/Checkbox/Checkbox.test.ts +77 -0
  199. package/rancher-components/components/Form/Checkbox/Checkbox.vue +395 -0
  200. package/rancher-components/components/Form/Checkbox/index.ts +1 -0
  201. package/rancher-components/components/Form/LabeledInput/LabeledInput.test.ts +29 -0
  202. package/rancher-components/components/Form/LabeledInput/LabeledInput.vue +343 -0
  203. package/rancher-components/components/Form/LabeledInput/index.ts +1 -0
  204. package/rancher-components/components/Form/Radio/RadioButton.vue +270 -0
  205. package/rancher-components/components/Form/Radio/RadioGroup.vue +235 -0
  206. package/rancher-components/components/Form/Radio/index.ts +2 -0
  207. package/rancher-components/components/Form/TextArea/TextAreaAutoGrow.vue +168 -0
  208. package/rancher-components/components/Form/TextArea/index.ts +1 -0
  209. package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.test.ts +107 -0
  210. package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.vue +137 -0
  211. package/rancher-components/components/Form/ToggleSwitch/index.ts +1 -0
  212. package/rancher-components/components/Form/index.ts +5 -0
  213. package/rancher-components/components/LabeledTooltip/LabeledTooltip.vue +137 -0
  214. package/rancher-components/components/LabeledTooltip/index.ts +1 -0
  215. package/scripts/publish-shell.sh +40 -7
  216. package/scripts/record-deps.js +37 -0
  217. package/scripts/sync-shell-deps +37 -0
  218. package/scripts/test-plugins-build.sh +8 -5
  219. package/scripts/typegen.sh +84 -0
  220. package/store/auth.js +3 -0
  221. package/store/catalog.js +9 -8
  222. package/store/i18n.js +10 -1
  223. package/store/index.js +12 -3
  224. package/store/prefs.js +16 -0
  225. package/store/type-map.js +32 -5
  226. package/store/uiplugins.ts +15 -61
  227. package/types/shell/index.d.ts +3046 -0
  228. package/utils/__tests__/object.test.ts +0 -24
  229. package/utils/__tests__/selector.test.ts +1 -1
  230. package/utils/dynamic-importer.js +4 -0
  231. package/utils/favicon.js +8 -2
  232. package/utils/gc/gc-interval.ts +40 -0
  233. package/utils/gc/gc-root-store.js +76 -0
  234. package/utils/gc/gc-route-changed.ts +44 -0
  235. package/utils/gc/gc-types.ts +21 -0
  236. package/utils/gc/gc.ts +282 -0
  237. package/utils/grafana.js +2 -6
  238. package/utils/socket.js +41 -20
  239. package/utils/string.js +1 -7
  240. package/utils/validators/formRules/__tests__/index.test.ts +108 -0
  241. package/utils/validators/formRules/index.ts +9 -1
  242. package/config/footer.js +0 -19
  243. package/creators/pkg/nuxt.config.js +0 -6
  244. package/pages/plugins.vue +0 -387
  245. package/server/verdaccio-middleware.js +0 -56
@@ -218,7 +218,7 @@ export default class Workload extends WorkloadService {
218
218
  path: 'metadata.name',
219
219
  required: true,
220
220
  translationKey: 'generic.name',
221
- type: 'dnsLabel',
221
+ type: 'subDomain',
222
222
  },
223
223
  {
224
224
  nullable: false,
@@ -405,7 +405,7 @@ export default class Workload extends WorkloadService {
405
405
  case WORKLOAD_TYPES.CRON_JOB:
406
406
  out.push(detailItem.endpoint);
407
407
  break;
408
- case WORKLOAD_TYPES.POD:
408
+ case POD:
409
409
  out.push(detailItem.ready);
410
410
  break;
411
411
  default: break;
@@ -612,8 +612,10 @@ export default class Workload extends WorkloadService {
612
612
 
613
613
  async matchingPods() {
614
614
  const all = await this.$dispatch('findAll', { type: POD });
615
+ const allInNamespace = all.filter(pod => pod.metadata.namespace === this.metadata.namespace);
616
+
615
617
  const selector = convertSelectorObj(this.spec.selector);
616
618
 
617
- return matching(all, selector);
619
+ return matching(allInNamespace, selector);
618
620
  }
619
621
  }
@@ -123,6 +123,11 @@ export default class WorkloadService extends SteveModel {
123
123
 
124
124
  return containers;
125
125
  }
126
+
127
+ if ( this.spec.containers ) {
128
+ return this.spec.containers;
129
+ }
130
+
126
131
  const { spec:{ template:{ spec:{ containers } } } } = this;
127
132
 
128
133
  return containers;
@@ -135,6 +140,11 @@ export default class WorkloadService extends SteveModel {
135
140
 
136
141
  return initContainers;
137
142
  }
143
+
144
+ if (this.spec.initContainers) {
145
+ return this.spec.initContainers;
146
+ }
147
+
138
148
  const { spec:{ template:{ spec:{ initContainers } } } } = this;
139
149
 
140
150
  return initContainers;
package/nuxt.config.js CHANGED
@@ -185,8 +185,6 @@ export default function(dir, _appConfig) {
185
185
 
186
186
  // Serve up the dist-pkg folder under /pkg
187
187
  serverMiddleware.push({ path: `/pkg/`, handler: serveStatic(`${ dir }/dist-pkg/`) });
188
- // Endpoint to download and unpack a tgz from the local verdaccio rgistry (dev)
189
- serverMiddleware.push(path.resolve(dir, SHELL, 'server', 'verdaccio-middleware'));
190
188
  // Add the standard dashboard server middleware after the middleware added to serve up UI packages
191
189
  serverMiddleware.push(path.resolve(dir, SHELL, 'server', 'server-middleware'));
192
190
 
@@ -202,6 +200,8 @@ export default function(dir, _appConfig) {
202
200
  process.env.DRONE_VERSION ||
203
201
  require('./package.json').version;
204
202
 
203
+ const prime = process.env.PRIME;
204
+
205
205
  const dev = (process.env.NODE_ENV !== 'production');
206
206
  const devPorts = dev || process.env.DEV_PORTS === 'true';
207
207
  const pl = process.env.PL || STANDARD;
@@ -496,7 +496,8 @@ export default function(dir, _appConfig) {
496
496
  plugins: [
497
497
  // TODO: Browser support
498
498
  // ['@babel/plugin-transform-modules-commonjs'],
499
- ['@babel/plugin-proposal-private-property-in-object', { loose: true }]
499
+ ['@babel/plugin-proposal-private-property-in-object', { loose: true }],
500
+ 'babel-plugin-istanbul'
500
501
  ],
501
502
  }
502
503
  },
@@ -554,7 +555,7 @@ export default function(dir, _appConfig) {
554
555
  plugins: [
555
556
  // Extensions
556
557
  path.relative(dir, path.join(SHELL, 'core/plugins.js')),
557
- path.relative(dir, path.join(SHELL, 'core/plugins-loader.js')),
558
+ path.relative(dir, path.join(SHELL, 'core/plugins-loader.js')), // Load builtin plugins
558
559
 
559
560
  // Third-party
560
561
  path.join(NUXT_SHELL, 'plugins/axios'),
@@ -578,33 +579,34 @@ export default function(dir, _appConfig) {
578
579
  { src: path.join(NUXT_SHELL, 'plugins/nuxt-client-init'), ssr: false },
579
580
  path.join(NUXT_SHELL, 'plugins/replaceall'),
580
581
  path.join(NUXT_SHELL, 'plugins/back-button'),
581
- { src: path.join(NUXT_SHELL, 'plugins/plugin'), ssr: false },
582
+ { src: path.join(NUXT_SHELL, 'plugins/plugin'), ssr: false }, // Load dyanmic plugins
582
583
  { src: path.join(NUXT_SHELL, 'plugins/codemirror-loader'), ssr: false },
584
+ { src: path.join(NUXT_SHELL, 'plugins/formatters'), ssr: false }, // Populate formatters cache for sorted table
585
+ { src: path.join(NUXT_SHELL, 'plugins/version'), ssr: false }, // Makes a fetch to the backend to get version metadata
583
586
  ],
584
587
 
585
588
  // Proxy: https://github.com/nuxt-community/proxy-module#options
586
589
  proxy: {
587
- '/k8s': proxyWsOpts(api), // Straight to a remote cluster (/k8s/clusters/<id>/)
588
- '/pp': proxyWsOpts(api), // For (epinio) standalone API
589
- '/api': proxyWsOpts(api), // Management k8s API
590
- '/apis': proxyWsOpts(api), // Management k8s API
591
- '/v1': proxyWsOpts(api), // Management Steve API
592
- '/v3': proxyWsOpts(api), // Rancher API
593
- '/v3-public': proxyOpts(api), // Rancher Unauthed API
594
- '/api-ui': proxyOpts(api), // Browser API UI
595
- '/meta': proxyMetaOpts(api), // Browser API UI
596
- '/v1-*': proxyOpts(api), // SAML, KDM, etc
590
+ '/k8s': proxyWsOpts(api), // Straight to a remote cluster (/k8s/clusters/<id>/)
591
+ '/pp': proxyWsOpts(api), // For (epinio) standalone API
592
+ '/api': proxyWsOpts(api), // Management k8s API
593
+ '/apis': proxyWsOpts(api), // Management k8s API
594
+ '/v1': proxyWsOpts(api), // Management Steve API
595
+ '/v3': proxyWsOpts(api), // Rancher API
596
+ '/v3-public': proxyOpts(api), // Rancher Unauthed API
597
+ '/api-ui': proxyOpts(api), // Browser API UI
598
+ '/meta': proxyMetaOpts(api), // Browser API UI
599
+ '/v1-*': proxyOpts(api), // SAML, KDM, etc
600
+ '/rancherversion': proxyPrimeOpts(api), // Rancher version endpoint
597
601
  // These are for Ember embedding
598
- '/c/*/edit': proxyOpts('https://127.0.0.1:8000'), // Can't proxy all of /c because that's used by Vue too
599
- '/k/': proxyOpts('https://127.0.0.1:8000'),
600
- '/g/': proxyOpts('https://127.0.0.1:8000'),
601
- '/n/': proxyOpts('https://127.0.0.1:8000'),
602
- '/p/': proxyOpts('https://127.0.0.1:8000'),
603
- '/assets': proxyOpts('https://127.0.0.1:8000'),
604
- '/translations': proxyOpts('https://127.0.0.1:8000'),
605
- '/engines-dist': proxyOpts('https://127.0.0.1:8000'),
606
- // Plugin dev
607
- '/verdaccio/': proxyOpts('http://127.0.0.1:4873/-'),
602
+ '/c/*/edit': proxyOpts('https://127.0.0.1:8000'), // Can't proxy all of /c because that's used by Vue too
603
+ '/k/': proxyOpts('https://127.0.0.1:8000'),
604
+ '/g/': proxyOpts('https://127.0.0.1:8000'),
605
+ '/n/': proxyOpts('https://127.0.0.1:8000'),
606
+ '/p/': proxyOpts('https://127.0.0.1:8000'),
607
+ '/assets': proxyOpts('https://127.0.0.1:8000'),
608
+ '/translations': proxyOpts('https://127.0.0.1:8000'),
609
+ '/engines-dist': proxyOpts('https://127.0.0.1:8000'),
608
610
  },
609
611
 
610
612
  // Nuxt server
@@ -663,6 +665,49 @@ export default function(dir, _appConfig) {
663
665
  };
664
666
  }
665
667
 
668
+ // Intercept the /rancherversion API call wnad modify the 'RancherPrime' value
669
+ // if configured to do so by the environment variable PRIME
670
+ function proxyPrimeOpts(target) {
671
+ const opts = proxyOpts(target);
672
+
673
+ // Don't intercept if the PRIME environment variable is not set
674
+ if (!prime?.length) {
675
+ return opts;
676
+ }
677
+
678
+ opts.onProxyRes = (proxyRes, req, res) => {
679
+ const _end = res.end;
680
+ let body = '';
681
+
682
+ proxyRes.on( 'data', (data) => {
683
+ data = data.toString('utf-8');
684
+ body += data;
685
+ });
686
+
687
+ res.write = () => {};
688
+
689
+ res.end = () => {
690
+ let output = body;
691
+
692
+ try {
693
+ const out = JSON.parse(body);
694
+
695
+ out.RancherPrime = prime;
696
+ output = JSON.stringify(out);
697
+ } catch (err) {}
698
+
699
+ res.setHeader('content-length', output.length );
700
+ res.setHeader('content-type', 'application/json' );
701
+ res.setHeader('transfer-encoding', '');
702
+ res.setHeader('cache-control', 'no-cache');
703
+ res.writeHead(proxyRes.statusCode);
704
+ _end.apply(res, [output]);
705
+ };
706
+ };
707
+
708
+ return opts;
709
+ }
710
+
666
711
  function onProxyRes(proxyRes, req, res) {
667
712
  if (devPorts) {
668
713
  proxyRes.headers['X-Frame-Options'] = 'ALLOWALL';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rancher/shell",
3
- "version": "0.1.3",
3
+ "version": "0.1.21",
4
4
  "description": "Rancher Dashboard Shell",
5
5
  "repository": "https://github.com/rancherlabs/dashboard",
6
6
  "license": "Apache-2.0",
@@ -32,125 +32,124 @@
32
32
  "e2e:dev": "start-server-and-test dev https://localhost:8005 cy:open"
33
33
  },
34
34
  "dependencies": {
35
- "@aws-sdk/client-ec2": "^3.1.0",
36
- "@aws-sdk/client-eks": "^3.1.0",
37
- "@aws-sdk/client-kms": "^3.8.1",
38
- "@babel/plugin-proposal-optional-chaining": "^7.14.5",
39
- "@babel/plugin-proposal-private-property-in-object": "^7.14.5",
40
- "@babel/preset-typescript": "^7.15.0",
41
- "@innologica/vue-dropdown-menu": "^0.1.3",
42
- "@novnc/novnc": "^1.2.0",
35
+ "@aws-sdk/client-ec2": "3.1.0",
36
+ "@aws-sdk/client-eks": "3.1.0",
37
+ "@aws-sdk/client-kms": "3.8.1",
38
+ "@babel/plugin-proposal-optional-chaining": "7.14.5",
39
+ "@babel/plugin-proposal-private-property-in-object": "7.14.5",
40
+ "@babel/preset-typescript": "7.16.7",
41
+ "@innologica/vue-dropdown-menu": "0.1.3",
42
+ "@novnc/novnc": "1.2.0",
43
43
  "@nuxt/types": "2.14.6",
44
- "@nuxt/typescript-build": "^2.1.0",
45
- "@nuxtjs/axios": "^5.3.6",
46
- "@nuxtjs/eslint-config-typescript": "^6.0.1",
47
- "@nuxtjs/eslint-module": "^1.1.0",
48
- "@nuxtjs/proxy": "^1.3.3",
49
- "@nuxtjs/style-resources": "^1.2.1",
50
- "@nuxtjs/webpack-profile": "^0.1.0",
51
- "@popperjs/core": "^2.4.0",
52
- "@types/node": "^16.4.3",
53
- "@typescript-eslint/eslint-plugin": "^4.18.0",
54
- "@typescript-eslint/parser": "^4.18.0",
55
- "@vue/cli-plugin-babel": "^4.5.15",
56
- "@vue/cli-plugin-typescript": "^4.5.15",
57
- "@vue/cli-service": "^4.5.13",
44
+ "@nuxt/typescript-build": "2.1.0",
45
+ "@nuxtjs/axios": "5.12.0",
46
+ "@nuxtjs/eslint-config-typescript": "6.0.1",
47
+ "@nuxtjs/eslint-module": "1.2.0",
48
+ "@nuxtjs/proxy": "1.3.3",
49
+ "@nuxtjs/style-resources": "1.2.1",
50
+ "@nuxtjs/webpack-profile": "0.1.0",
51
+ "@popperjs/core": "2.4.4",
52
+ "@types/node": "16.4.3",
53
+ "@typescript-eslint/eslint-plugin": "4.33.0",
54
+ "@typescript-eslint/parser": "4.33.0",
55
+ "@vue/cli-plugin-babel": "4.5.15",
56
+ "@vue/cli-plugin-typescript": "4.5.15",
57
+ "@vue/cli-service": "4.5.15",
58
58
  "@vue/test-utils": "1.2.1",
59
- "@vue/vue2-jest": "^27.0.0",
60
- "add": "^2.0.6",
61
- "ansi_up": "^5.0.0",
62
- "babel-eslint": "^10.0.1",
63
- "babel-plugin-module-resolver": "^4.0.0",
64
- "babel-preset-vue": "^2.0.2",
65
- "browser-env": "^3.2.6",
66
- "comlink": "^4.3.1",
67
- "cookie": "^0.4.0",
68
- "cookie-universal-nuxt": "^2.0.17",
69
- "core-js": "^3.20.3",
70
- "cron-validator": "^1.2.0",
71
- "cronstrue": "^1.92.0",
72
- "cross-env": "^6.0.3",
59
+ "@vue/vue2-jest": "27.0.0",
60
+ "add": "2.0.6",
61
+ "ansi_up": "5.0.0",
62
+ "babel-eslint": "10.1.0",
63
+ "babel-plugin-module-resolver": "4.0.0",
64
+ "babel-preset-vue": "2.0.2",
65
+ "browser-env": "3.3.0",
66
+ "cookie": "0.5.0",
67
+ "cookie-universal-nuxt": "2.1.4",
68
+ "core-js": "3.21.1",
69
+ "cron-validator": "1.2.0",
70
+ "cronstrue": "1.95.0",
71
+ "cross-env": "6.0.3",
73
72
  "css-loader": "4.3.0",
74
- "csv-loader": "^3.0.3",
75
- "cypress": "8.4.1",
76
- "d3": "^5.12.0",
77
- "d3-selection": "^1.3.0",
78
- "dagre-d3": "^0.6.3",
79
- "dayjs": "^1.8.16",
80
- "diff2html": "^2.11.2",
81
- "dompurify": "^2.0.12",
73
+ "csv-loader": "3.0.3",
74
+ "cypress": "10.3.1",
75
+ "d3": "7.3.0",
76
+ "d3-selection": "1.4.1",
77
+ "dagre-d3": "0.6.4",
78
+ "dayjs": "1.8.29",
79
+ "diff2html": "2.11.2",
80
+ "dompurify": "2.0.12",
82
81
  "eslint": "7.32.0",
83
- "eslint-config-standard": ">=12.0.0",
82
+ "eslint-config-standard": "16.0.3",
84
83
  "eslint-import-resolver-node": "0.3.4",
85
84
  "eslint-module-utils": "2.6.1",
86
- "eslint-plugin-cypress": "^2.11.3",
85
+ "eslint-plugin-cypress": "2.12.1",
87
86
  "eslint-plugin-import": "2.23.4",
88
- "eslint-plugin-jest": "^23.6.0",
89
- "eslint-plugin-n": "^15.2.0",
87
+ "eslint-plugin-jest": "24.4.0",
88
+ "eslint-plugin-n": "15.2.0",
90
89
  "eslint-plugin-vue": "7.14.0",
91
- "event-target-shim": "^5.0.1",
92
- "express": "^4.17.1",
93
- "file-saver": "^2.0.2",
94
- "frontmatter-markdown-loader": "^3.6.3",
95
- "identicon.js": "^2.3.3",
96
- "intl-messageformat": "^7.7.2",
97
- "is-url": "^1.2.4",
98
- "jest": "^27.5.1",
99
- "jest-serializer-vue": "^2.0.2",
100
- "jexl": "^2.2.2",
101
- "jquery": "^3.5.0",
102
- "js-cookie": "^2.2.0",
103
- "js-yaml": "^4.1.0",
104
- "js-yaml-loader": "^1.2.2",
105
- "jsdiff": "^1.1.1",
106
- "jsdom-global": "^3.0.2",
107
- "jsonpath-plus": "^6.0.1",
108
- "jsrsasign": "^10.2.0",
109
- "jszip": "^3.7.0",
110
- "lodash": "^4.17.21",
111
- "marked": "^2.0.0",
112
- "nodemon": "^2.0.2",
90
+ "event-target-shim": "5.0.1",
91
+ "express": "4.17.1",
92
+ "file-saver": "2.0.2",
93
+ "frontmatter-markdown-loader": "3.7.0",
94
+ "identicon.js": "2.3.3",
95
+ "intl-messageformat": "7.8.4",
96
+ "is-url": "1.2.4",
97
+ "jest": "27.5.1",
98
+ "jest-serializer-vue": "2.0.2",
99
+ "jexl": "2.2.2",
100
+ "jquery": "3.5.1",
101
+ "js-cookie": "2.2.1",
102
+ "js-yaml": "4.1.0",
103
+ "js-yaml-loader": "1.2.2",
104
+ "jsdiff": "1.1.1",
105
+ "jsdom-global": "3.0.2",
106
+ "jsonpath-plus": "6.0.1",
107
+ "jsrsasign": "10.2.0",
108
+ "jszip": "3.7.0",
109
+ "lodash": "4.17.21",
110
+ "marked": "4.0.17",
111
+ "nodemon": "2.0.4",
113
112
  "nuxt": "2.15.8",
114
- "nyc": "^15.0.0",
115
- "papaparse": "^5.3.0",
116
- "portal-vue": "^2.1.5",
117
- "rancher-icons": "rancher/icons#v2.0.0",
118
- "require-extension-hooks": "^0.3.3",
119
- "require-extension-hooks-babel": "^1.0.0-beta.1",
120
- "require-extension-hooks-vue": "^3.0.0",
121
- "sass": "^1.38.2",
122
- "sass-loader": "10",
123
- "serve-static": "^1.14.1",
124
- "set-cookie-parser": "^2.4.0",
125
- "shell-quote": "^1.7.2",
126
- "sinon": "^8.0.4",
127
- "start-server-and-test": "^1.13.1",
128
- "style-loader": "^1.1.2",
129
- "ts-node": "^8.3.0",
130
- "typescript": "~4.1.5",
131
- "url-parse": "^1.5.0",
132
- "v-tooltip": "^2.0.2",
113
+ "nyc": "15.1.0",
114
+ "papaparse": "5.3.0",
115
+ "portal-vue": "2.1.7",
116
+ "rancher-icons": "rancher/icons#v2.0.3",
117
+ "require-extension-hooks": "0.3.3",
118
+ "require-extension-hooks-babel": "1.0.0",
119
+ "require-extension-hooks-vue": "3.0.0",
120
+ "sass": "1.51.0",
121
+ "sass-loader": "10.2.1",
122
+ "serve-static": "1.14.1",
123
+ "set-cookie-parser": "2.4.6",
124
+ "shell-quote": "1.7.3",
125
+ "sinon": "8.1.1",
126
+ "start-server-and-test": "1.13.1",
127
+ "style-loader": "1.2.1",
128
+ "ts-node": "8.10.2",
129
+ "typescript": "4.1.6",
130
+ "url-parse": "1.5.10",
131
+ "v-tooltip": "2.0.3",
133
132
  "vue": "2.6.14",
134
- "vue-clipboard2": "^0.3.1",
135
- "vue-codemirror": "^4.0.6",
136
- "vue-js-modal": "^1.3.31",
137
- "vue-resize": "^0.4.5",
138
- "vue-select": "^3.13.0",
133
+ "vue-clipboard2": "0.3.1",
134
+ "vue-codemirror": "4.0.6",
135
+ "vue-js-modal": "1.3.35",
136
+ "vue-resize": "0.4.5",
137
+ "vue-select": "3.18.3",
139
138
  "vue-server-renderer": "2.6.14",
140
- "vue-shortkey": "^3.1.7",
139
+ "vue-shortkey": "3.1.7",
141
140
  "vue-template-compiler": "2.6.14",
142
- "vue2-transitions": "^0.3.0",
143
- "vuedraggable": "^2.24.3",
144
- "vuex": "^3.6.2",
145
- "webpack-bundle-analyzer": "^4.5.0",
146
- "webpack-virtual-modules": "^0.4.3",
147
- "xterm": "^4.9.0",
148
- "xterm-addon-fit": "^0.4.0",
149
- "xterm-addon-search": "^0.7.0",
150
- "xterm-addon-web-links": "^0.4.0",
151
- "xterm-addon-webgl": "^0.9.0",
152
- "worker-loader": "^3.0.8",
153
- "yarn": "^1.22.11"
141
+ "vue2-transitions": "0.3.0",
142
+ "vuedraggable": "2.24.3",
143
+ "vuex": "3.6.2",
144
+ "webpack-bundle-analyzer": "4.5.0",
145
+ "webpack-virtual-modules": "0.4.3",
146
+ "xterm": "4.9.0",
147
+ "xterm-addon-fit": "0.4.0",
148
+ "xterm-addon-search": "0.7.0",
149
+ "xterm-addon-web-links": "0.4.0",
150
+ "xterm-addon-webgl": "0.9.0",
151
+ "worker-loader": "3.0.8",
152
+ "yarn": "1.22.18"
154
153
  },
155
154
  "nyc": {
156
155
  "extension": [
@@ -158,4 +157,4 @@
158
157
  ".vue"
159
158
  ]
160
159
  }
161
- }
160
+ }
@@ -26,6 +26,7 @@ import {
26
26
  setBrand,
27
27
  setVendor
28
28
  } from '@shell/config/private-label';
29
+ import loadPlugins from '@shell/plugins/plugin';
29
30
 
30
31
  export default {
31
32
  name: 'Login',
@@ -255,6 +256,15 @@ export default {
255
256
  this.$cookies.remove(USERNAME);
256
257
  }
257
258
 
259
+ // User logged with local login - we don't do any redirect/reload, so the boot-time plugin will not run again to laod the plugins
260
+ // so we manually load them here - other SSO auth providers bounce out and back to the Dashboard, so on the bounce-back
261
+ // the plugins will load via the boot-time plugin
262
+ await loadPlugins({
263
+ app: this.$store.app,
264
+ store: this.$store,
265
+ $plugin: this.$store.$plugin
266
+ });
267
+
258
268
  if (this.firstLogin || user[0]?.mustChangePassword) {
259
269
  this.$store.dispatch('auth/setInitialPass', this.password);
260
270
  this.$router.push({ name: 'auth-setup' });
@@ -395,7 +405,7 @@ export default {
395
405
  </a>
396
406
  </div>
397
407
  <div class="locale-elector">
398
- <LocaleSelector></LocaleSelector>
408
+ <LocaleSelector mode="login" />
399
409
  </div>
400
410
  </template>
401
411
  </div>
@@ -2,6 +2,8 @@
2
2
  import { GITHUB_CODE, GITHUB_NONCE, BACK_TO } from '@shell/config/query-params';
3
3
  import { get } from '@shell/utils/object';
4
4
  import { base64Decode } from '@shell/utils/crypto';
5
+ import loadPlugins from '@shell/plugins/plugin';
6
+
5
7
  const samlProviders = ['ping', 'adfs', 'keycloak', 'okta', 'shibboleth'];
6
8
 
7
9
  function reply(err, code) {
@@ -60,6 +62,13 @@ export default {
60
62
  if ( res._status === 200) {
61
63
  const backTo = route.query[BACK_TO] || '/';
62
64
 
65
+ // Load plugins
66
+ await loadPlugins({
67
+ app: store.app,
68
+ store,
69
+ $plugin: store.$plugin
70
+ });
71
+
63
72
  redirect(backTo);
64
73
  } else {
65
74
  redirect(`/auth/login?err=${ escape(res) }`);
@@ -2,6 +2,8 @@
2
2
  import AsyncButton from '@shell/components/AsyncButton';
3
3
  import Loading from '@shell/components/Loading';
4
4
  import { Banner } from '@components/Banner';
5
+ import Carousel from '@shell/components/Carousel';
6
+ import ButtonGroup from '@shell/components/ButtonGroup';
5
7
  import SelectIconGrid from '@shell/components/SelectIconGrid';
6
8
  import TypeDescription from '@shell/components/TypeDescription';
7
9
  import {
@@ -12,15 +14,18 @@ import { sortBy } from '@shell/utils/sort';
12
14
  import { mapGetters } from 'vuex';
13
15
  import { Checkbox } from '@components/Form/Checkbox';
14
16
  import Select from '@shell/components/form/Select';
15
- import { mapPref, HIDE_REPOS, SHOW_PRE_RELEASE } from '@shell/store/prefs';
17
+ import { mapPref, HIDE_REPOS, SHOW_PRE_RELEASE, SHOW_CHART_MODE } from '@shell/store/prefs';
16
18
  import { removeObject, addObject, findBy } from '@shell/utils/array';
17
19
  import { compatibleVersionsFor, filterAndArrangeCharts } from '@shell/store/catalog';
18
20
  import { CATALOG } from '@shell/config/labels-annotations';
21
+ import { isUIPlugin } from '@shell/config/uiplugins';
19
22
 
20
23
  export default {
21
24
  components: {
22
25
  AsyncButton,
23
26
  Banner,
27
+ Carousel,
28
+ ButtonGroup,
24
29
  Loading,
25
30
  Checkbox,
26
31
  Select,
@@ -48,6 +53,17 @@ export default {
48
53
  searchQuery: null,
49
54
  showDeprecated: null,
50
55
  showHidden: null,
56
+ chartMode: this.$store.getters['prefs/get'](SHOW_CHART_MODE),
57
+ chartOptions: [
58
+ {
59
+ label: 'Browse',
60
+ value: 'browse',
61
+ },
62
+ {
63
+ label: 'Featured',
64
+ value: 'featured'
65
+ }
66
+ ]
51
67
  };
52
68
  },
53
69
 
@@ -134,6 +150,10 @@ export default {
134
150
  return false;
135
151
  }
136
152
 
153
+ if (isUIPlugin(c)) {
154
+ return false;
155
+ }
156
+
137
157
  return true;
138
158
  });
139
159
  },
@@ -154,6 +174,14 @@ export default {
154
174
  });
155
175
  },
156
176
 
177
+ getFeaturedCharts() {
178
+ const allCharts = (this.filteredCharts || []);
179
+
180
+ const featuredCharts = allCharts.filter(value => value.featured).sort((a, b) => a.featured - b.featured);
181
+
182
+ return featuredCharts.slice(0, 5);
183
+ },
184
+
157
185
  categories() {
158
186
  const map = {};
159
187
 
@@ -184,6 +212,10 @@ export default {
184
212
  return out;
185
213
  },
186
214
 
215
+ showCarousel() {
216
+ return this.chartMode === 'featured' && this.getFeaturedCharts.length;
217
+ }
218
+
187
219
  },
188
220
 
189
221
  watch: {
@@ -313,7 +345,20 @@ export default {
313
345
  {{ t('catalog.charts.header') }}
314
346
  </h1>
315
347
  </div>
348
+ <div v-if="getFeaturedCharts.length > 0" class="actions-container">
349
+ <ButtonGroup
350
+ v-model="chartMode"
351
+ :options="chartOptions"
352
+ />
353
+ </div>
316
354
  </header>
355
+ <div v-if="showCarousel">
356
+ <h3>Featured Charts</h3>
357
+ <Carousel
358
+ :sliders="getFeaturedCharts"
359
+ @clicked="(row) => selectChart(row)"
360
+ />
361
+ </div>
317
362
  <TypeDescription resource="chart" />
318
363
  <div class="left-right-split">
319
364
  <Select
@@ -632,10 +632,6 @@ export default {
632
632
  return { name: 'c-cluster-legacy-project' };
633
633
  },
634
634
 
635
- mcmRoute() {
636
- return { name: 'c-cluster-mcapps' };
637
- },
638
-
639
635
  windowsIncompatible() {
640
636
  if (this.chart?.windowsIncompatible) {
641
637
  return this.t('catalog.charts.windowsIncompatible');
@@ -762,8 +758,10 @@ export default {
762
758
 
763
759
  // Load a values component for the UI if it is named in the Helm chart.
764
760
  if ( component ) {
765
- if ( this.$store.getters['catalog/haveComponent'](component) ) {
766
- this.valuesComponent = this.$store.getters['catalog/importComponent'](component);
761
+ const hasChartComponent = this.$store.getters['type-map/hasCustomChart'](component);
762
+
763
+ if ( hasChartComponent ) {
764
+ this.valuesComponent = this.$store.getters['type-map/importChart'](component);
767
765
  const loaded = await this.valuesComponent();
768
766
 
769
767
  this.showValuesComponent = true;
@@ -1537,7 +1535,7 @@ export default {
1537
1535
  </div>
1538
1536
 
1539
1537
  <Banner color="warning" class="description">
1540
- <span>
1538
+ <span v-if="!mcapp">
1541
1539
  {{ t('catalog.install.error.legacy.label', { legacyType: mcapp ? legacyDefs.mcm : legacyDefs.legacy }, true) }}
1542
1540
  </span>
1543
1541
  <template v-if="!legacyEnabled">
@@ -1546,9 +1544,12 @@ export default {
1546
1544
  {{ t('catalog.install.error.legacy.enableLegacy.goto') }}
1547
1545
  </nuxt-link>
1548
1546
  </template>
1547
+ <template v-else-if="mcapp">
1548
+ <span v-html="t('catalog.install.error.legacy.mcmNotSupported')" />
1549
+ </template>
1549
1550
  <template v-else>
1550
- <nuxt-link :to="mcapp ? mcmRoute : legacyAppRoute">
1551
- <span v-html="t('catalog.install.error.legacy.navigate', { legacyType: mcapp ? legacyDefs.mcm : legacyDefs.legacy }, true)" />
1551
+ <nuxt-link :to="legacyAppRoute">
1552
+ <span v-html="t('catalog.install.error.legacy.navigate')" />
1552
1553
  </nuxt-link>
1553
1554
  </template>
1554
1555
  </Banner>