@rancher/shell 3.0.5-rc.5 → 3.0.5-rc.7
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/data/aws-regions.json +1 -0
- package/assets/images/key.svg +17 -0
- package/assets/styles/base/_spacing.scss +2 -2
- package/assets/styles/base/_variables.scss +17 -11
- package/assets/styles/global/_form.scss +1 -1
- package/assets/styles/global/_labeled-input.scss +1 -1
- package/assets/styles/themes/_dark.scss +5 -0
- package/assets/styles/themes/_light.scss +11 -2
- package/assets/styles/vendor/vue-select.scss +1 -1
- package/assets/translations/en-us.yaml +426 -64
- package/assets/translations/zh-hans.yaml +3 -4
- package/cloud-credential/gcp.vue +9 -1
- package/components/AppModal.vue +2 -0
- package/components/CodeMirror.vue +2 -2
- package/components/ConfigMapSettings/Settings.vue +377 -0
- package/components/ConfigMapSettings/index.vue +354 -0
- package/components/CruResource.vue +1 -2
- package/components/DetailText.vue +61 -11
- package/components/Drawer/Chrome.vue +115 -0
- package/components/Drawer/ResourceDetailDrawer/ConfigTab.vue +61 -0
- package/components/Drawer/ResourceDetailDrawer/YamlTab.vue +48 -0
- package/components/Drawer/ResourceDetailDrawer/__tests__/ConfigTab.test.ts +54 -0
- package/components/Drawer/ResourceDetailDrawer/__tests__/YamlTab.test.ts +80 -0
- package/components/Drawer/ResourceDetailDrawer/__tests__/composables.test.ts +106 -0
- package/components/Drawer/ResourceDetailDrawer/__tests__/helpers.test.ts +42 -0
- package/components/Drawer/ResourceDetailDrawer/composables.ts +53 -0
- package/components/Drawer/ResourceDetailDrawer/helpers.ts +10 -0
- package/components/Drawer/ResourceDetailDrawer/index.vue +111 -0
- package/components/GrowlManager.vue +16 -15
- package/components/IconOrSvg.vue +5 -0
- package/components/KeyValueView.vue +1 -1
- package/components/Loading.vue +1 -1
- package/components/LocaleSelector.vue +9 -1
- package/components/PaginatedResourceTable.vue +46 -1
- package/components/ProgressBarMulti.vue +1 -0
- package/components/PromptModal.vue +6 -1
- package/components/PromptRestore.vue +22 -44
- package/components/RelatedResources.vue +4 -12
- package/components/Resource/Detail/Additional.vue +46 -0
- package/components/Resource/Detail/Metadata/Annotations/__tests__/index.test.ts +1 -1
- package/components/Resource/Detail/Metadata/Annotations/index.vue +5 -0
- package/components/Resource/Detail/Metadata/IdentifyingInformation/__tests__/identifying-fields.test.ts +223 -0
- package/components/Resource/Detail/Metadata/IdentifyingInformation/composable.ts +47 -256
- package/components/Resource/Detail/Metadata/IdentifyingInformation/identifying-fields.ts +317 -0
- package/components/Resource/Detail/Metadata/IdentifyingInformation/index.vue +34 -5
- package/components/Resource/Detail/Metadata/KeyValue.vue +32 -22
- package/components/Resource/Detail/Metadata/Labels/__tests__/index.test.ts +1 -1
- package/components/Resource/Detail/Metadata/Labels/index.vue +4 -0
- package/components/Resource/Detail/Metadata/Rectangle.vue +3 -1
- package/components/Resource/Detail/Metadata/__tests__/KeyValue.test.ts +1 -1
- package/components/Resource/Detail/Metadata/__tests__/Rectangle.test.ts +1 -1
- package/components/Resource/Detail/Metadata/__tests__/composables.test.ts +75 -0
- package/components/Resource/Detail/Metadata/composables.ts +60 -11
- package/components/Resource/Detail/Metadata/index.vue +12 -5
- package/components/Resource/Detail/Page.vue +15 -0
- package/components/Resource/Detail/ResourceRow.vue +37 -18
- package/components/Resource/Detail/ResourceTabs/ConfigMapDataTab/__tests__/composables.test.ts +29 -0
- package/components/Resource/Detail/ResourceTabs/ConfigMapDataTab/__tests__/index.test.ts +48 -0
- package/components/Resource/Detail/ResourceTabs/ConfigMapDataTab/composables.ts +31 -0
- package/components/Resource/Detail/ResourceTabs/ConfigMapDataTab/index.vue +50 -0
- package/components/Resource/Detail/ResourceTabs/KnownHostsTab/__tests__/composables.test.ts +66 -0
- package/components/Resource/Detail/ResourceTabs/KnownHostsTab/composables.ts +21 -0
- package/components/Resource/Detail/ResourceTabs/KnownHostsTab/index.vue +31 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/Basic.vue +45 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/BasicAuth.vue +31 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/Certificate.vue +31 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/Registry.vue +22 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/ServiceAccountToken.vue +31 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/Ssh.vue +32 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/Basic.test.ts +40 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/BasicAuth.test.ts +33 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/Certificate.test.ts +33 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/Registry.test.ts +27 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/ServiceAccountToken.test.ts +33 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/Ssh.test.ts +33 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/auth-types.test.ts +186 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/__tests__/composables.test.ts +102 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/auth-types.ts +109 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/composeables.ts +52 -0
- package/components/Resource/Detail/ResourceTabs/SecretDataTab/index.vue +71 -0
- package/components/Resource/Detail/SpacedRow.vue +1 -1
- package/components/Resource/Detail/TitleBar/Title.vue +2 -1
- package/components/Resource/Detail/TitleBar/__tests__/Title.test.ts +1 -1
- package/components/Resource/Detail/TitleBar/__tests__/Top.test.ts +1 -1
- package/components/Resource/Detail/TitleBar/__tests__/composables.test.ts +63 -0
- package/components/Resource/Detail/TitleBar/__tests__/index.test.ts +1 -1
- package/components/Resource/Detail/TitleBar/composables.ts +45 -0
- package/components/Resource/Detail/TitleBar/index.vue +85 -13
- package/components/Resource/Detail/composables.ts +45 -0
- package/components/ResourceDetail/Masthead/__tests__/index.test.ts +70 -0
- package/components/ResourceDetail/{__tests__/Masthead.test.ts → Masthead/__tests__/legacy.test.ts} +3 -3
- package/components/ResourceDetail/Masthead/index.vue +65 -0
- package/components/ResourceDetail/Masthead/latest.vue +44 -0
- package/components/ResourceDetail/{Masthead.vue → Masthead/legacy.vue} +1 -1
- package/components/ResourceDetail/__tests__/index.test.ts +26 -5
- package/components/ResourceDetail/index.vue +33 -17
- package/components/ResourceDetail/legacy.vue +18 -1
- package/components/ResourceList/Masthead.vue +6 -0
- package/components/ResourceList/index.vue +1 -0
- package/components/ResourceTable.vue +6 -1
- package/components/ResourceYaml.vue +15 -2
- package/components/RichTranslation.vue +106 -0
- package/components/SlideInPanelManager.vue +46 -11
- package/components/SortableTable/index.vue +1 -1
- package/components/SortableTable/selection.js +0 -1
- package/components/StateDot/index.vue +28 -0
- package/components/Tabbed/index.vue +17 -16
- package/components/Wizard.vue +4 -2
- package/components/__tests__/ConfigMapSettings.test.ts +376 -0
- package/components/__tests__/GrowlManager.test.ts +0 -25
- package/components/__tests__/PromptRestore.test.ts +1 -65
- package/components/__tests__/RichTranslation.test.ts +115 -0
- package/components/auth/login/ldap.vue +1 -1
- package/components/fleet/FleetApplications.vue +0 -7
- package/components/fleet/FleetClusterTargets/TargetsList.vue +66 -0
- package/components/fleet/FleetClusterTargets/index.vue +455 -0
- package/components/fleet/FleetClusters.vue +25 -6
- package/components/fleet/FleetGitRepoPaths.vue +476 -0
- package/components/fleet/FleetHelmOps.vue +8 -0
- package/components/fleet/FleetRepos.vue +1 -6
- package/components/fleet/FleetResources.vue +4 -5
- package/components/fleet/FleetValuesFrom.vue +295 -0
- package/components/fleet/__tests__/FleetClusterTargets.test.ts +1224 -0
- package/components/fleet/__tests__/FleetGitRepoPaths.test.ts +265 -0
- package/components/fleet/__tests__/FleetOCIStorageSecret.test.ts +13 -13
- package/components/fleet/__tests__/FleetValuesFrom.test.ts +300 -0
- package/components/fleet/dashboard/ResourceCard.vue +1 -0
- package/components/fleet/dashboard/ResourceCardSummary.vue +1 -5
- package/components/fleet/dashboard/ResourceDetails.vue +8 -10
- package/components/fleet/dashboard/ResourcePanel.vue +17 -9
- package/components/form/ArrayList.vue +13 -2
- package/components/form/ChangePassword.vue +3 -1
- package/components/form/FileImageSelector.vue +1 -1
- package/components/form/Footer.vue +10 -4
- package/components/form/KeyValue.vue +81 -43
- package/components/form/LabeledSelect.vue +56 -16
- package/components/form/Labels.vue +90 -17
- package/components/form/MatchExpressions.vue +46 -5
- package/components/form/NameNsDescription.vue +2 -1
- package/components/form/Networking.vue +24 -19
- package/components/form/ResourceLabeledSelect.vue +4 -3
- package/components/form/ResourceSelector.vue +1 -0
- package/components/form/ResourceTabs/index.vue +5 -0
- package/components/form/SecretSelector.vue +9 -2
- package/components/form/Select.vue +57 -19
- package/components/form/SelectOrCreateAuthSecret.vue +6 -3
- package/components/form/SimpleSecretSelector.vue +9 -2
- package/components/form/Taints.vue +21 -2
- package/components/form/UnitInput.vue +8 -0
- package/components/form/ValueFromResource.vue +1 -1
- package/components/form/__tests__/LabeledSelect.test.ts +8 -4
- package/components/form/__tests__/Labels.test.ts +360 -0
- package/components/form/__tests__/MatchExpressions.test.ts +16 -13
- package/components/form/__tests__/Networking.test.ts +116 -0
- package/components/form/__tests__/Select.test.ts +5 -2
- package/components/formatter/FleetApplicationSource.vue +1 -1
- package/components/formatter/PodImages.vue +1 -1
- package/components/formatter/WorkloadHealthScale.vue +1 -1
- package/components/formatter/__tests__/LiveDate.test.ts +10 -2
- package/components/google/AccountAccess.vue +209 -0
- package/components/google/types/gcp.d.ts +136 -0
- package/components/google/types/index.d.ts +101 -0
- package/components/google/util/__mocks__/gcp.ts +465 -0
- package/components/google/util/formatter.ts +82 -0
- package/components/google/util/gcp.ts +134 -0
- package/components/google/util/index.d.ts +11 -0
- package/components/nav/Favorite.vue +1 -1
- package/components/nav/Group.vue +71 -45
- package/components/nav/Header.vue +5 -1
- package/components/nav/NamespaceFilter.vue +13 -1
- package/components/nav/NotificationCenter/Notification.vue +510 -0
- package/components/nav/NotificationCenter/NotificationHeader.vue +112 -0
- package/components/nav/NotificationCenter/index.vue +148 -0
- package/composables/drawer.ts +26 -0
- package/composables/resources.test.ts +63 -0
- package/composables/resources.ts +38 -0
- package/composables/useIsNewDetailPageEnabled.ts +17 -0
- package/config/labels-annotations.js +8 -0
- package/config/pagination-table-headers.js +8 -1
- package/config/product/auth.js +16 -1
- package/config/product/{cis.js → compliance.js} +23 -26
- package/config/product/explorer.js +32 -3
- package/config/product/fleet.js +7 -0
- package/config/product/manager.js +0 -1
- package/config/product/settings.js +22 -11
- package/config/query-params.js +13 -0
- package/config/roles.ts +1 -1
- package/config/router/navigation-guards/authentication.js +51 -2
- package/config/router/routes.js +47 -31
- package/config/settings.ts +21 -3
- package/config/store.js +2 -0
- package/config/system-namespaces.js +1 -1
- package/config/table-headers.js +32 -3
- package/config/types.js +16 -7
- package/config/version.js +1 -1
- package/core/plugin.ts +32 -7
- package/core/types.ts +18 -1
- package/detail/{cis.cattle.io.clusterscan.vue → compliance.cattle.io.clusterscan.vue} +22 -18
- package/detail/management.cattle.io.fleetworkspace.vue +18 -27
- package/detail/management.cattle.io.oidcclient.vue +369 -0
- package/detail/node.vue +2 -2
- package/detail/pod.vue +2 -2
- package/detail/provisioning.cattle.io.cluster.vue +3 -47
- package/detail/service.vue +10 -1
- package/detail/workload/index.vue +8 -2
- package/dialog/ExtensionCatalogUninstallDialog.vue +7 -4
- package/dialog/GenericPrompt.vue +1 -1
- package/dialog/ImportDialog.vue +8 -8
- package/dialog/OidcClientSecretDialog.vue +117 -0
- package/dialog/RotateEncryptionKeyDialog.vue +10 -30
- package/edit/__tests__/cis.cattle.io.clusterscan.test.ts +3 -3
- package/edit/__tests__/fleet.cattle.io.gitrepo.test.ts +5 -2
- package/edit/auth/ldap/__tests__/config.test.ts +14 -0
- package/edit/auth/ldap/config.vue +24 -0
- package/edit/autoscaling.horizontalpodautoscaler/index.vue +4 -1
- package/edit/{cis.cattle.io.clusterscan.vue → compliance.cattle.io.clusterscan.vue} +30 -31
- package/edit/{cis.cattle.io.clusterscanbenchmark.vue → compliance.cattle.io.clusterscanbenchmark.vue} +4 -4
- package/edit/{cis.cattle.io.clusterscanprofile.vue → compliance.cattle.io.clusterscanprofile.vue} +5 -5
- package/edit/configmap.vue +8 -2
- package/edit/constraints.gatekeeper.sh.constraint/index.vue +1 -0
- package/edit/fleet.cattle.io.gitrepo.vue +44 -222
- package/edit/fleet.cattle.io.helmop.vue +44 -269
- package/edit/helm.cattle.io.projecthelmchart.vue +1 -0
- package/edit/k8s.cni.cncf.io.networkattachmentdefinition.vue +1 -0
- package/edit/logging-flow/index.vue +1 -0
- package/edit/logging.banzaicloud.io.output/index.vue +1 -0
- package/edit/management.cattle.io.fleetworkspace.vue +1 -0
- package/edit/management.cattle.io.oidcclient.vue +162 -0
- package/edit/management.cattle.io.project.vue +4 -1
- package/edit/monitoring.coreos.com.alertmanagerconfig/index.vue +1 -1
- package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +5 -0
- package/edit/monitoring.coreos.com.prometheusrule/index.vue +1 -0
- package/edit/monitoring.coreos.com.receiver/auth.vue +30 -30
- package/edit/monitoring.coreos.com.receiver/index.vue +1 -0
- package/edit/monitoring.coreos.com.receiver/types/email.vue +1 -1
- package/edit/monitoring.coreos.com.route.vue +1 -0
- package/edit/namespace.vue +1 -0
- package/edit/networking.istio.io.destinationrule/index.vue +4 -1
- package/edit/networking.k8s.io.ingress/Certificate.vue +12 -12
- package/edit/networking.k8s.io.ingress/__tests__/Certificate.test.ts +165 -0
- package/edit/networking.k8s.io.ingress/index.vue +4 -1
- package/edit/networking.k8s.io.networkpolicy/PolicyRules.vue +7 -2
- package/edit/networking.k8s.io.networkpolicy/index.vue +6 -2
- package/edit/node.vue +1 -0
- package/edit/persistentvolume/index.vue +4 -1
- package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +3 -2
- package/edit/provisioning.cattle.io.cluster/rke2.vue +516 -426
- package/edit/provisioning.cattle.io.cluster/tabs/Basics.vue +48 -39
- package/edit/provisioning.cattle.io.cluster/tabs/MachinePool.vue +5 -0
- package/edit/provisioning.cattle.io.cluster/tabs/registries/RegistryConfigs.vue +2 -2
- package/edit/resources.cattle.io.restore.vue +1 -1
- package/edit/secret/basic.vue +1 -0
- package/edit/secret/index.vue +127 -15
- package/edit/service.vue +4 -1
- package/edit/serviceaccount.vue +4 -1
- package/edit/storage.k8s.io.storageclass/index.vue +4 -1
- package/edit/workload/index.vue +5 -0
- package/list/{cis.cattle.io.clusterscan.vue → compliance.cattle.io.clusterscan.vue} +2 -2
- package/list/management.cattle.io.oidcclient.vue +108 -0
- package/list/node.vue +2 -0
- package/list/projectsecret.vue +345 -0
- package/list/secret.vue +109 -0
- package/machine-config/amazonec2.vue +3 -24
- package/machine-config/components/GCEImage.vue +374 -0
- package/machine-config/google.vue +617 -0
- package/mixins/__tests__/brand.spec.ts +170 -0
- package/mixins/brand.js +16 -17
- package/mixins/create-edit-view/impl.js +10 -1
- package/mixins/create-edit-view/index.js +5 -0
- package/mixins/resource-fetch-api-pagination.js +24 -8
- package/mixins/resource-fetch.js +3 -1
- package/mixins/vue-select-overrides.js +1 -0
- package/models/cluster.x-k8s.io.machinedeployment.js +11 -2
- package/models/{cis.cattle.io.clusterscan.js → compliance.cattle.io.clusterscan.js} +8 -8
- package/models/{cis.cattle.io.clusterscanbenchmark.js → compliance.cattle.io.clusterscanbenchmark.js} +1 -1
- package/models/{cis.cattle.io.clusterscanprofile.js → compliance.cattle.io.clusterscanprofile.js} +5 -5
- package/models/{cis.cattle.io.clusterscanreport.js → compliance.cattle.io.clusterscanreport.js} +1 -1
- package/models/fleet-application.js +8 -79
- package/models/fleet.cattle.io.cluster.js +13 -2
- package/models/fleet.cattle.io.gitrepo.js +2 -2
- package/models/fleet.cattle.io.helmop.js +9 -39
- package/models/management.cattle.io.fleetworkspace.js +2 -1
- package/models/management.cattle.io.oidcclient.js +18 -0
- package/models/management.cattle.io.registration.js +3 -0
- package/models/provisioning.cattle.io.cluster.js +29 -33
- package/models/secret.js +157 -2
- package/models/service.js +4 -0
- package/models/workload.js +5 -0
- package/package.json +2 -2
- package/pages/about.vue +4 -58
- package/pages/auth/login.vue +1 -1
- package/pages/c/_cluster/apps/charts/AddRepoLink.vue +0 -1
- package/pages/c/_cluster/apps/charts/index.vue +296 -81
- package/pages/c/_cluster/auth/user.retention/index.vue +87 -78
- package/pages/c/_cluster/explorer/index.vue +3 -3
- package/pages/c/_cluster/explorer/projectsecret.vue +34 -0
- package/pages/c/_cluster/explorer/tools/pages/_page.vue +0 -1
- package/pages/c/_cluster/fleet/application/create.vue +3 -2
- package/pages/c/_cluster/fleet/index.vue +94 -57
- package/pages/c/_cluster/fleet/settings/index.vue +229 -0
- package/pages/c/_cluster/longhorn/index.vue +5 -2
- package/pages/c/_cluster/uiplugins/CatalogList/index.vue +16 -1
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +2 -2
- package/pages/explorer/resource/detail/configmap.vue +30 -7
- package/pages/explorer/resource/detail/projectsecret.vue +9 -0
- package/pages/explorer/resource/detail/secret.vue +63 -0
- package/pages/home.vue +9 -55
- package/pages/support/index.vue +4 -6
- package/plugins/dashboard-store/__tests__/normalize.test.ts +223 -0
- package/plugins/dashboard-store/__tests__/resource-class.test.ts +191 -0
- package/plugins/dashboard-store/__tests__/utils/normalize-usecases.ts +1526 -0
- package/plugins/dashboard-store/actions.js +19 -5
- package/plugins/dashboard-store/getters.js +4 -0
- package/plugins/dashboard-store/normalize.js +29 -17
- package/plugins/dashboard-store/resource-class.js +68 -19
- package/plugins/steve/steve-pagination-utils.ts +38 -19
- package/plugins/steve/subscribe.js +6 -1
- package/rancher-components/Banner/Banner.vue +13 -0
- package/rancher-components/Form/Checkbox/Checkbox.vue +9 -4
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +1 -1
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +1 -0
- package/rancher-components/RcItemCard/RcItemCard.vue +8 -3
- package/store/auth.js +2 -0
- package/store/catalog.js +23 -1
- package/store/growl.js +97 -8
- package/store/index.js +6 -0
- package/store/notifications.ts +426 -0
- package/store/prefs.js +0 -1
- package/store/type-map.js +19 -16
- package/store/uiplugins.ts +15 -1
- package/types/fleet.d.ts +24 -0
- package/types/kube/kube-api.ts +12 -0
- package/types/notifications/index.ts +74 -0
- package/types/shell/index.d.ts +661 -589
- package/types/store/dashboard-store.types.ts +16 -0
- package/types/store/pagination.types.ts +16 -6
- package/utils/__tests__/create-yaml.test.ts +235 -0
- package/utils/__tests__/fleet.test.ts +148 -0
- package/utils/__tests__/object.test.ts +54 -1
- package/utils/__tests__/string.test.ts +273 -1
- package/utils/__tests__/time.test.ts +31 -0
- package/utils/auth.js +9 -2
- package/utils/create-yaml.js +103 -9
- package/utils/crypto/encryption.ts +103 -0
- package/utils/cspAdaptor.ts +51 -0
- package/utils/fleet.ts +54 -65
- package/utils/object.js +36 -0
- package/utils/pagination-utils.ts +19 -1
- package/utils/release-notes.ts +48 -0
- package/utils/selector-typed.ts +7 -2
- package/utils/string.js +24 -0
- package/utils/{time.js → time.ts} +25 -6
- package/utils/uiplugins.ts +22 -0
- package/utils/validators/formRules/index.ts +3 -0
- package/components/Resource/Detail/TitleBar/composable.ts +0 -31
- package/config/product/legacy.js +0 -62
- package/models/etcdbackup.js +0 -45
- package/pages/c/_cluster/legacy/pages/_page.vue +0 -29
- package/pages/c/_cluster/legacy/project/_page.vue +0 -57
- package/pages/c/_cluster/legacy/project/index.vue +0 -32
- package/pages/c/_cluster/legacy/project/pipelines.vue +0 -96
|
@@ -1,6 +1,74 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { pickBy, omitBy, mapValues } from 'lodash';
|
|
3
|
+
import { matchesSomeRegex } from '@shell/utils/string';
|
|
4
|
+
import { LABELS_TO_IGNORE_REGEX, ANNOTATIONS_TO_IGNORE_REGEX } from '@shell/config/labels-annotations';
|
|
5
|
+
import KeyValue from '@shell/components/form/KeyValue.vue';
|
|
3
6
|
import { ToggleSwitch } from '@components/Form/ToggleSwitch';
|
|
7
|
+
import { _VIEW } from '@shell/config/query-params';
|
|
8
|
+
|
|
9
|
+
export class Factory {
|
|
10
|
+
private protectedKeys: string[] = [];
|
|
11
|
+
private protectedRegexes: RegExp[] = [];
|
|
12
|
+
private protectedWarning = '';
|
|
13
|
+
|
|
14
|
+
private isProtected(key: string) {
|
|
15
|
+
return this.protectedKeys.includes(key) || matchesSomeRegex(key, this.protectedRegexes);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
private omitProtected(obj: object) {
|
|
19
|
+
return omitBy(obj, (_, key) => this.isProtected(key));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
private pickProtected(obj: object) {
|
|
23
|
+
return pickBy(obj, (_, key) => this.isProtected(key));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
private keyErrorMap(elems: object) {
|
|
27
|
+
return mapValues(this.pickProtected(elems), () => this.protectedWarning);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
constructor(protectedKeys: string[], protectedRegexes: RegExp[], msg: string, initValue: object) {
|
|
31
|
+
// Init privates
|
|
32
|
+
this.protectedKeys = protectedKeys || [];
|
|
33
|
+
this.protectedRegexes = protectedRegexes || [];
|
|
34
|
+
this.protectedWarning = msg || '';
|
|
35
|
+
|
|
36
|
+
this.initValue = initValue || {};
|
|
37
|
+
this.value = this.omitProtected(this.initValue);
|
|
38
|
+
this.keyErrors = this.keyErrorMap(this.value);
|
|
39
|
+
this.hasProtectedKeys = Object.keys(this.pickProtected(this.initValue)).length > 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
initValue: object = {};
|
|
43
|
+
value: object = {};
|
|
44
|
+
keyErrors: object = {};
|
|
45
|
+
hasProtectedKeys = false;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Updates resource's model and discard new protected keys
|
|
49
|
+
* Old protected keys remain untouched on edit
|
|
50
|
+
*
|
|
51
|
+
* @param value edited labels/annotations
|
|
52
|
+
* @param callbackFn function to set model's labels/annotations
|
|
53
|
+
*/
|
|
54
|
+
update(value: Record<string, string>, callbackFn: (value: object) => void) {
|
|
55
|
+
const neu = value || {};
|
|
56
|
+
|
|
57
|
+
callbackFn({
|
|
58
|
+
...this.omitProtected(neu),
|
|
59
|
+
...this.pickProtected(this.initValue),
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
this.value = neu;
|
|
63
|
+
this.keyErrors = this.keyErrorMap(neu);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
interface DataType {
|
|
68
|
+
labels: Factory,
|
|
69
|
+
annotations: Factory,
|
|
70
|
+
toggler: boolean,
|
|
71
|
+
}
|
|
4
72
|
|
|
5
73
|
export default {
|
|
6
74
|
components: {
|
|
@@ -60,8 +128,14 @@ export default {
|
|
|
60
128
|
},
|
|
61
129
|
},
|
|
62
130
|
|
|
63
|
-
data() {
|
|
64
|
-
|
|
131
|
+
data(): DataType {
|
|
132
|
+
const protectedWarning = this.t('labels.protectedWarning');
|
|
133
|
+
|
|
134
|
+
return {
|
|
135
|
+
labels: new Factory(this.value.systemLabels, LABELS_TO_IGNORE_REGEX, protectedWarning, this.value.labels),
|
|
136
|
+
annotations: new Factory(this.value.systemAnnotations, ANNOTATIONS_TO_IGNORE_REGEX, protectedWarning, this.value.annotations),
|
|
137
|
+
toggler: false
|
|
138
|
+
};
|
|
65
139
|
},
|
|
66
140
|
|
|
67
141
|
computed: {
|
|
@@ -75,6 +149,10 @@ export default {
|
|
|
75
149
|
|
|
76
150
|
columnsClass() {
|
|
77
151
|
return `${ this.displaySideBySide ? 'col span-6' : 'row' }`.trim();
|
|
152
|
+
},
|
|
153
|
+
|
|
154
|
+
showToggler() {
|
|
155
|
+
return this.mode === _VIEW && (this.labels.hasProtectedKeys || this.annotations.hasProtectedKeys);
|
|
78
156
|
}
|
|
79
157
|
}
|
|
80
158
|
};
|
|
@@ -88,7 +166,7 @@ export default {
|
|
|
88
166
|
<t k="labels.labels.title" />
|
|
89
167
|
</h3>
|
|
90
168
|
<ToggleSwitch
|
|
91
|
-
v-if="
|
|
169
|
+
v-if="showToggler"
|
|
92
170
|
v-model:value="toggler"
|
|
93
171
|
name="label-system-toggle"
|
|
94
172
|
:on-label="t('labels.labels.show')"
|
|
@@ -98,21 +176,17 @@ export default {
|
|
|
98
176
|
<t k="labels.labels.description" />
|
|
99
177
|
</p>
|
|
100
178
|
<div :class="columnsClass">
|
|
101
|
-
<slot
|
|
102
|
-
name="labels"
|
|
103
|
-
:toggler="toggler"
|
|
104
|
-
>
|
|
179
|
+
<slot name="labels">
|
|
105
180
|
<KeyValue
|
|
106
181
|
key="labels"
|
|
107
|
-
:value="
|
|
108
|
-
:protected-keys="value.systemLabels || []"
|
|
109
|
-
:toggle-filter="toggler"
|
|
182
|
+
:value="toggler ? labels.initValue : labels.value"
|
|
110
183
|
:add-label="t('labels.addLabel')"
|
|
111
184
|
:add-icon="addIcon"
|
|
112
185
|
:mode="mode"
|
|
113
186
|
:read-allowed="false"
|
|
114
187
|
:value-can-be-empty="true"
|
|
115
|
-
|
|
188
|
+
:key-errors="labels.keyErrors"
|
|
189
|
+
@update:value="labels.update($event, (x) => value.setLabels(x))"
|
|
116
190
|
/>
|
|
117
191
|
</slot>
|
|
118
192
|
</div>
|
|
@@ -125,17 +199,16 @@ export default {
|
|
|
125
199
|
>
|
|
126
200
|
<KeyValue
|
|
127
201
|
key="annotations"
|
|
128
|
-
:value="
|
|
202
|
+
:value="toggler ? annotations.initValue : annotations.value"
|
|
129
203
|
:add-label="t('labels.addAnnotation')"
|
|
130
204
|
:add-icon="addIcon"
|
|
131
205
|
:mode="mode"
|
|
132
|
-
:protected-keys="value.systemAnnotations || []"
|
|
133
|
-
:toggle-filter="toggler"
|
|
134
206
|
:title="t('labels.annotations.title')"
|
|
135
207
|
:title-protip="annotationTitleTooltip"
|
|
136
208
|
:read-allowed="false"
|
|
137
209
|
:value-can-be-empty="true"
|
|
138
|
-
|
|
210
|
+
:key-errors="annotations.keyErrors"
|
|
211
|
+
@update:value="annotations.update($event, (x) => value.setAnnotations(x))"
|
|
139
212
|
/>
|
|
140
213
|
</div>
|
|
141
214
|
</div>
|
|
@@ -8,7 +8,7 @@ import { convert, simplify } from '@shell/utils/selector';
|
|
|
8
8
|
import LabeledSelect from '@shell/components/form/LabeledSelect';
|
|
9
9
|
|
|
10
10
|
export default {
|
|
11
|
-
emits: ['update:value', 'remove'],
|
|
11
|
+
emits: ['update:value', 'add', 'remove'],
|
|
12
12
|
|
|
13
13
|
components: { Select, LabeledSelect },
|
|
14
14
|
props: {
|
|
@@ -54,6 +54,26 @@ export default {
|
|
|
54
54
|
default: true
|
|
55
55
|
},
|
|
56
56
|
|
|
57
|
+
labelKey: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: '',
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
addLabel: {
|
|
63
|
+
type: String,
|
|
64
|
+
default: '',
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
addIcon: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: '',
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
addClass: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: '',
|
|
75
|
+
},
|
|
76
|
+
|
|
57
77
|
// whether or not to show remove rule button right side of the rule
|
|
58
78
|
showRemoveButton: {
|
|
59
79
|
type: Boolean,
|
|
@@ -146,6 +166,10 @@ export default {
|
|
|
146
166
|
return this.mode === 'view';
|
|
147
167
|
},
|
|
148
168
|
|
|
169
|
+
_addLabel() {
|
|
170
|
+
return this.addLabel || this.t('workload.scheduling.affinity.matchExpressions.addRule');
|
|
171
|
+
},
|
|
172
|
+
|
|
149
173
|
node() {
|
|
150
174
|
return NODE;
|
|
151
175
|
},
|
|
@@ -212,6 +236,12 @@ export default {
|
|
|
212
236
|
}
|
|
213
237
|
|
|
214
238
|
this.rules.push(newRule);
|
|
239
|
+
|
|
240
|
+
this.$nextTick(() => {
|
|
241
|
+
this.focus(this.rules.length - 1);
|
|
242
|
+
|
|
243
|
+
this.$emit('add');
|
|
244
|
+
});
|
|
215
245
|
},
|
|
216
246
|
|
|
217
247
|
update() {
|
|
@@ -245,6 +275,10 @@ export default {
|
|
|
245
275
|
this.$emit('update:value', simplify(out));
|
|
246
276
|
}
|
|
247
277
|
});
|
|
278
|
+
},
|
|
279
|
+
|
|
280
|
+
focus(index = 0) {
|
|
281
|
+
this.$refs[`input-match-expression-key-${ index }`]?.[0]?.focus();
|
|
248
282
|
}
|
|
249
283
|
}
|
|
250
284
|
};
|
|
@@ -274,7 +308,7 @@ export default {
|
|
|
274
308
|
{{ t('workload.scheduling.affinity.matchExpressions.matchType') }}
|
|
275
309
|
</label>
|
|
276
310
|
<label>
|
|
277
|
-
{{ t('workload.scheduling.affinity.matchExpressions.key') }}
|
|
311
|
+
{{ labelKey || t('workload.scheduling.affinity.matchExpressions.key') }}
|
|
278
312
|
</label>
|
|
279
313
|
<label>
|
|
280
314
|
{{ t('workload.scheduling.affinity.matchExpressions.operator') }}
|
|
@@ -315,6 +349,7 @@ export default {
|
|
|
315
349
|
</div>
|
|
316
350
|
<input
|
|
317
351
|
v-else-if="!hasKeySelectOptions"
|
|
352
|
+
:ref="`input-match-expression-key-${index}`"
|
|
318
353
|
v-model="row.key"
|
|
319
354
|
:mode="mode"
|
|
320
355
|
:data-testid="`input-match-expression-key-control-${index}`"
|
|
@@ -322,6 +357,7 @@ export default {
|
|
|
322
357
|
>
|
|
323
358
|
<LabeledSelect
|
|
324
359
|
v-else
|
|
360
|
+
:ref="`input-match-expression-key-${index}`"
|
|
325
361
|
v-model:value="row.key"
|
|
326
362
|
:mode="mode"
|
|
327
363
|
:options="keysSelectOptions"
|
|
@@ -389,15 +425,20 @@ export default {
|
|
|
389
425
|
</div>
|
|
390
426
|
<div
|
|
391
427
|
v-if="!isView && showAddButton"
|
|
392
|
-
class="
|
|
428
|
+
class="mmt-4"
|
|
393
429
|
>
|
|
394
430
|
<button
|
|
395
431
|
type="button"
|
|
396
432
|
class="btn role-tertiary add"
|
|
397
|
-
:
|
|
433
|
+
:class="[addClass]"
|
|
434
|
+
data-testid="input-match-expression-add-rule"
|
|
398
435
|
@click="addRule"
|
|
399
436
|
>
|
|
400
|
-
<
|
|
437
|
+
<i
|
|
438
|
+
v-if="addIcon"
|
|
439
|
+
class="mr-5 icon"
|
|
440
|
+
:class="[addIcon]"
|
|
441
|
+
/> {{ _addLabel }}
|
|
401
442
|
</button>
|
|
402
443
|
</div>
|
|
403
444
|
</div>
|
|
@@ -319,7 +319,7 @@ export default {
|
|
|
319
319
|
}
|
|
320
320
|
|
|
321
321
|
if (props.descriptionKey) {
|
|
322
|
-
description.value = get(v, props.descriptionKey);
|
|
322
|
+
description.value = get(v.value, props.descriptionKey);
|
|
323
323
|
} else {
|
|
324
324
|
description.value = metadata?.annotations?.[DESCRIPTION];
|
|
325
325
|
}
|
|
@@ -429,6 +429,7 @@ export default {
|
|
|
429
429
|
|
|
430
430
|
<template>
|
|
431
431
|
<div class="row mb-20">
|
|
432
|
+
<slot name="project-selector" />
|
|
432
433
|
<div
|
|
433
434
|
v-if="namespaced && !nameNsHidden && createNamespace"
|
|
434
435
|
:data-testid="componentTestid + '-namespace-create'"
|
|
@@ -31,28 +31,23 @@ export default {
|
|
|
31
31
|
const t = this.$store.getters['i18n/t'];
|
|
32
32
|
|
|
33
33
|
return {
|
|
34
|
-
dnsPolicy:
|
|
35
|
-
networkMode:
|
|
36
|
-
|
|
37
|
-
nameservers:
|
|
38
|
-
searches:
|
|
39
|
-
hostname:
|
|
40
|
-
subdomain:
|
|
41
|
-
options:
|
|
34
|
+
dnsPolicy: this.value.dnsPolicy || 'ClusterFirst',
|
|
35
|
+
networkMode: this.value.hostNetwork ? { label: t('workload.networking.networkMode.options.hostNetwork'), value: true } : { label: t('workload.networking.networkMode.options.normal'), value: false },
|
|
36
|
+
tmpHostAliases: [],
|
|
37
|
+
nameservers: null,
|
|
38
|
+
searches: null,
|
|
39
|
+
hostname: null,
|
|
40
|
+
subdomain: null,
|
|
41
|
+
options: null,
|
|
42
42
|
};
|
|
43
43
|
},
|
|
44
44
|
|
|
45
45
|
created() {
|
|
46
|
-
const hostAliases =
|
|
47
|
-
return {
|
|
48
|
-
ip: entry.ip,
|
|
49
|
-
hostnames: entry.hostnames.join(', ')
|
|
50
|
-
};
|
|
51
|
-
});
|
|
46
|
+
const hostAliases = this.value.hostAliases || [];
|
|
52
47
|
const { dnsConfig = {}, hostname, subdomain } = this.value;
|
|
53
48
|
const { nameservers, searches, options } = dnsConfig;
|
|
54
49
|
|
|
55
|
-
this.
|
|
50
|
+
this.tmpHostAliases = hostAliases;
|
|
56
51
|
this.nameservers = nameservers;
|
|
57
52
|
this.searches = searches;
|
|
58
53
|
this.hostname = hostname;
|
|
@@ -89,6 +84,15 @@ export default {
|
|
|
89
84
|
];
|
|
90
85
|
},
|
|
91
86
|
|
|
87
|
+
hostAliases() {
|
|
88
|
+
return (this.value.hostAliases || []).map((entry) => {
|
|
89
|
+
return {
|
|
90
|
+
ip: entry.ip,
|
|
91
|
+
hostnames: entry.hostnames?.join(', ') ?? ''
|
|
92
|
+
};
|
|
93
|
+
});
|
|
94
|
+
},
|
|
95
|
+
|
|
92
96
|
...mapGetters({ t: 'i18n/t' })
|
|
93
97
|
},
|
|
94
98
|
|
|
@@ -121,12 +125,12 @@ export default {
|
|
|
121
125
|
|
|
122
126
|
methods: {
|
|
123
127
|
updateHostAliases(neu) {
|
|
124
|
-
this.
|
|
128
|
+
this.tmpHostAliases = neu.map((entry) => {
|
|
125
129
|
const ip = entry.ip.trim();
|
|
126
130
|
const hostnames = entry.hostnames.trim().split(/[\s,]+/).filter((x) => !!x);
|
|
127
131
|
|
|
128
132
|
return { ip, hostnames };
|
|
129
|
-
})
|
|
133
|
+
});
|
|
130
134
|
this.update();
|
|
131
135
|
},
|
|
132
136
|
|
|
@@ -142,7 +146,7 @@ export default {
|
|
|
142
146
|
dnsConfig,
|
|
143
147
|
dnsPolicy: this.dnsPolicy,
|
|
144
148
|
hostname: this.hostname,
|
|
145
|
-
hostAliases: this.
|
|
149
|
+
hostAliases: this.tmpHostAliases,
|
|
146
150
|
subdomain: this.subdomain,
|
|
147
151
|
hostNetwork: this.networkMode.value
|
|
148
152
|
};
|
|
@@ -256,7 +260,8 @@ export default {
|
|
|
256
260
|
<div class="col span-12">
|
|
257
261
|
<KeyValue
|
|
258
262
|
key="hostAliases"
|
|
259
|
-
|
|
263
|
+
data-test="hostAliases"
|
|
264
|
+
:value="hostAliases"
|
|
260
265
|
:mode="mode"
|
|
261
266
|
:title="t('workload.networking.hostAliases.label')"
|
|
262
267
|
:protip="t('workload.networking.hostAliases.tip')"
|
|
@@ -127,9 +127,10 @@ export default defineComponent({
|
|
|
127
127
|
const defaultOptions: LabelSelectPaginationFunctionOptions = {
|
|
128
128
|
opts,
|
|
129
129
|
filters,
|
|
130
|
-
type:
|
|
131
|
-
ctx:
|
|
132
|
-
sort:
|
|
130
|
+
type: this.resourceType,
|
|
131
|
+
ctx: { getters: this.$store.getters, dispatch: this.$store.dispatch },
|
|
132
|
+
sort: [{ asc: true, field: 'metadata.name' }],
|
|
133
|
+
store: this.inStore
|
|
133
134
|
};
|
|
134
135
|
const options = this.paginatedResourceSettings?.requestSettings ? this.paginatedResourceSettings.requestSettings(defaultOptions) : defaultOptions;
|
|
135
136
|
const res = await labelSelectPaginationFunction(options);
|
|
@@ -68,6 +68,10 @@ export default {
|
|
|
68
68
|
extensionParams: {
|
|
69
69
|
type: Object,
|
|
70
70
|
default: null
|
|
71
|
+
},
|
|
72
|
+
useHash: {
|
|
73
|
+
type: Boolean,
|
|
74
|
+
default: true
|
|
71
75
|
}
|
|
72
76
|
},
|
|
73
77
|
|
|
@@ -233,6 +237,7 @@ export default {
|
|
|
233
237
|
v-bind="$attrs"
|
|
234
238
|
:default-tab="defaultTab"
|
|
235
239
|
:resource="value"
|
|
240
|
+
:use-hash="useHash"
|
|
236
241
|
@changed="tabChange"
|
|
237
242
|
>
|
|
238
243
|
<slot />
|
|
@@ -173,11 +173,18 @@ export default {
|
|
|
173
173
|
paginatePageOptions(opts) {
|
|
174
174
|
const { opts: { filter } } = opts;
|
|
175
175
|
|
|
176
|
-
const filters = !!filter ? [PaginationParamFilter.createSingleField({
|
|
176
|
+
const filters = !!filter ? [PaginationParamFilter.createSingleField({
|
|
177
|
+
field: 'metadata.name', value: filter, exact: false, equals: true
|
|
178
|
+
})] : [];
|
|
177
179
|
|
|
178
180
|
filters.push(
|
|
179
181
|
PaginationParamFilter.createSingleField({ field: 'metadata.namespace', value: this.namespace }),
|
|
180
|
-
PaginationParamFilter.
|
|
182
|
+
PaginationParamFilter.createMultipleFields(this.types.map((t) => ({
|
|
183
|
+
field: 'metadata.fields.1',
|
|
184
|
+
equals: true,
|
|
185
|
+
exact: true,
|
|
186
|
+
value: t
|
|
187
|
+
})))
|
|
181
188
|
);
|
|
182
189
|
|
|
183
190
|
return {
|
|
@@ -5,6 +5,9 @@ import VueSelectOverrides from '@shell/mixins/vue-select-overrides';
|
|
|
5
5
|
import { generateRandomAlphaString } from '@shell/utils/string';
|
|
6
6
|
import { LabeledTooltip } from '@components/LabeledTooltip';
|
|
7
7
|
import { onClickOption, calculatePosition } from '@shell/utils/select';
|
|
8
|
+
import { _VIEW } from '@shell/config/query-params';
|
|
9
|
+
import { useClickOutside } from '@shell/composables/useClickOutside';
|
|
10
|
+
import { ref } from 'vue';
|
|
8
11
|
|
|
9
12
|
export default {
|
|
10
13
|
emits: ['update:value', 'createdListItem', 'on-open', 'on-close'],
|
|
@@ -81,7 +84,7 @@ export default {
|
|
|
81
84
|
},
|
|
82
85
|
closeOnSelect: {
|
|
83
86
|
type: Boolean,
|
|
84
|
-
default: true
|
|
87
|
+
default: true,
|
|
85
88
|
},
|
|
86
89
|
|
|
87
90
|
compact: {
|
|
@@ -93,11 +96,18 @@ export default {
|
|
|
93
96
|
default: false
|
|
94
97
|
}
|
|
95
98
|
},
|
|
99
|
+
setup() {
|
|
100
|
+
const select = ref(null);
|
|
101
|
+
const isOpen = ref(false);
|
|
102
|
+
|
|
103
|
+
useClickOutside(select, () => {
|
|
104
|
+
isOpen.value = false;
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
return { isOpen, select };
|
|
108
|
+
},
|
|
96
109
|
data() {
|
|
97
|
-
return {
|
|
98
|
-
isOpen: false,
|
|
99
|
-
generatedUid: `s-uid-${ generateRandomAlphaString(12) }`
|
|
100
|
-
};
|
|
110
|
+
return { generatedUid: `s-uid-${ generateRandomAlphaString(12) }` };
|
|
101
111
|
},
|
|
102
112
|
methods: {
|
|
103
113
|
// resizeHandler = in mixin
|
|
@@ -124,16 +134,20 @@ export default {
|
|
|
124
134
|
calculatePosition(dropdownList, component, width, this.placement);
|
|
125
135
|
},
|
|
126
136
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
if (!this.isSearchable || (searchBox && document.activeElement && !searchBox.contains(document.activeElement))) {
|
|
132
|
-
ev.preventDefault();
|
|
137
|
+
// Ensure we only focus on open, otherwise we re-open on close
|
|
138
|
+
clickSelect(ev) {
|
|
139
|
+
if (this.mode === _VIEW || this.loading === true || this.disabled === true) {
|
|
140
|
+
return;
|
|
133
141
|
}
|
|
134
142
|
|
|
135
|
-
this
|
|
143
|
+
this.isOpen = !this.isOpen;
|
|
136
144
|
|
|
145
|
+
if (this.isOpen) {
|
|
146
|
+
this.focusSearch(ev);
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
|
|
150
|
+
focusSearch() {
|
|
137
151
|
this.$nextTick(() => {
|
|
138
152
|
const el = this.$refs['select-input']?.searchEl;
|
|
139
153
|
|
|
@@ -143,6 +157,10 @@ export default {
|
|
|
143
157
|
});
|
|
144
158
|
},
|
|
145
159
|
|
|
160
|
+
focusWrapper() {
|
|
161
|
+
this.$refs.select.focus();
|
|
162
|
+
},
|
|
163
|
+
|
|
146
164
|
get,
|
|
147
165
|
|
|
148
166
|
onClickOption(option, event) {
|
|
@@ -195,19 +213,36 @@ export default {
|
|
|
195
213
|
},
|
|
196
214
|
|
|
197
215
|
handleDropdownOpen(args) {
|
|
216
|
+
if (!this.isOpen) {
|
|
217
|
+
return false;
|
|
218
|
+
}
|
|
219
|
+
|
|
198
220
|
// function that prevents the "opening dropdown on focus"
|
|
199
221
|
// default behaviour of v-select
|
|
200
222
|
return args.noDrop || args.disabled ? false : args.open;
|
|
201
223
|
},
|
|
202
224
|
onOpen() {
|
|
203
|
-
this.
|
|
225
|
+
this.focusSearch();
|
|
204
226
|
this.$emit('on-open');
|
|
205
227
|
this.resizeHandler();
|
|
206
228
|
},
|
|
207
229
|
|
|
208
|
-
|
|
230
|
+
closeOnSelecting() {
|
|
231
|
+
if (!this.closeOnSelect) {
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
this.close();
|
|
236
|
+
},
|
|
237
|
+
|
|
238
|
+
close() {
|
|
209
239
|
this.isOpen = false;
|
|
240
|
+
this.onClose();
|
|
241
|
+
},
|
|
242
|
+
|
|
243
|
+
onClose() {
|
|
210
244
|
this.$emit('on-close');
|
|
245
|
+
this.focusWrapper();
|
|
211
246
|
},
|
|
212
247
|
},
|
|
213
248
|
computed: {
|
|
@@ -272,11 +307,12 @@ export default {
|
|
|
272
307
|
role="combobox"
|
|
273
308
|
:aria-expanded="isOpen"
|
|
274
309
|
:aria-label="$attrs['aria-label'] || undefined"
|
|
310
|
+
:aria-labelledby="$attrs['aria-labelledby'] || undefined"
|
|
275
311
|
:aria-describedby="$attrs['aria-describedby'] || undefined"
|
|
276
|
-
@click="
|
|
277
|
-
@keydown.enter="
|
|
278
|
-
@keydown.down.prevent="
|
|
279
|
-
@keydown.space="
|
|
312
|
+
@click="clickSelect"
|
|
313
|
+
@keydown.self.enter="clickSelect"
|
|
314
|
+
@keydown.self.down.prevent="clickSelect"
|
|
315
|
+
@keydown.self.space.prevent="clickSelect"
|
|
280
316
|
>
|
|
281
317
|
<v-select
|
|
282
318
|
ref="select-input"
|
|
@@ -291,7 +327,7 @@ export default {
|
|
|
291
327
|
:get-option-label="(opt) => getOptionLabel(opt)"
|
|
292
328
|
:label="optionLabel"
|
|
293
329
|
:options="options"
|
|
294
|
-
:close-on-select="
|
|
330
|
+
:close-on-select="false"
|
|
295
331
|
:map-keydown="mappedKeys"
|
|
296
332
|
:placeholder="placeholder"
|
|
297
333
|
:reduce="(x) => reduce(x)"
|
|
@@ -309,6 +345,8 @@ export default {
|
|
|
309
345
|
@open="onOpen"
|
|
310
346
|
@close="onClose"
|
|
311
347
|
@option:created="(e) => $emit('createdListItem', e)"
|
|
348
|
+
@option:selecting="closeOnSelecting"
|
|
349
|
+
@option:selected="closeOnSelect && close"
|
|
312
350
|
@keydown.enter.stop
|
|
313
351
|
>
|
|
314
352
|
<template
|
|
@@ -237,7 +237,7 @@ export default {
|
|
|
237
237
|
let filteredSecrets = [];
|
|
238
238
|
|
|
239
239
|
if (this.allSecrets) {
|
|
240
|
-
//
|
|
240
|
+
// Filter secrets given their namespace and required secret type
|
|
241
241
|
filteredSecrets = this.allSecrets
|
|
242
242
|
.filter((x) => this.filterByNamespace ? x.metadata.namespace === this.namespace : true
|
|
243
243
|
)
|
|
@@ -450,6 +450,7 @@ export default {
|
|
|
450
450
|
),
|
|
451
451
|
],
|
|
452
452
|
}),
|
|
453
|
+
watch: this.cacheSecrets,
|
|
453
454
|
};
|
|
454
455
|
|
|
455
456
|
if (this.cacheSecrets) {
|
|
@@ -464,9 +465,11 @@ export default {
|
|
|
464
465
|
null,
|
|
465
466
|
findPageArgs
|
|
466
467
|
);
|
|
467
|
-
|
|
468
|
+
// Strictly speaking this could be any store (request action should be agnostic)
|
|
469
|
+
const res = await this.$store.dispatch(`${ this.inStore }/request`, { url });
|
|
468
470
|
|
|
469
|
-
|
|
471
|
+
// Classify
|
|
472
|
+
return await this.$store.dispatch(`${ this.inStore }/createMany`, res?.data || []);
|
|
470
473
|
},
|
|
471
474
|
|
|
472
475
|
updateKeyVal() {
|
|
@@ -156,11 +156,18 @@ export default {
|
|
|
156
156
|
paginatePageOptions(opts) {
|
|
157
157
|
const { opts: { filter } } = opts;
|
|
158
158
|
|
|
159
|
-
const filters = !!filter ? [PaginationParamFilter.createSingleField({
|
|
159
|
+
const filters = !!filter ? [PaginationParamFilter.createSingleField({
|
|
160
|
+
field: 'metadata.name', value: filter, exact: false, equals: true
|
|
161
|
+
})] : [];
|
|
160
162
|
|
|
161
163
|
filters.push(
|
|
162
164
|
PaginationParamFilter.createSingleField({ field: 'metadata.namespace', value: this.namespace }),
|
|
163
|
-
PaginationParamFilter.
|
|
165
|
+
PaginationParamFilter.createMultipleFields(this.types.map((t) => ({
|
|
166
|
+
field: 'metadata.fields.1',
|
|
167
|
+
equals: true,
|
|
168
|
+
exact: true,
|
|
169
|
+
value: t
|
|
170
|
+
})))
|
|
164
171
|
);
|
|
165
172
|
|
|
166
173
|
return {
|