@rancher/shell 0.1.4 → 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 (152) hide show
  1. package/assets/brand/suse/favicon.png +0 -0
  2. package/assets/images/generic-plugin.svg +1 -7
  3. package/assets/translations/en-us.yaml +81 -47
  4. package/components/CommunityLinks.vue +40 -49
  5. package/components/ExplorerProjectsNamespaces.vue +20 -3
  6. package/components/LazyImage.vue +21 -8
  7. package/components/PromptRemove.vue +2 -2
  8. package/components/ResourceList/Masthead.vue +21 -1
  9. package/components/ResourceList/ResourceLoadingIndicator.vue +0 -8
  10. package/components/ResourceList/index.vue +9 -23
  11. package/components/SortableTable/index.vue +13 -10
  12. package/components/Tabbed/index.vue +25 -7
  13. package/components/TypeDescription.vue +10 -1
  14. package/components/fleet/FleetClusters.vue +6 -0
  15. package/components/fleet/FleetRepos.vue +7 -1
  16. package/components/form/Command.vue +5 -0
  17. package/components/form/EnvVars.vue +5 -0
  18. package/components/form/NameNsDescription.vue +3 -1
  19. package/components/form/NodeScheduling.vue +6 -1
  20. package/components/form/PodAffinity.vue +5 -0
  21. package/components/form/ServiceNameSelect.vue +5 -0
  22. package/components/form/ValueFromResource.vue +7 -1
  23. package/components/nav/TopLevelMenu.vue +2 -1
  24. package/config/home-links.js +155 -0
  25. package/config/private-label.js +1 -1
  26. package/config/product/manager.js +0 -2
  27. package/config/product/uiplugins.js +1 -1
  28. package/config/settings.js +3 -1
  29. package/config/uiplugins.js +63 -6
  30. package/config/version.js +17 -0
  31. package/core/plugin.ts +12 -0
  32. package/core/plugins.js +29 -5
  33. package/core/types.ts +6 -0
  34. package/creators/app/{.eslintignore → files/.eslintignore} +0 -0
  35. package/creators/app/{.eslintrc.js → files/.eslintrc.js} +0 -0
  36. package/creators/app/{.vscode → files/.vscode}/settings.json +0 -0
  37. package/creators/app/{babel.config.js → files/babel.config.js} +0 -0
  38. package/creators/app/{nuxt.config.js → files/nuxt.config.js} +0 -0
  39. package/creators/app/{tsconfig.json → files/tsconfig.json} +2 -1
  40. package/creators/app/init +16 -17
  41. package/creators/app/package.json +6 -0
  42. package/creators/pkg/{babel.config.js → files/babel.config.js} +0 -0
  43. package/creators/pkg/{index.ts → files/index.ts} +0 -0
  44. package/creators/pkg/{tsconfig.json → files/tsconfig.json} +13 -12
  45. package/creators/pkg/{vue.config.js → files/vue.config.js} +0 -0
  46. package/creators/pkg/init +1 -1
  47. package/creators/update/init +54 -0
  48. package/creators/update/package.json +20 -0
  49. package/creators/update/upgrade +56 -0
  50. package/creators/update/yarn-error.log +54 -0
  51. package/detail/workload/index.vue +1 -0
  52. package/edit/persistentvolume/index.vue +48 -13
  53. package/edit/persistentvolumeclaim.vue +31 -13
  54. package/edit/provisioning.cattle.io.cluster/rke2.vue +27 -19
  55. package/edit/workload/index.vue +19 -9
  56. package/edit/workload/mixins/workload.js +109 -114
  57. package/edit/workload/storage/index.vue +11 -17
  58. package/edit/workload/storage/persistentVolumeClaim/index.vue +5 -0
  59. package/edit/workload/storage/secret.vue +6 -1
  60. package/list/catalog.cattle.io.app.vue +10 -9
  61. package/list/catalog.cattle.io.clusterrepo.vue +6 -61
  62. package/list/cis.cattle.io.clusterscan.vue +12 -12
  63. package/list/fleet.cattle.io.bundle.vue +33 -28
  64. package/list/fleet.cattle.io.cluster.vue +26 -22
  65. package/list/fleet.cattle.io.clustergroup.vue +6 -0
  66. package/list/fleet.cattle.io.clusterregistrationtoken.vue +28 -24
  67. package/list/fleet.cattle.io.gitrepo.vue +25 -14
  68. package/list/helm.cattle.io.projecthelmchart.vue +52 -33
  69. package/list/logging.banzaicloud.io.clusterflow.vue +7 -12
  70. package/list/logging.banzaicloud.io.flow.vue +7 -14
  71. package/list/management.cattle.io.cluster.vue +26 -15
  72. package/list/management.cattle.io.feature.vue +13 -8
  73. package/list/management.cattle.io.user.vue +38 -19
  74. package/list/monitoring.coreos.com.alertmanagerconfig.vue +8 -15
  75. package/list/namespace.vue +14 -1
  76. package/list/node.vue +13 -16
  77. package/list/persistentvolume.vue +16 -9
  78. package/list/persistentvolumeclaim.vue +5 -8
  79. package/list/provisioning.cattle.io.cluster.vue +34 -8
  80. package/list/service.vue +24 -12
  81. package/list/ui.cattle.io.navlink.vue +6 -0
  82. package/list/workload.vue +2 -2
  83. package/middleware/authenticated.js +6 -0
  84. package/mixins/resource-fetch.js +12 -18
  85. package/mixins/resource-manager.js +126 -0
  86. package/models/catalog.cattle.io.uiplugin.js +4 -0
  87. package/models/pod.js +15 -5
  88. package/models/provisioning.cattle.io.cluster.js +4 -0
  89. package/models/workload.service.js +10 -0
  90. package/nuxt.config.js +2 -1
  91. package/package.json +1 -1
  92. package/pages/auth/login.vue +10 -0
  93. package/pages/auth/verify.vue +9 -0
  94. package/pages/c/_cluster/settings/DefaultLinksEditor.vue +108 -0
  95. package/pages/c/_cluster/settings/links.vue +53 -101
  96. package/pages/c/_cluster/settings/performance.vue +90 -7
  97. package/pages/c/_cluster/uiplugins/DeveloperInstallDialog.vue +3 -3
  98. package/pages/c/_cluster/uiplugins/InstallDialog.vue +71 -20
  99. package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +21 -5
  100. package/pages/c/_cluster/uiplugins/RemoveUIPlugins.vue +2 -7
  101. package/pages/c/_cluster/uiplugins/SetupUIPlugins.vue +23 -15
  102. package/pages/c/_cluster/uiplugins/UninstallDialog.vue +11 -4
  103. package/pages/c/_cluster/uiplugins/index.vue +179 -65
  104. package/pages/support/index.vue +31 -142
  105. package/plugins/dashboard-store/actions.js +19 -0
  106. package/plugins/dashboard-store/getters.js +20 -3
  107. package/plugins/dashboard-store/mutations.js +13 -7
  108. package/plugins/plugin.js +18 -15
  109. package/plugins/steve/getters.js +12 -0
  110. package/plugins/version.js +21 -0
  111. package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +6 -7
  112. package/rancher-components/components/BadgeState/BadgeState.spec.ts +12 -0
  113. package/rancher-components/components/BadgeState/BadgeState.vue +107 -0
  114. package/rancher-components/components/BadgeState/index.ts +1 -0
  115. package/rancher-components/components/Banner/Banner.test.ts +13 -0
  116. package/rancher-components/components/Banner/Banner.vue +163 -0
  117. package/rancher-components/components/Banner/index.ts +1 -0
  118. package/rancher-components/components/Card/Card.vue +150 -0
  119. package/rancher-components/components/Card/index.ts +1 -0
  120. package/rancher-components/components/Form/Checkbox/Checkbox.test.ts +77 -0
  121. package/rancher-components/components/Form/Checkbox/Checkbox.vue +395 -0
  122. package/rancher-components/components/Form/Checkbox/index.ts +1 -0
  123. package/rancher-components/components/Form/LabeledInput/LabeledInput.test.ts +29 -0
  124. package/rancher-components/components/Form/LabeledInput/LabeledInput.vue +343 -0
  125. package/rancher-components/components/Form/LabeledInput/index.ts +1 -0
  126. package/rancher-components/components/Form/Radio/RadioButton.vue +270 -0
  127. package/rancher-components/components/Form/Radio/RadioGroup.vue +235 -0
  128. package/rancher-components/components/Form/Radio/index.ts +2 -0
  129. package/rancher-components/components/Form/TextArea/TextAreaAutoGrow.vue +168 -0
  130. package/rancher-components/components/Form/TextArea/index.ts +1 -0
  131. package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.test.ts +107 -0
  132. package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.vue +137 -0
  133. package/rancher-components/components/Form/ToggleSwitch/index.ts +1 -0
  134. package/rancher-components/components/Form/index.ts +5 -0
  135. package/rancher-components/components/LabeledTooltip/LabeledTooltip.vue +137 -0
  136. package/rancher-components/components/LabeledTooltip/index.ts +1 -0
  137. package/scripts/publish-shell.sh +39 -6
  138. package/scripts/record-deps.js +37 -0
  139. package/scripts/test-plugins-build.sh +8 -5
  140. package/scripts/typegen.sh +84 -0
  141. package/store/auth.js +3 -0
  142. package/store/index.js +12 -3
  143. package/types/shell/index.d.ts +3046 -0
  144. package/utils/favicon.js +8 -2
  145. package/utils/gc/gc-interval.ts +40 -0
  146. package/utils/gc/gc-root-store.js +76 -0
  147. package/utils/gc/gc-route-changed.ts +44 -0
  148. package/utils/gc/gc-types.ts +21 -0
  149. package/utils/gc/gc.ts +282 -0
  150. package/config/footer.js +0 -18
  151. package/creators/pkg/nuxt.config.js +0 -6
  152. package/yarn-error.log +0 -195
