@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
@@ -38,6 +38,17 @@ export default {
38
38
  noContent: {
39
39
  type: Boolean,
40
40
  default: false,
41
+ },
42
+
43
+ // Remove padding and box-shadow
44
+ flat: {
45
+ type: Boolean,
46
+ default: false,
47
+ },
48
+
49
+ tabsOnly: {
50
+ type: Boolean,
51
+ default: false,
41
52
  }
42
53
  },
43
54
 
@@ -207,7 +218,7 @@ export default {
207
218
  </script>
208
219
 
209
220
  <template>
210
- <div :class="{'side-tabs': !!sideTabs }">
221
+ <div :class="{'side-tabs': !!sideTabs, 'tabs-only': tabsOnly }">
211
222
  <ul
212
223
  ref="tablist"
213
224
  role="tablist"
@@ -233,6 +244,7 @@ export default {
233
244
  @click.prevent="select(tab.name, $event)"
234
245
  >
235
246
  <span>{{ tab.labelDisplay }}</span>
247
+ <span v-if="tab.badge" class="tab-badge">{{ tab.badge }}</span>
236
248
  <i v-if="hasIcon(tab)" v-tooltip="t('validation.tab')" class="conditions-alert-icon icon-error icon-lg" />
237
249
  </a>
238
250
  </li>
@@ -251,7 +263,13 @@ export default {
251
263
  </ul>
252
264
  <slot name="tab-row-extras" />
253
265
  </ul>
254
- <div :class="{ 'tab-container': !!tabs.length || !!sideTabs, 'no-content': noContent }">
266
+ <div
267
+ :class="{
268
+ 'tab-container': !!tabs.length || !!sideTabs,
269
+ 'no-content': noContent,
270
+ 'tab-container--flat': !!flat,
271
+ }"
272
+ >
255
273
  <slot />
256
274
  </div>
257
275
  </div>
@@ -326,6 +344,15 @@ export default {
326
344
  color: var(--error);
327
345
  }
328
346
  }
347
+
348
+ .tab-badge {
349
+ margin-left: 5px;
350
+ background-color: var(--link);
351
+ color: #fff;
352
+ border-radius: 6px;
353
+ padding: 1px 7px;
354
+ font-size: 11px;
355
+ }
329
356
  }
330
357
  }
331
358
 
@@ -335,6 +362,28 @@ export default {
335
362
  &.no-content {
336
363
  padding: 0 0 3px 0;
337
364
  }
365
+
366
+ // Example case: Tabbed component within a tabbed component
367
+ &--flat {
368
+ padding: 0;
369
+
370
+ .side-tabs {
371
+ box-shadow: unset;
372
+ }
373
+ }
374
+ }
375
+
376
+ .tabs-only {
377
+ margin-bottom: 20px;
378
+
379
+ .tab-container {
380
+ display: none;
381
+ }
382
+
383
+ .tabs {
384
+ border: 0;
385
+ border-bottom: 2px solid var(--border);
386
+ }
338
387
  }
339
388
 
