@rancher/shell 0.3.0 → 0.3.1
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.
- package/assets/styles/global/_button.scss +5 -1
- package/assets/styles/global/_columns.scss +4 -0
- package/assets/styles/global/_layout.scss +1 -2
- package/assets/styles/global/_select.scss +1 -4
- package/assets/styles/themes/_dark.scss +4 -4
- package/assets/styles/themes/_light.scss +4 -3
- package/assets/styles/themes/_suse.scss +1 -1
- package/assets/styles/vendor/vue-select.scss +4 -3
- package/assets/translations/en-us.yaml +669 -73
- package/assets/translations/zh-hans.yaml +547 -165
- package/chart/monitoring/steps/uninstall-v1.vue +2 -2
- package/cloud-credential/azure.vue +23 -0
- package/cloud-credential/harvester.vue +25 -62
- package/cloud-credential/pnap.vue +80 -0
- package/components/.DS_Store +0 -0
- package/components/AdvancedSection.vue +9 -2
- package/components/Alert.vue +2 -2
- package/components/ButtonDropdown.vue +0 -2
- package/components/ButtonGroup.vue +1 -0
- package/components/CollapsibleCard.vue +0 -1
- package/components/CruResource.vue +41 -4
- package/components/DetailTop.vue +58 -3
- package/components/DisableAuthProviderModal.vue +106 -0
- package/{rancher-components/components/Utils/DraggableZone → components}/DraggableZone.vue +0 -0
- package/components/ExplorerMembers.vue +253 -30
- package/components/ExplorerProjectsNamespaces.vue +77 -33
- package/components/GrowlManager.vue +3 -3
- package/components/IconOrSvg.vue +149 -0
- package/components/LogItem.vue +69 -0
- package/components/PodSecurityAdmission.vue +302 -0
- package/components/PromptModal.vue +1 -0
- package/components/ResourceDetail/Masthead.vue +54 -2
- package/components/ResourceDetail/index.vue +12 -5
- package/components/ResourceList/Masthead.vue +11 -1
- package/components/ResourceList/ResourceLoadingIndicator.vue +12 -2
- package/components/ResourceList/index.vue +53 -12
- package/components/ResourceList/resource-list.config.js +7 -0
- package/components/ResourceTable.vue +31 -6
- package/components/SimpleBox.vue +1 -1
- package/components/SortableTable/THead.vue +15 -5
- package/components/SortableTable/index.vue +21 -10
- package/components/Tabbed/index.vue +20 -15
- package/components/__tests__/.DS_Store +0 -0
- package/components/__tests__/AsyncButton.test.ts +140 -0
- package/components/__tests__/BackLink.test.ts +33 -0
- package/components/__tests__/ButtonGroup.test.ts +124 -0
- package/components/__tests__/ClusterBadge.test.ts +32 -0
- package/components/__tests__/CollapsibleCard.test.ts +64 -0
- package/components/__tests__/ConsumptionGauge.test.ts +88 -0
- package/components/__tests__/CruResource.test.ts +3 -2
- package/components/__tests__/FixedBanner.test.ts +129 -0
- package/components/__tests__/GrowlManager.test.ts +147 -0
- package/components/__tests__/NamespaceFilter.test.ts +33 -25
- package/components/__tests__/PercentageBar.test.ts +32 -0
- package/components/__tests__/PodSecurityAdmission.test.ts +398 -0
- package/components/auth/AuthBanner.vue +20 -10
- package/components/auth/RoleDetailEdit.vue +26 -17
- package/components/auth/SelectPrincipal.vue +36 -5
- package/components/form/ArrayList.vue +3 -35
- package/components/form/ArrayListGrouped.vue +13 -4
- package/components/form/ArrayListSelect.vue +5 -5
- package/components/form/Error.vue +8 -0
- package/components/form/KeyValue.vue +39 -7
- package/components/form/LabeledSelect.vue +5 -2
- package/components/form/Labels.vue +46 -16
- package/components/form/Members/ClusterPermissionsEditor.vue +17 -17
- package/components/form/Members/MembershipEditor.vue +12 -12
- package/components/form/NameNsDescription.vue +1 -1
- package/components/form/NodeScheduling.vue +1 -1
- package/components/form/Probe.vue +3 -3
- package/components/form/ResourceQuota/Project.vue +6 -6
- package/components/form/ResourceTabs/index.vue +1 -6
- package/components/form/Security.vue +7 -6
- package/components/form/Select.vue +3 -2
- package/components/form/SelectOrCreateAuthSecret.vue +22 -29
- package/components/form/ServicePorts.vue +8 -0
- package/components/form/WorkloadPorts.vue +7 -1
- package/components/form/__tests__/ArrayList.test.ts +74 -0
- package/components/form/__tests__/ArrayListGrouped.test.ts +6 -4
- package/components/formatter/Checked.vue +1 -1
- package/components/formatter/ClusterLink.vue +5 -0
- package/components/formatter/IconIsDefault.vue +2 -2
- package/components/formatter/InternalExternalIP.vue +11 -8
- package/components/formatter/LiveDuration.vue +78 -0
- package/components/formatter/WorkloadHealthScale.vue +5 -3
- package/components/nav/Header.vue +6 -3
- package/components/nav/NamespaceFilter.vue +146 -63
- package/components/nav/TopLevelMenu.vue +22 -19
- package/components/nav/WindowManager/ContainerLogs.vue +83 -126
- package/components/nav/WindowManager/ContainerShell.vue +9 -7
- package/components/nav/WindowManager/Window.vue +2 -0
- package/components/nav/WindowManager/index.vue +10 -0
- package/config/elemental-types.js +9 -0
- package/config/features.js +2 -0
- package/config/home-links.js +4 -1
- package/config/pod-security-admission.ts +82 -0
- package/config/product/apps.js +1 -1
- package/config/product/auth.js +6 -5
- package/config/product/explorer.js +6 -6
- package/config/product/fleet.js +1 -1
- package/config/product/manager.js +6 -2
- package/config/secret.js +0 -1
- package/config/settings.ts +26 -9
- package/config/table-headers.js +22 -11
- package/config/types.js +4 -1
- package/content/docs/zh-hans/getting-started.md +113 -137
- package/content/docs/zh-hans/whats-new.md +8 -46
- package/creators/pkg/package-lock.json +37 -0
- package/creators/pkg/package.json +1 -1
- package/detail/catalog.cattle.io.app.vue +1 -1
- package/detail/pod.vue +1 -1
- package/detail/provisioning.cattle.io.cluster.vue +35 -9
- package/detail/service.vue +2 -9
- package/detail/workload/index.vue +0 -1
- package/dialog/AddClusterMemberDialog.vue +22 -28
- package/dialog/AddProjectMemberDialog.vue +53 -9
- package/dialog/DiagnosticTimingsDialog.vue +8 -7
- package/dialog/DrainNode.vue +44 -48
- package/dialog/ForceMachineRemoveDialog.vue +5 -7
- package/dialog/GenericPrompt.vue +15 -20
- package/dialog/RollbackWorkloadDialog.vue +15 -46
- package/dialog/RotateCertificatesDialog.vue +5 -7
- package/dialog/RotateEncryptionKeyDialog.vue +5 -9
- package/dialog/SaveAsRKETemplateDialog.vue +5 -13
- package/dialog/ScaleMachineDownDialog.vue +1 -1
- package/dialog/ScalePoolDownDialog.vue +121 -0
- package/edit/__tests__/management.cattle.io.setting.test.ts +3 -3
- package/edit/auth/azuread.vue +16 -16
- package/edit/auth/github.vue +8 -0
- package/edit/auth/googleoauth.vue +10 -1
- package/edit/auth/ldap/index.vue +10 -0
- package/edit/auth/oidc.vue +10 -0
- package/edit/auth/saml.vue +10 -0
- package/edit/autoscaling.horizontalpodautoscaler/index.vue +1 -1
- package/edit/cloudcredential.vue +3 -7
- package/edit/logging-flow/Match.vue +39 -8
- package/edit/logging-flow/index.vue +27 -4
- package/edit/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +107 -0
- package/edit/management.cattle.io.project.vue +8 -1
- package/edit/management.cattle.io.setting.vue +5 -2
- package/edit/management.cattle.io.user.vue +7 -1
- package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +23 -7
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/email.vue +2 -2
- package/edit/monitoring.coreos.com.prometheusrule/GroupRules.vue +14 -6
- package/edit/namespace.vue +18 -4
- package/edit/networking.k8s.io.ingress/Certificate.vue +1 -0
- package/edit/networking.k8s.io.ingress/IngressClass.vue +8 -6
- package/edit/networking.k8s.io.ingress/RulePath.vue +12 -6
- package/edit/networking.k8s.io.ingress/index.vue +8 -6
- package/edit/persistentvolume/index.vue +30 -27
- package/edit/persistentvolume/plugins/cephfs.vue +29 -29
- package/edit/persistentvolume/plugins/csi.vue +102 -62
- package/edit/persistentvolume/plugins/fc.vue +19 -19
- package/edit/persistentvolume/plugins/iscsi.vue +45 -45
- package/edit/persistentvolume/plugins/rbd.vue +39 -39
- package/edit/persistentvolumeclaim.vue +78 -75
- package/edit/provisioning.cattle.io.cluster/MachinePool.vue +11 -7
- package/edit/provisioning.cattle.io.cluster/RegistryConfigs.vue +10 -1
- package/edit/provisioning.cattle.io.cluster/RegistryMirrors.vue +87 -27
- package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +3 -6
- package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +93 -0
- package/edit/provisioning.cattle.io.cluster/import.vue +1 -1
- package/edit/provisioning.cattle.io.cluster/index.vue +29 -6
- package/edit/provisioning.cattle.io.cluster/rke2.vue +440 -152
- package/edit/secret/index.vue +3 -7
- package/edit/service.vue +3 -1
- package/edit/storage.k8s.io.storageclass/index.vue +100 -16
- package/edit/storage.k8s.io.storageclass/provisioners/driver.harvesterhci.io.vue +114 -0
- package/edit/workload/__tests__/index.test.ts +98 -0
- package/edit/workload/index.vue +58 -8
- package/edit/workload/mixins/workload.js +107 -70
- package/edit/workload/storage/ContainerMountPaths.vue +0 -10
- package/edit/workload/storage/emptyDir.vue +88 -0
- package/edit/workload/storage/ephemeralVolume/index.vue +1 -1
- package/edit/workload/storage/index.vue +8 -0
- package/edit/workload/storage/persistentVolumeClaim/index.vue +1 -1
- package/layouts/default.vue +57 -44
- package/list/__tests__/workload.test.ts +5 -2
- package/list/catalog.cattle.io.app.vue +1 -0
- package/list/cis.cattle.io.clusterscan.vue +1 -0
- package/list/fleet.cattle.io.bundle.vue +5 -6
- package/list/fleet.cattle.io.cluster.vue +6 -3
- package/list/fleet.cattle.io.clusterregistrationtoken.vue +5 -6
- package/list/fleet.cattle.io.gitrepo.vue +4 -9
- package/list/helm.cattle.io.projecthelmchart.vue +1 -5
- package/list/logging.banzaicloud.io.clusterflow.vue +4 -1
- package/list/logging.banzaicloud.io.flow.vue +6 -5
- package/list/management.cattle.io.cluster.vue +1 -0
- package/list/management.cattle.io.feature.vue +3 -4
- package/list/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +47 -0
- package/list/management.cattle.io.setting.vue +2 -2
- package/list/management.cattle.io.user.vue +4 -10
- package/list/monitoring.coreos.com.alertmanagerconfig.vue +2 -7
- package/list/node.vue +8 -5
- package/list/persistentvolume.vue +3 -3
- package/list/persistentvolumeclaim.vue +3 -4
- package/list/provisioning.cattle.io.cluster.vue +18 -19
- package/list/service.vue +6 -14
- package/list/workload.vue +43 -38
- package/machine-config/azure.vue +429 -60
- package/machine-config/pnap.vue +288 -0
- package/mixins/auth-config.js +1 -3
- package/mixins/browser-tab-visibility.js +8 -14
- package/mixins/chart.js +1 -1
- package/mixins/create-edit-view/impl.js +4 -0
- package/mixins/create-edit-view/index.js +4 -2
- package/mixins/resource-fetch-namespaced.js +98 -0
- package/mixins/resource-fetch.js +79 -45
- package/mixins/resource-manager.js +1 -23
- package/models/apps.controllerrevision.js +7 -0
- package/models/apps.daemonset.js +18 -0
- package/models/apps.deployment.js +44 -0
- package/models/apps.replicaset.js +7 -0
- package/models/apps.statefulset.js +18 -0
- package/models/batch.job.js +7 -14
- package/models/cluster/node.js +10 -2
- package/models/cluster.x-k8s.io.machine.js +26 -4
- package/models/cluster.x-k8s.io.machinedeployment.js +12 -2
- package/models/event.js +7 -0
- package/models/logging.banzaicloud.io.flow.js +4 -0
- package/models/management.cattle.io.cluster.js +1 -1
- package/models/management.cattle.io.clusterroletemplatebinding.js +1 -1
- package/models/management.cattle.io.globalrole.js +2 -2
- package/models/management.cattle.io.node.js +37 -2
- package/models/management.cattle.io.podsecurityadmissionconfigurationtemplate.ts +4 -0
- package/models/management.cattle.io.project.js +30 -11
- package/models/management.cattle.io.setting.js +1 -1
- package/models/management.cattle.io.user.js +37 -1
- package/models/namespace.js +42 -5
- package/models/persistentvolume.js +14 -2
- package/models/pod.js +15 -0
- package/models/projectroletemplatebinding.js +7 -0
- package/models/provisioning.cattle.io.cluster.js +61 -10
- package/models/rke-machine.cattle.io.pnapmachinetemplate.js +15 -0
- package/models/service.js +14 -13
- package/models/storage.k8s.io.storageclass.js +33 -18
- package/models/workload.js +38 -7
- package/nuxt.config.js +27 -17
- package/package.json +7 -7
- package/pages/about.vue +14 -2
- package/pages/c/_cluster/apps/charts/index.vue +4 -3
- package/pages/c/_cluster/apps/charts/install.vue +59 -22
- package/pages/c/_cluster/auth/config/_id.vue +6 -0
- package/pages/c/_cluster/auth/config/index.vue +8 -6
- package/pages/c/_cluster/auth/group.principal/assign-edit.vue +1 -1
- package/pages/c/_cluster/auth/roles/index.vue +1 -1
- package/pages/c/_cluster/explorer/index.vue +12 -6
- package/pages/c/_cluster/longhorn/index.vue +1 -1
- package/pages/c/_cluster/monitoring/alertmanagerconfig/_alertmanagerconfigid/receiver.vue +15 -4
- package/pages/c/_cluster/monitoring/index.vue +1 -1
- package/pages/c/_cluster/neuvector/index.vue +1 -1
- package/pages/c/_cluster/settings/performance.vue +48 -2
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +34 -1
- package/pages/c/_cluster/uiplugins/index.vue +28 -2
- package/pages/diagnostic.vue +5 -4
- package/pages/home.vue +105 -30
- package/pages/prefs.vue +23 -12
- package/pages/rio/mesh.vue +1 -1
- package/pkg/dynamic-importer.lib.js +8 -0
- package/pkg/vue.config.js +4 -0
- package/plugins/dashboard-store/__tests__/mutations.spec.js +406 -0
- package/plugins/dashboard-store/actions.js +32 -25
- package/plugins/dashboard-store/getters.js +50 -33
- package/plugins/dashboard-store/mutations.js +134 -28
- package/plugins/dashboard-store/resource-class.js +21 -41
- package/plugins/steve/actions.js +30 -0
- package/plugins/steve/caches/resourceCache.js +60 -0
- package/plugins/steve/getters.js +44 -1
- package/plugins/steve/mutations.js +97 -36
- package/plugins/steve/resourceWatcher.js +277 -0
- package/plugins/steve/schema.utils.js +25 -0
- package/plugins/steve/subscribe.js +288 -115
- package/plugins/steve/worker/index.js +17 -0
- package/plugins/steve/worker/web-worker.advanced.js +302 -0
- package/plugins/steve/{web-worker.steve-sub-worker.js → worker/web-worker.basic.js} +3 -44
- package/rancher-components/Card/Card.vue +3 -3
- package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +1 -0
- package/rancher-components/StringList/StringList.test.ts +45 -420
- package/rancher-components/StringList/StringList.vue +1 -10
- package/rancher-components/components/Banner/Banner.test.ts +44 -0
- package/rancher-components/components/Banner/Banner.vue +129 -61
- package/rancher-components/components/Form/Checkbox/Checkbox.test.ts +13 -22
- package/rancher-components/components/Form/Checkbox/Checkbox.vue +8 -6
- package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.test.ts +9 -9
- package/rancher-components/components/LabeledTooltip/LabeledTooltip.vue +0 -1
- package/rancher-components/components/StringList/StringList.test.ts +7 -7
- package/rancher-components/components/StringList/StringList.vue +21 -15
- package/scripts/test-plugins-build.sh +8 -0
- package/static/loading-indicator.html +1 -1
- package/store/index.js +54 -3
- package/store/plugins.js +0 -17
- package/store/pnap.js +128 -0
- package/store/prefs.js +4 -2
- package/store/type-map.js +55 -13
- package/types/pod-security-admission.ts +36 -0
- package/types/shell/index.d.ts +496 -396
- package/utils/__tests__/object.test.ts +17 -1
- package/utils/__tests__/pod-security-admission.test.ts +61 -0
- package/utils/async.ts +36 -0
- package/utils/color.js +45 -0
- package/utils/crypto/browserHashUtils.js +18 -0
- package/utils/dynamic-importer.js +8 -0
- package/utils/install-redirect.js +1 -1
- package/utils/object.js +24 -0
- package/utils/pod-security-admission.ts +39 -0
- package/utils/socket.js +61 -24
- package/utils/string.js +2 -0
- package/utils/svg-filter.js +301 -0
- package/utils/time.js +49 -0
- package/utils/validators/cidr.js +4 -0
- package/utils/validators/formRules/__tests__/index.test.ts +23 -3
- package/utils/validators/formRules/index.ts +14 -0
- package/config/product/harvester-manager.js +0 -162
- package/edit/harvesterhci.io.management.cluster.vue +0 -153
- package/list/harvesterhci.io.management.cluster.vue +0 -241
- package/machine-config/harvester.vue +0 -693
- package/models/harvesterhci.io.management.cluster.js +0 -228
- package/pages/c/_cluster/harvesterManager/index.vue +0 -24
- package/rancher-components/Card/Card.test.ts +0 -39
- package/rancher-components/Utils/DraggableZone/DraggableZone.vue +0 -181
- package/rancher-components/Utils/DraggableZone/index.ts +0 -1
- package/rancher-components/components/Utils/DraggableZone/index.ts +0 -1
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { NORMAN } from '@shell/config/types';
|
|
3
|
+
import { exceptionToErrorsArray, stringify } from '@shell/utils/error';
|
|
4
|
+
import { _CREATE } from '@shell/config/query-params';
|
|
5
|
+
import CreateEditView from '@shell/mixins/create-edit-view';
|
|
6
|
+
import Loading from '@shell/components/Loading';
|
|
7
|
+
import { Banner } from '@components/Banner';
|
|
8
|
+
import LabeledSelect from '@shell/components/form/LabeledSelect';
|
|
9
|
+
import { LabeledInput } from '@components/Form/LabeledInput';
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
components: {
|
|
13
|
+
Loading,
|
|
14
|
+
Banner,
|
|
15
|
+
LabeledSelect,
|
|
16
|
+
LabeledInput,
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
mixins: [CreateEditView],
|
|
20
|
+
|
|
21
|
+
props: {
|
|
22
|
+
credentialId: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
disabled: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: false,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
async fetch() {
|
|
33
|
+
this.errors = [];
|
|
34
|
+
|
|
35
|
+
try {
|
|
36
|
+
if (this.credentialId) {
|
|
37
|
+
this.credential = await this.$store.dispatch('rancher/find', {
|
|
38
|
+
type: NORMAN.CLOUD_CREDENTIAL,
|
|
39
|
+
id: this.credentialId,
|
|
40
|
+
});
|
|
41
|
+
this.$set(this.value, 'clientIdentifier', this.credential.decodedData.clientIdentifier);
|
|
42
|
+
}
|
|
43
|
+
} catch (e) {
|
|
44
|
+
this.credential = null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
try {
|
|
48
|
+
this.allProducts = await this.$store.dispatch('pnap/allProducts', { credentialId: this.credentialId });
|
|
49
|
+
|
|
50
|
+
this.osChoices = await this.$store.dispatch('pnap/osChoices', { credentialId: this.credentialId });
|
|
51
|
+
|
|
52
|
+
const serverOs = this.osChoices[0].value;
|
|
53
|
+
|
|
54
|
+
if (!this.value.serverOs) {
|
|
55
|
+
this.value.serverOs = serverOs;
|
|
56
|
+
}
|
|
57
|
+
if (!this.value.serverLocation) {
|
|
58
|
+
this.value.serverLocation = 'PHX';
|
|
59
|
+
}
|
|
60
|
+
if (!this.value.serverType) {
|
|
61
|
+
this.value.serverType = 's1.c1.medium';
|
|
62
|
+
}
|
|
63
|
+
this.updateInterfaces();
|
|
64
|
+
} catch (e) {
|
|
65
|
+
this.errors = exceptionToErrorsArray(e);
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
data() {
|
|
70
|
+
return {
|
|
71
|
+
credential: null,
|
|
72
|
+
allProducts: null,
|
|
73
|
+
osChoices: null,
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
watch: {
|
|
78
|
+
'credentialId'() {
|
|
79
|
+
this.$fetch();
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
computed: {
|
|
84
|
+
isCreate() {
|
|
85
|
+
return this.mode === _CREATE;
|
|
86
|
+
},
|
|
87
|
+
locationChoices() {
|
|
88
|
+
const products = this.allProducts;
|
|
89
|
+
const result = [];
|
|
90
|
+
|
|
91
|
+
if (Array.isArray(products)) {
|
|
92
|
+
const map = new Map();
|
|
93
|
+
|
|
94
|
+
for (const prod of products) {
|
|
95
|
+
for (const plan of prod.plans) {
|
|
96
|
+
if (!map.has(plan.location)) {
|
|
97
|
+
map.set(plan.location, true);
|
|
98
|
+
result.push({ value: plan.location, label: plan.location });
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
} else {
|
|
103
|
+
result.push({ value: products.message });
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return result;
|
|
107
|
+
},
|
|
108
|
+
typeChoices() {
|
|
109
|
+
const products = this.allProducts;
|
|
110
|
+
const result = [];
|
|
111
|
+
|
|
112
|
+
if (Array.isArray(products)) {
|
|
113
|
+
const map = new Map();
|
|
114
|
+
const serverLocation = this.value.serverLocation;
|
|
115
|
+
|
|
116
|
+
for (const prod of products) {
|
|
117
|
+
for (const plan of prod.plans) {
|
|
118
|
+
if (
|
|
119
|
+
!map.has(prod.productCode) &&
|
|
120
|
+
plan.location === serverLocation
|
|
121
|
+
) {
|
|
122
|
+
map.set(prod.productCode, true);
|
|
123
|
+
result.push({
|
|
124
|
+
value: prod.productCode,
|
|
125
|
+
label: `${ prod.productCode } - $${ plan.price }/hour`,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
if (!map.has(this.value.serverType) && products.length > 0) {
|
|
131
|
+
this.preselectFirst(result[0].value);
|
|
132
|
+
}
|
|
133
|
+
} else {
|
|
134
|
+
result.push({ value: products.message });
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return result;
|
|
138
|
+
},
|
|
139
|
+
type() {
|
|
140
|
+
const products = this.allProducts;
|
|
141
|
+
|
|
142
|
+
if (Array.isArray(products)) {
|
|
143
|
+
const serverLocation = this.value.serverLocation;
|
|
144
|
+
const serverType = this.value.serverType;
|
|
145
|
+
|
|
146
|
+
for (const prod of products) {
|
|
147
|
+
for (const plan of prod.plans) {
|
|
148
|
+
if (prod.productCode === serverType && plan.location === serverLocation) {
|
|
149
|
+
return prod;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return products.message;
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
|
|
159
|
+
methods: {
|
|
160
|
+
stringify,
|
|
161
|
+
|
|
162
|
+
updateInterfaces() {
|
|
163
|
+
if (!this.value.interfaces) {
|
|
164
|
+
this.value.interfaces = [];
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
|
|
168
|
+
preselectFirst(val) {
|
|
169
|
+
this.value.serverType = val;
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
</script>
|
|
174
|
+
|
|
175
|
+
<template>
|
|
176
|
+
<Loading
|
|
177
|
+
v-if="$fetchState.pending"
|
|
178
|
+
:delayed="true"
|
|
179
|
+
/>
|
|
180
|
+
<div v-else-if="errors.length">
|
|
181
|
+
<div
|
|
182
|
+
v-for="(err, idx) in errors"
|
|
183
|
+
:key="idx"
|
|
184
|
+
>
|
|
185
|
+
<Banner
|
|
186
|
+
color="error"
|
|
187
|
+
:label="stringify(err)"
|
|
188
|
+
/>
|
|
189
|
+
</div>
|
|
190
|
+
</div>
|
|
191
|
+
<div v-else>
|
|
192
|
+
<div class="row mt-20">
|
|
193
|
+
<div class="col span-6">
|
|
194
|
+
<LabeledSelect
|
|
195
|
+
v-model="value.serverLocation"
|
|
196
|
+
:mode="mode"
|
|
197
|
+
:options="locationChoices"
|
|
198
|
+
:searchable="true"
|
|
199
|
+
:required="true"
|
|
200
|
+
:disabled="disabled"
|
|
201
|
+
:label="t('cluster.machineConfig.pnap.serverLocation.label')"
|
|
202
|
+
/>
|
|
203
|
+
</div>
|
|
204
|
+
<div class="col span-6">
|
|
205
|
+
<LabeledSelect
|
|
206
|
+
v-model="value.serverType"
|
|
207
|
+
:mode="mode"
|
|
208
|
+
:options="typeChoices"
|
|
209
|
+
:searchable="true"
|
|
210
|
+
:required="true"
|
|
211
|
+
:disabled="disabled"
|
|
212
|
+
:label="t('cluster.machineConfig.pnap.serverType.label')"
|
|
213
|
+
/>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
<div class="row mt-20">
|
|
217
|
+
<div class="col span-3">
|
|
218
|
+
<LabeledInput
|
|
219
|
+
v-model="type.metadata.cpu"
|
|
220
|
+
:mode="mode"
|
|
221
|
+
:disabled="true"
|
|
222
|
+
:label="t('cluster.machineConfig.pnap.serverCpu.label')"
|
|
223
|
+
/>
|
|
224
|
+
</div>
|
|
225
|
+
<div class="col span-3">
|
|
226
|
+
<LabeledInput
|
|
227
|
+
v-model="type.metadata.coresPerCpu"
|
|
228
|
+
:mode="mode"
|
|
229
|
+
:disabled="true"
|
|
230
|
+
:label="t('cluster.machineConfig.pnap.serverCoresPerCpu.label')"
|
|
231
|
+
/>
|
|
232
|
+
</div>
|
|
233
|
+
<div class="col span-3">
|
|
234
|
+
<LabeledInput
|
|
235
|
+
v-model="type.metadata.cpuCount"
|
|
236
|
+
:mode="mode"
|
|
237
|
+
:disabled="true"
|
|
238
|
+
:label="t('cluster.machineConfig.pnap.serverCpuCount.label')"
|
|
239
|
+
/>
|
|
240
|
+
</div>
|
|
241
|
+
<div class="col span-3">
|
|
242
|
+
<LabeledInput
|
|
243
|
+
v-model="type.metadata.cpuFrequency"
|
|
244
|
+
:mode="mode"
|
|
245
|
+
:disabled="true"
|
|
246
|
+
:label="t('cluster.machineConfig.pnap.serverCpuFrequency.label')"
|
|
247
|
+
/>
|
|
248
|
+
</div>
|
|
249
|
+
</div>
|
|
250
|
+
<div class="row mt-20">
|
|
251
|
+
<div class="col span-3">
|
|
252
|
+
<LabeledInput
|
|
253
|
+
v-model="type.metadata.ramInGb"
|
|
254
|
+
:mode="mode"
|
|
255
|
+
:disabled="true"
|
|
256
|
+
:label="t('cluster.machineConfig.pnap.serverRam.label')"
|
|
257
|
+
/>
|
|
258
|
+
</div>
|
|
259
|
+
<div class="col span-3">
|
|
260
|
+
<LabeledInput
|
|
261
|
+
v-model="type.metadata.storage"
|
|
262
|
+
:mode="mode"
|
|
263
|
+
:disabled="true"
|
|
264
|
+
:label="t('cluster.machineConfig.pnap.serverStorage.label')"
|
|
265
|
+
/>
|
|
266
|
+
</div>
|
|
267
|
+
<div class="col span-3">
|
|
268
|
+
<LabeledInput
|
|
269
|
+
v-model="type.metadata.network"
|
|
270
|
+
:mode="mode"
|
|
271
|
+
:disabled="true"
|
|
272
|
+
:label="t('cluster.machineConfig.pnap.serverNetwork.label')"
|
|
273
|
+
/>
|
|
274
|
+
</div>
|
|
275
|
+
<div class="col span-3">
|
|
276
|
+
<LabeledSelect
|
|
277
|
+
v-model="value.serverOs"
|
|
278
|
+
:mode="mode"
|
|
279
|
+
:options="osChoices"
|
|
280
|
+
:searchable="true"
|
|
281
|
+
:required="true"
|
|
282
|
+
:disabled="disabled"
|
|
283
|
+
:label="t('cluster.machineConfig.pnap.serverOs.label')"
|
|
284
|
+
/>
|
|
285
|
+
</div>
|
|
286
|
+
</div>
|
|
287
|
+
</div>
|
|
288
|
+
</template>
|
package/mixins/auth-config.js
CHANGED
|
@@ -214,7 +214,7 @@ export default {
|
|
|
214
214
|
}
|
|
215
215
|
},
|
|
216
216
|
|
|
217
|
-
async disable(
|
|
217
|
+
async disable() {
|
|
218
218
|
try {
|
|
219
219
|
if (this.model.hasAction('disable')) {
|
|
220
220
|
await this.model.doAction('disable');
|
|
@@ -233,10 +233,8 @@ export default {
|
|
|
233
233
|
opt: { url: '/v3/principals', force: true }
|
|
234
234
|
});
|
|
235
235
|
this.showLdap = false;
|
|
236
|
-
btnCb(true);
|
|
237
236
|
} catch (err) {
|
|
238
237
|
this.errors = [err];
|
|
239
|
-
btnCb(false);
|
|
240
238
|
}
|
|
241
239
|
},
|
|
242
240
|
|
|
@@ -5,33 +5,27 @@ export default {
|
|
|
5
5
|
computed: { ...mapGetters(['isSingleProduct']) },
|
|
6
6
|
methods: {
|
|
7
7
|
setTabVisibilityListener(isAdd) {
|
|
8
|
-
|
|
8
|
+
if ((!this.isSingleProduct || this.isSingleProduct?.enableSessionCheck) && this.$config.rancherEnv !== 'desktop') {
|
|
9
|
+
const method = isAdd ? 'addEventListener' : 'removeEventListener';
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
document[method]('visibilitychange', this.visibilityChange, true);
|
|
12
|
+
}
|
|
11
13
|
},
|
|
12
14
|
|
|
13
15
|
async visibilityChange() {
|
|
14
16
|
if (!document.hidden) {
|
|
15
|
-
await this.$store.dispatch('rancher/
|
|
17
|
+
await this.$store.dispatch('rancher/request', {
|
|
16
18
|
type: NORMAN.USER,
|
|
17
|
-
opt: {
|
|
18
|
-
url: '/v3/users',
|
|
19
|
-
filter: { me: true },
|
|
20
|
-
force: true
|
|
21
|
-
}
|
|
19
|
+
opt: { url: '/v3/users?me=true' }
|
|
22
20
|
});
|
|
23
21
|
}
|
|
24
22
|
},
|
|
25
23
|
},
|
|
26
24
|
|
|
27
25
|
mounted() {
|
|
28
|
-
|
|
29
|
-
this.setTabVisibilityListener(true);
|
|
30
|
-
}
|
|
26
|
+
this.setTabVisibilityListener(true);
|
|
31
27
|
},
|
|
32
28
|
beforeDestroy() {
|
|
33
|
-
|
|
34
|
-
this.setTabVisibilityListener(false);
|
|
35
|
-
}
|
|
29
|
+
this.setTabVisibilityListener(false);
|
|
36
30
|
},
|
|
37
31
|
};
|
package/mixins/chart.js
CHANGED
|
@@ -242,7 +242,7 @@ export default {
|
|
|
242
242
|
|
|
243
243
|
methods: {
|
|
244
244
|
async fetchChart() {
|
|
245
|
-
await this.$store.dispatch('catalog/load');
|
|
245
|
+
await this.$store.dispatch('catalog/load', { force: true, reset: true }); // not the problem
|
|
246
246
|
|
|
247
247
|
if ( this.query.appNamespace && this.query.appName ) {
|
|
248
248
|
// First check the URL query for an app name and namespace.
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { _EDIT, _YAML } from '@shell/config/query-params';
|
|
2
|
+
import Vue from 'vue';
|
|
3
|
+
|
|
2
4
|
import impl from './impl';
|
|
3
5
|
|
|
4
|
-
export default {
|
|
6
|
+
export default Vue.extend({
|
|
5
7
|
...impl,
|
|
6
8
|
|
|
7
9
|
props: {
|
|
@@ -43,4 +45,4 @@ export default {
|
|
|
43
45
|
default: false,
|
|
44
46
|
},
|
|
45
47
|
},
|
|
46
|
-
};
|
|
48
|
+
});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { mapGetters } from 'vuex';
|
|
2
|
+
import { ResourceListComponentName } from '../components/ResourceList/resource-list.config';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Companion mixin used with `resource-fetch` for `ResourceList` to determine if the user needs to filter the list by a single namespace
|
|
6
|
+
*/
|
|
7
|
+
export default {
|
|
8
|
+
|
|
9
|
+
data() {
|
|
10
|
+
return { forceUpdateLiveAndDelayed: 0 };
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
computed: {
|
|
14
|
+
...mapGetters(['currentProduct', 'currentCluster', 'isSingleNamespace']),
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Does the user need to update the filter to supply a single namespace?
|
|
18
|
+
*/
|
|
19
|
+
namespaceFilterRequired() {
|
|
20
|
+
return this.__namespaceRequired && !this.__singleNamespaceFilter;
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Returns the namespace that requests should be filtered by
|
|
25
|
+
*/
|
|
26
|
+
namespaceFilter() {
|
|
27
|
+
return this.__namespaceRequired ? this.__singleNamespaceFilter : '';
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* If the Project/Namespace filter from the header contains a single NS... return it
|
|
32
|
+
*/
|
|
33
|
+
__singleNamespaceFilter() {
|
|
34
|
+
const ns = this.isSingleNamespace;
|
|
35
|
+
|
|
36
|
+
return ns ? ns.replace('ns://', '') : '';
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Do we need to filter the list by a namespace?
|
|
41
|
+
*/
|
|
42
|
+
__namespaceRequired() {
|
|
43
|
+
if (!this.forceNsFilter?.enabled || this.perfConfig.forceNsFilter.threshold === undefined) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return !this.currentProduct.showWorkspaceSwitcher && this.__areResourcesNamespaced && this.__areResourcesTooMany;
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Are all core list resources namespaced?
|
|
52
|
+
*/
|
|
53
|
+
__areResourcesNamespaced() {
|
|
54
|
+
return (this.loadResources || []).every((type) => {
|
|
55
|
+
const schema = this.$store.getters['cluster/schemaFor'](type);
|
|
56
|
+
|
|
57
|
+
return schema?.attributes?.namespaced;
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Are there too many core list resources to show in the list?
|
|
63
|
+
*/
|
|
64
|
+
__areResourcesTooMany() {
|
|
65
|
+
// __getCountForResources is defined on resource-fetch mixin...
|
|
66
|
+
const count = this.__getCountForResources(this.loadResources);
|
|
67
|
+
|
|
68
|
+
return count > this.perfConfig.forceNsFilter.threshold;
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
watch: {
|
|
74
|
+
__namespaceRequired: {
|
|
75
|
+
handler(neu) {
|
|
76
|
+
this.$store.dispatch('setNamespaceFilterMode', neu ? 'namespace' : null, { root: true });
|
|
77
|
+
},
|
|
78
|
+
immediate: true,
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
async namespaceFilter(neu) {
|
|
82
|
+
if (neu) {
|
|
83
|
+
// When a NS filter is required and the user selects a different one, kick off a new set of API requests
|
|
84
|
+
//
|
|
85
|
+
// ResourceList has two modes
|
|
86
|
+
// 1) ResourceList component handles API request to fetch resources
|
|
87
|
+
// 2) Custom list component handles API request to fetch resources
|
|
88
|
+
//
|
|
89
|
+
// This covers case 2
|
|
90
|
+
if (this.$options.name !== ResourceListComponentName && !!this.$fetch) {
|
|
91
|
+
await this.$fetch();
|
|
92
|
+
}
|
|
93
|
+
// Ensure any live/delayed columns get updated
|
|
94
|
+
this.forceUpdateLiveAndDelayed = new Date().getTime();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
};
|
package/mixins/resource-fetch.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { mapGetters } from 'vuex';
|
|
2
2
|
import { COUNT, MANAGEMENT } from '@shell/config/types';
|
|
3
3
|
import { SETTING, DEFAULT_PERF_SETTING } from '@shell/config/settings';
|
|
4
|
+
import ResourceFetchNamespaced from '@shell/mixins/resource-fetch-namespaced';
|
|
4
5
|
|
|
5
6
|
// Number of pages to fetch when loading incrementally
|
|
6
7
|
const PAGES = 4;
|
|
7
8
|
|
|
8
9
|
export default {
|
|
10
|
+
|
|
11
|
+
mixins: [ResourceFetchNamespaced],
|
|
12
|
+
|
|
9
13
|
data() {
|
|
10
14
|
// fetching the settings related to manual refresh from global settings
|
|
11
15
|
const perfSetting = this.$store.getters['management/byId'](MANAGEMENT.SETTING, SETTING.UI_PERFORMANCE);
|
|
@@ -24,16 +28,21 @@ export default {
|
|
|
24
28
|
return {
|
|
25
29
|
perfConfig,
|
|
26
30
|
init: false,
|
|
27
|
-
counts: {},
|
|
28
31
|
multipleResources: [],
|
|
32
|
+
loadResources: [this.resource],
|
|
29
33
|
// manual refresh vars
|
|
30
34
|
hasManualRefresh: false,
|
|
31
35
|
watch: true,
|
|
32
36
|
isTooManyItemsToAutoUpdate: false,
|
|
33
37
|
force: false,
|
|
34
38
|
// incremental loading vars
|
|
35
|
-
incremental:
|
|
39
|
+
incremental: false,
|
|
36
40
|
fetchedResourceType: [],
|
|
41
|
+
// force ns filtering
|
|
42
|
+
forceNsFilter: {
|
|
43
|
+
...perfConfig.forceNsFilter,
|
|
44
|
+
threshold: parseInt(perfConfig?.forceNsFilter?.threshold || '0', 10)
|
|
45
|
+
}
|
|
37
46
|
};
|
|
38
47
|
},
|
|
39
48
|
beforeDestroy() {
|
|
@@ -42,10 +51,8 @@ export default {
|
|
|
42
51
|
// clear up the store to make sure we aren't storing anything that might interfere with the next rendered list view
|
|
43
52
|
this.$store.dispatch('resource-fetch/clearData');
|
|
44
53
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
this.fetchedResourceType.forEach((type) => {
|
|
48
|
-
this.$store.dispatch(`${ inStore }/incrementLoadCounter`, type);
|
|
54
|
+
this.fetchedResourceType.forEach((item) => {
|
|
55
|
+
this.$store.dispatch(`${ item.currStore }/incrementLoadCounter`, item.type);
|
|
49
56
|
});
|
|
50
57
|
}
|
|
51
58
|
},
|
|
@@ -53,9 +60,13 @@ export default {
|
|
|
53
60
|
computed: {
|
|
54
61
|
...mapGetters({ refreshFlag: 'resource-fetch/refreshFlag' }),
|
|
55
62
|
rows() {
|
|
56
|
-
const
|
|
63
|
+
const currResource = this.fetchedResourceType.find(item => item.type === this.resource);
|
|
57
64
|
|
|
58
|
-
|
|
65
|
+
if (currResource) {
|
|
66
|
+
return this.$store.getters[`${ currResource.currStore }/all`](this.resource);
|
|
67
|
+
} else {
|
|
68
|
+
return [];
|
|
69
|
+
}
|
|
59
70
|
},
|
|
60
71
|
loading() {
|
|
61
72
|
return this.rows.length ? false : this.$fetchState.pending;
|
|
@@ -70,11 +81,15 @@ export default {
|
|
|
70
81
|
}
|
|
71
82
|
},
|
|
72
83
|
methods: {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
84
|
+
// this defines all the flags needed for the mechanism
|
|
85
|
+
// to work. They should be defined based on the main list view
|
|
86
|
+
// resource that is to be displayed. The secondary resources
|
|
87
|
+
// fetched should follow what was defined (if it is manual and/or incremental)
|
|
88
|
+
$initializeFetchData(type, multipleResources = [], storeType) {
|
|
76
89
|
if (!this.init) {
|
|
77
|
-
this.
|
|
90
|
+
const currStore = storeType || this.$store.getters['currentStore']();
|
|
91
|
+
|
|
92
|
+
this.__gatherResourceFetchData(type, multipleResources, currStore);
|
|
78
93
|
|
|
79
94
|
// make sure after init that, if we have a manual refresh, we always set the force = true
|
|
80
95
|
if (!this.watch) {
|
|
@@ -85,31 +100,61 @@ export default {
|
|
|
85
100
|
this.hasManualRefresh = true;
|
|
86
101
|
}
|
|
87
102
|
}
|
|
103
|
+
},
|
|
104
|
+
// data fetching for the mechanism
|
|
105
|
+
$fetchType(type, multipleResources = [], storeType) {
|
|
106
|
+
const currStore = storeType || this.$store.getters['currentStore']();
|
|
107
|
+
|
|
108
|
+
this.$initializeFetchData(type, multipleResources, currStore);
|
|
88
109
|
|
|
89
|
-
if (!this.fetchedResourceType.
|
|
90
|
-
this.fetchedResourceType.push(
|
|
110
|
+
if (!this.fetchedResourceType.find(item => item.type === type)) {
|
|
111
|
+
this.fetchedResourceType.push({
|
|
112
|
+
type,
|
|
113
|
+
currStore
|
|
114
|
+
});
|
|
91
115
|
}
|
|
92
116
|
|
|
93
|
-
|
|
117
|
+
let incremental = 0;
|
|
118
|
+
|
|
119
|
+
if (this.incremental) {
|
|
120
|
+
const resourceCount = this.__getCountForResources([type], this.namespaceFilter, currStore);
|
|
121
|
+
|
|
122
|
+
incremental = Math.ceil(resourceCount / PAGES);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const opt = {
|
|
126
|
+
incremental,
|
|
127
|
+
watch: this.watch,
|
|
128
|
+
force: this.force,
|
|
129
|
+
hasManualRefresh: this.hasManualRefresh
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const schema = this.$store.getters[`${ currStore }/schemaFor`](type);
|
|
133
|
+
|
|
134
|
+
if (schema?.attributes?.namespaced) {
|
|
135
|
+
opt.namespaced = this.namespaceFilter;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return this.$store.dispatch(`${ currStore }/findAll`, {
|
|
94
139
|
type,
|
|
95
|
-
opt
|
|
96
|
-
incremental: this.incremental,
|
|
97
|
-
watch: this.watch,
|
|
98
|
-
force: this.force,
|
|
99
|
-
hasManualRefresh: this.hasManualRefresh
|
|
100
|
-
}
|
|
140
|
+
opt
|
|
101
141
|
});
|
|
102
142
|
},
|
|
103
|
-
__getCountForResource(resourceName) {
|
|
104
|
-
let resourceCount;
|
|
105
143
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
144
|
+
__getCountForResources(resourceNames, namespace, storeType) {
|
|
145
|
+
const currStore = storeType || this.$store.getters['currentStore']();
|
|
146
|
+
|
|
147
|
+
return resourceNames.reduce((res, type) => res + this.__getCountForResource(type, namespace, currStore), 0);
|
|
148
|
+
},
|
|
149
|
+
|
|
150
|
+
__getCountForResource(resourceName, namespace, storeType) {
|
|
151
|
+
const resourceCounts = this.$store.getters[`${ storeType }/all`](COUNT)[0]?.counts[`${ resourceName }`]; // NB `rancher` store behaves differently, lacks counts but has resource
|
|
152
|
+
const resourceCount = namespace && resourceCounts?.namespaces ? resourceCounts?.namespaces[namespace]?.count : resourceCounts?.summary?.count;
|
|
109
153
|
|
|
110
154
|
return resourceCount || 0;
|
|
111
155
|
},
|
|
112
|
-
|
|
156
|
+
|
|
157
|
+
__gatherResourceFetchData(resourceName, multipleResources, currStore) {
|
|
113
158
|
// flag to prevent a first data update being triggered from the requestData watcher
|
|
114
159
|
this.init = true;
|
|
115
160
|
|
|
@@ -123,8 +168,6 @@ export default {
|
|
|
123
168
|
|
|
124
169
|
// other vars
|
|
125
170
|
this.multipleResources = multipleResources;
|
|
126
|
-
const resourceName = type;
|
|
127
|
-
const inStore = this.$store.getters['currentStore'](resourceName);
|
|
128
171
|
let resourceCount = 0;
|
|
129
172
|
|
|
130
173
|
// manual refresh vars
|
|
@@ -132,30 +175,21 @@ export default {
|
|
|
132
175
|
let isTooManyItemsToAutoUpdate = false;
|
|
133
176
|
|
|
134
177
|
// incremental loading vars
|
|
135
|
-
let incremental =
|
|
178
|
+
let incremental = false;
|
|
136
179
|
|
|
137
180
|
// get resource counts
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
if (this.multipleResources.length) {
|
|
142
|
-
this.multipleResources.forEach((item) => {
|
|
143
|
-
resourceCount = resourceCount + this.__getCountForResource(item);
|
|
144
|
-
});
|
|
145
|
-
} else {
|
|
146
|
-
resourceCount = this.__getCountForResource(resourceName);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
181
|
+
const resourcesForCount = this.multipleResources.length ? this.multipleResources : [resourceName];
|
|
182
|
+
|
|
183
|
+
resourceCount = this.__getCountForResources(resourcesForCount, this.namespaceFilter, currStore);
|
|
149
184
|
|
|
150
185
|
// manual refresh check
|
|
151
186
|
if (manualDataRefreshEnabled && resourceCount >= manualDataRefreshThreshold) {
|
|
152
187
|
watch = false;
|
|
153
188
|
isTooManyItemsToAutoUpdate = true;
|
|
154
189
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
190
|
+
|
|
191
|
+
// incremental loading check
|
|
192
|
+
incremental = incrementalLoadingEnabled && incrementalLoadingThreshold > 0 && resourceCount >= incrementalLoadingThreshold;
|
|
159
193
|
|
|
160
194
|
// pass on the flag that controls the appearance of the manual refresh button on the sortable table
|
|
161
195
|
this.$store.dispatch('resource-fetch/updateIsTooManyItems', isTooManyItemsToAutoUpdate);
|