Binary file
@@ -1,7 +1 @@
1
- <svg width="36px" height="36px" viewBox="0 0 36 36" version="1.1" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
2
- <style type="text/css">
3
- .st0{fill:#777;}
4
- </style>
5
- <path d="M29.81,16H29V8.83a2,2,0,0,0-2-2H21A5.14,5.14,0,0,0,16.51,2,5,5,0,0,0,11,6.83H4a2,2,0,0,0-2,2V17H4.81A3.13,3.13,0,0,1,8,19.69,3,3,0,0,1,7.22,22,3,3,0,0,1,5,23H2v8.83a2,2,0,0,0,2,2H27a2,2,0,0,0,2-2V26h1a5,5,0,0,0,5-5.51A5.15,5.15,0,0,0,29.81,16Zm2.41,7A3,3,0,0,1,30,24H27v7.83H4V25H5a5,5,0,0,0,5-5.51A5.15,5.15,0,0,0,4.81,15H4V8.83h9V7a3,3,0,0,1,1-2.22A3,3,0,0,1,16.31,4,3.13,3.13,0,0,1,19,7.19V8.83h8V18h2.81A3.13,3.13,0,0,1,33,20.69,3,3,0,0,1,32.22,23Z" class="clr-i-outline clr-i-outline-path-1 st0"></path>
6
- <rect class="st0" x="0" y="0" width="36" height="36" fill-opacity="0"/>
7
- </svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="#777" transform="translate(0, 0) scale(1, 1) "><path d="M20.5 11H19V7c0-1.1-.9-2-2-2h-4V3.5C13 2.12 11.88 1 10.5 1S8 2.12 8 3.5V5H4c-1.1 0-1.99.9-1.99 2v3.8H3.5c1.49 0 2.7 1.21 2.7 2.7s-1.21 2.7-2.7 2.7H2V20c0 1.1.9 2 2 2h3.8v-1.5c0-1.49 1.21-2.7 2.7-2.7 1.49 0 2.7 1.21 2.7 2.7V22H17c1.1 0 2-.9 2-2v-4h1.5c1.38 0 2.5-1.12 2.5-2.5S21.88 11 20.5 11z"/></g></svg>
@@ -48,6 +48,7 @@ generic:
48
48
  plusMore: "+ {n} more"
49
49
  readFromFile: Read from File
50
50
  readFromFolder: Read from Folder
51
+ reload: Reload
51
52
  register: Register
52
53
  remove: Remove
53
54
  resource: |-
@@ -189,7 +190,7 @@ product:
189
190
  neuvector: NeuVector
190
191
  harvesterManager: Virtualization Management
191
192
  rancher: Rancher
192
- uiplugins: UI Plugins
193
+ uiplugins: Extensions
193
194
 
194
195
  suffix:
195
196
  percent: "%"
@@ -3665,7 +3666,7 @@ persistentVolumeClaim:
3665
3666
  status:
3666
3667
  label: Status
3667
3668
 
3668
- # UI Plugins
3669
+ # Rancher Extensions
3669
3670
  plugins:
3670
3671
  labels:
3671
3672
  builtin: Built-in
@@ -3674,78 +3675,85 @@ plugins:
3674
3675
  installing: Installing ...
3675
3676
  uninstalling: Uninstalling ...
3676
3677
  descriptions:
3677
- experimental: This UI Plugin is marked as experimental
3678
- third-party: This UI plugin is provided by a Third-Party
3678
+ experimental: This Extension is marked as experimental
3679
+ third-party: This Extension is provided by a Third-Party
3679
3680
  error:
3680
- title: Error loading plugin
3681
- message: Could not load plugin code
3681
+ title: Error loading extension
3682
+ message: Could not load extension code
3683
+ generic: Extension error
3684
+ api: This Extension is not compatible with the Extensions API
3685
+ host: This Extension is not compatible with this application
3686
+ version: This Extension is not compatible with this version of Rancher
3687
+ load: An error occurred loading the code for this Extension
3682
3688
  success:
3683
- title: Loaded plugin {name}
3684
- message: Plugin was loaded successfully
3689
+ title: Loaded extension {name}
3690
+ message: Extension was loaded successfully
3685
3691
  developer:
3686
3692
  label: Developer Load
3687
- title: Developer Load Plugin
3688
- prompt: Load a plugin from a URL
3693
+ title: Developer Load Extension
3694
+ prompt: Load an extension from a URL
3689
3695
  fields:
3690
- url: Plugin URL
3691
- name: Plugin module name
3692
- persist: Persist plugin by creating custom resource
3696
+ url: Extension URL
3697
+ name: Extension module name
3698
+ persist: Persist extension by creating custom resource
3693
3699
  info:
3694
3700
  detail: Detail
3695
3701
  versions: Versions
3696
3702
  versionError: Could not load version information
3697
3703
  empty:
3698
- all: No UI Plugins either installed nor available
3699
- available: No UI Plugins available
3700
- installed: No UI Plugins installed
3701
- updates: No UI Plugin updates available
3702
- loadError: An error occurred loading the code for this plugin
3703
- helmError: "An error occurred installing the plugin via Helm"
3704
+ all: Extensions are neither installed or available
3705
+ available: No Extensions available
3706
+ installed: No Extensions installed
3707
+ updates: No updates available for installed Extensions
3708
+ loadError: An error occurred loading the code for this extension
3709
+ helmError: "An error occurred installing the extension via Helm"
3704
3710
  tabs:
3705
3711
  all: All
3706
3712
  available: Available
3707
3713
  installed: Installed
3708
3714
  updates: Updates
3709
- title: UI Plugins
3715
+ title: Extensions
3716
+ version: "Version: {version}"
3710
3717
  install:
3711
3718
  label: Install
3712
- title: Install UI Plugin {name}
3713
- prompt: "Are you sure that you want to install this UI Plugin?"
3719
+ title: Install Extension {name}
3720
+ prompt: "Are you sure that you want to install this Extension?"
3714
3721
  version: Version
3715
- warnNotCertified: Please ensure that you are aware of the risks of installing UI Plugins from untrusted authors
3722
+ warnNotCertified: Please ensure that you are aware of the risks of installing Extensions from untrusted authors
3716
3723
  update:
3717
3724
  label: Update
3718
- title: Update UI Plugin {name}
3719
- prompt: "Are you sure that you want to update this UI Plugin?"
3725
+ title: Update Extension {name}
3726
+ prompt: "Are you sure that you want to update this Extension?"
3720
3727
  rollback:
3721
3728
  label: Rollback
3722
- title: Rollback UI Plugin {name}
3723
- prompt: "Are you sure that you want to rollback this UI Plugin?"
3729
+ title: Rollback Extension {name}
3730
+ prompt: "Are you sure that you want to rollback this Extension?"
3724
3731
  uninstall:
3725
3732
  label: Uninstall
3726
- title: "Uninstall UI Plugin: {name}"
3727
- prompt: "Are you sure that you want to uninstall this UI Plugin?"
3728
- upgradeAvailable: A newer version of this UI Plugin is available
3733
+ title: "Uninstall Extension: {name}"
3734
+ prompt: "Are you sure that you want to uninstall this Extension?"
3735
+ upgradeAvailable: A newer version of this Extension is available
3736
+ reload: Extensions changed - reload required
3729
3737
  safeMode:
3730
- title: UI Plugins Safe Mode
3731
- message: UI Plugins were not loaded
3738
+ title: Extensions Safe Mode
3739
+ message: Extensions were not loaded
3732
3740
  setup:
3733
- title: UI Plugin Support is not enabled
3741
+ title: Extension support is not enabled
3734
3742
  prompt:
3735
3743
  cant: Automatic installation is not available - required Helm Charts could not be found
3736
- can: You need to install the Plugin Operator
3744
+ can: You need to install the Extension Operator
3737
3745
  install:
3738
- title: Enable UI Plugin Support?
3739
- prompt: This will install the Helm charts to enable Rancher UI Plugin support
3740
- airgap: Un-check if your Rancher installation is air-gapped
3741
- addRancherRepo: Add the Rancher UI Plugins Repository
3746
+ title: Enable Extension Support?
3747
+ prompt: This will install the Helm charts to enable Extension support
3748
+ airgap: The Rancher Extensions Repository provides extensions published by Rancher. Un-check if your Rancher installation is air-gapped
3749
+ addRancherRepo: Add the Rancher Extension Repository
3742
3750
  remove:
3743
- label: Disable UI Plugin Support
3744
- title: Disable UI Plugin Support?
3745
- prompt: This will un-install the Helm charts that enable Rancher UI Plugin support
3751
+ label: Disable Extension Support
3752
+ title: Disable Extension Support?
3753
+ prompt: This will un-install the Helm charts that enable Extension support
3746
3754
  registry:
3747
- title: Remove the Rancher UI Plugins Repository
3748
- prompt: Remove the default UI Plugins Repository
3755
+ title: Remove the Rancher Extensions Repository
3756
+ prompt: The Rancher Extensions Repository provides extensions published by Rancher
3749
3757
 
3750
3758
  prefs:
3751
3759
  title: Preferences
@@ -3785,7 +3793,7 @@ prefs:
3785
3793
  viewInApi: Enable "View in API"
3786
3794
  allNamespaces: Show system Namespaces managed by Rancher (not intended for editing or deletion)
3787
3795
  themeShortcut: Enable Dark/Light Theme keyboard shortcut toggle (shift+T)
3788
- pluginDeveloper: Enable UI Plugin Developer features
3796
+ pluginDeveloper: Enable Extension developer features
3789
3797
  hideDesc:
3790
3798
  label: Hide All Type Descriptions
3791
3799
  helm:
@@ -6174,7 +6182,7 @@ performance:
6174
6182
  label: Incremental Loading
6175
6183
  setting: You can configure the threshold above which incremental loading will be used.
6176
6184
  description: |-
6177
- When enabled, resources will appear more quickly, but it may take slightly longer to load the entire set of resources. This setting only applies to the following resources: Pods, Deployments, Cron Jobs, Daemon Sets, Jobs, Stateful Sets, Replica Sets, Replication Controllers, Workloads and Secrets.
6185
+ When enabled, resources will appear more quickly, but it may take slightly longer to load the entire set of resources. This setting only applies to resources that come from the Kubernetes API
6178
6186
  checkboxLabel: Enable incremental loading
6179
6187
  inputLabel: Resource Threshold
6180
6188
  manualRefresh:
@@ -6183,7 +6191,7 @@ performance:
6183
6191
  setting: You can configure a threshold above which manual refresh will be enabled.
6184
6192
  buttonTooltip: Refresh list
6185
6193
  description: |-
6186
- When enabled, list data will not auto-update but instead the user must manually trigger a list-view refresh. This setting only applies to the following resources: Pods, Deployments, Cron Jobs, Daemon Sets, Jobs, Stateful Sets, Replica Sets, Replication Controllers, Workloads and Secrets.
6194
+ When enabled, list data will not auto-update but instead the user must manually trigger a list-view refresh. This setting only applies to resources that come from the Kubernetes API
6187
6195
  checkboxLabel: Enable manual refresh of data for lists
6188
6196
  inputLabel: Resource Threshold
6189
6197
  websocketNotification:
@@ -6191,6 +6199,29 @@ performance:
6191
6199
  description: |-
6192
6200
  When checked, websocket notifications will not appear when the UI detects a disconnection.
6193
6201
  checkboxLabel: Disable websocket notifications
6202
+ gc:
6203
+ label: Resource Garbage Collection
6204
+ description: The UI will cache kuberentes resources locally to avoid having to re-fetch them. In some cases this can lead to a large amount of data stored in the browser. Enable this setting to periodically remove them.
6205
+ banner: This setting is experimental and may be removed or updated in future versions.
6206
+ checkboxLabel: Enable Garbage Collection
6207
+ whenRun:
6208
+ description: Update when garbage collection runs
6209
+ intervalCheckBox:
6210
+ label: Run garbage collection periodically
6211
+ interval:
6212
+ inputLabel: Run every
6213
+ route:
6214
+ description: Run garbage collection on page change
6215
+ inputLabel: Page Change
6216
+ howRun:
6217
+ description: Update how garbage collection runs
6218
+ age:
6219
+ description: "Resource types musn't have been accessed within this period to be considered for garbage collection."
6220
+ inputLabel: Resource Age
6221
+ count:
6222
+ description: Resource types must exceed this amount to be considered for garbage collection.
6223
+ inputLabel: Resource Count
6224
+
6194
6225
 
6195
6226
  banner:
6196
6227
  label: Fixed Banners
@@ -6310,13 +6341,16 @@ resourceQuota:
6310
6341
  customLinks:
6311
6342
  displayTitle: Links
6312
6343
  label: Home Links
6313
- description: 'Links to display on the home page.'
6344
+ description: 'Configure the links to display on the home page. You can define your own custom links as well as show or hide default links.'
6314
6345
  restoreDefaults: 'Restore Defaults'
6315
6346
  addLink: Add Link
6316
6347
  restoreSuccess: Default URLs have been restored.
6317
6348
  settings:
6349
+ default: Default Links
6350
+ custom: Custom Links
6318
6351
  keyLabel: Display Text
6319
6352
  valueLabel: URL
6353
+ showLabel: Show
6320
6354
  defaults:
6321
6355
  docs: Docs
6322
6356
  forums: Forums
@@ -1,10 +1,11 @@
1
1
  <script>
2
- import { options } from '@shell/config/footer';
3
2
  import SimpleBox from '@shell/components/SimpleBox';
4
3
  import Closeable from '@shell/mixins/closeable';
5
4
  import { MANAGEMENT } from '@shell/config/types';
6
5
  import { SETTING } from '@shell/config/settings';
7
6
  import { mapGetters } from 'vuex';
7
+ import { isRancherPrime } from '@shell/config/version';
8
+ import { fetchLinks } from '@shell/config/home-links';
8
9
 
9
10
  export default {
10
11
  name: 'CommunityLinks',
@@ -18,36 +19,23 @@ export default {
18
19
  return {};
19
20
  },
20
21
  },
22
+ isSupportPage: {
23
+ type: Boolean,
24
+ default: false,
25
+ },
21
26
  },
