@rancher/shell 0.3.29 → 0.5.0

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 (301) hide show
  1. package/assets/images/providers/ovhcloudmks.svg +122 -0
  2. package/assets/images/providers/ovhcloudpubliccloud.svg +122 -0
  3. package/assets/styles/global/_layout.scss +99 -0
  4. package/assets/translations/en-us.yaml +31 -6
  5. package/assets/translations/zh-hans.yaml +2 -2
  6. package/babel.config.js +7 -1
  7. package/chart/monitoring/alerting/index.vue +7 -21
  8. package/chart/monitoring/grafana/index.vue +55 -0
  9. package/chart/monitoring/index.vue +51 -17
  10. package/chart/monitoring/prometheus/index.vue +37 -43
  11. package/chart/rancher-backup/index.vue +2 -1
  12. package/cloud-credential/azure.vue +4 -17
  13. package/components/AsyncButton.vue +17 -5
  14. package/components/Certificates.vue +164 -0
  15. package/components/CodeMirror.vue +19 -21
  16. package/components/CopyCode.vue +6 -2
  17. package/components/CopyToClipboard.vue +2 -1
  18. package/components/CopyToClipboardText.vue +14 -9
  19. package/components/CruResource.vue +1 -0
  20. package/components/DraggableZone.vue +2 -2
  21. package/components/EtcdInfoBanner.vue +5 -5
  22. package/components/ExplorerProjectsNamespaces.vue +25 -1
  23. package/components/IconOrSvg.vue +1 -1
  24. package/components/LandingPagePreference.vue +1 -4
  25. package/components/Markdown.vue +16 -12
  26. package/components/PodSecurityAdmission.vue +2 -2
  27. package/components/Questions/index.vue +1 -1
  28. package/components/ResourceDetail/Masthead.vue +25 -9
  29. package/components/ResourceTable.vue +14 -2
  30. package/components/ResourceYaml.vue +5 -0
  31. package/components/SideNav.vue +1 -1
  32. package/components/SingleClusterInfo.vue +1 -4
  33. package/components/StatusTable.vue +5 -1
  34. package/components/Tabbed/index.vue +12 -0
  35. package/components/__tests__/CopyCode.test.ts +5 -4
  36. package/components/fleet/FleetBundles.vue +5 -11
  37. package/components/fleet/FleetRepos.vue +62 -27
  38. package/components/fleet/FleetResources.vue +6 -1
  39. package/components/fleet/FleetSummary.vue +3 -3
  40. package/components/fleet/__tests__/FleetSummary.test.ts +316 -0
  41. package/components/form/ArrayListSelect.vue +10 -0
  42. package/components/form/Error.vue +3 -3
  43. package/components/form/Footer.vue +2 -2
  44. package/components/form/GitPicker.vue +83 -38
  45. package/components/form/KeyValue.vue +4 -0
  46. package/components/form/LabeledSelect.vue +4 -0
  47. package/components/form/Password.vue +3 -1
  48. package/components/formatter/Checked.vue +11 -3
  49. package/components/formatter/FleetClusterSummaryGraph.vue +27 -0
  50. package/components/formatter/FleetSummaryGraph.vue +23 -11
  51. package/components/formatter/LiveDuration.vue +1 -1
  52. package/components/formatter/PercentageBar.vue +1 -1
  53. package/components/formatter/__tests__/Checked.test.ts +19 -0
  54. package/components/nav/Group.vue +2 -2
  55. package/components/nav/Header.vue +1 -2
  56. package/components/nav/TopLevelMenu.vue +36 -6
  57. package/components/nav/Type.vue +1 -3
  58. package/components/nav/WindowManager/ContainerLogs.vue +101 -3
  59. package/components/nav/WindowManager/ContainerShell.vue +6 -1
  60. package/components/nav/WindowManager/__tests__/ContainerLogs.test.ts +186 -0
  61. package/components/nav/WindowManager/index.vue +11 -10
  62. package/components/nav/__tests__/TopLevelMenu.test.ts +33 -0
  63. package/components/nav/__tests__/Type.test.ts +1 -1
  64. package/components/nuxt/nuxt-child.js +14 -78
  65. package/components/nuxt/nuxt.js +1 -1
  66. package/{layouts → components/templates}/blank.vue +1 -1
  67. package/{layouts → components/templates}/default.vue +8 -98
  68. package/{layouts → components/templates}/error.vue +10 -19
  69. package/{layouts → components/templates}/home.vue +4 -1
  70. package/{layouts → components/templates}/plain.vue +4 -1
  71. package/{layouts → components/templates}/standalone.vue +1 -1
  72. package/{layouts → components/templates}/unauthenticated.vue +1 -1
  73. package/composables/useCompactInput.test.ts +36 -0
  74. package/composables/useCompactInput.ts +20 -0
  75. package/composables/useLabeledFormElement.test.ts +135 -0
  76. package/composables/useLabeledFormElement.ts +138 -0
  77. package/config/harvester-manager-types.js +2 -0
  78. package/config/home-links.js +1 -1
  79. package/config/private-label.js +22 -0
  80. package/config/product/explorer.js +3 -0
  81. package/config/product/fleet.js +6 -1
  82. package/config/product/manager.js +8 -2
  83. package/config/query-params.js +1 -0
  84. package/config/router.js +385 -364
  85. package/config/settings.ts +1 -0
  86. package/config/store.js +1 -1
  87. package/config/system-namespaces.js +3 -0
  88. package/config/table-headers.js +47 -0
  89. package/core/plugin-helpers.js +3 -5
  90. package/core/plugin-routes.ts +56 -114
  91. package/core/plugin.ts +16 -10
  92. package/core/plugins-loader.js +7 -9
  93. package/core/plugins.js +0 -3
  94. package/creators/app/files/.gitlab-ci.yml +14 -0
  95. package/creators/app/init +19 -0
  96. package/detail/fleet.cattle.io.cluster.vue +11 -1
  97. package/detail/provisioning.cattle.io.cluster.vue +4 -3
  98. package/dialog/ScaleMachineDownDialog.vue +34 -17
  99. package/edit/__tests__/service.test.ts +89 -0
  100. package/edit/auth/googleoauth.vue +1 -5
  101. package/edit/cloudcredential.vue +2 -0
  102. package/edit/configmap.vue +2 -1
  103. package/edit/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +2 -2
  104. package/edit/monitoring.coreos.com.prometheusrule/AlertingRule.vue +12 -3
  105. package/edit/monitoring.coreos.com.prometheusrule/GroupRules.vue +2 -1
  106. package/edit/networking.k8s.io.networkpolicy/__tests__/PolicyRuleTarget.spec.ts +1 -1
  107. package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +15 -7
  108. package/edit/provisioning.cattle.io.cluster/__tests__/Advanced.test.ts +112 -0
  109. package/edit/provisioning.cattle.io.cluster/__tests__/Basics.test.ts +473 -0
  110. package/edit/provisioning.cattle.io.cluster/__tests__/{CustomCommand.tests.ts → CustomCommand.test.ts} +6 -0
  111. package/edit/provisioning.cattle.io.cluster/__tests__/DrainOptions.test.ts +1 -1
  112. package/edit/provisioning.cattle.io.cluster/__tests__/index.test.ts +73 -0
  113. package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +7 -1
  114. package/edit/provisioning.cattle.io.cluster/__tests__/utils/cluster.ts +386 -0
  115. package/edit/provisioning.cattle.io.cluster/import.vue +2 -2
  116. package/edit/provisioning.cattle.io.cluster/index.vue +92 -36
  117. package/edit/provisioning.cattle.io.cluster/rke2.vue +171 -583
  118. package/edit/provisioning.cattle.io.cluster/tabs/AddOnConfig.vue +137 -0
  119. package/edit/provisioning.cattle.io.cluster/tabs/Advanced.vue +157 -0
  120. package/edit/provisioning.cattle.io.cluster/{Basics.vue → tabs/Basics.vue} +94 -19
  121. package/edit/provisioning.cattle.io.cluster/{MachinePool.vue → tabs/MachinePool.vue} +1 -0
  122. package/edit/provisioning.cattle.io.cluster/tabs/etcd/index.vue +135 -0
  123. package/edit/provisioning.cattle.io.cluster/tabs/networking/index.vue +189 -0
  124. package/edit/provisioning.cattle.io.cluster/tabs/registries/index.vue +144 -0
  125. package/edit/provisioning.cattle.io.cluster/tabs/upgrade/index.vue +76 -0
  126. package/edit/service.vue +12 -0
  127. package/edit/workload/Upgrading.vue +3 -2
  128. package/edit/workload/mixins/workload.js +1 -1
  129. package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +2 -1
  130. package/initialize/App.js +25 -71
  131. package/initialize/client.js +21 -162
  132. package/initialize/index.js +47 -124
  133. package/list/management.cattle.io.feature.vue +1 -7
  134. package/list/node.vue +1 -0
  135. package/machine-config/__tests__/vmwarevsphere.test.ts +100 -21
  136. package/machine-config/vmwarevsphere.vue +73 -51
  137. package/middleware/authenticated.js +10 -17
  138. package/mixins/auth-config.js +2 -7
  139. package/mixins/brand.js +29 -41
  140. package/mixins/create-edit-view/index.js +2 -2
  141. package/mixins/labeled-form-element.ts +6 -1
  142. package/models/__tests__/management.cattle.io.cluster.test.ts +4 -0
  143. package/models/__tests__/management.cattle.io.node.ts +85 -0
  144. package/models/__tests__/management.cattle.io.nodepool.ts +83 -0
  145. package/models/__tests__/namespace.test.ts +49 -9
  146. package/models/__tests__/workload.test.ts +91 -0
  147. package/models/cluster/node.js +4 -4
  148. package/models/cluster.x-k8s.io.machinedeployment.js +14 -0
  149. package/models/fleet.cattle.io.cluster.js +4 -0
  150. package/models/fleet.cattle.io.gitrepo.js +56 -13
  151. package/models/management.cattle.io.cluster.js +7 -3
  152. package/models/management.cattle.io.kontainerdriver.js +1 -1
  153. package/models/management.cattle.io.node.js +18 -14
  154. package/models/management.cattle.io.nodepool.js +17 -0
  155. package/models/namespace.js +1 -1
  156. package/models/pod.js +20 -0
  157. package/models/provisioning.cattle.io.cluster.js +39 -4
  158. package/models/secret.js +117 -18
  159. package/models/workload.js +16 -0
  160. package/models/workload.service.js +18 -0
  161. package/package.json +11 -10
  162. package/pages/about.vue +0 -1
  163. package/pages/account/create-key.vue +0 -1
  164. package/pages/account/index.vue +0 -1
  165. package/pages/auth/login.vue +0 -1
  166. package/pages/auth/logout.vue +0 -2
  167. package/pages/auth/setup.vue +0 -4
  168. package/pages/auth/verify.vue +14 -8
  169. package/pages/c/_cluster/apps/charts/index.vue +64 -43
  170. package/pages/c/_cluster/apps/charts/install.vue +4 -4
  171. package/pages/c/_cluster/apps/index.vue +0 -2
  172. package/pages/c/_cluster/auth/index.vue +0 -2
  173. package/pages/c/_cluster/ecm/index.vue +0 -2
  174. package/pages/c/_cluster/explorer/index.vue +28 -2
  175. package/pages/c/_cluster/fleet/index.vue +1 -1
  176. package/pages/c/_cluster/index.vue +0 -2
  177. package/pages/c/_cluster/settings/banners.vue +0 -2
  178. package/pages/c/_cluster/settings/brand.vue +0 -2
  179. package/pages/c/_cluster/settings/index.vue +0 -2
  180. package/pages/c/_cluster/settings/links.vue +0 -1
  181. package/pages/c/_cluster/settings/performance.vue +0 -1
  182. package/pages/c/_cluster/uiplugins/CatalogList/CatalogLoadDialog.vue +2 -1
  183. package/pages/c/_cluster/uiplugins/CatalogList/index.vue +10 -46
  184. package/pages/c/_cluster/uiplugins/index.vue +0 -2
  185. package/pages/diagnostic.vue +1 -2
  186. package/pages/fail-whale.vue +0 -1
  187. package/pages/prefs.vue +0 -1
  188. package/pages/support/index.vue +2 -8
  189. package/pkg/auto-import.js +1 -1
  190. package/plugins/axios.js +0 -36
  191. package/plugins/back-button.js +3 -5
  192. package/plugins/clean-html-directive.js +1 -19
  193. package/plugins/clean-html.js +53 -0
  194. package/plugins/clean-tooltip-directive.js +1 -1
  195. package/plugins/codemirror-loader.js +1 -1
  196. package/plugins/codemirror.js +41 -0
  197. package/plugins/dashboard-store/__tests__/{mutations.spec.ts → mutations.test.ts} +1 -1
  198. package/plugins/dashboard-store/__tests__/resource-class.test.ts +49 -0
  199. package/plugins/dashboard-store/__tests__/utils/store-mocks.ts +7 -0
  200. package/plugins/dashboard-store/actions.js +30 -4
  201. package/plugins/dashboard-store/classify.js +1 -18
  202. package/plugins/dashboard-store/getters.js +10 -5
  203. package/plugins/dashboard-store/index.js +0 -12
  204. package/plugins/dashboard-store/mutations.js +0 -4
  205. package/plugins/dashboard-store/resource-class.js +59 -18
  206. package/plugins/index.js +11 -0
  207. package/plugins/steve/__tests__/steve-class.spec.ts +59 -0
  208. package/plugins/steve/__tests__/utils/steve-mocks.ts +31 -0
  209. package/plugins/steve/getters.js +4 -1
  210. package/plugins/steve/norman-class.js +19 -0
  211. package/plugins/steve/steve-class.js +22 -0
  212. package/plugins/steve/subscribe.js +4 -10
  213. package/rancher-components/Accordion/Accordion.test.ts +45 -0
  214. package/rancher-components/Accordion/Accordion.vue +86 -0
  215. package/rancher-components/Accordion/index.ts +1 -0
  216. package/rancher-components/BadgeState/BadgeState.vue +3 -3
  217. package/rancher-components/Banner/Banner.vue +2 -2
  218. package/rancher-components/Card/Card.vue +3 -3
  219. package/rancher-components/Form/Checkbox/Checkbox.vue +3 -3
  220. package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +18 -1
  221. package/rancher-components/Form/LabeledInput/LabeledInput.vue +65 -24
  222. package/rancher-components/Form/Radio/RadioButton.test.ts +7 -3
  223. package/rancher-components/Form/Radio/RadioButton.vue +13 -7
  224. package/rancher-components/Form/Radio/RadioGroup.test.ts +30 -0
  225. package/rancher-components/Form/Radio/RadioGroup.vue +8 -3
  226. package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +6 -4
  227. package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +7 -4
  228. package/rancher-components/LabeledTooltip/LabeledTooltip.vue +9 -4
  229. package/rancher-components/StringList/StringList.test.ts +270 -0
  230. package/rancher-components/StringList/StringList.vue +65 -26
  231. package/rancher-components/components/Accordion/Accordion.test.ts +45 -0
  232. package/rancher-components/components/Accordion/Accordion.vue +86 -0
  233. package/rancher-components/components/Accordion/index.ts +1 -0
  234. package/rancher-components/components/BadgeState/BadgeState.vue +3 -3
  235. package/rancher-components/components/Banner/Banner.vue +2 -2
  236. package/rancher-components/components/Card/Card.vue +3 -3
  237. package/rancher-components/components/Form/Checkbox/Checkbox.vue +3 -3
  238. package/rancher-components/components/Form/LabeledInput/LabeledInput.test.ts +18 -1
  239. package/rancher-components/components/Form/LabeledInput/LabeledInput.vue +57 -24
  240. package/rancher-components/components/Form/Radio/RadioButton.vue +13 -7
  241. package/rancher-components/components/Form/Radio/RadioGroup.vue +4 -3
  242. package/rancher-components/components/Form/TextArea/TextAreaAutoGrow.vue +6 -4
  243. package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.vue +7 -4
  244. package/rancher-components/components/LabeledTooltip/LabeledTooltip.vue +9 -4
  245. package/rancher-components/components/StringList/StringList.vue +8 -8
  246. package/scripts/.gitlab/workflows/build-extension-catalog.gitlab-ci.yml +50 -0
  247. package/scripts/extension/bundle +19 -7
  248. package/scripts/extension/helm/scripts/package +11 -3
  249. package/scripts/extension/parse-tag-name +2 -2
  250. package/scripts/extension/publish +20 -9
  251. package/scripts/publish-shell.sh +10 -0
  252. package/scripts/test-plugins-build.sh +85 -9
  253. package/server/har-file.js +183 -0
  254. package/store/catalog.js +1 -1
  255. package/store/features.js +1 -0
  256. package/store/i18n.js +11 -0
  257. package/store/index.js +13 -15
  258. package/store/prefs.js +33 -35
  259. package/store/type-map.js +8 -7
  260. package/tsconfig.json +35 -9
  261. package/tsconfig.paths.json +21 -0
  262. package/types/shell/index.d.ts +433 -234
  263. package/types/vue-shim.d.ts +42 -0
  264. package/utils/__tests__/create-yaml.test.ts +60 -0
  265. package/utils/axios.js +0 -19
  266. package/utils/azure.js +24 -0
  267. package/utils/clipboard.js +5 -0
  268. package/utils/create-yaml.js +17 -10
  269. package/utils/git.ts +1 -1
  270. package/utils/monitoring.js +1 -1
  271. package/utils/nuxt.js +18 -39
  272. package/utils/object.js +14 -0
  273. package/utils/router.scrollBehavior.js +12 -14
  274. package/utils/time.js +1 -1
  275. package/utils/url.ts +1 -1
  276. package/vue.config.js +23 -2
  277. package/.DS_Store +0 -0
  278. package/assets/images/providers/aks-black.svg +0 -28
  279. package/assets/images/providers/aks.svg +0 -31
  280. package/edit/provisioning.cattle.io.cluster/__tests__/Basics.tests.ts +0 -234
  281. package/initialize/layouts.ts +0 -26
  282. package/mixins/fetch.server.js +0 -73
  283. package/pages/c/index.vue +0 -9
  284. package/pages/rio/mesh.vue +0 -508
  285. package/plugins/transitions.js +0 -4
  286. package/plugins/vue-clipboard2.js +0 -4
  287. package/tsconfig.default.json +0 -46
  288. package/yarn-error.log +0 -200
  289. /package/components/form/__tests__/{NameNsDescription.ts → NameNsDescription.test.ts} +0 -0
  290. /package/edit/networking.k8s.io.networkpolicy/__tests__/utils/{selectors.ts → selectors.test.ts} +0 -0
  291. /package/edit/provisioning.cattle.io.cluster/{AgentConfiguration.vue → tabs/AgentConfiguration.vue} +0 -0
  292. /package/edit/provisioning.cattle.io.cluster/{MemberRoles.vue → tabs/MemberRoles.vue} +0 -0
  293. /package/edit/provisioning.cattle.io.cluster/{S3Config.vue → tabs/etcd/S3Config.vue} +0 -0
  294. /package/edit/provisioning.cattle.io.cluster/{ACE.vue → tabs/networking/ACE.vue} +0 -0
  295. /package/edit/provisioning.cattle.io.cluster/{RegistryConfigs.vue → tabs/registries/RegistryConfigs.vue} +0 -0
  296. /package/edit/provisioning.cattle.io.cluster/{RegistryMirrors.vue → tabs/registries/RegistryMirrors.vue} +0 -0
  297. /package/edit/provisioning.cattle.io.cluster/{DrainOptions.vue → tabs/upgrade/DrainOptions.vue} +0 -0
  298. /package/plugins/dashboard-store/__tests__/{actions.spec.ts → actions.test.ts} +0 -0
  299. /package/plugins/dashboard-store/__tests__/{getters.spec.ts → getters.test.ts} +0 -0
  300. /package/rancher-components/BadgeState/{BadgeState.spec.ts → BadgeState.test.ts} +0 -0
  301. /package/rancher-components/components/BadgeState/{BadgeState.spec.ts → BadgeState.test.ts} +0 -0
