@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
package/pages/prefs.vue CHANGED
@@ -1,32 +1,41 @@
1
1
  <script>
2
2
  import day from 'dayjs';
3
3
  import { mapGetters } from 'vuex';
4
+ import { isAdminUser } from '@shell/store/type-map';
4
5
  import BackLink from '@shell/components/BackLink';
5
6
  import BackRoute from '@shell/mixins/back-link';
6
7
  import ButtonGroup from '@shell/components/ButtonGroup';
7
8
  import { Checkbox } from '@components/Form/Checkbox';
8
9
  import LandingPagePreference from '@shell/components/LandingPagePreference';
9
10
  import {
10
- mapPref, THEME, KEYMAP, DEV, DATE_FORMAT, TIME_FORMAT, ROWS_PER_PAGE, HIDE_DESC, SHOW_PRE_RELEASE, MENU_MAX_CLUSTERS
11
+ mapPref, THEME, KEYMAP, DATE_FORMAT, TIME_FORMAT, ROWS_PER_PAGE, HIDE_DESC, SHOW_PRE_RELEASE, MENU_MAX_CLUSTERS,
12
+ VIEW_IN_API, ALL_NAMESPACES, THEME_SHORTCUT, PLUGIN_DEVELOPER
11
13
  } from '@shell/store/prefs';
12
14
  import LabeledSelect from '@shell/components/form/LabeledSelect';
13
15
  import { addObject } from '@shell/utils/array';
16
+ import LocaleSelector from '@shell/components/LocaleSelector';
14
17
 
15
18
  export default {
16
19
  layout: 'plain',
17
20
  components: {
18
- BackLink, ButtonGroup, LabeledSelect, Checkbox, LandingPagePreference
21
+ BackLink, ButtonGroup, LabeledSelect, Checkbox, LandingPagePreference, LocaleSelector
19
22
  },
20
- mixins: [BackRoute],
21
- computed: {
22
- keymap: mapPref(KEYMAP),
23
- dev: mapPref(DEV),
24
- dateFormat: mapPref(DATE_FORMAT),
25
- timeFormat: mapPref(TIME_FORMAT),
26
- perPage: mapPref(ROWS_PER_PAGE),
27
- hideDesc: mapPref(HIDE_DESC),
28
- showPreRelease: mapPref(SHOW_PRE_RELEASE),
29
- menuMaxClusters: mapPref(MENU_MAX_CLUSTERS),
23
+ mixins: [BackRoute],
24
+ data() {
25
+ return { admin: isAdminUser(this.$store.getters) };
26
+ },
27
+ computed: {
28
+ keymap: mapPref(KEYMAP),
29
+ viewInApi: mapPref(VIEW_IN_API),
30
+ allNamespaces: mapPref(ALL_NAMESPACES),
31
+ themeShortcut: mapPref(THEME_SHORTCUT),
32
+ dateFormat: mapPref(DATE_FORMAT),
33
+ timeFormat: mapPref(TIME_FORMAT),
34
+ perPage: mapPref(ROWS_PER_PAGE),
35
+ hideDesc: mapPref(HIDE_DESC),
36
+ showPreRelease: mapPref(SHOW_PRE_RELEASE),
37
+ menuMaxClusters: mapPref(MENU_MAX_CLUSTERS),
38
+ pluginDeveloper: mapPref(PLUGIN_DEVELOPER),
30
39
 
31
40
  ...mapGetters(['isSingleProduct']),
32
41
 
@@ -137,101 +146,112 @@ export default {
137
146
  this.hideDesc = val;
138
147
  }
139
148
  },
140
- },
149
+ }
141
150
  };
142
151
  </script>
143
152
 
144
153
  <template>
145
154
  <div>
146
155
  <BackLink :link="backLink" />
147
- <h1 v-t="'prefs.title'" />
148
-
149
- <h4 v-t="'prefs.theme.label'" />
150
- <div>
151
- <ButtonGroup v-model="theme" :options="themeOptions" />
156
+ <h1 v-t="'prefs.title'" class="mb-20" />
157
+ <!-- Language -->
158
+ <div class="mt-10 mb-10">
159
+ <h4 v-t="'prefs.language'" />
160
+ <div class="row">
161
+ <div class="col span-4">
162
+ <LocaleSelector />
163
+ </div>
164
+ </div>
152
165
  </div>