22
27
 
23
28
  mixins: [Closeable],
24
29
 
25
30
  async fetch() {
26
- // If user already have custom links and uiIssueSetting Doc URL set
27
- // This should already be in the uiCustomLinks
28
- try {
29
- this.uiCustomLinks = await this.$store.dispatch('management/find', { type: MANAGEMENT.SETTING, id: SETTING.UI_CUSTOM_LINKS });
30
- } catch (err) {
31
-
32
- }
33
-
34
- // Fallback:
35
- // NB: this.uiIssueSetting is deprecated now.
36
- if (!this.uiCustomLinks) {
37
- try {
38
- this.uiIssuesSetting = await this.$store.dispatch('management/find', { type: MANAGEMENT.SETTING, id: SETTING.ISSUES });
39
- } catch (err) {
40
-
41
- }
42
- }
31
+ this.links = await fetchLinks(this.$store, this.hasSupport, this.isSupportPage, str => this.t(str));
43
32
  },
44
33
 
45
34
  data() {
46
- return { uiCustomLinks: null, uiIssuesSetting: null };
35
+ return { links: {} };
47
36
  },
48
37
 
49
38
  computed: {
50
-
51
39
  ...mapGetters('i18n', [
52
40
  'selectedLocaleLabel'
53
41
  ]),
@@ -56,38 +44,41 @@ export default {
56
44
  return !!Object.keys(this.options).length || !!Object.keys(this.$slots).length;
57
45
  },
58
46
 
47
+ hasSupport() {
48
+ return isRancherPrime() || this.$store.getters['management/byId'](MANAGEMENT.SETTING, SETTING.SUPPORTED )?.value === 'true';
49
+ },
50
+
59
51
  options() {
60
- // Link options are provided
61
- if (Object.keys(this.linkOptions).length > 0) {
62
- return this.linkOptions;
52
+ // Use linkOptions if provided - used by Harvester
53
+ if (this.linkOptions && Object.keys(this.linkOptions).length) {
54
+ const options = [];
55
+
56
+ Object.keys(this.linkOptions).forEach((key) => {
57
+ options.push({
58
+ key,
59
+ label: this.t(key),
60
+ value: this.linkOptions[key]
61
+ });
62
+ });
63
+
64
+ return options;
63
65
  }
64
66
 
65
- // Custom links set from settings
66
- if (!!this.uiCustomLinks?.value) {
67
- try {
68
- const customLinks = JSON.parse(this.uiCustomLinks.value);
69
-
70
- if (Array.isArray(customLinks)) {
71
- return customLinks.reduce((prev, curr) => {
72
- prev[curr.key] = curr.value;
73
-
74
- return prev;
75
- }, {});
76
- }
77
- } catch (e) {
78
- console.error('Could not parse custom links setting', e); // eslint-disable-line no-console
79
- }
67
+ // Combine the links
68
+ const all = [];
69
+
70
+ if (this.links.custom) {
71
+ all.push(...this.links.custom);
80
72
  }
81
73
 
82
- // Fallback
83
- return options(false, this.uiIssuesSetting?.value);
84
- },
74
+ if (this.links.defaults) {
75
+ all.push(...this.links.defaults.filter(link => link.enabled));
76
+ }
77
+
78
+ return all;
79
+ }
85
80
  },
86
81
  methods: {
87
- getLabel(label) {
88
- return this.$store.getters['i18n/withFallback'](`customLinks.defaults.${ label }`, null, label);
89
- },
90
-
91
82
  show() {
92
83
  this.$modal.show('wechat-modal');
93
84
  },
@@ -106,11 +97,11 @@ export default {
106
97
  {{ t('customLinks.displayTitle') }}
107
98
  </h2>
108
99
  </template>
109
- <div v-for="(value, name) in options" :key="name" class="support-link">
110
- <n-link v-if="value.startsWith('/') " :to="value">
111
- {{ getLabel(name) }}
100
+ <div v-for="link in options" :key="link.label" class="support-link">
101
+ <n-link v-if="link.value.startsWith('/') " :to="link.value">
102
+ {{ link.label }}
112
103
  </n-link>
113
- <a v-else :href="value" rel="noopener noreferrer nofollow" target="_blank"> {{ getLabel(name) }} </a>
104
+ <a v-else :href="link.value" rel="noopener noreferrer nofollow" target="_blank"> {{ link.label }} </a>
114
105
  </div>
115
106
  <slot />
116
107
  <div v-if="selectedLocaleLabel === t('locale.zh-hans')" class="support-link">
@@ -10,12 +10,14 @@ import { mapPref, GROUP_RESOURCES, ALL_NAMESPACES } from '@shell/store/prefs';
10
10
  import MoveModal from '@shell/components/MoveModal';
11
11
  import { defaultTableSortGenerationFn } from '@shell/components/ResourceTable.vue';
12
12
  import { NAMESPACE_FILTER_ALL_ORPHANS } from '@shell/utils/namespace-filter';
13
+ import ResourceFetch from '@shell/mixins/resource-fetch';
13
14
 
14
15
  export default {
15
16
  name: 'ListProjectNamespace',
16
17
  components: {
17
18
  Masthead, MoveModal, ResourceTable
18
19
  },
20
+ mixins: [ResourceFetch],
19
21
 
20
22
  props: {
21
23
  createProjectLocationOverride: {
@@ -42,14 +44,15 @@ export default {
42
44
  return;
43
45
  }
44
46
 
45
- this.namespaces = await this.$store.dispatch(`${ inStore }/findAll`, { type: NAMESPACE });
47
+ await this.$fetchType(NAMESPACE);
46
48
  this.projects = await this.$store.dispatch('management/findAll', { type: MANAGEMENT.PROJECT, opt: { force: true } });
47
49
  },
48
50
 
49
51
  data() {
50
52
  return {
53
+ loadResources: [NAMESPACE],
54
+ loadIndeterminate: true,
51
55
  schema: null,
52
- namespaces: [],
53
56
  projects: [],
54
57
  projectSchema: null,
55
58
  MANAGEMENT,
@@ -66,6 +69,17 @@ export default {
66
69
 
67
70
  computed: {
68
71
  ...mapGetters(['currentCluster', 'currentProduct']),
72
+ namespaces() {
73
+ const inStore = this.$store.getters['currentStore'](NAMESPACE);
74
+
75
+ return this.$store.getters[`${ inStore }/all`](NAMESPACE);
76
+ },
77
+ loading() {
78
+ return !this.currentCluster || this.namespaces.length ? false : this.$fetchState.pending;
79
+ },
80
+ showIncrementalLoadingIndicator() {
81
+ return this.perfConfig?.incrementalLoading?.enabled;
82
+ },
69
83
  isNamespaceCreatable() {
70
84
  return (this.schema?.collectionMethods || []).includes('POST');
71
85
  },
@@ -309,6 +323,9 @@ export default {
309
323
  :favorite-resource="VIRTUAL_TYPES.PROJECT_NAMESPACES"
310
324
  :create-location="createProjectLocation"
311
325
  :create-button-label="t('projectNamespaces.createProject')"
326
+ :show-incremental-loading-indicator="showIncrementalLoadingIndicator"
327
+ :load-resources="loadResources"
328
+ :load-indeterminate="loadIndeterminate"
312
329
  />
313
330
  <ResourceTable
314
331
  ref="table"
@@ -319,7 +336,7 @@ export default {
319
336
  :rows="filteredRows"
320
337
  :groupable="true"
321
338
  :sort-generation-fn="sortGenerationFn"
322
- :loading="$fetchState.pending || !currentCluster"
339
+ :loading="loading"
323
340
  group-tooltip="resourceTable.groupBy.project"
324
341
  key-field="_key"
325
342
  v-on="$listeners"
@@ -19,17 +19,18 @@ export default {
19
19
  },
20
20
  },
21
21
 
22
- mounted() {
23
- const $img = $(this.$refs.img);
24
-
25
- if ( this.src ) {
26
- $img.attr('src', this.src);
27
- this.boundError = this.onError.bind(this);
28
-
29
- $img.on('error', this.boundError);
22
+ watch: {
23
+ src(neu, old) {
24
+ if (neu !== old) {
25
+ this.loadImage();
26
+ }
30
27
  }
31
28
  },
32
29
 
30
+ mounted() {
31
+ this.loadImage();
32
+ },
33
+
33
34
  beforeDestroy() {
34
35
  const $img = $(this.$refs.img);
35
36
 
@@ -39,6 +40,18 @@ export default {
39
40
  },
40
41
 
41
42
  methods: {
43
+ // Ensure we load the image when the source changes
44
+ loadImage() {
45
+ const $img = $(this.$refs.img);
46
+
47
+ if ( this.src ) {
48
+ $img.attr('src', this.src);
49
+ this.boundError = this.onError.bind(this);
50
+
51
+ $img.on('error', this.boundError);
52
+ }
53
+ },
54
+
42
55
  onError() {
43
56
  const $img = $(this.$refs.img);
44
57
 
@@ -266,7 +266,7 @@ export default {
266
266
  await this.refreshSpoofedTypes(spoofedTypes);
267
267
  this.done();
268
268
  } catch (err) {
269
- this.error = err;
269
+ this.error = err.message || err;
270
270
  btnCB(false);
271
271
  }
272
272
  },
@@ -278,7 +278,7 @@ export default {
278
278
  await this.refreshSpoofedTypes(spoofedTypes);
279
279
  this.done();
280
280
  } catch (err) {
281
- this.error = err;
281
+ this.error = err.message || err;
282
282
  btnCB(false);
283
283
  }
284
284
  },
@@ -4,6 +4,7 @@ import Favorite from '@shell/components/nav/Favorite';
4
4
  import TypeDescription from '@shell/components/TypeDescription';
5
5
  import { get } from '@shell/utils/object';
6
6
  import { AS, _YAML } from '@shell/config/query-params';
7
+ import ResourceLoadingIndicator from './ResourceLoadingIndicator';
7
8
 
8
9
  /**
9
10
  * Resource List Masthead component.
@@ -15,6 +16,7 @@ export default {
15
16
  components: {
16
17
  Favorite,
17
18
  TypeDescription,
19
+ ResourceLoadingIndicator,
18
20
  },
19
21
  props: {
20
22
  resource: {
@@ -53,6 +55,20 @@ export default {
53
55
  type: String,
54
56
  default: null
55
57
  },
58
+ loadResources: {
59
+ type: Array,
60
+ default: () => []
61
+ },
62
+
63
+ loadIndeterminate: {
64
+ type: Boolean,
65
+ default: false
66
+ },
67
+
68
+ showIncrementalLoadingIndicator: {
69
+ type: Boolean,
70
+ default: false
71
+ },
56
72
 
57
73
  /**
58
74
  * Inherited global identifier prefix for tests
@@ -155,7 +171,11 @@ export default {
155
171
  <h1 class="m-0">
156
172
  {{ _typeDisplay }} <Favorite v-if="isExplorer" :resource="favoriteResource || resource" />
157
173
  </h1>
158
- <slot name="header"></slot>
174
+ <ResourceLoadingIndicator
175
+ v-if="showIncrementalLoadingIndicator"
176
+ :resources="loadResources"
177
+ :indeterminate="loadIndeterminate"
178
+ />
159
179
  </div>
160
180
  <div class="actions-container">
161
181
  <slot name="actions">
@@ -16,10 +16,6 @@ export default {
16
16
  indeterminate: {
17
17
  type: Boolean,
18
18
  default: false,
19
- },
20
- rows: {
21
- type: Array,
22
- default: undefined,
23
19
  }
24
20
  },
25
21
 
@@ -32,10 +28,6 @@ export default {
32
28
  computed: {
33
29
  // Count of rows - either from the data provided or from the rows for the first resource
34
30
  rowsCount() {
35
- if (this.rows) {
36
- return this.rows.length;
37
- }
38
-
39
31
  if (this.resources.length > 0) {
40
32
  const existingData = this.$store.getters[`${ this.inStore }/all`](this.resources[0]) || [];
41
33
 
@@ -3,7 +3,7 @@ import ResourceTable from '@shell/components/ResourceTable';
3
3
  import Loading from '@shell/components/Loading';
4
4
  import Masthead from './Masthead';
5
5
  import ResourceLoadingIndicator from './ResourceLoadingIndicator';
6
- import ResourceFetch, { TYPES_RESTRICTED } from '@shell/mixins/resource-fetch';
6
+ import ResourceFetch from '@shell/mixins/resource-fetch';
7
7
 
8
8
  export default {
9
9
  components: {
@@ -43,8 +43,8 @@ export default {
43
43
  if (component?.$loadingResources) {
44
44
  const { loadResources, loadIndeterminate } = component?.$loadingResources(this.$route, this.$store);
45
45
 
46
- this.loadResources = loadResources;
47
- this.loadIndeterminate = loadIndeterminate;
46
+ this.loadResources = loadResources || [resource];
47
+ this.loadIndeterminate = loadIndeterminate || false;
48
48
  }
49
49
  }
50
50
 
@@ -55,11 +55,7 @@ export default {
55
55
  return;
56
56
  }
57
57
 
58
- if (TYPES_RESTRICTED.includes(resource)) {
59
- this.rows = await this.$fetchType(resource);
60
- } else {
61
- this.rows = await store.dispatch(`${ inStore }/findAll`, { type: resource });
62
- }
58
+ await this.$fetchType(resource);
63
59
  }
64
60
  },
65
61
 
@@ -75,13 +71,10 @@ export default {
75
71
 
76
72
  const showMasthead = getters[`type-map/optionsFor`](resource).showListMasthead;
77
73
 
78
- const existingData = getters[`${ inStore }/all`](resource) || [];
79
-
80
74
  return {
81
75
  inStore,
82
76
  schema,
83
77
  hasListComponent,
84
- hasData: existingData.length > 0,
85
78
  showMasthead: showMasthead === undefined ? true : showMasthead,
86
79
  resource,
87
80
  // manual refresh
@@ -89,7 +82,6 @@ export default {
89
82
  watch: false,
90
83
  force: false,
91
84
  // Provided by fetch later
92
- rows: [],
93
85
  customTypeDisplay: null,
94
86
  // incremental loading
95
87
  loadResources: [resource],
@@ -111,10 +103,6 @@ export default {
111
103
  return this.$store.getters['type-map/groupByFor'](this.schema);
112
104
  },
113
105
 
114
- loading() {
115
- return this.hasData ? false : this.$fetchState.pending;
116
- },
117
-
118
106
  showIncrementalLoadingIndicator() {
119
107
  return this.perfConfig?.incrementalLoading?.enabled;
120
108
  }
@@ -142,18 +130,16 @@ export default {
142
130
  :type-display="customTypeDisplay"
143
131
  :schema="schema"
144
132
  :resource="resource"
133
+ :show-incremental-loading-indicator="showIncrementalLoadingIndicator"
134
+ :load-resources="loadResources"
135
+ :load-indeterminate="loadIndeterminate"
145
136
  >
146
- <template v-slot:header>
147
- <ResourceLoadingIndicator
148
- v-if="showIncrementalLoadingIndicator"
149
- :resources="loadResources"
150
- :indeterminate="loadIndeterminate"
151
- />
152
- </template>
153
137
  </Masthead>
154
138
  <div v-if="hasListComponent">
155
139
  <component
156
140
  :is="listComponent"
141
+ :incremental-loading-indicator="showIncrementalLoadingIndicator"
142
+ :rows="rows"
157
143
  v-bind="$data"
158
144
  />
159
145
  </div>