340
389
  .side-tabs {
@@ -347,12 +396,6 @@ export default {
347
396
  padding: 20px;
348
397
  }
349
398
 
350
- // Tabbed component within a tabbed component
351
- .tab-container & {
352
- margin: -20px;
353
- box-shadow: unset;
354
- }
355
-
356
399
  & .tabs {
357
400
  width: $sideways-tabs-width;
358
401
  min-width: $sideways-tabs-width;
@@ -424,7 +467,9 @@ export default {
424
467
  }
425
468
  }
426
469
 
427
- & .tab-container {
470
+ &
471
+
472
+ .tab-container {
428
473
  width: calc(100% - #{$sideways-tabs-width});
429
474
  flex-grow: 1;
430
475
  background-color: var(--body-bg);
@@ -1,7 +1,9 @@
1
1
  <script>
2
+ import { mapGetters } from 'vuex';
2
3
  import { Banner } from '@components/Banner';
3
4
  import { HIDE_DESC, mapPref } from '@shell/store/prefs';
4
5
  import { addObject } from '@shell/utils/array';
6
+ import { CATALOG } from '@shell/config/types';
5
7
 
6
8
  export default {
7
9
  components: { Banner },
@@ -14,10 +16,17 @@ export default {
14
16
  },
15
17
 
16
18
  computed: {
19
+ ...mapGetters(['currentCluster']),
17
20
  hideDescriptions: mapPref(HIDE_DESC),
18
21
 
19
22
  typeDescriptionKey() {
20
- const key = `typeDescription."${ this.resource }"`;
23
+ let key;
24
+
25
+ if (this.resource === CATALOG.CLUSTER_REPO) {
26
+ key = !this.currentCluster || this.currentCluster.isLocal ? 'typeDescription."catalog.cattle.io.clusterrepo.local"' : 'typeDescription."catalog.cattle.io.clusterrepo"';
27
+ } else {
28
+ key = `typeDescription."${ this.resource }"`;
29
+ }
21
30
 
22
31
  if ( this.hideDescriptions.includes(this.resource) || this.hideDescriptions.includes('ALL') ) {
23
32
  return false;
@@ -159,6 +159,7 @@ export default {
159
159
  .name {
160
160
  grid-area: name;
161
161
  line-height: math.div($size, 2);
162
+ overflow-wrap: anywhere;
162
163
  }
163
164
 
164
165
  .description {
@@ -103,9 +103,14 @@ export default {
103
103
  return out;
104
104
  },
105
105
  },
106
+
107
+ methods: {
108
+ displayWarning(row) {
109
+ return !!row.status?.summary && (row.status.summary.desiredReady !== row.status.summary.ready);
110
+ }
111
+ }
106
112
  };
107
113
  </script>
108
-
109
114
  <template>
110
115
  <div>
111
116
  <Loading v-if="$fetchState.pending" />
@@ -117,9 +122,9 @@ export default {
117
122
  :rows="bundles"
118
123
  >
119
124
  <template #cell:deploymentsReady="{row}">
120
- <span v-if="row.status.summary.desiredReady != row.status.summary.ready" class="text-warning">
125
+ <span v-if="displayWarning(row)" class="text-warning">
121
126
  {{ row.status.summary.ready }}/{{ row.status.summary.desiredReady }}</span>
122
- <span v-else>{{ row.status.summary.desiredReady }}</span>
127
+ <span v-else-if="row.status">{{ row.status.summary.desiredReady }}</span>
123
128
  </template>
124
129
  </ResourceTable>
125
130
  </div>
@@ -16,6 +16,11 @@ export default {
16
16
  type: Object,
17
17
  default: null,
18
18
  },
19
+
20
+ loading: {
21
+ type: Boolean,
22
+ default: false,
23
+ },
19
24
  },
20
25
 
21
26
  computed: {
@@ -80,6 +85,7 @@ export default {
80
85
  :schema="schema"
81
86
  :headers="headers"
82
87
  :rows="rows"
88
+ :loading="loading"
83
89
  key-field="_key"
84
90
  v-on="$listeners"
85
91
  >
@@ -28,6 +28,11 @@ export default {
28
28
  type: Object,
29
29
  required: true,
30
30
  },
31
+
32
+ loading: {
33
+ type: Boolean,
34
+ required: false,
35
+ },
31
36
  },
32
37
 
33
38
  computed: {
@@ -89,13 +94,14 @@ export default {
89
94
 
90
95
  <template>
91
96
  <div>
92
- <FleetIntro v-if="noRows" />
97
+ <FleetIntro v-if="noRows && !loading" />
93
98
  <ResourceTable
94
99
  v-if="!noRows"
95
100
  v-bind="$attrs"
96
101
  :schema="schema"
97
102
  :headers="headers"
98
103
  :rows="rows"
104
+ :loading="loading"
99
105
  key-field="_key"
100
106
  v-on="$listeners"
101
107
  >
@@ -84,6 +84,12 @@ export default {
84
84
  const out = { ...getResourceDefaultState(this.$store.getters['i18n/withFallback'], this.stateKey) };
85
85
 
86
86
  resources.forEach(({ status, metadata }) => {
87
+ if (!status) {
88
+ out[STATES_ENUM.UNKNOWN].count += 1;
89
+
90
+ return;
91
+ }
92
+
87
93
  const k = status?.summary.ready > 0 && status?.summary.desiredReady === status.summary.ready;
88
94
 
89
95
  if (k) {
@@ -36,6 +36,10 @@ export default {
36
36
  return {};
37
37
  },
38
38
  },
39
+ loading: {
40
+ default: false,
41
+ type: Boolean
42
+ },
39
43
  },
40
44
 
41
45
  data() {
@@ -200,6 +204,7 @@ export default {
200
204
  :config-maps="configMaps"
201
205
  :secrets="secrets"
202
206
  :value="value"
207
+ :loading="loading"
203
208
  />
204
209
  </div>
205
210
  </template>
@@ -23,6 +23,10 @@ export default {
23
23
  type: Array,
24
24
  required: true
25
25
  },
26
+ loading: {
27
+ default: false,
28
+ type: Boolean
29
+ },
26
30
  /**
27
31
  * Container spec
28
32
  */
@@ -107,6 +111,7 @@ export default {
107
111
  :all-secrets="secrets"
108
112
  :all-config-maps="configMaps"
109
113
  :mode="mode"
114
+ :loading="loading"
110
115
  @remove="removeRow(i)"
111
116
  @input="updateRow"
112
117
  />
@@ -12,6 +12,8 @@ import { _EDIT, _VIEW } from '@shell/config/query-params';
12
12
  import { asciiLike } from '@shell/utils/string';
13
13
 
14
14
  export default {
15
+ name: 'KeyValue',
16
+
15
17
  components: {
16
18
  Select,
17
19
  TextAreaAutoGrow,
@@ -22,6 +24,10 @@ export default {
22
24
  type: [Array, Object],
23
25
  default: null,
24
26
  },
27
+ defaultValue: {
28
+ type: [Array, Object],
29
+ default: null,
30
+ },
25
31
  // If the user supplies this array, then it indicates which keys should be shown as binary
26
32
  binaryValueKeys: {
27
33
  type: [Array, Object],
@@ -223,68 +229,13 @@ export default {
223
229
  }
224
230
  },
225
231
  data() {
226
- const rows = [];
227
-
228
- if ( this.asMap ) {
229
- const input = this.value || {};
230
-
231
- Object.keys(input).forEach((key) => {
232
- let value = input[key];
233
- const decodedValue = base64Decode(input[key]);
234
- const asciiValue = asciiLike(decodedValue);
235
-
236
- if ( this.handleBase64 && asciiValue) {
237
- value = base64Decode(value);
238
- }
239
-
240
- rows.push({
241
- key,
242
- value,
243
- binary: this.displayValuesAsBinary || (this.handleBase64 && !asciiValue),
244
- canEncode: this.handleBase64 && asciiValue,
245
- supported: true,
246
- });
247
- });
248
- } else {
249
- const input = this.value || [];
250
-
251
- for ( const row of input ) {
252
- let value = row[this.valueName] || '';
253
- const decodedValue = base64Decode(row[this.valueName]);
254
- const asciiValue = asciiLike(decodedValue);
255
-
256
- if ( this.handleBase64 && asciiValue) {
257
- value = base64Decode(value);
258
- }
259
- const entry = {
260
- [this.keyName]: row[this.keyName] || '',
261
- [this.valueName]: value,
262
- binary: this.displayValuesAsBinary || (this.handleBase64 && !asciiValue),
263
- canEncode: this.handleBase64 && asciiValue,
264
- supported: this.supported(row),
265
- };
266
-
267
- this.preserveKeys?.map((k) => {
268
- if ( typeof row[k] !== 'undefined' ) {
269
- entry[k] = row[k];
270
- }
271
- });
272
- rows.push(entry);
273
- }
274
- }
275
- if ( !rows.length && this.initialEmptyRow ) {
276
- rows.push({
277
- [this.keyName]: '',
278
- [this.valueName]: '',
279
- binary: false,
280
- canEncode: this.handleBase64,
281
- supported: true
282
- });
283
- }
232
+ const rows = this.getRows(this.value);
284
233
 
285
234
  return { rows };
286
235
  },
236
+
287
237
  computed: {
238
+
288
239
  isView() {
289
240
  return this.mode === _VIEW;
290
241
  },
@@ -315,7 +266,78 @@ export default {
315
266
  created() {
316
267
  this.queueUpdate = debounce(this.update, 500);
317
268
  },
269
+ watch: {
270
+ defaultValue(neu) {
271
+ if (Array.isArray(neu)) {
272
+ this.rows = this.getRows(neu);
273
+ this.$emit('input', neu);
274
+ }
275
+ }
276
+ },
318
277
  methods: {
278
+ getRows(value) {
279
+ const rows = [];
280
+
281
+ if ( this.asMap ) {
282
+ const input = value || {};
283
+
284
+ Object.keys(input).forEach((key) => {
285
+ let value = input[key];
286
+ const decodedValue = base64Decode(input[key]);
287
+ const asciiValue = asciiLike(decodedValue);
288
+
289
+ if ( this.handleBase64 && asciiValue) {
290
+ value = base64Decode(value);
291
+ }
292
+
293
+ rows.push({
294
+ key,
295
+ value,
296
+ binary: this.displayValuesAsBinary || (this.handleBase64 && !asciiValue),
297
+ canEncode: this.handleBase64 && asciiValue,
298
+ supported: true,
299
+ });
300
+ });
301
+ } else {
302
+ const input = value || [];
303
+
304
+ for ( const row of input ) {
305
+ let value = row[this.valueName] || '';
306
+ const decodedValue = base64Decode(row[this.valueName]);
307
+ const asciiValue = asciiLike(decodedValue);
308
+
309
+ if ( this.handleBase64 && asciiValue) {
310
+ value = base64Decode(value);
311
+ }
312
+ const entry = {
313
+ [this.keyName]: row[this.keyName] || '',
314
+ [this.valueName]: value,
315
+ binary: this.displayValuesAsBinary || (this.handleBase64 && !asciiValue),
316
+ canEncode: this.handleBase64 && asciiValue,
317
+ supported: this.supported(row),
318
+ };
319
+
320
+ this.preserveKeys?.map((k) => {
321
+ if ( typeof row[k] !== 'undefined' ) {
322
+ entry[k] = row[k];
323
+ }
324
+ });
325
+ rows.push(entry);
326
+ }
327
+ }
328
+ if ( !rows.length && this.initialEmptyRow ) {
329
+ rows.push({
330
+ [this.keyName]: '',
331
+ [this.valueName]: '',
332
+ binary: false,
333
+ canEncode: this.handleBase64,
334
+ supported: true
335
+ });
336
+ }
337
+
338
+ return rows;
339
+ },
340
+
319
341
  add(key = '', value = '') {
320
342
  const obj = {
321
343
  ...this.defaultAddData,
@@ -5,7 +5,7 @@ import { get, set } from '@shell/utils/object';
5
5
  import { sortBy } from '@shell/utils/sort';
6
6
  import { NAMESPACE } from '@shell/config/types';
7
7
  import { DESCRIPTION } from '@shell/config/labels-annotations';
8
- import { _VIEW, _EDIT } from '@shell/config/query-params';
8
+ import { _VIEW, _EDIT, _CREATE } from '@shell/config/query-params';
9
9
  import { LabeledInput } from '@components/Form/LabeledInput';
10
10
  import LabeledSelect from '@shell/components/form/LabeledSelect';
11
11
 
@@ -224,15 +224,21 @@ 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
+ // By default, include the namespace in the dropdown.
228
+ let out = true;
229
+
227
230
  if (this.currentProduct?.hideSystemResources) {
228
231
  // Filter out the namespace
229
232
  // if it is a system namespace or if it is managed by
230
233
  // Fleet.
231
- return !namespace.isSystem && !namespace.isFleetManaged;
234
+ out = !namespace.isSystem && !namespace.isFleetManaged;
232
235
  }
233
236
 
234
- // By default, include the namespace in the dropdown.
235
- return true;
237
+ if (this.mode === _CREATE) {
238
+ out = out && !!namespace.links.update;
239
+ }
240
+
241
+ return out;
236
242
  }));
237
243
 
238
244
  const withLabels = filtered.map(this.namespaceMapper || ((obj) => {
@@ -336,7 +342,7 @@ export default {
336
342
  }
337
343
 
338
344
  if (this.namespaced) {
339
- this.$emit('isNamespaceNew', this.namespaces && !this.namespaces.find(n => n.value === val));
345
+ this.$emit('isNamespaceNew', !val || (this.namespaces && !this.namespaces.find(n => n.value === val)));
340
346
  }
341
347
 
342
348
  if (this.namespaceKey) {
@@ -355,10 +361,12 @@ export default {
355
361
  if (!e || e.value === '') { // The blank value in the dropdown is labeled "Create a New Namespace"
356
362
  this.createNamespace = true;
357
363
  this.$parent.$emit('createNamespace', true);
364
+ this.$emit('isNamespaceNew', true);
358
365
  Vue.nextTick(() => this.$refs.namespace.focus());
359
366
  } else {
360
367
  this.createNamespace = false;
361
368
  this.$parent.$emit('createNamespace', false);
369
+ this.$emit('isNamespaceNew', false);
362
370
  }
363
371
  }
364
372
  },
@@ -31,7 +31,11 @@ export default {
31
31
  mode: {
32
32
  type: String,
33
33
  default: 'create'
34
- }
34
+ },
35
+ loading: {
36
+ default: false,
37
+ type: Boolean
38
+ },
35
39
  },
36
40
 
37
41
  data() {
@@ -177,6 +181,7 @@ export default {
177
181
  :options="nodes || []"
178
182
  :mode="mode"
179
183
  :multiple="false"
184
+ :loading="loading"
180
185
  @input="update"
181
186
  />
182
187
  </div>
@@ -40,6 +40,10 @@ export default {
40
40
  type: Array,
41
41
  default: null
42
42
  },
43
+ loading: {
44
+ default: false,
45
+ type: Boolean
46
+ },
43
47
  },
44
48
 
45
49
  data() {
@@ -305,6 +309,7 @@ export default {
305
309
  :placeholder="t('workload.scheduling.affinity.topologyKey.placeholder')"
306
310
  :options="existingNodeLabels"
307
311
  :disabled="mode==='view'"
312
+ :loading="loading"
308
313
  @input="update"
309
314
  />
310
315
  <LabeledInput
@@ -85,7 +85,11 @@ export default {
85
85
  showConditions() {
86
86
  const inStore = this.$store.getters['currentStore'](this.value.type);
87
87
 
88
- return this.isView && this.needConditions && this.value?.type && this.$store.getters[`${ inStore }/pathExistsInSchema`](this.value.type, 'status.conditions');
88
+ if ( this.$store.getters[`${ inStore }/schemaFor`](this.value.type) ) {
89
+ return this.isView && this.needConditions && this.value?.type && this.$store.getters[`${ inStore }/pathExistsInSchema`](this.value.type, 'status.conditions');
90
+ }
91
+
92
+ return false;
89
93
  },
90
94
  showEvents() {
91
95
  return this.isView && this.needEvents && this.hasEvents && (this.events.length || this.alwaysShowEvents);
@@ -60,6 +60,10 @@ export default {
60
60
  type: Boolean,
61
61
  default: true,
62
62
  },
63
+ loading: {
64
+ type: Boolean,
65
+ default: false,
66
+ },
63
67
  },
64
68
 
65
69
  data() {
@@ -134,6 +138,7 @@ export default {
134
138
  :option-label="optionLabel"
135
139
  :placement="$attrs.placement ? $attrs.placement : null"
136
140
  :v-bind="$attrs"
141
+ :loading="loading"
137
142
  @input="changeSelected"
138
143
  />
139
144
  <button
@@ -34,7 +34,11 @@ export default {
34
34
  namespaced: {
35
35
  type: Boolean,
36
36
  default: true
37
- }
37
+ },
38
+ loading: {
39
+ default: false,
40
+ type: Boolean
41
+ },
38
42
  },
39
43
 
40
44
  data() {
@@ -300,6 +304,7 @@ export default {
300
304
  :get-option-key="opt=>opt.id|| opt"
301
305
  :mode="mode"
302
306
  :label="sourceLabel"
307
+ :loading="loading"
303
308
  />
304
309
  </div>
305
310
  <div v-if="type!=='secretRef' && type!== 'configMapRef'">
@@ -310,6 +315,7 @@ export default {
310
315
  :mode="mode"
311
316
  option-label="label"
312
317
  :label="t('workload.container.command.fromResource.key.label')"
318
+ :loading="loading"
313
319
  @input="updateRow"
314
320
  />
315
321
  </div>
@@ -25,12 +25,8 @@ export default {
25
25
  return this.row?.detailLocation;
26
26
  },
27
27
 
28
- clusterHasIssues() {
29
- return this.row.status?.conditions?.some(condition => condition.error === true);
30
- },
31
-
32
28
  statusErrorConditions() {
33
- if (this.clusterHasIssues) {
29
+ if (this.row.hasError) {
34
30
  return this.row?.status.conditions.filter(condition => condition.error === true);
35
31
  }
36
32
 
@@ -38,7 +34,7 @@ export default {
38
34
  },
39
35
 
40
36
  formattedConditions() {
41
- if (this.clusterHasIssues) {
37
+ if (this.row.hasError) {
42
38
  const filteredConditions = this.statusErrorConditions;
43
39
  const formattedTooltip = [];
44
40
 
@@ -69,7 +65,7 @@ export default {
69
65
  class="template-upgrade-icon icon-alert icon"
70
66
  />
71
67
  <i
72
- v-if="clusterHasIssues"
68
+ v-if="row.hasError"
73
69
  v-tooltip="{ content: `<div>${formattedConditions}</div>`, html: true }"
74
70
  class="conditions-alert-icon icon-error icon-lg"
75
71
  />
@@ -1,6 +1,6 @@
1
1
  <script>
2
2
  import { mapGetters } from 'vuex';
3
- import { NAMESPACE_FILTERS, DEV } from '@shell/store/prefs';
3
+ import { NAMESPACE_FILTERS, ALL_NAMESPACES } from '@shell/store/prefs';
4
4
  import { NAMESPACE, MANAGEMENT } from '@shell/config/types';
5
5
  import { sortBy } from '@shell/utils/sort';
6
6
  import { isArray, addObjects, findBy, filterBy } from '@shell/utils/array';
@@ -322,8 +322,8 @@ export default {
322
322
 
323
323
  methods: {
324
324
  filterNamespaces(namespaces) {
325
- if (this.$store.getters['prefs/get'](DEV)) {
326
- // If developer tools are turned on in the user preferences,
325
+ if (this.$store.getters['prefs/get'](ALL_NAMESPACES)) {
326
+ // If all namespaces options are turned on in the user preferences,
327
327
  // return all namespaces including system namespaces and RBAC
328
328
  // management namespaces.
329
329
  return namespaces;