@@ -11,7 +11,7 @@ export default {
11
11
  const inStore = this.$store.getters['currentProduct'].inStore;
12
12
  let monitoringVersion = '';
13
13
 
14
- if (this.$store.getters[`${ inStore }/canList}`](CATALOG.APP)) {
14
+ if (this.$store.getters[`${ inStore }/canList`](CATALOG.APP)) {
15
15
  try {
16
16
  const res = await this.$store.dispatch(`${ inStore }/find`, { type: CATALOG.APP, id: 'cattle-monitoring-system/rancher-monitoring' });
17
17
 
@@ -23,13 +23,13 @@ export default {
23
23
 
24
24
  const leader = await hasLeader(monitoringVersion, this.$store.dispatch, this.currentCluster.id);
25
25
 
26
- this.hasLeader = leader ? this.t('generic.yes') : this.t('generic.no');
26
+ this.hasLeader = leader ? 'Yes' : 'No';
27
27
  this.leaderChanges = await leaderChanges(monitoringVersion, this.$store.dispatch, this.currentCluster.id);
28
28
  this.failedProposals = await failedProposals(monitoringVersion, this.$store.dispatch, this.currentCluster.id);
29
29
  },
30
30
  data() {
31
31
  return {
32
- hasLeader: this.t('generic.no'),
32
+ hasLeader: 'No',
33
33
  leaderChanges: 0,
34
34
  failedProposals: 0
35
35
  };
@@ -46,10 +46,10 @@ export default {
46
46
  color="info"
47
47
  >
48
48
  <div class="datum">
49
- <label>{{ t('etcdInfoBanner.hasLeader') }}</label> {{ hasLeader }}
49
+ <label>{{ t('etcdInfoBanner.hasLeader') }}</label> {{ hasLeader }},
50
50
  </div>
51
51
  <div class="datum">
52
- <label>{{ t('etcdInfoBanner.leaderChanges') }}</label> {{ leaderChanges }}
52
+ <label>{{ t('etcdInfoBanner.leaderChanges') }}</label> {{ leaderChanges }},
53
53
  </div>
54
54
  <div class="datum">
55
55
  <label>{{ t('etcdInfoBanner.failedProposals') }}</label> {{ failedProposals }}
@@ -391,7 +391,7 @@ export default {
391
391
  />
392
392
  <ResourceTable
393
393
  ref="table"
394
- class="table"
394
+ class="table project-namespaces-table"
395
395
  v-bind="$attrs"
396
396
  :schema="schema"
397
397
  :headers="headers"
@@ -505,6 +505,10 @@ export default {
505
505
  <style lang="scss" scoped>
506
506
  .project-namespaces {
507
507
  & ::v-deep {
508
+ .project-namespaces-table table {
509
+ table-layout: fixed;
510
+ }
511
+
508
512
  .project-name {
509
513
  line-height: 30px;
510
514
  }
@@ -514,6 +518,26 @@ export default {
514
518
  flex-direction: row;
515
519
  justify-content: space-between;
516
520
 
521
+ .group-tab {
522
+ max-width: calc(100% - 230px);
523
+ }
524
+
525
+ .project-name {
526
+ display: flex;
527
+ flex-direction: row;
528
+ align-items: center;
529
+
530
+ span:first-child {
531
+ padding-right: 8px;
532
+ }
533
+
534
+ span:last-child {
535
+ text-overflow: ellipsis;
536
+ overflow: hidden;
537
+ white-space: nowrap;
538
+ }
539
+ }
540
+
517
541
  &.has-description {
518
542
  .right {
519
543
  margin-top: 5px;
@@ -76,7 +76,7 @@ export default {
76
76
  for (let x = 0; x < Object.keys(stylesheet.cssRules).length; x++) {
77
77
  const cssRules = stylesheet.cssRules[x];
78
78
 
79
- if (cssRules.selectorText && ((currTheme === 'light' && cssRules.selectorText.includes('body') &&
79
+ if (cssRules.selectorText && ((currTheme === 'light' && (cssRules.selectorText.includes('body') || cssRules.selectorText.includes('BODY')) &&
80
80
  cssRules.selectorText.includes('.theme-light') && cssRules.style.cssText.includes('--link:')) ||
81
81
  (currTheme === 'dark' && cssRules.selectorText.includes('.theme-dark')))) {
82
82
  // grab the colors to be used on the icon from the css rules
@@ -15,10 +15,7 @@ export default {
15
15
  },
16
16
 
17
17
  async fetch() {
18
- this.clusters = await this.$store.dispatch('management/findAll', {
19
- type: MANAGEMENT.CLUSTER,
20
- opt: { url: MANAGEMENT.CLUSTER }
21
- });
18
+ this.clusters = await this.$store.dispatch('management/findAll', { type: MANAGEMENT.CLUSTER });
22
19
  },
23
20
 
24
21
  data() {
@@ -13,9 +13,8 @@ export default {
13
13
 
14
14
  data() {
15
15
  return {
16
- loaded: false,
17
- marked: null,
18
- dompurify: null,
16
+ loaded: false,
17
+ marked: null,
19
18
  };
20
19
  },
21
20
 
@@ -26,15 +25,10 @@ export default {
26
25
  breaks: true
27
26
  });
28
27
  },
29
-
30
- sanitized() {
31
- return this.dompurify.sanitize(this.html);
32
- },
33
28
  },
34
29
 
35
30
  async mounted() {
36
31
  const marked = (await import(/* webpackChunkName: "markdown" */ 'marked'));
37
- const dompurify = (await import(/* webpackChunkName: "markdown" */ 'dompurify')).default;
38
32
 
39
33
  const renderer = new marked.Renderer();
40
34
  const linkRenderer = renderer.link;
@@ -63,11 +57,8 @@ export default {
63
57
  return rendered;
64
58
  };
65
59
 
66
- dompurify.setConfig({ ADD_ATTR: ['target'] });
67
-
68
60
  this.marked = marked;
69
61
  this.markedRenderer = renderer;
70
- this.dompurify = dompurify;
71
62
  this.loaded = true;
72
63
  this.$emit('loaded', true);
73
64
  }
@@ -77,7 +68,7 @@ export default {
77
68
  <template>
78
69
  <div
79
70
  v-if="loaded"
80
- v-clean-html="sanitized"
71
+ v-clean-html="html"
81
72
  class="markdown"
82
73
  />
83
74
  <Loading v-else />
@@ -96,8 +87,20 @@ export default {
96
87
  }
97
88
 
98
89
  .markdown {
90
+ blockquote {
91
+ color: rgb(101, 109, 118);
92
+ border-left: 0.25em solid rgb(208, 215, 222);
93
+ padding: 0 1em;
94
+ margin-bottom: 16px;
95
+ }
96
+
97
+ table {
98
+ border-collapse: collapse;
99
+ }
100
+
99
101
  TH {
100
102
  text-align: left;
103
+ border: 1px solid #e3e7eb;
101
104
  }
102
105
 
103
106
  table tr th {
@@ -118,6 +121,7 @@ export default {
118
121
  text-align: left;
119
122
  margin: 0;
120
123
  padding: 6px 13px;
124
+ border: 1px solid #e3e7eb;
121
125
  }
122
126
 
123
127
  table tr th :first-child, table tr td :first-child {
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import Vue from 'vue';
2
+ import { defineComponent } from 'vue';
3
3
  import { _VIEW, _CREATE } from '@shell/config/query-params';
4
4
  import LabeledSelect from '@shell/components/form/LabeledSelect.vue';
5
5
  import Checkbox from '@components/Form/Checkbox/Checkbox.vue';
@@ -25,7 +25,7 @@ const getExemptionControl = (): PSAExemptionControl => ({
25
25
  value: ''
26
26
  });
27
27
 
28
- export default Vue.extend({
28
+ export default defineComponent({
29
29
  components: {
30
30
  Checkbox, LabeledSelect, LabeledInput
31
31
  },
@@ -258,7 +258,7 @@ export default {
258
258
  }
259
259
 
260
260
  if ( this.tabbed === 'multiple' ) {
261
- return this.groups.length > 1;
261
+ return !!this.groups.length;
262
262
  }
263
263
 
264
264
  return true;
@@ -177,13 +177,16 @@ export default {
177
177
 
178
178
  project() {
179
179
  if (this.isNamespace) {
180
- const id = (this.value?.metadata?.labels || {})[PROJECT];
181
- const clusterId = this.$store.getters['currentCluster'].id;
180
+ const cluster = this.$store.getters['currentCluster'];
182
181
 
183
- return this.$store.getters['management/byId'](MANAGEMENT.PROJECT, `${ clusterId }/${ id }`);
184
- } else {
185
- return null;
182
+ if (cluster) {
183
+ const id = (this.value?.metadata?.labels || {})[PROJECT];
184
+
185
+ return this.$store.getters['management/byId'](MANAGEMENT.PROJECT, `${ cluster.id }/${ id }`);
186
+ }
186
187
  }
188
+
189
+ return null;
187
190
  },
188
191
 
189
192
  banner() {
@@ -370,7 +373,7 @@ export default {
370
373
  },
371
374
 
372
375
  hideNamespaceLocation() {
373
- return this.$store.getters['currentProduct'].hideNamespaceLocation;
376
+ return this.$store.getters['currentProduct'].hideNamespaceLocation || this.value.namespaceLocation === null;
374
377
  },
375
378
  },
376
379
 
@@ -419,6 +422,7 @@ export default {
419
422
  <span v-if="value.detailPageHeaderActionOverride && value.detailPageHeaderActionOverride(realMode)">{{ value.detailPageHeaderActionOverride(realMode) }}</span>
420
423
  <t
421
424
  v-else
425
+ class="mastehead-resource-title"
422
426
  :k="'resourceDetail.header.' + realMode"
423
427
  :subtype="resourceSubtype"
424
428
  :name="displayName"
@@ -541,6 +545,10 @@ export default {
541
545
 
542
546
  HEADER {
543
547
  margin: 0;
548
+
549
+ .title {
550
+ overflow: hidden;
551
+ }
544
552
  }
545
553
 
546
554
  .primaryheader {
@@ -550,6 +558,17 @@ export default {
550
558
 
551
559
  h1 {
552
560
  margin: 0;
561
+ overflow: hidden;
562
+ display: flex;
563
+ flex-direction: row;
564
+ align-items: center;
565
+
566
+ .mastehead-resource-title {
567
+ padding: 0 8px;
568
+ text-overflow: ellipsis;
569
+ overflow: hidden;
570
+ white-space: nowrap;
571
+ }
553
572
  }
554
573
  }
555
574
 
@@ -572,9 +591,6 @@ export default {
572
591
 
573
592
  .masthead-state {
574
593
  font-size: initial;
575
- display: inline-block;
576
- position: relative;
577
- top: -2px;
578
594
  }
579
595
 
580
596
  .masthead-istio {
@@ -97,6 +97,14 @@ export default {
97
97
  default: 'sortableTable.paging.resource',
98
98
  },
99
99
 
100
+ /**
101
+ * Additional params to pass to the pagingLabel translation
102
+ */
103
+ pagingParams: {
104
+ type: Object,
105
+ default: null,
106
+ },
107
+
100
108
  rowActions: {
101
109
  type: Boolean,
102
110
  default: true,
@@ -392,7 +400,11 @@ export default {
392
400
  return standard.concat(this.listGroups);
393
401
  },
394
402
 
395
- pagingParams() {
403
+ parsedPagingParams() {
404
+ if (this.pagingParams) {
405
+ return this.pagingParams;
406
+ }
407
+
396
408
  if ( !this.schema ) {
397
409
  return {
398
410
  singularLabel: '',
@@ -482,7 +494,7 @@ export default {
482
494
  :group-options="groupOptions"
483
495
  :search="search"
484
496
  :paging="true"
485
- :paging-params="pagingParams"
497
+ :paging-params="parsedPagingParams"
486
498
  :paging-label="pagingLabel"
487
499
  :row-actions="rowActions"
488
500
  :table-actions="_showBulkActions"
@@ -190,6 +190,11 @@ export default {
190
190
 
191
191
  cm.foldLinesMatching(/managedFields/);
192
192
 
193
+ // Allow the model to supply an array of json paths to fold other sections in the YAML for the given resource type
194
+ if (this.value?.yamlFolding) {
195
+ this.value.yamlFolding.forEach((path) => cm.foldYaml(path));
196
+ }
197
+
193
198
  // regardless of edit or create we should probably fold all the comments so they dont get out of hand.
194
199
  const saved = cm.getMode().fold;
195
200
 
@@ -583,7 +583,7 @@ export default {
583
583
  }
584
584
  }
585
585
 
586
- &.nuxt-link-active:not(:hover) {
586
+ &.router-link-active:not(:hover) {
587
587
  A {
588
588
  background-color: var(--nav-active);
589
589
  }
@@ -13,10 +13,7 @@ export default {
13
13
  },
14
14
 
15
15
  async fetch() {
16
- this.clusters = await this.$store.dispatch('management/findAll', {
17
- type: MANAGEMENT.CLUSTER,
18
- opt: { url: MANAGEMENT.CLUSTER }
19
- });
16
+ this.clusters = await this.$store.dispatch('management/findAll', { type: MANAGEMENT.CLUSTER });
20
17
  },
21
18
 
22
19
  data() {
@@ -3,6 +3,8 @@ import {
3
3
  LAST_UPDATED, TYPE, REASON, MESSAGE, STATUS
4
4
  } from '@shell/config/table-headers';
5
5
  import SortableTable from '@shell/components/SortableTable';
6
+ import { copyTextToClipboard } from '@shell/utils/clipboard';
7
+ import { exceptionToErrorsArray } from '@shell/utils/error';
6
8
  export default {
7
9
  components: { SortableTable },
8
10
  props: {
@@ -31,12 +33,14 @@ export default {
31
33
  $event.stopPropagation();
32
34
  $event.preventDefault();
33
35
 
34
- this.$copyText(this.$slots.default[0].text).then(() => {
36
+ copyTextToClipboard(this.$slots.default[0].text).then(() => {
35
37
  this.copied = true;
36
38
 
37
39
  setTimeout(() => {
38
40
  this.copied = false;
39
41
  }, 2000);
42
+ }).catch((e) => {
43
+ this.$emit('error', exceptionToErrorsArray(e));
40
44
  });
41
45
  },
42
46
  }
@@ -19,6 +19,11 @@ export default {
19
19
  default: false
20
20
  },
21
21
 
22
+ hideSingleTab: {
23
+ type: Boolean,
24
+ default: false
25
+ },
26
+
22
27
  showTabsAddRemove: {
23
28
  type: Boolean,
24
29
  default: false
@@ -86,6 +91,11 @@ export default {
86
91
  sortedTabs() {
87
92
  return sortBy(this.tabs, ['weight:desc', 'labelDisplay', 'name']);
88
93
  },
94
+
95
+ // hide tabs based on tab count IF flag is active
96
+ hideTabs() {
97
+ return this.hideSingleTab && this.sortedTabs.length === 1;
98
+ }
89
99
  },
90
100
 
91
101
  watch: {
@@ -225,11 +235,13 @@ export default {
225
235
  <template>
226
236
  <div :class="{'side-tabs': !!sideTabs, 'tabs-only': tabsOnly }">
227
237
  <ul
238
+ v-if="!hideTabs"
228
239
  ref="tablist"
229
240
  role="tablist"
230
241
  class="tabs"
231
242
  :class="{'clearfix':!sideTabs, 'vertical': sideTabs, 'horizontal': !sideTabs}"
232
243
  tabindex="0"
244
+ data-testid="tabbed-block"
233
245
  @keydown.right.prevent="selectNext(1)"
234
246
  @keydown.left.prevent="selectNext(-1)"
235
247
  @keydown.down.prevent="selectNext(1)"
@@ -1,12 +1,13 @@
1
1
  import { mount } from '@vue/test-utils';
2
2
  import CopyCode from '@shell/components/CopyCode.vue';
3
3
 
4
+ jest.mock('@shell/utils/clipboard', () => {
5
+ return { copyTextToClipboard: jest.fn(() => Promise.resolve({})) };
6
+ });
7
+
4
8
  describe('component: CopyCode', () => {
5
9
  it('should emit copied after click', async() => {
6
- const wrapper = mount(CopyCode, {
7
- mocks: { $copyText: () => new Promise(() => undefined) },
8
- slots: { default: '<div></div>' }
9
- });
10
+ const wrapper = mount(CopyCode, { slots: { default: '<div></div>' } });
10
11
 
11
12
  await wrapper.find('code').trigger('click');
12
13
 
@@ -37,8 +37,8 @@ export default {
37
37
 
38
38
  computed: {
39
39
 
40
- allBundles() {
41
- // gitrepo model has getter for bundles.
40
+ allBundlesInRepo() {
41
+ // gitrepo model has getter for its bundles.
42
42
  return this.value.bundles || [];
43
43
  },
44
44
 
@@ -65,13 +65,7 @@ export default {
65
65
  bundles() {
66
66
  const harvester = this.harvesterClusters;
67
67
 
68
- return this.allBundles.filter((bundle) => {
69
- const isRepoBundle = bundle.metadata.name.startsWith(`${ this.value.metadata.name }-`);
70
-
71
- if (!isRepoBundle) {
72
- return false;
73
- }
74
-
68
+ return this.allBundlesInRepo.filter((bundle) => {
75
69
  const targets = bundle.spec?.targets || [];
76
70
 
77
71
  // Filter out any bundle that has one target whose cluster is a harvester cluster
@@ -84,7 +78,7 @@ export default {
84
78
  },
85
79
 
86
80
  hidden() {
87
- return this.allBundles.length - this.bundles.length;
81
+ return this.allBundlesInRepo.length - this.bundles.length;
88
82
  },
89
83
 
90
84
  headers() {
@@ -105,7 +99,6 @@ export default {
105
99
  return out;
106
100
  },
107
101
  },
108
-
109
102
  methods: {
110
103
  displayWarning(row) {
111
104
  return !!row.status?.summary && (row.status.summary.desiredReady !== row.status.summary.ready);
@@ -113,6 +106,7 @@ export default {
113
106
  }
114
107
  };
115
108
  </script>
109
+
116
110
  <template>
117
111
  <div>
118
112
  <Loading v-if="$fetchState.pending" />
@@ -8,8 +8,16 @@ import {
8
8
  AGE,
9
9
  STATE,
10
10
  NAME,
11
- FLEET_SUMMARY
11
+ FLEET_SUMMARY,
12
+ FLEET_REPO,
13
+ FLEET_REPO_TARGET,
14
+ FLEET_REPO_CLUSTERS_READY,
15
+ FLEET_REPO_CLUSTER_SUMMARY,
16
+ FLEET_REPO_PER_CLUSTER_STATE
17
+
12
18
  } from '@shell/config/table-headers';
19
+ import { FLEET } from '@shell/config/labels-annotations';
20
+ import { STATES_ENUM } from '@shell/plugins/dashboard-store/resource-class';
13
21
 
14
22
  export default {
15
23
 
@@ -19,6 +27,11 @@ export default {
19
27
  ResourceTable, Link, Shortened, FleetIntro
20
28
  },
21
29
  props: {
30
+ clusterId: {
31
+ type: String,
32
+ required: false,
33
+ default: null,
34
+ },
22
35
  rows: {
23
36
  type: Array,
24
37
  required: true,
@@ -54,35 +67,46 @@ export default {
54
67
  });
55
68
  },
56
69
 
70
+ isClusterView() {
71
+ return !!this.clusterId;
72
+ },
73
+
57
74
  noRows() {
58
75
  return !this.filteredRows.length;
59
76
  },
60
77
 
61
78
  headers() {
62
- const out = [
63
- STATE,
64
- NAME,
65
- {
66
- name: 'repo',
67
- labelKey: 'tableHeaders.repo',
68
- value: 'repoDisplay',
69
- sort: 'repoDisplay',
70
- search: ['spec.repo', 'status.commit'],
79
+ // Cluster summary is only shown in the cluster view
80
+ const fleetClusterSummary = {
81
+ ...FLEET_REPO_CLUSTER_SUMMARY,
82
+ formatterOpts: {
83
+ // Fleet uses labels to identify clusters
84
+ clusterLabel: this.clusterId
71
85
  },
72
- {
73
- name: 'target',
74
- labelKey: 'tableHeaders.target',
75
- value: 'targetInfo.modeDisplay',
76
- sort: ['targetInfo.modeDisplay', 'targetInfo.cluster', 'targetInfo.clusterGroup'],
77
- },
78
- {
79
- name: 'clustersReady',
80
- labelKey: 'tableHeaders.clustersReady',
81
- value: 'status.readyClusters',
82
- sort: 'status.readyClusters',
83
- search: false,
86
+ };
87
+
88
+ // if hasPerClusterState then use the repo state
89
+ const fleetPerClusterState = {
90
+ ...FLEET_REPO_PER_CLUSTER_STATE,
91
+ value: (row) => {
92
+ const statePerCluster = row.clusterResourceStatus?.find((c) => {
93
+ return c.clusterLabel === this.clusterId;
94
+ });
95
+
96
+ return statePerCluster ? statePerCluster?.status?.displayStatus : STATES_ENUM.ACTIVE;
84
97
  },
85
- FLEET_SUMMARY,
98
+ };
99
+
100
+ const summary = this.isClusterView ? [fleetClusterSummary] : [FLEET_REPO_CLUSTERS_READY, FLEET_SUMMARY];
101
+
102
+ const state = this.isClusterView ? fleetPerClusterState : STATE;
103
+
104
+ const out = [
105
+ state,
106
+ NAME,
107
+ FLEET_REPO,
108
+ FLEET_REPO_TARGET,
109
+ ...summary,
86
110
  AGE
87
111
  ];
88
112
 
@@ -92,6 +116,12 @@ export default {
92
116
  methods: {
93
117
  parseTargetMode(row) {
94
118
  return row.targetInfo?.mode === 'clusterGroup' ? this.t('fleet.gitRepo.warningTooltip.clusterGroup') : this.t('fleet.gitRepo.warningTooltip.cluster');
119
+ },
120
+
121
+ clusterViewResourceStatus(row) {
122
+ return row.clusterResourceStatus.find((c) => {
123
+ return c.metadata?.labels[FLEET.CLUSTER_NAME] === this.clusterId;
124
+ });
95
125
  }
96
126
  },
97
127
  };
@@ -111,7 +141,7 @@ export default {
111
141
  key-field="_key"
112
142
  v-on="$listeners"
113
143
  >
114
- <template #cell:repo="{row}">
144
+ <template #cell:repo="{ row }">
115
145
  <Link
116
146
  :row="row"
117
147
  :value="row.spec.repo"
@@ -119,6 +149,7 @@ export default {
119
149
  before-icon-key="repoIcon"
120
150
  url-key="spec.repo"
121
151
  />
152
+ {{ row.cluster }}
122
153
  <template v-if="row.commitDisplay">
123
154
  <div class="text-muted">
124
155
  <Shortened
@@ -130,7 +161,10 @@ export default {
130
161
  </template>
131
162
  </template>
132
163
 
133
- <template #cell:clustersReady="{row}">
164
+ <template
165
+ v-if="!isClusterView"
166
+ #cell:clustersReady="{ row }"
167
+ >
134
168
  <span
135
169
  v-if="!row.clusterInfo"
136
170
  class="text-muted"
@@ -138,7 +172,8 @@ export default {
138
172
  <span
139
173
  v-else-if="row.clusterInfo.unready"
140
174
  class="text-warning"
141
- >{{ row.clusterInfo.ready }}/{{ row.clusterInfo.total }}</span>
175
+ >{{ row.clusterInfo.ready }}/{{
176
+ row.clusterInfo.total }}</span>
142
177
  <span
143
178
  v-else
144
179
  class="cluster-count-info"
@@ -152,7 +187,7 @@ export default {
152
187
  </span>
153
188
  </template>
154
189
 
155
- <template #cell:target="{row}">
190
+ <template #cell:target="{ row }">
156
191
  {{ row.targetInfo.modeDisplay }}
157
192
  </template>
158
193
  </ResourceTable>
@@ -11,7 +11,12 @@ export default {
11
11
  value: {
12
12
  type: Object,
13
13
  required: true,
14
- }
14
+ },
15
+ clusterId: {
16
+ type: String,
17
+ required: false,
18
+ default: null,
19
+ },
15
20
  },
16
21
 
17
22
  computed: {