@rancher/shell 3.0.5-rc.3 → 3.0.5-rc.6
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/icons/document.svg +3 -0
- package/assets/images/key.svg +17 -0
- package/assets/images/vendor/cognito.svg +1 -0
- package/assets/styles/app.scss +1 -0
- package/assets/styles/base/_basic.scss +10 -0
- package/assets/styles/base/_spacing.scss +29 -0
- package/assets/styles/global/_form.scss +1 -1
- package/assets/styles/global/_labeled-input.scss +1 -1
- package/assets/styles/global/_layout.scss +1 -1
- package/assets/styles/themes/_dark.scss +28 -0
- package/assets/styles/themes/_light.scss +68 -0
- package/assets/styles/vendor/vue-select.scss +1 -1
- package/assets/translations/en-us.yaml +721 -83
- package/assets/translations/zh-hans.yaml +11 -9
- package/cloud-credential/gcp.vue +9 -1
- package/components/AppModal.vue +2 -0
- package/components/Certificates.vue +5 -0
- package/components/CodeMirror.vue +1 -1
- 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 +116 -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 +82 -0
- package/components/Drawer/ResourceDetailDrawer/__tests__/helpers.test.ts +42 -0
- package/components/Drawer/ResourceDetailDrawer/composables.ts +50 -0
- package/components/Drawer/ResourceDetailDrawer/helpers.ts +10 -0
- package/components/Drawer/ResourceDetailDrawer/index.vue +110 -0
- package/components/FilterPanel.vue +156 -0
- package/components/{fleet/ForceDirectedTreeChart/index.vue → ForceDirectedTreeChart.vue} +47 -41
- package/components/GrowlManager.vue +16 -15
- package/components/IconOrSvg.vue +19 -35
- package/components/KeyValueView.vue +1 -1
- package/components/LocaleSelector.vue +9 -1
- package/components/ProgressBarMulti.vue +1 -0
- package/components/PromptModal.vue +6 -1
- package/components/PromptRemove.vue +5 -1
- package/components/RelatedResources.vue +4 -12
- package/components/Resource/Detail/Additional.vue +46 -0
- package/components/Resource/Detail/Card/PodsCard/Bubble.vue +13 -0
- package/components/Resource/Detail/Card/PodsCard/composable.ts +30 -0
- package/components/Resource/Detail/Card/PodsCard/index.vue +118 -0
- package/components/Resource/Detail/Card/ResourceUsageCard/composable.ts +51 -0
- package/components/Resource/Detail/Card/ResourceUsageCard/index.vue +79 -0
- package/components/Resource/Detail/Card/Scaler.vue +89 -0
- package/components/Resource/Detail/Card/StateCard/composables.ts +112 -0
- package/components/Resource/Detail/Card/StateCard/index.vue +39 -0
- package/components/Resource/Detail/Card/VerticalGap.vue +11 -0
- package/components/Resource/Detail/Card/__tests__/Card.test.ts +36 -0
- package/components/Resource/Detail/Card/__tests__/PodsCard.test.ts +84 -0
- package/components/Resource/Detail/Card/__tests__/ResourceUsageCard.test.ts +72 -0
- package/components/Resource/Detail/Card/__tests__/Scaler.test.ts +87 -0
- package/components/Resource/Detail/Card/__tests__/StateCard.test.ts +53 -0
- package/components/Resource/Detail/Card/__tests__/VerticalGap.test.ts +14 -0
- package/components/Resource/Detail/Card/__tests__/index.test.ts +36 -0
- package/components/Resource/Detail/Card/index.vue +56 -0
- package/components/Resource/Detail/Metadata/Annotations/__tests__/index.test.ts +19 -0
- package/components/Resource/Detail/Metadata/Annotations/composable.ts +12 -0
- package/components/Resource/Detail/Metadata/Annotations/index.vue +31 -0
- package/components/Resource/Detail/Metadata/IdentifyingInformation/__tests__/identifying-fields.test.ts +223 -0
- package/components/Resource/Detail/Metadata/IdentifyingInformation/__tests__/index.test.ts +103 -0
- package/components/Resource/Detail/Metadata/IdentifyingInformation/composable.ts +64 -0
- package/components/Resource/Detail/Metadata/IdentifyingInformation/identifying-fields.ts +298 -0
- package/components/Resource/Detail/Metadata/IdentifyingInformation/index.vue +133 -0
- package/components/Resource/Detail/Metadata/KeyValue.vue +138 -0
- package/components/Resource/Detail/Metadata/Labels/__tests__/index.test.ts +18 -0
- package/components/Resource/Detail/Metadata/Labels/composable.ts +12 -0
- package/components/Resource/Detail/Metadata/Labels/index.vue +31 -0
- package/components/Resource/Detail/Metadata/Rectangle.vue +32 -0
- package/components/Resource/Detail/Metadata/__tests__/KeyValue.test.ts +107 -0
- package/components/Resource/Detail/Metadata/__tests__/Rectangle.test.ts +24 -0
- package/components/Resource/Detail/Metadata/__tests__/composables.test.ts +75 -0
- package/components/Resource/Detail/Metadata/__tests__/index.test.ts +91 -0
- package/components/Resource/Detail/Metadata/composables.ts +78 -0
- package/components/Resource/Detail/Metadata/index.vue +73 -0
- package/components/Resource/Detail/Page.vue +37 -0
- package/components/Resource/Detail/PercentageBar.vue +40 -0
- package/components/Resource/Detail/ResourceRow.vue +138 -0
- 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 +14 -0
- package/components/Resource/Detail/StatusBar.vue +59 -0
- package/components/Resource/Detail/StatusRow.vue +61 -0
- package/components/Resource/Detail/TitleBar/Title.vue +14 -0
- package/components/Resource/Detail/TitleBar/Top.vue +14 -0
- package/components/Resource/Detail/TitleBar/__tests__/Title.test.ts +17 -0
- package/components/Resource/Detail/TitleBar/__tests__/Top.test.ts +17 -0
- package/components/Resource/Detail/TitleBar/__tests__/composables.test.ts +63 -0
- package/components/Resource/Detail/TitleBar/__tests__/index.test.ts +142 -0
- package/components/Resource/Detail/TitleBar/composables.ts +44 -0
- package/components/Resource/Detail/TitleBar/index.vue +196 -0
- package/components/Resource/Detail/Top/index.vue +34 -0
- package/components/Resource/Detail/__tests__/Page.test.ts +32 -0
- 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/__tests__/index.test.ts +135 -0
- package/components/ResourceDetail/index.vue +73 -557
- package/components/ResourceDetail/legacy.vue +562 -0
- package/components/ResourceList/Masthead.vue +6 -0
- package/components/ResourceTable.vue +41 -7
- package/components/ResourceYaml.vue +14 -1
- package/components/SlideInPanelManager.vue +117 -10
- package/components/SortableTable/index.vue +13 -2
- package/components/SortableTable/selection.js +21 -8
- package/components/StateDot/index.vue +28 -0
- package/components/StatusBadge.vue +6 -4
- package/components/SubtleLink.vue +25 -0
- package/components/Tabbed/index.vue +11 -15
- package/components/Wizard.vue +16 -3
- package/components/YamlEditor.vue +1 -1
- package/components/__tests__/ConfigMapSettings.test.ts +376 -0
- package/components/__tests__/FilterPanel.test.ts +81 -0
- package/components/__tests__/GrowlManager.test.ts +0 -25
- package/components/auth/AuthBanner.vue +2 -3
- package/components/auth/RoleDetailEdit.vue +45 -3
- package/components/auth/login/ldap.vue +1 -1
- package/components/auth/login/oidc.vue +6 -1
- package/components/fleet/FleetApplications.vue +174 -0
- 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 +123 -0
- package/components/fleet/FleetIntro.vue +58 -28
- package/components/fleet/FleetNoWorkspaces.vue +5 -1
- package/components/fleet/FleetOCIStorageSecret.vue +171 -0
- package/components/fleet/FleetRepos.vue +37 -80
- package/components/fleet/FleetResources.vue +53 -26
- package/components/fleet/FleetSummary.vue +26 -51
- 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 +213 -0
- package/components/fleet/__tests__/FleetSummary.test.ts +39 -39
- package/components/fleet/__tests__/FleetValuesFrom.test.ts +300 -0
- package/components/fleet/dashboard/Empty.vue +73 -0
- package/components/fleet/dashboard/ResourceCard.vue +184 -0
- package/components/fleet/dashboard/ResourceCardSummary.vue +195 -0
- package/components/fleet/dashboard/ResourceDetails.vue +194 -0
- package/components/fleet/dashboard/ResourcePanel.vue +383 -0
- package/components/form/ArrayList.vue +19 -2
- package/components/form/ChangePassword.vue +3 -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 +1 -1
- 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/SimpleSecretSelector.vue +17 -4
- package/components/form/Taints.vue +21 -2
- package/components/form/UnitInput.vue +8 -0
- package/components/form/ValueFromResource.vue +31 -19
- 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__/Select.test.ts +5 -2
- package/components/formatter/FleetApplicationClustersReady.vue +77 -0
- package/components/formatter/FleetApplicationSource.vue +71 -0
- package/components/formatter/FleetSummaryGraph.vue +7 -0
- package/components/formatter/WorkloadHealthScale.vue +1 -1
- package/components/google/AccountAccess.vue +211 -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 +70 -47
- package/components/nav/Header.vue +13 -8
- 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/components/nav/TopLevelMenu.helper.ts +55 -34
- package/components/nav/TopLevelMenu.vue +11 -0
- package/components/nav/Type.vue +4 -1
- package/composables/drawer.ts +26 -0
- package/composables/resources.test.ts +63 -0
- package/composables/resources.ts +38 -0
- package/composables/useI18n.ts +12 -11
- package/composables/useIsNewDetailPageEnabled.ts +17 -0
- package/config/labels-annotations.js +20 -11
- package/config/product/auth.js +17 -1
- package/config/product/{cis.js → compliance.js} +23 -26
- package/config/product/explorer.js +5 -1
- package/config/product/fleet.js +77 -17
- package/config/product/settings.js +22 -11
- package/config/query-params.js +6 -1
- package/config/roles.ts +2 -1
- package/config/router/navigation-guards/authentication.js +51 -2
- package/config/router/routes.js +45 -31
- package/config/secret.ts +15 -0
- package/config/settings.ts +24 -5
- package/config/store.js +2 -0
- package/config/system-namespaces.js +1 -1
- package/config/table-headers.js +53 -23
- package/config/types.js +17 -6
- package/core/plugin-helpers.ts +3 -2
- 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/fleet.cattle.io.cluster.vue +28 -15
- package/detail/fleet.cattle.io.gitrepo.vue +10 -1
- package/detail/fleet.cattle.io.helmop.vue +157 -0
- 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/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/HelmOpForceUpdateDialog.vue +132 -0
- package/dialog/ImportDialog.vue +8 -8
- package/dialog/OidcClientSecretDialog.vue +117 -0
- package/dialog/RedeployWorkloadDialog.vue +164 -0
- package/edit/__tests__/cis.cattle.io.clusterscan.test.ts +3 -3
- package/edit/__tests__/fleet.cattle.io.gitrepo.test.ts +60 -68
- package/edit/auth/oidc.vue +159 -93
- 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 +4 -1
- package/edit/constraints.gatekeeper.sh.constraint/index.vue +1 -0
- package/edit/fleet.cattle.io.gitrepo.vue +70 -255
- package/edit/fleet.cattle.io.helmop.vue +772 -0
- 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 +44 -10
- 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/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/rke2.vue +418 -382
- package/edit/provisioning.cattle.io.cluster/tabs/Basics.vue +27 -27
- package/edit/provisioning.cattle.io.cluster/tabs/MachinePool.vue +5 -0
- package/edit/resources.cattle.io.restore.vue +1 -1
- package/edit/secret/index.vue +1 -0
- 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/fleet.cattle.io.gitrepo.vue +1 -1
- package/list/fleet.cattle.io.helmop.vue +108 -0
- package/list/management.cattle.io.oidcclient.vue +108 -0
- package/list/namespace.vue +5 -2
- package/list/node.vue +2 -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/auth-config.js +8 -1
- package/mixins/brand.js +16 -17
- package/mixins/create-edit-view/index.js +5 -0
- package/mixins/preset.js +100 -0
- package/mixins/resource-fetch-api-pagination.js +18 -0
- package/mixins/resource-fetch.js +1 -1
- package/mixins/resource-table-watch.js +45 -0
- package/mixins/vue-select-overrides.js +1 -0
- package/models/__tests__/chart.test.ts +273 -0
- package/models/__tests__/fleet.cattle.io.gitrepo.test.ts +1 -1
- package/models/chart.js +144 -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 +314 -0
- package/models/fleet.cattle.io.bundle.js +9 -8
- package/models/fleet.cattle.io.cluster.js +11 -0
- package/models/fleet.cattle.io.gitrepo.js +41 -365
- package/models/fleet.cattle.io.helmop.js +198 -0
- package/models/management.cattle.io.authconfig.js +1 -0
- package/models/management.cattle.io.fleetworkspace.js +14 -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 +5 -5
- package/models/service.js +4 -0
- package/models/workload.js +19 -18
- package/package.json +2 -1
- package/pages/about.vue +4 -58
- package/pages/auth/login.vue +1 -1
- package/pages/auth/verify.vue +13 -1
- package/pages/c/_cluster/apps/charts/AddRepoLink.vue +36 -0
- package/pages/c/_cluster/apps/charts/AppChartCardFooter.vue +80 -0
- package/pages/c/_cluster/apps/charts/AppChartCardSubHeader.vue +54 -0
- package/pages/c/_cluster/apps/charts/StatusLabel.vue +33 -0
- package/pages/c/_cluster/apps/charts/index.vue +487 -465
- package/pages/c/_cluster/auth/user.retention/index.vue +87 -78
- package/pages/c/_cluster/explorer/EventsTable.vue +1 -1
- package/pages/c/_cluster/explorer/index.vue +3 -3
- package/pages/c/_cluster/explorer/tools/pages/_page.vue +0 -1
- package/pages/c/_cluster/fleet/__tests__/index.test.ts +426 -0
- package/pages/c/_cluster/fleet/application/_resource/_id.vue +14 -0
- package/pages/c/_cluster/fleet/application/_resource/create.vue +14 -0
- package/pages/c/_cluster/fleet/application/create.vue +341 -0
- package/pages/c/_cluster/fleet/application/index.vue +139 -0
- package/pages/c/_cluster/fleet/graph/config.js +277 -0
- package/pages/c/_cluster/fleet/index.vue +809 -329
- 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 +42 -0
- package/pages/explorer/resource/detail/secret.vue +50 -0
- package/pages/home.vue +9 -55
- package/pages/support/index.vue +4 -6
- package/plugins/dashboard-store/actions.js +50 -14
- package/plugins/dashboard-store/getters.js +38 -21
- package/plugins/dashboard-store/mutations.js +51 -7
- package/plugins/dashboard-store/resource-class.js +30 -4
- package/plugins/steve/__tests__/subscribe.spec.ts +66 -1
- package/plugins/steve/actions.js +3 -0
- package/plugins/steve/steve-pagination-utils.ts +17 -8
- package/plugins/steve/subscribe.js +235 -43
- package/rancher-components/BadgeState/BadgeState.vue +3 -1
- package/rancher-components/Banner/Banner.vue +13 -0
- package/rancher-components/Form/Checkbox/Checkbox.vue +11 -6
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +1 -1
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +1 -0
- package/rancher-components/RcItemCard/RcItemCard.test.ts +189 -0
- package/rancher-components/RcItemCard/RcItemCard.vue +430 -0
- package/rancher-components/RcItemCard/RcItemCardAction.vue +24 -0
- package/rancher-components/RcItemCard/index.ts +2 -0
- package/store/auth.js +3 -0
- package/store/catalog.js +85 -25
- package/store/growl.js +97 -8
- package/store/index.js +39 -14
- package/store/notifications.ts +426 -0
- package/store/prefs.js +0 -1
- package/store/slideInPanel.ts +6 -0
- package/store/type-map.js +19 -15
- package/store/uiplugins.ts +15 -1
- package/types/fleet.d.ts +59 -0
- package/types/notifications/index.ts +74 -0
- package/types/resources/settings.d.ts +19 -1
- package/types/shell/index.d.ts +388 -307
- package/types/store/dashboard-store.types.ts +33 -3
- package/types/store/pagination.types.ts +6 -1
- package/types/store/subscribe.types.ts +50 -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 +41 -5
- package/utils/crypto/encryption.ts +103 -0
- package/utils/cspAdaptor.ts +51 -0
- package/utils/fleet-types.ts +0 -0
- package/utils/fleet.ts +190 -2
- package/utils/object.js +36 -0
- package/utils/pagination-utils.ts +27 -2
- package/utils/pagination-wrapper.ts +132 -50
- package/utils/release-notes.ts +48 -0
- package/utils/selector-typed.ts +7 -2
- package/utils/settings.ts +4 -1
- package/utils/string.js +24 -0
- package/utils/style.ts +39 -0
- package/utils/{time.js → time.ts} +25 -6
- package/utils/uiplugins.ts +22 -0
- package/utils/validators/formRules/__tests__/index.test.ts +36 -3
- package/utils/validators/formRules/index.ts +13 -3
- package/utils/window.js +11 -7
- package/components/__tests__/ApplicationCard.test.ts +0 -27
- package/components/cards/ApplicationCard.vue +0 -145
- package/components/fleet/ForceDirectedTreeChart/chartIcons.js +0 -17
- package/config/product/legacy.js +0 -62
- package/config/secret.js +0 -14
- package/pages/c/_cluster/fleet/GitRepoGraphConfig.js +0 -249
- 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
- /package/components/ResourceDetail/{Masthead.vue → Masthead/legacy.vue} +0 -0
- /package/{components/form/SSHKnownHosts → dialog}/__tests__/KnownHostsEditDialog.test.ts +0 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { useI18n } from '@shell/composables/useI18n';
|
|
3
|
+
import { _VIEW } from '@shell/config/query-params';
|
|
4
|
+
import { useStore } from 'vuex';
|
|
5
|
+
import Tab from '@shell/components/Tabbed/Tab.vue';
|
|
6
|
+
import { useTemplateRef } from 'vue';
|
|
7
|
+
import ResourceYaml from '@shell/components/ResourceYaml.vue';
|
|
8
|
+
|
|
9
|
+
export interface Props {
|
|
10
|
+
resource: any;
|
|
11
|
+
yaml: string;
|
|
12
|
+
}
|
|
13
|
+
</script>
|
|
14
|
+
<script setup lang="ts">
|
|
15
|
+
const props = defineProps<Props>();
|
|
16
|
+
const store = useStore();
|
|
17
|
+
const i18n = useI18n(store);
|
|
18
|
+
const yamlComponent: any = useTemplateRef('yaml');
|
|
19
|
+
</script>
|
|
20
|
+
<template>
|
|
21
|
+
<Tab
|
|
22
|
+
class="yaml-tab"
|
|
23
|
+
name="yaml-tab"
|
|
24
|
+
:label="i18n.t('component.drawer.resourceDetailDrawer.yamlTab.title')"
|
|
25
|
+
@active="() => yamlComponent?.refresh()"
|
|
26
|
+
>
|
|
27
|
+
<ResourceYaml
|
|
28
|
+
ref="yaml"
|
|
29
|
+
:value="props.resource"
|
|
30
|
+
:yaml="props.yaml"
|
|
31
|
+
:mode="_VIEW"
|
|
32
|
+
/>
|
|
33
|
+
</Tab>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<style lang="scss" scoped>
|
|
37
|
+
.yaml-tab {
|
|
38
|
+
:deep() .codemirror-container {
|
|
39
|
+
background-color: var(--body-bg);
|
|
40
|
+
border-radius: var(--border-radius-md);
|
|
41
|
+
padding: 16px;
|
|
42
|
+
|
|
43
|
+
.CodeMirror, .CodeMirror-gutter {
|
|
44
|
+
background-color: var(--body-bg);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
</style>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { mount } from '@vue/test-utils';
|
|
2
|
+
import ConfigTab from '@shell/components/Drawer/ResourceDetailDrawer/ConfigTab.vue';
|
|
3
|
+
import { createStore } from 'vuex';
|
|
4
|
+
import { defineComponent, markRaw } from 'vue';
|
|
5
|
+
import Tab from '@shell/components/Tabbed/Tab.vue';
|
|
6
|
+
import { _VIEW } from '@shell/config/query-params';
|
|
7
|
+
|
|
8
|
+
const DynamicComponent = defineComponent({
|
|
9
|
+
template: '<div>DynamicComponent</div>',
|
|
10
|
+
props: {
|
|
11
|
+
value: { type: Object, required: true },
|
|
12
|
+
mode: { type: String, required: true },
|
|
13
|
+
initialValue: { type: Object, required: true },
|
|
14
|
+
useTabbedHash: { type: Boolean, required: true }
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
describe('component: ResourceDetailDrawer/ConfigTab', () => {
|
|
19
|
+
const resource = { resource: 'RESOURCE' };
|
|
20
|
+
const global = {
|
|
21
|
+
provide: {
|
|
22
|
+
addTab: jest.fn(), removeTab: jest.fn(), sideTabs: false, store: createStore({})
|
|
23
|
+
},
|
|
24
|
+
directives: { 'clean-tooltip': jest.fn() }
|
|
25
|
+
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
it('should render container with config-tab class and correct label and name', async() => {
|
|
29
|
+
const wrapper = mount(ConfigTab, {
|
|
30
|
+
props: { resource, component: markRaw(DynamicComponent) },
|
|
31
|
+
global
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const component = wrapper.getComponent(Tab);
|
|
35
|
+
|
|
36
|
+
expect(wrapper.classes().includes('config-tab')).toBeTruthy();
|
|
37
|
+
expect(component.props('label')).toStrictEqual('component.drawer.resourceDetailDrawer.configTab.title');
|
|
38
|
+
expect(component.props('name')).toStrictEqual('config-tab');
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('should render a dynamic component within the .container and pass the correct props', () => {
|
|
42
|
+
const wrapper = mount(ConfigTab, {
|
|
43
|
+
props: { resource, component: markRaw(DynamicComponent) },
|
|
44
|
+
global
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const component = wrapper.find('.container').getComponent(DynamicComponent);
|
|
48
|
+
|
|
49
|
+
expect(component.props('value')).toStrictEqual(resource);
|
|
50
|
+
expect(component.props('mode')).toStrictEqual(_VIEW);
|
|
51
|
+
expect(component.props('initialValue')).toStrictEqual(resource);
|
|
52
|
+
expect(component.props('useTabbedHash')).toStrictEqual(false);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { mount } from '@vue/test-utils';
|
|
2
|
+
import YamlTab from '@shell/components/Drawer/ResourceDetailDrawer/YamlTab.vue';
|
|
3
|
+
import { createStore } from 'vuex';
|
|
4
|
+
|
|
5
|
+
import Tab from '@shell/components/Tabbed/Tab.vue';
|
|
6
|
+
import { _VIEW } from '@shell/config/query-params';
|
|
7
|
+
import ResourceYaml from '@shell/components/ResourceYaml.vue';
|
|
8
|
+
import { nextTick } from 'vue';
|
|
9
|
+
|
|
10
|
+
jest.mock('@shell/components/ResourceYaml.vue', () => ({
|
|
11
|
+
template: `<div>ResourceYaml</div>`,
|
|
12
|
+
props: {
|
|
13
|
+
value: {
|
|
14
|
+
type: Object,
|
|
15
|
+
required: true
|
|
16
|
+
},
|
|
17
|
+
yaml: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: true
|
|
20
|
+
},
|
|
21
|
+
mode: {
|
|
22
|
+
type: String,
|
|
23
|
+
required: true
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
methods: { refresh: jest.fn() }
|
|
27
|
+
}));
|
|
28
|
+
|
|
29
|
+
describe('component: ResourceDetailDrawer/ConfigTab', () => {
|
|
30
|
+
const resource = { resource: 'RESOURCE' };
|
|
31
|
+
const yaml = 'YAML';
|
|
32
|
+
const global = {
|
|
33
|
+
provide: {
|
|
34
|
+
addTab: jest.fn(), removeTab: jest.fn(), sideTabs: false, store: createStore({})
|
|
35
|
+
},
|
|
36
|
+
directives: { 'clean-tooltip': jest.fn() }
|
|
37
|
+
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
it('should render container with yaml-tab class and correct label and name', async() => {
|
|
41
|
+
const wrapper = mount(YamlTab, {
|
|
42
|
+
props: { resource, yaml },
|
|
43
|
+
global
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const component = wrapper.getComponent(Tab);
|
|
47
|
+
|
|
48
|
+
expect(wrapper.classes().includes('yaml-tab')).toBeTruthy();
|
|
49
|
+
expect(component.props('label')).toStrictEqual('component.drawer.resourceDetailDrawer.yamlTab.title');
|
|
50
|
+
expect(component.props('name')).toStrictEqual('yaml-tab');
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('should render a ResourceYaml component and pass the correct props', () => {
|
|
54
|
+
const wrapper = mount(YamlTab, {
|
|
55
|
+
props: { resource, yaml },
|
|
56
|
+
global
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const component = wrapper.getComponent(ResourceYaml);
|
|
60
|
+
|
|
61
|
+
expect(component.props('value')).toStrictEqual(resource);
|
|
62
|
+
expect(component.props('yaml')).toStrictEqual(yaml);
|
|
63
|
+
expect(component.props('mode')).toStrictEqual(_VIEW);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('should refresh yaml editor when tab is activated, without it the editor will not resize', async() => {
|
|
67
|
+
const wrapper = mount(YamlTab, {
|
|
68
|
+
props: { resource, yaml },
|
|
69
|
+
global
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
const tabComponent = wrapper.getComponent(Tab);
|
|
73
|
+
|
|
74
|
+
expect(ResourceYaml.methods?.refresh).toHaveBeenCalledTimes(0);
|
|
75
|
+
tabComponent.vm.$emit('active');
|
|
76
|
+
await nextTick();
|
|
77
|
+
|
|
78
|
+
expect(ResourceYaml.methods?.refresh).toHaveBeenCalledTimes(1);
|
|
79
|
+
});
|
|
80
|
+
});
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { useDefaultConfigTabProps, useDefaultYamlTabProps, useResourceDetailDrawer } from '@shell/components/Drawer/ResourceDetailDrawer/composables';
|
|
2
|
+
import * as helpers from '@shell/components/Drawer/ResourceDetailDrawer/helpers';
|
|
3
|
+
import * as vuex from 'vuex';
|
|
4
|
+
import * as drawer from '@shell/composables/drawer';
|
|
5
|
+
|
|
6
|
+
jest.mock('@shell/components/Drawer/ResourceDetailDrawer/helpers');
|
|
7
|
+
jest.mock('vuex');
|
|
8
|
+
jest.mock('@shell/composables/drawer');
|
|
9
|
+
jest.mock('@shell/components/Drawer/ResourceDetailDrawer/index.vue', () => ({ name: 'ResourceDetailDrawer' } as any));
|
|
10
|
+
|
|
11
|
+
describe('composables: ResourceDetailDrawer', () => {
|
|
12
|
+
const resource = { type: 'RESOURCE' };
|
|
13
|
+
const yaml = 'YAML';
|
|
14
|
+
|
|
15
|
+
describe('useDefaultYamlTabProps', () => {
|
|
16
|
+
it('should return the appropriate values based on input', async() => {
|
|
17
|
+
const getYamlSpy = jest.spyOn(helpers, 'getYaml').mockImplementation(() => Promise.resolve(yaml));
|
|
18
|
+
const props = await useDefaultYamlTabProps(resource);
|
|
19
|
+
|
|
20
|
+
expect(getYamlSpy).toHaveBeenCalledWith(resource);
|
|
21
|
+
expect(props.yaml).toStrictEqual(yaml);
|
|
22
|
+
expect(props.resource).toStrictEqual(resource);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
describe('useDefaultConfigTabProps', () => {
|
|
27
|
+
const hasCustomEdit = jest.fn();
|
|
28
|
+
const importEdit = jest.fn();
|
|
29
|
+
const editComponent = { component: 'EDIT_COMPONENT' };
|
|
30
|
+
const store: any = {
|
|
31
|
+
getters: {
|
|
32
|
+
'type-map/hasCustomEdit': hasCustomEdit,
|
|
33
|
+
'type-map/importEdit': importEdit
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
it('should return undefined if it does not have a customEdit', async() => {
|
|
38
|
+
jest.spyOn(vuex, 'useStore').mockImplementation(() => store);
|
|
39
|
+
const hasCustomEditSpy = hasCustomEdit.mockImplementation(() => false);
|
|
40
|
+
const props = useDefaultConfigTabProps(resource);
|
|
41
|
+
|
|
42
|
+
expect(hasCustomEditSpy).toHaveBeenCalledWith(resource.type);
|
|
43
|
+
expect(props).toBeUndefined();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('should return props if it has a customEdit', async() => {
|
|
47
|
+
jest.spyOn(vuex, 'useStore').mockImplementation(() => store);
|
|
48
|
+
const hasCustomEditSpy = hasCustomEdit.mockImplementation(() => true);
|
|
49
|
+
const importEditSpy = importEdit.mockImplementation(() => editComponent);
|
|
50
|
+
const props = useDefaultConfigTabProps(resource);
|
|
51
|
+
|
|
52
|
+
expect(hasCustomEditSpy).toHaveBeenCalledWith(resource.type);
|
|
53
|
+
expect(importEditSpy).toHaveBeenCalledWith(resource.type);
|
|
54
|
+
expect(props?.component).toStrictEqual(editComponent);
|
|
55
|
+
expect(props?.resource).toStrictEqual(resource);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
describe('useResourceDetailDrawer', () => {
|
|
60
|
+
it('should create a wrapper that passes that appropriate properties to the drawer methods', () => {
|
|
61
|
+
const openSpy = jest.fn();
|
|
62
|
+
const closeSpy = jest.fn();
|
|
63
|
+
const selector = '.selector';
|
|
64
|
+
const useDrawerSpy = jest.spyOn(drawer, 'useDrawer').mockImplementation(() => ({ open: openSpy, close: closeSpy }));
|
|
65
|
+
const resourceDetailDrawer = useResourceDetailDrawer();
|
|
66
|
+
|
|
67
|
+
resourceDetailDrawer.openResourceDetailDrawer(resource, selector);
|
|
68
|
+
|
|
69
|
+
expect(useDrawerSpy).toHaveBeenCalledTimes(1);
|
|
70
|
+
expect(openSpy).toHaveBeenCalledWith({ name: 'ResourceDetailDrawer' }, selector, {
|
|
71
|
+
resource,
|
|
72
|
+
onClose: closeSpy,
|
|
73
|
+
width: '73%',
|
|
74
|
+
// We want this to be full viewport height top to bottom
|
|
75
|
+
height: '100vh',
|
|
76
|
+
top: '0',
|
|
77
|
+
'z-index': 101, // We want this to be above the main side menu
|
|
78
|
+
closeOnRouteChange: ['name', 'params', 'query']
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { getYaml } from '@shell/components/Drawer/ResourceDetailDrawer/helpers';
|
|
2
|
+
|
|
3
|
+
describe('helpers: ResourceDetailDrawer', () => {
|
|
4
|
+
describe('getYaml', () => {
|
|
5
|
+
const resource = {
|
|
6
|
+
hasLink: jest.fn(),
|
|
7
|
+
followLink: jest.fn(),
|
|
8
|
+
cleanForDownload: jest.fn()
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const yaml = 'YAML';
|
|
12
|
+
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
jest.clearAllMocks();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('should skip following a link if it does not have a view link', async() => {
|
|
18
|
+
resource.hasLink.mockImplementation(() => false);
|
|
19
|
+
resource.cleanForDownload.mockImplementation(() => yaml);
|
|
20
|
+
|
|
21
|
+
const response = await getYaml(resource);
|
|
22
|
+
|
|
23
|
+
expect(resource.hasLink).toHaveBeenCalledWith('view');
|
|
24
|
+
expect(resource.followLink).toHaveBeenCalledTimes(0);
|
|
25
|
+
expect(resource.cleanForDownload).toHaveBeenCalledWith(undefined);
|
|
26
|
+
expect(response).toStrictEqual(yaml);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('should follow link if it has a view link', async() => {
|
|
30
|
+
resource.hasLink.mockImplementation(() => true);
|
|
31
|
+
resource.followLink.mockImplementation(() => Promise.resolve({ data: yaml }));
|
|
32
|
+
resource.cleanForDownload.mockImplementation(() => yaml);
|
|
33
|
+
|
|
34
|
+
const response = await getYaml(resource);
|
|
35
|
+
|
|
36
|
+
expect(resource.hasLink).toHaveBeenCalledWith('view');
|
|
37
|
+
expect(resource.followLink).toHaveBeenCalledWith('view', { headers: { accept: 'application/yaml' } });
|
|
38
|
+
expect(resource.cleanForDownload).toHaveBeenCalledWith(yaml);
|
|
39
|
+
expect(response).toStrictEqual(yaml);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import ResourceDetailDrawer from '@shell/components/Drawer/ResourceDetailDrawer/index.vue';
|
|
2
|
+
import { Props as YamlTabProps } from '@shell/components/Drawer/ResourceDetailDrawer/YamlTab.vue';
|
|
3
|
+
import { Props as ConfigTabProps } from '@shell/components/Drawer/ResourceDetailDrawer/ConfigTab.vue';
|
|
4
|
+
import { useStore } from 'vuex';
|
|
5
|
+
import { useDrawer } from '@shell/composables/drawer';
|
|
6
|
+
import { getYaml } from '@shell/components/Drawer/ResourceDetailDrawer/helpers';
|
|
7
|
+
|
|
8
|
+
export function useResourceDetailDrawer() {
|
|
9
|
+
const { open, close } = useDrawer();
|
|
10
|
+
|
|
11
|
+
const openResourceDetailDrawer = (resource: any, returnFocusSelector: string) => {
|
|
12
|
+
open(ResourceDetailDrawer,
|
|
13
|
+
returnFocusSelector,
|
|
14
|
+
{
|
|
15
|
+
resource,
|
|
16
|
+
onClose: close,
|
|
17
|
+
width: '73%',
|
|
18
|
+
// We want this to be full viewport height top to bottom
|
|
19
|
+
height: '100vh',
|
|
20
|
+
top: '0',
|
|
21
|
+
'z-index': 101, // We want this to be above the main side menu
|
|
22
|
+
closeOnRouteChange: ['name', 'params', 'query'] // We want to ignore hash changes, tables in extensions can trigger the drawer to close while opening
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return { openResourceDetailDrawer };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export async function useDefaultYamlTabProps(resource: any): Promise<YamlTabProps> {
|
|
30
|
+
const yaml = await getYaml(resource);
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
resource,
|
|
34
|
+
yaml
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function useDefaultConfigTabProps(resource: any): ConfigTabProps | undefined {
|
|
39
|
+
const store = useStore();
|
|
40
|
+
|
|
41
|
+
if (!store.getters['type-map/hasCustomEdit'](resource.type)) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
resource,
|
|
47
|
+
component: store.getters['type-map/importEdit'](resource.type),
|
|
48
|
+
resourceType: resource.type
|
|
49
|
+
};
|
|
50
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export async function getYaml(resource: any): Promise<string> {
|
|
2
|
+
let yaml;
|
|
3
|
+
const opt = { headers: { accept: 'application/yaml' } };
|
|
4
|
+
|
|
5
|
+
if (resource.hasLink('view')) {
|
|
6
|
+
yaml = (await resource.followLink('view', opt)).data;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
return resource.cleanForDownload(yaml);
|
|
10
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Drawer from '@shell/components/Drawer/Chrome.vue';
|
|
3
|
+
import { useI18n } from '@shell/composables/useI18n';
|
|
4
|
+
import { useStore } from 'vuex';
|
|
5
|
+
import Tabbed from '@shell/components/Tabbed/index.vue';
|
|
6
|
+
import YamlTab, { Props as YamlProps } from '@shell/components/Drawer/ResourceDetailDrawer/YamlTab.vue';
|
|
7
|
+
import { useDefaultConfigTabProps, useDefaultYamlTabProps } from '@shell/components/Drawer/ResourceDetailDrawer/composables';
|
|
8
|
+
import ConfigTab from '@shell/components/Drawer/ResourceDetailDrawer/ConfigTab.vue';
|
|
9
|
+
import { computed, ref } from 'vue';
|
|
10
|
+
import RcButton from '@components/RcButton/RcButton.vue';
|
|
11
|
+
import StateDot from '@shell/components/StateDot/index.vue';
|
|
12
|
+
|
|
13
|
+
export interface Props {
|
|
14
|
+
resource: any;
|
|
15
|
+
|
|
16
|
+
onClose?: () => void;
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
const props = defineProps<Props>();
|
|
21
|
+
const emit = defineEmits(['close']);
|
|
22
|
+
const store = useStore();
|
|
23
|
+
const i18n = useI18n(store);
|
|
24
|
+
|
|
25
|
+
const yamlTabProps = ref<YamlProps | null>(null);
|
|
26
|
+
const configTabProps = useDefaultConfigTabProps(props.resource);
|
|
27
|
+
|
|
28
|
+
useDefaultYamlTabProps(props.resource).then((props) => {
|
|
29
|
+
yamlTabProps.value = props;
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const title = computed(() => {
|
|
33
|
+
const resourceType = store.getters['type-map/labelFor']({ id: props.resource.type });
|
|
34
|
+
const resourceName = props.resource.nameDisplay;
|
|
35
|
+
|
|
36
|
+
return i18n.t('component.drawer.resourceDetailDrawer.title', { resourceType, resourceName });
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const activeTab = ref<string>(configTabProps ? 'config-tab' : 'yaml-tab');
|
|
40
|
+
|
|
41
|
+
const action = computed(() => {
|
|
42
|
+
const isConfig = activeTab.value === 'config-tab';
|
|
43
|
+
const ariaLabel = isConfig ? i18n.t('component.drawer.resourceDetailDrawer.ariaLabel.editConfig') : i18n.t('component.drawer.resourceDetailDrawer.ariaLabel.editYaml');
|
|
44
|
+
const label = isConfig ? i18n.t('component.drawer.resourceDetailDrawer.ariaLabel.editConfig') : i18n.t('component.drawer.resourceDetailDrawer.ariaLabel.editYaml');
|
|
45
|
+
const action = isConfig ? () => props.resource.goToEdit() : () => props.resource.goToEditYaml();
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
ariaLabel,
|
|
49
|
+
label,
|
|
50
|
+
action
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
</script>
|
|
54
|
+
<template>
|
|
55
|
+
<Drawer
|
|
56
|
+
class="resource-detail-drawer"
|
|
57
|
+
:ariaTarget="title"
|
|
58
|
+
@close="emit('close')"
|
|
59
|
+
>
|
|
60
|
+
<template #title>
|
|
61
|
+
<StateDot
|
|
62
|
+
:color="resource.stateSimpleColor"
|
|
63
|
+
class="mmr-3"
|
|
64
|
+
/>
|
|
65
|
+
{{ title }}
|
|
66
|
+
</template>
|
|
67
|
+
<template #body>
|
|
68
|
+
<Tabbed
|
|
69
|
+
class="tabbed"
|
|
70
|
+
:useHash="false"
|
|
71
|
+
@changed="({selectedName}) => {activeTab = selectedName;}"
|
|
72
|
+
>
|
|
73
|
+
<ConfigTab
|
|
74
|
+
v-if="configTabProps"
|
|
75
|
+
v-bind="configTabProps"
|
|
76
|
+
/>
|
|
77
|
+
<YamlTab
|
|
78
|
+
v-if="yamlTabProps"
|
|
79
|
+
v-bind="yamlTabProps"
|
|
80
|
+
/>
|
|
81
|
+
</Tabbed>
|
|
82
|
+
</template>
|
|
83
|
+
<template #additional-actions>
|
|
84
|
+
<RcButton
|
|
85
|
+
:primary="true"
|
|
86
|
+
:aria-label="action.ariaLabel"
|
|
87
|
+
@click="action.action"
|
|
88
|
+
>
|
|
89
|
+
{{ action.label }}
|
|
90
|
+
</RcButton>
|
|
91
|
+
</template>
|
|
92
|
+
</Drawer>
|
|
93
|
+
</template>
|
|
94
|
+
|
|
95
|
+
<style lang="scss" scoped>
|
|
96
|
+
.resource-detail-drawer {
|
|
97
|
+
:deep() .tabbed {
|
|
98
|
+
& > .tabs {
|
|
99
|
+
border: none;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
& > .tab-container {
|
|
103
|
+
border: none;
|
|
104
|
+
border-top: 1px solid var(--border);
|
|
105
|
+
padding: 0;
|
|
106
|
+
padding-top: 24px;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
</style>
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { DefineComponent } from 'vue';
|
|
3
|
+
import Checkbox from '@components/Form/Checkbox/Checkbox.vue';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Generic type for the passed components as props
|
|
7
|
+
*/
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
|
+
type ComponentType = DefineComponent<any, any, any>;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A single filter option for a group (e.g., a single checkbox).
|
|
13
|
+
*/
|
|
14
|
+
type FilterOption = {
|
|
15
|
+
/** Value to apply when selected */
|
|
16
|
+
value?: string;
|
|
17
|
+
/** Optional custom component to render for this option (e.g., link or button) */
|
|
18
|
+
component?: ComponentType;
|
|
19
|
+
/** Props passed to the custom component */
|
|
20
|
+
componentProps?: Record<string, unknown>;
|
|
21
|
+
/** Label to show next to the checkbox, or a custom component next to the checkbox */
|
|
22
|
+
label?: string | { component: ComponentType; componentProps: Record<string, unknown>; };
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* A group of filter options (e.g., Repositories, Categories).
|
|
27
|
+
*/
|
|
28
|
+
type FilterGroup = {
|
|
29
|
+
/** Key that maps to the filters object (e.g., 'repos', 'categories') */
|
|
30
|
+
key: string;
|
|
31
|
+
/** Title for the filter group */
|
|
32
|
+
title: string;
|
|
33
|
+
/** The available options within this group */
|
|
34
|
+
options: FilterOption[];
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Props accepted by the filter panel.
|
|
39
|
+
*/
|
|
40
|
+
const props = defineProps<{
|
|
41
|
+
/** Two-way bound filters */
|
|
42
|
+
modelValue: Record<string, string[]>;
|
|
43
|
+
/** The list of filter groups to display */
|
|
44
|
+
filters: FilterGroup[];
|
|
45
|
+
}>();
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Event emitted by the component.
|
|
49
|
+
*/
|
|
50
|
+
const emit = defineEmits<{(e: 'update:modelValue', val: Record<string, string[]>): void;}>();
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Handles updating the selected filters for a given filter group key.
|
|
54
|
+
*
|
|
55
|
+
* @param key - The key of the filter group being updated (e.g., 'tags').
|
|
56
|
+
* @param value - The updated list of selected values (e.g. ['monitoring', 'networking']).
|
|
57
|
+
*/
|
|
58
|
+
const updateFilter = (key: string, value: string[]) => {
|
|
59
|
+
const newValue = { ...props.modelValue, [key]: value };
|
|
60
|
+
|
|
61
|
+
emit('update:modelValue', newValue);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
</script>
|
|
65
|
+
|
|
66
|
+
<template>
|
|
67
|
+
<div class="filter-panel">
|
|
68
|
+
<div
|
|
69
|
+
v-for="filter in filters"
|
|
70
|
+
:key="filter.key"
|
|
71
|
+
class="filter-panel-filter-group"
|
|
72
|
+
data-testid="filter-panel-filter-group"
|
|
73
|
+
>
|
|
74
|
+
<h4 class="filter-panel-filter-group-title">
|
|
75
|
+
{{ filter.title }}
|
|
76
|
+
</h4>
|
|
77
|
+
<div
|
|
78
|
+
v-for="(option, i) in filter.options"
|
|
79
|
+
:key="`${filter.key}-${i}`"
|
|
80
|
+
class="filter-panel-filter-option"
|
|
81
|
+
>
|
|
82
|
+
<template v-if="option.component">
|
|
83
|
+
<component
|
|
84
|
+
:is="option.component"
|
|
85
|
+
v-bind="option.componentProps"
|
|
86
|
+
data-testid="filter-panel-custom-component"
|
|
87
|
+
/>
|
|
88
|
+
</template>
|
|
89
|
+
<template v-else-if="option.label">
|
|
90
|
+
<Checkbox
|
|
91
|
+
:key="i"
|
|
92
|
+
class="filter-panel-filter-checkbox"
|
|
93
|
+
:label="typeof option.label === 'string' ? option.label : undefined"
|
|
94
|
+
:value="modelValue[filter.key]"
|
|
95
|
+
:value-when-true="option.value"
|
|
96
|
+
data-testid="filter-panel-filter-checkbox"
|
|
97
|
+
@update:value="updateFilter(filter.key, $event)"
|
|
98
|
+
>
|
|
99
|
+
<template #label>
|
|
100
|
+
<span v-if="typeof option.label === 'string'">{{ option.label }}</span>
|
|
101
|
+
<component
|
|
102
|
+
:is="option.label.component"
|
|
103
|
+
v-else
|
|
104
|
+
v-bind="option.label.componentProps"
|
|
105
|
+
/>
|
|
106
|
+
</template>
|
|
107
|
+
</Checkbox>
|
|
108
|
+
</template>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
</template>
|
|
113
|
+
|
|
114
|
+
<style lang='scss' scoped>
|
|
115
|
+
.filter-panel {
|
|
116
|
+
display: flex;
|
|
117
|
+
min-width: 250px;
|
|
118
|
+
height: max-content;
|
|
119
|
+
padding: 16px;
|
|
120
|
+
flex-direction: column;
|
|
121
|
+
align-items: flex-start;
|
|
122
|
+
gap: 24px;
|
|
123
|
+
border-radius: 6px;
|
|
124
|
+
background: var(--sortable-table-header-bg);
|
|
125
|
+
|
|
126
|
+
&-filter-group {
|
|
127
|
+
display: flex;
|
|
128
|
+
flex-direction: column;
|
|
129
|
+
gap: 6px;
|
|
130
|
+
width: 100%;
|
|
131
|
+
|
|
132
|
+
&-title {
|
|
133
|
+
margin-bottom: 6px;
|
|
134
|
+
font-size: 16px;
|
|
135
|
+
font-weight: 600;
|
|
136
|
+
line-height: 23px;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&-filter-option {
|
|
141
|
+
width: 100%;
|
|
142
|
+
|
|
143
|
+
.filter-panel-filter-checkbox {
|
|
144
|
+
|
|
145
|
+
.checkbox-label span {
|
|
146
|
+
max-width: 200px;
|
|
147
|
+
text-overflow: ellipsis;
|
|
148
|
+
white-space: nowrap;
|
|
149
|
+
overflow: hidden;
|
|
150
|
+
color: var(--link-text-secondary);
|
|
151
|
+
margin-left: 4px;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
</style>
|