153
- <div class="mt-10">
154
- <t k="prefs.theme.autoDetail" :pm="pm" :am="am" />
166
+ <!-- Theme -->
167
+ <div class="mt-10 mb-10">
168
+ <hr />
169
+ <h4 v-t="'prefs.theme.label'" />
170
+ <ButtonGroup v-model="theme" :options="themeOptions" />
171
+ <div class="mt-10">
172
+ <t k="prefs.theme.autoDetail" :pm="pm" :am="am" />
173
+ </div>
155
174
  </div>
156
- <div v-if="!isSingleProduct">
175
+ <!-- Login landing page -->
176
+ <div v-if="!isSingleProduct" class="mt-10 mb-10">
157
177
  <hr />
158
178
  <h4 v-t="'prefs.landing.label'" />
159
179
  <LandingPagePreference />
160
180
  </div>
161
- <hr />
162
- <h4 v-t="'prefs.displaySettings.title'" />
163
- <p class="set-landing-leadin">
164
- {{ t('prefs.displaySettings.detail', {}, raw=true) }}
165
- </p>
166
- <div class="row mt-20">
167
- <div class="col span-4">
168
- <LabeledSelect
169
- v-model="dateFormat"
170
- :label="t('prefs.dateFormat.label')"
171
- :options="dateOptions"
172
- />
173
- </div>
174
- <div class="col span-4">
175
- <LabeledSelect
176
- v-model="timeFormat"
177
- :label="t('prefs.timeFormat.label')"
178
- :options="timeOptions"
179
- />
181
+ <!-- Display Settings -->
182
+ <div class="mt-10 mb-10">
183
+ <hr />
184
+ <h4 v-t="'prefs.displaySettings.title'" />
185
+ <p class="set-landing-leadin">
186
+ {{ t('prefs.displaySettings.detail', {}, raw=true) }}
187
+ </p>
188
+ <div class="row mt-20">
189
+ <div class="col span-4">
190
+ <LabeledSelect
191
+ v-model="dateFormat"
192
+ :label="t('prefs.dateFormat.label')"
193
+ :options="dateOptions"
194
+ />
195
+ </div>
196
+ <div class="col span-4">
197
+ <LabeledSelect
198
+ v-model="timeFormat"
199
+ :label="t('prefs.timeFormat.label')"
200
+ :options="timeOptions"
201
+ />
202
+ </div>
180
203
  </div>
181
- </div>
182
204
 
183
- <div class="row mt-20">
184
- <div class="col span-4">
185
- <LabeledSelect
186
- v-model.number="perPage"
187
- :label="t('prefs.perPage.label')"
188
- :options="perPageOptions"
189
- option-key="value"
190
- option-label="label"
191
- placeholder="Select a row count"
192
- />
193
- </div>
194
- <div class="col span-4">
195
- <LabeledSelect
196
- v-model.number="menuMaxClusters"
197
- :label="t('prefs.clusterToShow.label')"
198
- :options="menuClusterOptions"
199
- option-key="value"
200
- option-label="label"
201
- placeholder="Select a row count"
202
- />
205
+ <div class="row mt-20">
206
+ <div class="col span-4">
207
+ <LabeledSelect
208
+ v-model.number="perPage"
209
+ :label="t('prefs.perPage.label')"
210
+ :options="perPageOptions"
211
+ option-key="value"
212
+ option-label="label"
213
+ placeholder="Select a row count"
214
+ />
215
+ </div>
216
+ <div class="col span-4">
217
+ <LabeledSelect
218
+ v-model.number="menuMaxClusters"
219
+ :label="t('prefs.clusterToShow.label')"
220
+ :options="menuClusterOptions"
221
+ option-key="value"
222
+ option-label="label"
223
+ placeholder="Select a row count"
224
+ />
225
+ </div>
203
226
  </div>
204
227
  </div>
205
-
206
- <hr />
207
- <div class="row">
208
- <div class="col prefs-advanced">
209
- <h4 v-t="'prefs.advanced'" />
210
- <Checkbox v-model="dev" :label="t('prefs.dev.label', {}, true)" />
211
- <p class="wrap-text">
212
- {{ t('prefs.advancedTooltip') }}
213
- </p>
214
- <br>
215
- <Checkbox v-if="!isSingleProduct" v-model="hideDescriptions" :label="t('prefs.hideDesc.label')" class="mt-10" />
216
- </div>
228
+ <!-- Advanced Features -->
229
+ <div class="col adv-features mt-10 mb-10">
230
+ <hr />
231
+ <h4 v-t="'prefs.advFeatures.title'" />
232
+ <Checkbox v-model="viewInApi" :label="t('prefs.advFeatures.viewInApi', {}, true)" class="mt-10" />
233
+ <br />
234
+ <Checkbox v-model="allNamespaces" :label="t('prefs.advFeatures.allNamespaces', {}, true)" class="mt-20" />
235
+ <br />
236
+ <Checkbox v-model="themeShortcut" :label="t('prefs.advFeatures.themeShortcut', {}, true)" class="mt-20" />
237
+ <br />
238
+ <Checkbox v-if="!isSingleProduct" v-model="hideDescriptions" :label="t('prefs.hideDesc.label')" class="mt-20" />
239
+ <template v-if="admin">
240
+ <br />
241
+ <Checkbox v-model="pluginDeveloper" :label="t('prefs.advFeatures.pluginDeveloper', {}, true)" class="mt-20" />
242
+ </template>
217
243
  </div>
218
-
219
- <hr />
220
- <div class="row">
221
- <div class="col span-12">
222
- <h4 v-t="'prefs.keymap.label'" />
223
- <ButtonGroup v-model="keymap" :options="keymapOptions" />
224
- </div>
244
+ <!-- YAML editor key mapping -->
245
+ <div class="col mt-10 mb-10">
246
+ <hr />
247
+ <h4 v-t="'prefs.keymap.label'" />
248
+ <ButtonGroup v-model="keymap" :options="keymapOptions" />
225
249
  </div>
226
-
227
- <div v-if="!isSingleProduct">
250
+ <!-- Helm Charts -->
251
+ <div v-if="!isSingleProduct" class="col mt-10 mb-40">
228
252
  <hr />
229
- <div class="row mb-20">
230
- <div class="col span-12">
231
- <h4 v-t="'prefs.helm.label'" />
232
- <ButtonGroup v-model="showPreRelease" :options="helmOptions" />
233
- </div>
234
- </div>
253
+ <h4 v-t="'prefs.helm.label'" />
254
+ <ButtonGroup v-model="showPreRelease" :options="helmOptions" />
235
255
  </div>
236
256
  </div>
237
257
  </template>
@@ -0,0 +1,17 @@
1
+ <script>
2
+ export default {
3
+ middleware({ redirect, store } ) {
4
+ const dashboardHome = { name: 'home' };
5
+ const t = store.getters['i18n/t'];
6
+
7
+ setTimeout(() => {
8
+ store.dispatch('growl/success', {
9
+ title: t('plugins.safeMode.title'),
10
+ message: t('plugins.safeMode.message')
11
+ }, { root: true });
12
+ }, 1000);
13
+
14
+ return redirect(dashboardHome);
15
+ }
16
+ };
17
+ </script>
@@ -1,17 +1,13 @@
1
1
  <script>
2
- import { options } from '@shell/config/footer';
3
2
  import BannerGraphic from '@shell/components/BannerGraphic';
4
- import AsyncButton from '@shell/components/AsyncButton';
5
3
  import IndentedPanel from '@shell/components/IndentedPanel';
6
- import { Card } from '@components/Card';
7
4
  import CommunityLinks from '@shell/components/CommunityLinks';
8
5
  import { CATALOG, MANAGEMENT } from '@shell/config/types';
9
- import { getVendor, setBrand } from '@shell/config/private-label';
6
+ import { getVendor } from '@shell/config/private-label';
10
7
  import { SETTING } from '@shell/config/settings';
11
8
  import { findBy } from '@shell/utils/array';
12
9
  import { addParam } from '@shell/utils/url';
13
-
14
- const KEY_REGEX = /^[0-9a-fA-F]{16}$/;
10
+ import { isRancherPrime } from '@shell/config/version';
15
11
 
16
12
  export default {
17
13
  layout: 'home',
@@ -19,8 +15,6 @@ export default {
19
15
  components: {
20
16
  BannerGraphic,
21
17
  IndentedPanel,
22
- AsyncButton,
23
- Card,
24
18
  CommunityLinks
25
19
  },
26
20
 
@@ -50,9 +44,7 @@ export default {
50
44
  if ( this.$store.getters['management/canList'](CATALOG.APP) ) {
51
45
  this.apps = await this.$store.dispatch('management/findAll', { type: CATALOG.APP });
52
46
  }
53
- this.supportSetting = await fetchOrCreateSetting('has-support', 'false');
54
47
  this.brandSetting = await fetchOrCreateSetting(SETTING.BRAND, '');
55
- this.communitySetting = await fetchOrCreateSetting(SETTING.COMMUNITY_LINKS, 'true');
56
48
  this.serverUrlSetting = await fetchOrCreateSetting(SETTING.SERVER_URL, '');
57
49
  this.uiIssuesSetting = await this.$store.dispatch('management/find', { type: MANAGEMENT.SETTING, id: SETTING.ISSUES });
58
50
  },
@@ -62,10 +54,8 @@ export default {
62
54
  apps: [],
63
55
  vendor: getVendor(),
64
56
  supportKey: '',
65
- supportSetting: null,
66
57
  brandSetting: null,
67
58
  uiIssuesSetting: null,
68
- communitySetting: null,
69
59
  serverSetting: null,
70
60
  promos: [
71
61
  'support.promos.one',
@@ -81,6 +71,10 @@ export default {
81
71
  return findBy(this.apps, 'metadata.name', 'rancher-csp-adapter' );
82
72
  },
83
73
 
74
+ hasSupport() {
75
+ return this.hasAWSSupport || isRancherPrime();
76
+ },
77
+
84
78
  hasAWSSupport() {
85
79
  return !!this.cspAdapter;
86
80
  },
@@ -103,68 +97,15 @@ export default {
103
97
  return `${ this.serverUrl }/v1/generateSUSERancherSupportConfig`;
104
98
  },
105
99
 
106
- hasSupport() {
107
- return (this.supportSetting?.value && this.supportSetting?.value !== 'false') || this.hasAWSSupport;
108
- },
109
-
110
- options() {
111
- return options( this.uiIssuesSetting?.value, this.communitySetting?.value === 'false');
112
- },
113
-
114
100
  title() {
115
101
  return this.hasSupport ? 'support.suse.title' : 'support.community.title';
116
102
  },
117
103
 
118
- validSupportKey() {
119
- return !!this.supportKey.match(KEY_REGEX);
120
- },
121
-
122
104
  sccLink() {
123
105
  return this.hasAWSSupport ? addParam('https://scc.suse.com', 'from_marketplace', '1') : 'https://scc.suse.com';
124
106
  }
125
107
  },
126
108
 
127
- methods: {
128
- async addSubscription(done) {
129
- try {
130
- this.supportSetting.value = 'true';
131
- this.brandSetting.value = 'suse';
132
- await Promise.all([this.supportSetting.save(), this.brandSetting.save()]);
133
- setBrand('suse');
134
- done(true);
135
- this.$modal.hide('toggle-support');
136
- } catch {
137
- done(false);
138
- }
139
- },
140
-
141
- async removeSubscription(done) {
142
- try {
143
- this.supportSetting.value = 'false';
144
- this.brandSetting.value = '';
145
- await Promise.all([this.supportSetting.save(), this.brandSetting.save()]);
146
- setBrand('');
147
- done(true);
148
- this.$modal.hide('toggle-support');
149
- } catch {
150
- done(false);
151
- }
152
- },
153
-
154
- showDialog(isAdd) {
155
- this.isRemoveDialog = isAdd;
156
- this.supportKey = '';
157
- this.$modal.show('toggle-support');
158
- },
159
-
160
- dialogOpened() {
161
- const input = this.$refs.subscriptionIDInput;
162
-
163
- if (input) {
164
- input.focus();
165
- }
166
- },
167
- }
168
109
  };
169
110
  </script>
170
111
  <template>
@@ -173,10 +114,18 @@ export default {
173
114
 
174
115
  <IndentedPanel>
175
116
  <div class="content mt-20">
176
- <div class="promo">
117
+ <div class="promo col main-panel">
177
118
  <div class="box mb-20 box-primary">
178
119
  <h2>{{ t('support.suse.access.title') }}</h2>
179
- <div>
120
+ <div v-if="!hasSupport" class="external support-links mt-20">
121
+ <div class="support-link">
122
+ <a class="support-link" href="https://rancher.com/support-maintenance-terms" target="_blank" rel="noopener noreferrer nofollow">{{ t('support.community.learnMore') }}</a>
123
+ </div>
124
+ <div class="support-link">
125
+ <a class="support-link" href="https://rancher.com/pricing" target="_blank" rel="noopener noreferrer nofollow">{{ t('support.community.pricing') }}</a>
126
+ </div>
127
+ </div>
128
+ <div v-else>
180
129
  <p class="pb-10">
181
130
  {{ hasAWSSupport ? t("support.suse.access.aws.text") : t("support.suse.access.text") }}
182
131
  </p>
@@ -194,69 +143,28 @@ export default {
194
143
  <div>{{ t(`${key}.text`) }}</div>
195
144
  </div>
196
145
  </div>
197
- <div v-if="!hasSupport" class="external">
198
- <a href="https://rancher.com/support-maintenance-terms" target="_blank" rel="noopener noreferrer nofollow">{{ t('support.community.learnMore') }} <i class="icon icon-external-link" /></a>
199
- or
200
- <a href="https://rancher.com/pricing" target="_blank" rel="noopener noreferrer nofollow">{{ t('support.community.pricing') }} <i class="icon icon-external-link" /></a>
201
- </div>
202
- <div v-if="!hasSupport" class="register row">
203
- <div>
204
- {{ t('support.subscription.haveSupport') }}
205
- </div>
206
- <button class="ml-5 btn role-secondary btn-sm" type="button" @click="showDialog(false)">
207
- {{ t('support.subscription.addSubscription') }}
208
- </button>
209
- </div>
210
- <div v-if="hasSupport && !hasAWSSupport" class="register row">
211
- <a class="remove-link" @click="showDialog(true)">
212
- {{ t('support.subscription.removeSubscription') }}
213
- </a>
214
- </div>
215
- </div>
216
- <div class="community">
217
- <CommunityLinks />
218
146
  </div>
147
+ <CommunityLinks :is-support-page="true" class="community col side-panel span-3" />
219
148
  </div>
220
149
  </IndentedPanel>
221
- <modal
222
- name="toggle-support"
223
- height="auto"
224
- :width="340"
225
- @opened="dialogOpened"
226
- >
227
- <Card :show-highlight-border="false" class="toggle-support">
228
- <template #title>
229
- {{ isRemoveDialog? t('support.subscription.removeTitle') : t('support.subscription.addTitle') }}
230
- </template>
231
- <template #body>
232
- <div v-if="isRemoveDialog" class="mt-20">
233
- {{ t('support.subscription.removeBody') }}
234
- </div>
235
- <div v-else class="mt-20">
236
- <p class="pb-10">
237
- {{ t('support.subscription.addLabel') }}
238
- </p>
239
- <input ref="subscriptionIDInput" v-model="supportKey" />
240
- </div>
241
- </template>
242
- <template #actions>
243
- <button type="button" class="btn role-secondary" @click="$modal.hide('toggle-support')">
244
- {{ t('generic.cancel') }}
245
- </button>
246
- <AsyncButton v-if="!isRemoveDialog" :disabled="!validSupportKey" class="pull-right" @click="addSubscription" />
247
- <AsyncButton v-else :action-label="t('generic.remove')" class="pull-right" @click="removeSubscription" />
248
- </template>
249
- </Card>
250
- </modal>
251
150
  </div>
252
151
  </template>
253
152
  <style lang="scss" scoped>
254
153
  .content {
255
- display: grid;
256
- grid-column-gap: 20px;
257
- grid-row-gap: 20px;
258
- grid-template-columns: 70% 30%;
259
- }
154
+
155
+ display: flex;
156
+ align-items: stretch;
157
+ .col {
158
+ margin: 0
159
+ }
160
+ .main-panel {
161
+ flex: auto;
162
+ }
163
+
164
+ .side-panel {
165
+ margin-left: 1.75%;
166
+ }
167
+ }
260
168
 
261
169
  .toggle-support {
262
170
  height: 100%;
@@ -271,21 +179,10 @@ export default {
271
179
  }
272
180
  }
273
181
 
274
- .community {
275
- border-left: 1px solid var(--border);
276
- padding-left: 20px;
277
- > h2 {
278
- font-size: 18px;
279
- font-weight: 300;
280
- margin-bottom: 20px;
281
- }
282
- .support-link {
283
- margin: 10px 0;
284
- }
285
- }
286
- .external {
287
- margin-top: 20px;
182
+ .support-link:not(:first-child) {
183
+ margin: 15px 0 0 0;
288
184
  }
185
+
289
186
  .register {
290
187
  display: flex;
291
188
  align-items: center;
@@ -53,6 +53,10 @@ export function resolveList(key) {
53
53
  return undefined;
54
54
  }
55
55
 
56
+ export function resolveChart(key) {
57
+ return undefined;
58
+ }
59
+
56
60
  export function resolveEdit(key) {
57
61
  return undefined;
58
62
  }
@@ -5,6 +5,7 @@ import { SPOOFED_API_PREFIX, SPOOFED_PREFIX } from '@shell/store/type-map';
5
5
  import { createYaml } from '@shell/utils/create-yaml';
6
6
  import { classify } from '@shell/plugins/dashboard-store/classify';
7
7
  import { normalizeType } from './normalize';
8
+ import garbageCollect from '@shell/utils/gc/gc';
8
9
 
9
10
  export const _ALL = 'all';
10
11
  export const _MERGE = 'merge';
@@ -316,6 +317,8 @@ export default {
316
317
  dispatch('resource-fetch/updateManualRefreshIsLoading', false, { root: true });
317
318
  }
318
319
 
320
+ garbageCollect.gcUpdateLastAccessed(ctx, type);
321
+
319
322
  return all;
320
323
  },
321
324
 
@@ -371,6 +374,8 @@ export default {
371
374
  });
372
375
  }
373
376
 
377
+ garbageCollect.gcUpdateLastAccessed(ctx, type);
378
+
374
379
  return getters.matching( type, selector, namespace );
375
380
  },
376
381
 
@@ -426,6 +431,8 @@ export default {
426
431
 
427
432
  out = getters.byId(type, id);
428
433
 
434
+ garbageCollect.gcUpdateLastAccessed(ctx, type);
435
+
429
436
  return out;
430
437
  },
431
438
 
@@ -490,6 +497,10 @@ export default {
490
497
  return classify(ctx, data);
491
498
  },
492
499
 
500
+ createMany(ctx, data) {
501
+ return data.map(d => classify(ctx, d));
502
+ },
503
+
493
504
  createPopulated(ctx, userData) {
494
505
  const data = ctx.getters['defaultFor'](userData.type);
495
506
 
@@ -587,5 +598,13 @@ export default {
587
598
 
588
599
  incrementLoadCounter({ commit }, resource) {
589
600
  commit('incrementLoadCounter', resource);
601
+ },
602
+
603
+ garbageCollect(ctx, ignoreTypes) {
604
+ return garbageCollect.garbageCollect(ctx, ignoreTypes);
605
+ },
606
+
607
+ gcResetStore({ state }) {
608
+ garbageCollect.gcResetStore(state);
590
609
  }
591
610
  };
@@ -9,10 +9,11 @@ import Resource from '@shell/plugins/dashboard-store/resource-class';
9
9
  import mutations from './mutations';
10
10
  import { keyFieldFor, normalizeType } from './normalize';
11
11
  import { lookup } from './model-loader';
12
+ import garbageCollect from '@shell/utils/gc/gc';
12
13
 
13
14
  export default {
14
15
 
15
- all: (state, getters) => (type) => {
16
+ all: (state, getters, rootState) => (type) => {
16
17
  type = getters.normalizeType(type);
17
18
 
18
19
  if ( !getters.typeRegistered(type) ) {
@@ -22,10 +23,14 @@ export default {
22
23
  mutations.registerType(state, type);
23
24
  }
24
25
 
26
+ garbageCollect.gcUpdateLastAccessed({
27
+ state, getters, rootState
28
+ }, type);
29
+
25
30
  return state.types[type].list;
26
31
  },
27
32
 
28
- matching: (state, getters) => (type, selector, namespace) => {
33
+ matching: (state, getters, rootState) => (type, selector, namespace) => {
29
34
  let all = getters['all'](type);
30
35
 
31
36
  // Filter first by namespace if one is provided, since this is efficient
@@ -33,16 +38,24 @@ export default {
33
38
  all = all.filter(obj => obj.namespace === namespace);
34
39
  }
35
40
 
41
+ garbageCollect.gcUpdateLastAccessed({
42
+ state, getters, rootState
43
+ }, type);
44
+
36
45
  return all.filter((obj) => {
37
46
  return matches(obj, selector);
38
47
  });
39
48
  },
40
49
 
41
- byId: (state, getters) => (type, id) => {
50
+ byId: (state, getters, rootState) => (type, id) => {
42
51
  type = getters.normalizeType(type);
43
52
  const entry = state.types[type];
44
53
 
45
54
  if ( entry ) {
55
+ garbageCollect.gcUpdateLastAccessed({
56
+ state, getters, rootState
57
+ }, type);
58
+
46
59
  return entry.map.get(id);
47
60
  }
48
61
  },
@@ -300,5 +313,9 @@ export default {
300
313
  }
301
314
 
302
315
  return 0;
316
+ },
317
+
318
+ gcIgnoreTypes: () => {
319
+ return {};
303
320
  }
304
321
  };