@rancher/shell 0.5.2 → 1.2.0
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/.DS_Store +0 -0
- package/assets/images/providers/aks-black.svg +28 -0
- package/assets/images/providers/aks.svg +31 -0
- package/assets/styles/global/_labeled-input.scss +1 -0
- package/assets/styles/global/_layout.scss +0 -99
- package/assets/translations/en-us.yaml +77 -71
- package/assets/translations/zh-hans.yaml +25 -23
- package/babel.config.js +1 -7
- package/chart/gatekeeper.vue +11 -2
- package/chart/istio.vue +10 -1
- package/chart/logging/index.vue +11 -2
- package/chart/monitoring/alerting/index.vue +21 -7
- package/chart/monitoring/grafana/index.vue +2 -57
- package/chart/monitoring/index.vue +26 -52
- package/chart/monitoring/prometheus/index.vue +43 -37
- package/chart/rancher-backup/index.vue +10 -3
- package/cloud-credential/azure.vue +17 -4
- package/components/AsyncButton.vue +0 -9
- package/components/Carousel.vue +0 -1
- package/components/ChartPsp.vue +76 -0
- package/components/CodeMirror.vue +21 -19
- package/components/CopyCode.vue +2 -6
- package/components/CopyToClipboard.vue +1 -2
- package/components/CopyToClipboardText.vue +9 -14
- package/components/CruResource.vue +0 -1
- package/components/EtcdInfoBanner.vue +5 -5
- package/components/ExplorerProjectsNamespaces.vue +1 -25
- package/components/IconOrSvg.vue +1 -1
- package/components/Markdown.vue +12 -16
- package/components/Questions/index.vue +1 -1
- package/components/ResourceDetail/Masthead.vue +9 -25
- package/components/ResourceList/Masthead.vue +18 -1
- package/components/ResourceTable.vue +2 -14
- package/components/ResourceYaml.vue +0 -5
- package/components/SideNav.vue +1 -1
- package/components/SortableTable/THead.vue +9 -7
- package/components/SortableTable/index.vue +3 -2
- package/components/StatusTable.vue +1 -5
- package/components/TabTitle.vue +84 -0
- package/components/Tabbed/index.vue +0 -12
- package/components/__tests__/ChartPsp.test.ts +75 -0
- package/components/__tests__/CopyCode.test.ts +4 -5
- package/components/fleet/FleetBundles.vue +11 -5
- package/components/fleet/FleetRepos.vue +27 -62
- package/components/fleet/FleetResources.vue +1 -6
- package/components/fleet/FleetStatus.vue +3 -3
- package/components/fleet/FleetSummary.vue +30 -35
- package/components/form/ArrayList.vue +8 -1
- package/components/form/ArrayListSelect.vue +9 -9
- package/components/form/KeyValue.vue +0 -1
- package/components/form/LabeledSelect.vue +0 -4
- package/components/form/Password.vue +1 -3
- package/components/form/Select.vue +1 -1
- package/components/form/SelectOrCreateAuthSecret.vue +4 -4
- package/components/form/__tests__/KeyValue.test.ts +1 -1
- package/components/formatter/Checked.vue +3 -11
- package/components/formatter/ClusterProvider.vue +18 -1
- package/components/formatter/FleetSummaryGraph.vue +11 -23
- package/components/formatter/LiveDate.vue +16 -0
- package/components/formatter/LiveDuration.vue +1 -1
- package/components/formatter/PercentageBar.vue +1 -1
- package/components/formatter/__tests__/ClusterProvider.test.ts +28 -0
- package/components/nav/Group.vue +2 -2
- package/components/nav/Header.vue +2 -1
- package/components/nav/TopLevelMenu.vue +3 -29
- package/components/nav/Type.vue +3 -1
- package/components/nav/WindowManager/ContainerLogs.vue +19 -120
- package/components/nav/WindowManager/ContainerShell.vue +1 -6
- package/components/nav/WindowManager/index.vue +10 -11
- package/components/nav/__tests__/TopLevelMenu.test.ts +0 -33
- package/components/nav/__tests__/Type.test.ts +1 -1
- package/components/nuxt/nuxt-child.js +78 -14
- package/components/nuxt/nuxt.js +1 -1
- package/components/user.retention/user-retention-header.vue +34 -0
- package/composables/useI18n.ts +26 -0
- package/composables/useStore.ts +16 -0
- package/config/harvester-manager-types.js +0 -2
- package/config/home-links.js +32 -2
- package/config/private-label.js +0 -22
- package/config/product/explorer.js +4 -4
- package/config/product/fleet.js +1 -6
- package/config/product/legacy.js +1 -84
- package/config/product/manager.js +15 -8
- package/config/query-params.js +0 -1
- package/config/router.js +368 -385
- package/config/settings.ts +9 -2
- package/config/store.js +1 -1
- package/config/system-namespaces.js +0 -3
- package/config/table-headers.js +27 -47
- package/config/types.js +5 -0
- package/config/uiplugins.js +1 -1
- package/core/plugin-helpers.js +5 -3
- package/core/plugin-routes.ts +114 -56
- package/core/plugin.ts +10 -16
- package/core/plugins-loader.js +9 -7
- package/core/plugins.js +3 -0
- package/core/types-provisioning.ts +0 -7
- package/creators/app/init +0 -19
- package/detail/fleet.cattle.io.cluster.vue +1 -11
- package/detail/node.vue +0 -42
- package/detail/pod.vue +1 -68
- package/detail/provisioning.cattle.io.cluster.vue +4 -6
- package/detail/workload/index.vue +1 -15
- package/dialog/ScaleMachineDownDialog.vue +17 -34
- package/edit/auth/googleoauth.vue +5 -1
- package/edit/catalog.cattle.io.clusterrepo.vue +7 -20
- package/edit/cloudcredential.vue +0 -2
- package/edit/fleet.cattle.io.gitrepo.vue +4 -3
- package/edit/management.cattle.io.project.vue +52 -1
- package/edit/management.cattle.io.setting.vue +2 -31
- package/edit/monitoring.coreos.com.prometheusrule/AlertingRule.vue +3 -12
- package/edit/monitoring.coreos.com.prometheusrule/GroupRules.vue +1 -2
- package/edit/networking.k8s.io.networkpolicy/__tests__/PolicyRuleTarget.spec.ts +1 -1
- package/edit/provisioning.cattle.io.cluster/{tabs/Basics.vue → Basics.vue} +126 -109
- package/edit/provisioning.cattle.io.cluster/{tabs/MachinePool.vue → MachinePool.vue} +7 -1
- package/edit/provisioning.cattle.io.cluster/{tabs/registries/RegistryConfigs.vue → RegistryConfigs.vue} +3 -1
- package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +7 -15
- package/edit/provisioning.cattle.io.cluster/__tests__/Basics.tests.ts +237 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/{CustomCommand.test.ts → CustomCommand.tests.ts} +0 -6
- package/edit/provisioning.cattle.io.cluster/__tests__/DrainOptions.test.ts +1 -1
- package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +1 -7
- package/edit/provisioning.cattle.io.cluster/import.vue +2 -2
- package/edit/provisioning.cattle.io.cluster/index.vue +37 -99
- package/edit/provisioning.cattle.io.cluster/rke2.vue +690 -181
- package/edit/service.vue +0 -12
- package/edit/workload/Upgrading.vue +2 -3
- package/edit/workload/index.vue +1 -2
- package/edit/workload/mixins/workload.js +1 -1
- package/initialize/App.js +71 -25
- package/initialize/client.js +162 -21
- package/initialize/index.js +124 -47
- package/initialize/layouts.ts +26 -0
- package/{components/templates → layouts}/blank.vue +1 -1
- package/{components/templates → layouts}/default.vue +98 -8
- package/{components/templates → layouts}/error.vue +19 -10
- package/{components/templates → layouts}/home.vue +1 -4
- package/{components/templates → layouts}/plain.vue +1 -4
- package/{components/templates → layouts}/standalone.vue +1 -1
- package/{components/templates → layouts}/unauthenticated.vue +1 -1
- package/list/management.cattle.io.feature.vue +7 -1
- package/list/management.cattle.io.user.vue +25 -1
- package/list/node.vue +0 -1
- package/machine-config/__tests__/vmwarevsphere.test.ts +161 -56
- package/machine-config/amazonec2.vue +1 -0
- package/machine-config/azure.vue +37 -21
- package/machine-config/vmwarevsphere.vue +47 -42
- package/middleware/authenticated.js +19 -14
- package/mixins/auth-config.js +7 -2
- package/mixins/brand.js +41 -29
- package/mixins/fetch.server.js +73 -0
- package/mixins/labeled-form-element.ts +1 -6
- package/models/__tests__/management.cattle.io.node.ts +0 -85
- package/models/__tests__/namespace.test.ts +9 -49
- package/models/cluster/node.js +4 -4
- package/models/cluster.x-k8s.io.machine.js +1 -1
- package/models/cluster.x-k8s.io.machinedeployment.js +0 -14
- package/models/fleet.cattle.io.cluster.js +0 -4
- package/models/fleet.cattle.io.gitrepo.js +13 -56
- package/models/management.cattle.io.cluster.js +3 -11
- package/models/management.cattle.io.kontainerdriver.js +0 -1
- package/models/management.cattle.io.node.js +14 -18
- package/models/management.cattle.io.nodepool.js +0 -17
- package/models/management.cattle.io.project.js +36 -0
- package/models/management.cattle.io.setting.js +7 -11
- package/models/management.cattle.io.user.js +65 -0
- package/models/namespace.js +1 -1
- package/models/pod.js +0 -20
- package/models/provisioning.cattle.io.cluster.js +8 -55
- package/models/secret.js +18 -117
- package/models/workload.js +0 -16
- package/models/workload.service.js +0 -18
- package/package.json +10 -12
- package/pages/about.vue +1 -0
- package/pages/account/create-key.vue +1 -0
- package/pages/account/index.vue +1 -0
- package/pages/auth/login.vue +1 -0
- package/pages/auth/logout.vue +2 -0
- package/pages/auth/setup.vue +4 -37
- package/pages/auth/verify.vue +8 -14
- package/pages/c/_cluster/apps/charts/__tests__/install.helper.test.ts +17 -2
- package/pages/c/_cluster/apps/charts/index.vue +58 -64
- package/pages/c/_cluster/apps/charts/install.helpers.js +13 -2
- package/pages/c/_cluster/apps/charts/install.vue +5 -5
- package/pages/c/_cluster/apps/index.vue +2 -0
- package/pages/c/_cluster/auth/index.vue +2 -0
- package/pages/c/_cluster/auth/user.retention/index.vue +384 -0
- package/pages/c/_cluster/ecm/index.vue +2 -0
- package/pages/c/_cluster/explorer/index.vue +53 -56
- package/pages/c/_cluster/explorer/tools/index.vue +3 -171
- package/pages/c/_cluster/fleet/index.vue +1 -1
- package/pages/c/_cluster/index.vue +2 -0
- package/pages/c/_cluster/manager/pages/_page.vue +5 -4
- package/pages/c/_cluster/monitoring/index.vue +1 -17
- package/pages/c/_cluster/settings/DefaultLinksEditor.vue +1 -0
- package/pages/c/_cluster/settings/banners.vue +2 -0
- package/pages/c/_cluster/settings/brand.vue +2 -0
- package/pages/c/_cluster/settings/index.vue +2 -0
- package/pages/c/_cluster/settings/links.vue +3 -2
- package/pages/c/_cluster/settings/performance.vue +1 -0
- package/pages/c/_cluster/uiplugins/AddExtensionRepos.vue +4 -4
- package/pages/c/_cluster/uiplugins/CatalogList/CatalogLoadDialog.vue +1 -2
- package/pages/c/_cluster/uiplugins/CatalogList/index.vue +46 -10
- package/pages/c/_cluster/uiplugins/SetupUIPlugins.vue +5 -2
- package/pages/c/_cluster/uiplugins/__tests__/AddExtensionRepos.test.ts +96 -0
- package/pages/c/_cluster/uiplugins/__tests__/SetupUIPlugins.test.ts +128 -0
- package/pages/c/_cluster/uiplugins/index.vue +2 -0
- package/pages/c/index.vue +9 -0
- package/pages/diagnostic.vue +2 -1
- package/pages/fail-whale.vue +1 -0
- package/pages/prefs.vue +1 -0
- package/pages/rio/mesh.vue +508 -0
- package/pages/support/index.vue +8 -2
- package/pkg/auto-import.js +1 -1
- package/plugins/axios.js +36 -0
- package/plugins/back-button.js +5 -3
- package/plugins/clean-html-directive.js +19 -1
- package/plugins/clean-tooltip-directive.js +1 -1
- package/plugins/codemirror-loader.js +1 -1
- package/plugins/codemirror.js +0 -41
- package/plugins/dashboard-store/__tests__/actions.spec.ts +250 -0
- package/plugins/dashboard-store/__tests__/{mutations.test.ts → mutations.spec.ts} +1 -1
- package/plugins/dashboard-store/actions.js +21 -22
- package/plugins/dashboard-store/classify.js +18 -1
- package/plugins/dashboard-store/getters.js +5 -10
- package/plugins/dashboard-store/index.js +12 -0
- package/plugins/dashboard-store/mutations.js +4 -0
- package/plugins/dashboard-store/resource-class.js +18 -59
- package/plugins/i18n.js +1 -1
- package/plugins/steve/__tests__/getters.spec.ts +56 -24
- package/plugins/steve/__tests__/subscribe.spec.ts +106 -0
- package/plugins/steve/getters.js +30 -7
- package/plugins/steve/mutations.js +5 -2
- package/plugins/steve/norman-class.js +0 -19
- package/plugins/steve/steve-class.js +0 -22
- package/plugins/steve/subscribe.js +34 -13
- package/plugins/transitions.js +4 -0
- package/plugins/vue-clipboard2.js +4 -0
- package/rancher-components/Accordion/Accordion.vue +3 -2
- package/rancher-components/BadgeState/BadgeState.vue +3 -3
- package/rancher-components/Banner/Banner.test.ts +1 -5
- package/rancher-components/Banner/Banner.vue +2 -2
- package/rancher-components/Card/Card.vue +4 -4
- package/rancher-components/Form/Checkbox/Checkbox.vue +4 -3
- package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +1 -1
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +55 -24
- package/rancher-components/Form/Radio/RadioButton.test.ts +1 -3
- package/rancher-components/Form/Radio/RadioButton.vue +13 -7
- package/rancher-components/Form/Radio/RadioGroup.vue +4 -3
- package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +7 -5
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +7 -4
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +9 -4
- package/rancher-components/StringList/StringList.vue +8 -8
- package/rancher-components/components/Accordion/Accordion.vue +3 -2
- package/rancher-components/components/BadgeState/BadgeState.test.ts +12 -0
- package/rancher-components/components/Form/LabeledInput/LabeledInput.test.ts +2 -19
- package/rancher-components/components/Form/LabeledInput/LabeledInput.vue +14 -11
- package/rancher-components/components/Form/TextArea/TextAreaAutoGrow.vue +1 -1
- package/rancher-components/components/StringList/StringList.test.ts +0 -270
- package/rancher-components/components/StringList/StringList.vue +18 -57
- package/scripts/extension/bundle +7 -19
- package/scripts/extension/helm/scripts/package +3 -11
- package/scripts/extension/parse-tag-name +4 -4
- package/scripts/extension/publish +9 -20
- package/scripts/publish-shell.sh +1 -11
- package/scripts/test-plugins-build.sh +9 -85
- package/store/catalog.js +1 -1
- package/store/features.js +0 -1
- package/store/i18n.js +0 -11
- package/store/index.js +11 -8
- package/store/prefs.js +38 -33
- package/store/type-map.js +8 -13
- package/tsconfig.default.json +46 -0
- package/tsconfig.json +9 -35
- package/types/shell/index.d.ts +404 -463
- package/utils/__tests__/create-yaml.test.ts +10 -0
- package/utils/axios.js +19 -0
- package/utils/create-yaml.js +6 -6
- package/utils/custom-validators.js +2 -0
- package/utils/error.js +1 -16
- package/utils/monitoring.js +2 -37
- package/utils/nuxt.js +39 -18
- package/utils/object.js +0 -14
- package/utils/router.scrollBehavior.js +14 -12
- package/utils/socket.js +1 -0
- package/utils/time.js +1 -1
- package/utils/title.ts +3 -0
- package/utils/url.ts +1 -1
- package/utils/validators/formRules/__tests__/index.test.ts +4 -49
- package/utils/validators/formRules/index.ts +9 -12
- package/utils/validators/setting.js +10 -6
- package/vue.config.js +3 -24
- package/chart/monitoring/steps/uninstall-v1.vue +0 -135
- package/components/Certificates.vue +0 -164
- package/components/fleet/__tests__/FleetSummary.test.ts +0 -316
- package/components/formatter/FleetClusterSummaryGraph.vue +0 -27
- package/components/formatter/__tests__/Checked.test.ts +0 -19
- package/components/nav/WindowManager/__tests__/ContainerLogs.test.ts +0 -186
- package/composables/useCompactInput.ts +0 -20
- package/composables/useLabeledFormElement.ts +0 -138
- package/creators/app/files/.gitlab-ci.yml +0 -14
- package/edit/__tests__/service.test.ts +0 -89
- package/edit/provisioning.cattle.io.cluster/__tests__/Advanced.test.ts +0 -112
- package/edit/provisioning.cattle.io.cluster/__tests__/Basics.test.ts +0 -473
- package/edit/provisioning.cattle.io.cluster/__tests__/index.test.ts +0 -73
- package/edit/provisioning.cattle.io.cluster/__tests__/utils/cluster.ts +0 -386
- package/edit/provisioning.cattle.io.cluster/tabs/AddOnConfig.vue +0 -137
- package/edit/provisioning.cattle.io.cluster/tabs/Advanced.vue +0 -157
- package/edit/provisioning.cattle.io.cluster/tabs/etcd/index.vue +0 -135
- package/edit/provisioning.cattle.io.cluster/tabs/networking/index.vue +0 -189
- package/edit/provisioning.cattle.io.cluster/tabs/registries/index.vue +0 -144
- package/edit/provisioning.cattle.io.cluster/tabs/upgrade/index.vue +0 -76
- package/mixins/v1-workload-metrics.js +0 -43
- package/models/__tests__/management.cattle.io.cluster.test.ts +0 -23
- package/models/__tests__/management.cattle.io.nodepool.ts +0 -83
- package/models/__tests__/provisioning.cattle.io.cluster.test.ts +0 -90
- package/models/__tests__/workload.test.ts +0 -91
- package/plugins/clean-html.js +0 -53
- package/plugins/dashboard-store/__tests__/actions.test.ts +0 -165
- package/plugins/dashboard-store/__tests__/resource-class.test.ts +0 -49
- package/plugins/dashboard-store/__tests__/utils/store-mocks.ts +0 -7
- package/plugins/index.js +0 -11
- package/plugins/steve/__tests__/steve-class.spec.ts +0 -59
- package/plugins/steve/__tests__/utils/steve-mocks.ts +0 -31
- package/scripts/.gitlab/workflows/build-extension-catalog.gitlab-ci.yml +0 -50
- package/server/har-file.js +0 -183
- package/tsconfig.paths.json +0 -18
- package/utils/azure.js +0 -24
- package/utils/clipboard.js +0 -5
- /package/components/form/__tests__/{NameNsDescription.test.ts → NameNsDescription.ts} +0 -0
- /package/edit/networking.k8s.io.networkpolicy/__tests__/utils/{selectors.test.ts → selectors.ts} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/networking/ACE.vue → ACE.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/AgentConfiguration.vue → AgentConfiguration.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/upgrade/DrainOptions.vue → DrainOptions.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/MemberRoles.vue → MemberRoles.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/registries/RegistryMirrors.vue → RegistryMirrors.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/etcd/S3Config.vue → S3Config.vue} +0 -0
- /package/plugins/dashboard-store/__tests__/{getters.test.ts → getters.spec.ts} +0 -0
- /package/rancher-components/BadgeState/{BadgeState.spec.ts → BadgeState.test.ts} +0 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { mapGetters } from 'vuex';
|
|
3
|
+
import { updatePageTitle } from '@shell/utils/title';
|
|
4
|
+
import { getVendor } from '@shell/config/private-label';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
props: {
|
|
8
|
+
/**
|
|
9
|
+
* Include can be 'full', 'vendor-only' or false
|
|
10
|
+
* 'full': Show's the entire breadcrumb include vendor, product and cluster
|
|
11
|
+
* 'vendor-only': Show only the vendor name in the breadcrumb i.e. 'Rancher > "child"'
|
|
12
|
+
* false: Don't include any part of the breadcrumb
|
|
13
|
+
*/
|
|
14
|
+
breadcrumb: {
|
|
15
|
+
type: [String, Boolean],
|
|
16
|
+
default: 'full',
|
|
17
|
+
validator(value) {
|
|
18
|
+
return ['full', 'vendor-only'].includes(value) || value === false;
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
includeVendor: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: true
|
|
24
|
+
},
|
|
25
|
+
showChild: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: true
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
computed: { ...mapGetters(['isExplorer', 'currentCluster', 'currentProduct']) },
|
|
31
|
+
|
|
32
|
+
methods: {
|
|
33
|
+
// This isn't a computed prop because it would trigger a recompute when the $slots changed
|
|
34
|
+
computeTitle() {
|
|
35
|
+
if (!this.$slots.default || this.$slots.default.length !== 1 || this.$slots.default[0].tag || (typeof this.$slots.default[0].text !== 'string')) {
|
|
36
|
+
console.error('The <TabTitle> component only supports text as the child.'); // eslint-disable-line no-console
|
|
37
|
+
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const breadcrumb = [this.$slots.default[0].text.trim()];
|
|
42
|
+
|
|
43
|
+
if (this.breadcrumb === 'full') {
|
|
44
|
+
if (this.currentCluster && (this.isExplorer || this.currentCluster.isHarvester ) ) {
|
|
45
|
+
breadcrumb.unshift(this.currentCluster.nameDisplay);
|
|
46
|
+
} else if (this.currentProduct?.name) {
|
|
47
|
+
const productName = this.$store.getters['i18n/withFallback'](`product.${ this.currentProduct.name }`, null, null);
|
|
48
|
+
|
|
49
|
+
if (productName) {
|
|
50
|
+
breadcrumb.unshift(productName);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (this.includeVendor && ['full', 'vendor-only'].includes(this.breadcrumb)) {
|
|
56
|
+
breadcrumb.unshift(getVendor());
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return breadcrumb;
|
|
60
|
+
},
|
|
61
|
+
updatePageTitle() {
|
|
62
|
+
updatePageTitle(...this.computeTitle());
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
created() {
|
|
67
|
+
this.updatePageTitle();
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
// Using the render function instead of <template> because <template><slot /></template> will yield a compiler error since
|
|
71
|
+
// <slot /> is not allowed to be a root node of a <template> and I don't want to wrap the child to avoid affecting existing styling
|
|
72
|
+
render() {
|
|
73
|
+
if (this.$slots.default) {
|
|
74
|
+
this.$slots.default.forEach((e) => {
|
|
75
|
+
e.text = (e.text || '').trim();
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
this.updatePageTitle();
|
|
80
|
+
|
|
81
|
+
return this.showChild ? this.$slots.default : null;
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
</script>
|
|
@@ -19,11 +19,6 @@ export default {
|
|
|
19
19
|
default: false
|
|
20
20
|
},
|
|
21
21
|
|
|
22
|
-
hideSingleTab: {
|
|
23
|
-
type: Boolean,
|
|
24
|
-
default: false
|
|
25
|
-
},
|
|
26
|
-
|
|
27
22
|
showTabsAddRemove: {
|
|
28
23
|
type: Boolean,
|
|
29
24
|
default: false
|
|
@@ -91,11 +86,6 @@ export default {
|
|
|
91
86
|
sortedTabs() {
|
|
92
87
|
return sortBy(this.tabs, ['weight:desc', 'labelDisplay', 'name']);
|
|
93
88
|
},
|
|
94
|
-
|
|
95
|
-
// hide tabs based on tab count IF flag is active
|
|
96
|
-
hideTabs() {
|
|
97
|
-
return this.hideSingleTab && this.sortedTabs.length === 1;
|
|
98
|
-
}
|
|
99
89
|
},
|
|
100
90
|
|
|
101
91
|
watch: {
|
|
@@ -235,13 +225,11 @@ export default {
|
|
|
235
225
|
<template>
|
|
236
226
|
<div :class="{'side-tabs': !!sideTabs, 'tabs-only': tabsOnly }">
|
|
237
227
|
<ul
|
|
238
|
-
v-if="!hideTabs"
|
|
239
228
|
ref="tablist"
|
|
240
229
|
role="tablist"
|
|
241
230
|
class="tabs"
|
|
242
231
|
:class="{'clearfix':!sideTabs, 'vertical': sideTabs, 'horizontal': !sideTabs}"
|
|
243
232
|
tabindex="0"
|
|
244
|
-
data-testid="tabbed-block"
|
|
245
233
|
@keydown.right.prevent="selectNext(1)"
|
|
246
234
|
@keydown.left.prevent="selectNext(-1)"
|
|
247
235
|
@keydown.down.prevent="selectNext(1)"
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { shallowMount, mount } from '@vue/test-utils';
|
|
2
|
+
import ChartPsp from '@shell/components/ChartPsp.vue';
|
|
3
|
+
|
|
4
|
+
describe('component: ChartPsp', () => {
|
|
5
|
+
it.each([
|
|
6
|
+
true, false
|
|
7
|
+
])('should render checkbox referencing value.global.cattle.psp.enabled as %p', (value) => {
|
|
8
|
+
const version = 'v1.24.11+rke2r1';
|
|
9
|
+
const wrapper = shallowMount(ChartPsp, {
|
|
10
|
+
propsData: {
|
|
11
|
+
value: { global: { cattle: { psp: { enabled: value } } } },
|
|
12
|
+
cluster: { kubernetesVersion: version }
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
expect(wrapper.findComponent({ name: 'Checkbox' }).props().value).toBe(value);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it.each([
|
|
20
|
+
['v1.24.11+rke2r1'],
|
|
21
|
+
])('should display the checkbox for cluster with k8s version %p', (version) => {
|
|
22
|
+
const wrapper = shallowMount(ChartPsp, {
|
|
23
|
+
propsData: {
|
|
24
|
+
value: { global: { cattle: { psp: { enabled: false } } } },
|
|
25
|
+
cluster: { kubernetesVersion: version }
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const input = wrapper.find(`[data-testid="psp-checkbox"]`).element as HTMLInputElement;
|
|
30
|
+
|
|
31
|
+
expect(input).toBeDefined();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it.each([
|
|
35
|
+
['v1.25.11+rke2r1'],
|
|
36
|
+
])('should not display the checkbox for cluster with k8s version %p', (version) => {
|
|
37
|
+
const wrapper = shallowMount(ChartPsp, {
|
|
38
|
+
propsData: {
|
|
39
|
+
value: { global: { cattle: { psp: { enabled: false } } } },
|
|
40
|
+
cluster: { kubernetesVersion: version }
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const input = wrapper.find(`[data-testid="psp-checkbox"]`).element as HTMLInputElement;
|
|
45
|
+
|
|
46
|
+
expect(input).toBeUndefined();
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('should update value.global.cattle.psp.enabled when checkbox is toggled', async() => {
|
|
50
|
+
const chartValues = { global: {} } as any;
|
|
51
|
+
const version = 'v1.24.11+rke2r1';
|
|
52
|
+
const wrapper = mount(ChartPsp, {
|
|
53
|
+
propsData: {
|
|
54
|
+
value: chartValues,
|
|
55
|
+
cluster: { kubernetesVersion: version }
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
await wrapper.find('.checkbox-container').trigger('click');
|
|
60
|
+
|
|
61
|
+
expect(chartValues.global.cattle.psp.enabled).toBe(true);
|
|
62
|
+
|
|
63
|
+
await wrapper.find('.checkbox-container').trigger('click');
|
|
64
|
+
expect(chartValues.global.cattle.psp.enabled).toBe(false);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it.each([
|
|
68
|
+
{ global: {} } as any,
|
|
69
|
+
{ global: { cattle: {} } } as any,
|
|
70
|
+
])('should define cattle.psp.enabled and set to false', (chartValues) => {
|
|
71
|
+
shallowMount(ChartPsp, { propsData: { value: chartValues } });
|
|
72
|
+
|
|
73
|
+
expect(chartValues.global.cattle.psp.enabled).toBe(false);
|
|
74
|
+
});
|
|
75
|
+
});
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { mount } from '@vue/test-utils';
|
|
2
2
|
import CopyCode from '@shell/components/CopyCode.vue';
|
|
3
3
|
|
|
4
|
-
jest.mock('@shell/utils/clipboard', () => {
|
|
5
|
-
return { copyTextToClipboard: jest.fn(() => Promise.resolve({})) };
|
|
6
|
-
});
|
|
7
|
-
|
|
8
4
|
describe('component: CopyCode', () => {
|
|
9
5
|
it('should emit copied after click', async() => {
|
|
10
|
-
const wrapper = mount(CopyCode, {
|
|
6
|
+
const wrapper = mount(CopyCode, {
|
|
7
|
+
mocks: { $copyText: () => new Promise(() => undefined) },
|
|
8
|
+
slots: { default: '<div></div>' }
|
|
9
|
+
});
|
|
11
10
|
|
|
12
11
|
await wrapper.find('code').trigger('click');
|
|
13
12
|
|
|
@@ -37,8 +37,8 @@ export default {
|
|
|
37
37
|
|
|
38
38
|
computed: {
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
// gitrepo model has getter for
|
|
40
|
+
allBundles() {
|
|
41
|
+
// gitrepo model has getter for bundles.
|
|
42
42
|
return this.value.bundles || [];
|
|
43
43
|
},
|
|
44
44
|
|
|
@@ -65,7 +65,13 @@ export default {
|
|
|
65
65
|
bundles() {
|
|
66
66
|
const harvester = this.harvesterClusters;
|
|
67
67
|
|
|
68
|
-
return this.
|
|
68
|
+
return this.allBundles.filter((bundle) => {
|
|
69
|
+
const isRepoBundle = bundle.metadata.name.startsWith(`${ this.value.metadata.name }-`);
|
|
70
|
+
|
|
71
|
+
if (!isRepoBundle) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
|
|
69
75
|
const targets = bundle.spec?.targets || [];
|
|
70
76
|
|
|
71
77
|
// Filter out any bundle that has one target whose cluster is a harvester cluster
|
|
@@ -78,7 +84,7 @@ export default {
|
|
|
78
84
|
},
|
|
79
85
|
|
|
80
86
|
hidden() {
|
|
81
|
-
return this.
|
|
87
|
+
return this.allBundles.length - this.bundles.length;
|
|
82
88
|
},
|
|
83
89
|
|
|
84
90
|
headers() {
|
|
@@ -99,6 +105,7 @@ export default {
|
|
|
99
105
|
return out;
|
|
100
106
|
},
|
|
101
107
|
},
|
|
108
|
+
|
|
102
109
|
methods: {
|
|
103
110
|
displayWarning(row) {
|
|
104
111
|
return !!row.status?.summary && (row.status.summary.desiredReady !== row.status.summary.ready);
|
|
@@ -106,7 +113,6 @@ export default {
|
|
|
106
113
|
}
|
|
107
114
|
};
|
|
108
115
|
</script>
|
|
109
|
-
|
|
110
116
|
<template>
|
|
111
117
|
<div>
|
|
112
118
|
<Loading v-if="$fetchState.pending" />
|
|
@@ -8,16 +8,8 @@ import {
|
|
|
8
8
|
AGE,
|
|
9
9
|
STATE,
|
|
10
10
|
NAME,
|
|
11
|
-
FLEET_SUMMARY
|
|
12
|
-
FLEET_REPO,
|
|
13
|
-
FLEET_REPO_TARGET,
|
|
14
|
-
FLEET_REPO_CLUSTERS_READY,
|
|
15
|
-
FLEET_REPO_CLUSTER_SUMMARY,
|
|
16
|
-
FLEET_REPO_PER_CLUSTER_STATE
|
|
17
|
-
|
|
11
|
+
FLEET_SUMMARY
|
|
18
12
|
} from '@shell/config/table-headers';
|
|
19
|
-
import { FLEET } from '@shell/config/labels-annotations';
|
|
20
|
-
import { STATES_ENUM } from '@shell/plugins/dashboard-store/resource-class';
|
|
21
13
|
|
|
22
14
|
export default {
|
|
23
15
|
|
|
@@ -27,11 +19,6 @@ export default {
|
|
|
27
19
|
ResourceTable, Link, Shortened, FleetIntro
|
|
28
20
|
},
|
|
29
21
|
props: {
|
|
30
|
-
clusterId: {
|
|
31
|
-
type: String,
|
|
32
|
-
required: false,
|
|
33
|
-
default: null,
|
|
34
|
-
},
|
|
35
22
|
rows: {
|
|
36
23
|
type: Array,
|
|
37
24
|
required: true,
|
|
@@ -67,46 +54,35 @@ export default {
|
|
|
67
54
|
});
|
|
68
55
|
},
|
|
69
56
|
|
|
70
|
-
isClusterView() {
|
|
71
|
-
return !!this.clusterId;
|
|
72
|
-
},
|
|
73
|
-
|
|
74
57
|
noRows() {
|
|
75
58
|
return !this.filteredRows.length;
|
|
76
59
|
},
|
|
77
60
|
|
|
78
61
|
headers() {
|
|
79
|
-
// Cluster summary is only shown in the cluster view
|
|
80
|
-
const fleetClusterSummary = {
|
|
81
|
-
...FLEET_REPO_CLUSTER_SUMMARY,
|
|
82
|
-
formatterOpts: {
|
|
83
|
-
// Fleet uses labels to identify clusters
|
|
84
|
-
clusterLabel: this.clusterId
|
|
85
|
-
},
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
// if hasPerClusterState then use the repo state
|
|
89
|
-
const fleetPerClusterState = {
|
|
90
|
-
...FLEET_REPO_PER_CLUSTER_STATE,
|
|
91
|
-
value: (row) => {
|
|
92
|
-
const statePerCluster = row.clusterResourceStatus?.find((c) => {
|
|
93
|
-
return c.clusterLabel === this.clusterId;
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
return statePerCluster ? statePerCluster?.status?.displayStatus : STATES_ENUM.ACTIVE;
|
|
97
|
-
},
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
const summary = this.isClusterView ? [fleetClusterSummary] : [FLEET_REPO_CLUSTERS_READY, FLEET_SUMMARY];
|
|
101
|
-
|
|
102
|
-
const state = this.isClusterView ? fleetPerClusterState : STATE;
|
|
103
|
-
|
|
104
62
|
const out = [
|
|
105
|
-
|
|
63
|
+
STATE,
|
|
106
64
|
NAME,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
65
|
+
{
|
|
66
|
+
name: 'repo',
|
|
67
|
+
labelKey: 'tableHeaders.repo',
|
|
68
|
+
value: 'repoDisplay',
|
|
69
|
+
sort: 'repoDisplay',
|
|
70
|
+
search: ['spec.repo', 'status.commit'],
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'target',
|
|
74
|
+
labelKey: 'tableHeaders.target',
|
|
75
|
+
value: 'targetInfo.modeDisplay',
|
|
76
|
+
sort: ['targetInfo.modeDisplay', 'targetInfo.cluster', 'targetInfo.clusterGroup'],
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'clustersReady',
|
|
80
|
+
labelKey: 'tableHeaders.clustersReady',
|
|
81
|
+
value: 'status.readyClusters',
|
|
82
|
+
sort: 'status.readyClusters',
|
|
83
|
+
search: false,
|
|
84
|
+
},
|
|
85
|
+
FLEET_SUMMARY,
|
|
110
86
|
AGE
|
|
111
87
|
];
|
|
112
88
|
|
|
@@ -116,12 +92,6 @@ export default {
|
|
|
116
92
|
methods: {
|
|
117
93
|
parseTargetMode(row) {
|
|
118
94
|
return row.targetInfo?.mode === 'clusterGroup' ? this.t('fleet.gitRepo.warningTooltip.clusterGroup') : this.t('fleet.gitRepo.warningTooltip.cluster');
|
|
119
|
-
},
|
|
120
|
-
|
|
121
|
-
clusterViewResourceStatus(row) {
|
|
122
|
-
return row.clusterResourceStatus.find((c) => {
|
|
123
|
-
return c.metadata?.labels[FLEET.CLUSTER_NAME] === this.clusterId;
|
|
124
|
-
});
|
|
125
95
|
}
|
|
126
96
|
},
|
|
127
97
|
};
|
|
@@ -141,7 +111,7 @@ export default {
|
|
|
141
111
|
key-field="_key"
|
|
142
112
|
v-on="$listeners"
|
|
143
113
|
>
|
|
144
|
-
<template #cell:repo="{
|
|
114
|
+
<template #cell:repo="{row}">
|
|
145
115
|
<Link
|
|
146
116
|
:row="row"
|
|
147
117
|
:value="row.spec.repo"
|
|
@@ -149,7 +119,6 @@ export default {
|
|
|
149
119
|
before-icon-key="repoIcon"
|
|
150
120
|
url-key="spec.repo"
|
|
151
121
|
/>
|
|
152
|
-
{{ row.cluster }}
|
|
153
122
|
<template v-if="row.commitDisplay">
|
|
154
123
|
<div class="text-muted">
|
|
155
124
|
<Shortened
|
|
@@ -161,10 +130,7 @@ export default {
|
|
|
161
130
|
</template>
|
|
162
131
|
</template>
|
|
163
132
|
|
|
164
|
-
<template
|
|
165
|
-
v-if="!isClusterView"
|
|
166
|
-
#cell:clustersReady="{ row }"
|
|
167
|
-
>
|
|
133
|
+
<template #cell:clustersReady="{row}">
|
|
168
134
|
<span
|
|
169
135
|
v-if="!row.clusterInfo"
|
|
170
136
|
class="text-muted"
|
|
@@ -172,8 +138,7 @@ export default {
|
|
|
172
138
|
<span
|
|
173
139
|
v-else-if="row.clusterInfo.unready"
|
|
174
140
|
class="text-warning"
|
|
175
|
-
>{{ row.clusterInfo.ready }}/{{
|
|
176
|
-
row.clusterInfo.total }}</span>
|
|
141
|
+
>{{ row.clusterInfo.ready }}/{{ row.clusterInfo.total }}</span>
|
|
177
142
|
<span
|
|
178
143
|
v-else
|
|
179
144
|
class="cluster-count-info"
|
|
@@ -187,7 +152,7 @@ export default {
|
|
|
187
152
|
</span>
|
|
188
153
|
</template>
|
|
189
154
|
|
|
190
|
-
<template #cell:target="{
|
|
155
|
+
<template #cell:target="{row}">
|
|
191
156
|
{{ row.targetInfo.modeDisplay }}
|
|
192
157
|
</template>
|
|
193
158
|
</ResourceTable>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { sortBy } from '@shell/utils/sort';
|
|
3
3
|
import { get } from '@shell/utils/object';
|
|
4
|
-
import { stateSort
|
|
4
|
+
import { stateSort } from '@shell/plugins/dashboard-store/resource-class';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
|
|
@@ -50,8 +50,8 @@ export default {
|
|
|
50
50
|
computed: {
|
|
51
51
|
meta() {
|
|
52
52
|
return {
|
|
53
|
-
total: this.values.map((x) => x.value).reduce((a, b) => a + b
|
|
54
|
-
readyCount: this.values.filter((x) => x.
|
|
53
|
+
total: this.values.map((x) => x.value).reduce((a, b) => a + b),
|
|
54
|
+
readyCount: this.values.filter((x) => x.label === 'Success' || x.label === 'Ready').map((x) => x.value).reduce((a, b) => a + b)
|
|
55
55
|
};
|
|
56
56
|
},
|
|
57
57
|
|
|
@@ -1,56 +1,52 @@
|
|
|
1
1
|
<script>
|
|
2
|
+
import capitalize from 'lodash/capitalize';
|
|
2
3
|
import { STATES, STATES_ENUM } from '@shell/plugins/dashboard-store/resource-class';
|
|
3
4
|
import FleetStatus from '@shell/components/fleet/FleetStatus';
|
|
4
5
|
|
|
5
6
|
const getResourceDefaultState = (labelGetter, stateKey) => {
|
|
6
7
|
return {
|
|
7
8
|
ready: {
|
|
8
|
-
count:
|
|
9
|
-
color:
|
|
10
|
-
label:
|
|
11
|
-
status: STATES_ENUM.READY
|
|
9
|
+
count: 0,
|
|
10
|
+
color: STATES[STATES_ENUM.READY].color,
|
|
11
|
+
label: labelGetter(`${ stateKey }.${ STATES_ENUM.READY }`, null, STATES[STATES_ENUM.READY].label )
|
|
12
12
|
},
|
|
13
13
|
info: {
|
|
14
|
-
count:
|
|
15
|
-
color:
|
|
16
|
-
label:
|
|
17
|
-
status: STATES_ENUM.INFO
|
|
14
|
+
count: 0,
|
|
15
|
+
color: STATES[STATES_ENUM.INFO].color,
|
|
16
|
+
label: labelGetter(`${ stateKey }.${ STATES_ENUM.INFO }`, null, STATES[STATES_ENUM.INFO].label )
|
|
18
17
|
},
|
|
19
18
|
warning: {
|
|
20
|
-
count:
|
|
21
|
-
color:
|
|
22
|
-
label:
|
|
23
|
-
status: STATES_ENUM.WARNING
|
|
19
|
+
count: 0,
|
|
20
|
+
color: STATES[STATES_ENUM.WARNING].color,
|
|
21
|
+
label: labelGetter(`${ stateKey }.${ STATES_ENUM.WARNING }`, null, STATES[STATES_ENUM.WARNING].label )
|
|
24
22
|
},
|
|
25
23
|
notready: {
|
|
26
|
-
count:
|
|
27
|
-
color:
|
|
28
|
-
label:
|
|
29
|
-
status: STATES_ENUM.NOT_READY
|
|
24
|
+
count: 0,
|
|
25
|
+
color: STATES[STATES_ENUM.NOT_READY].color,
|
|
26
|
+
label: labelGetter(`${ stateKey }.${ STATES_ENUM.NOT_READY }`, null, STATES[STATES_ENUM.NOT_READY].label )
|
|
30
27
|
},
|
|
31
28
|
error: {
|
|
32
|
-
count:
|
|
33
|
-
color:
|
|
34
|
-
label:
|
|
35
|
-
|
|
29
|
+
count: 0,
|
|
30
|
+
color: STATES[STATES_ENUM.ERROR].color,
|
|
31
|
+
label: labelGetter(`${ stateKey }.${ STATES_ENUM.ERROR }`, null, STATES[STATES_ENUM.ERROR].label )
|
|
32
|
+
|
|
36
33
|
},
|
|
37
34
|
errapplied: {
|
|
38
|
-
count:
|
|
39
|
-
color:
|
|
40
|
-
label:
|
|
41
|
-
|
|
35
|
+
count: 0,
|
|
36
|
+
color: STATES[STATES_ENUM.ERR_APPLIED].color,
|
|
37
|
+
label: labelGetter(`${ stateKey }.${ STATES_ENUM.ERR_APPLIED }`, null, STATES[STATES_ENUM.ERR_APPLIED].label )
|
|
38
|
+
|
|
42
39
|
},
|
|
43
40
|
waitapplied: {
|
|
44
|
-
count:
|
|
45
|
-
color:
|
|
46
|
-
label:
|
|
47
|
-
|
|
41
|
+
count: 0,
|
|
42
|
+
color: STATES[STATES_ENUM.WAIT_APPLIED].color,
|
|
43
|
+
label: labelGetter(`${ stateKey }.${ STATES_ENUM.WAIT_APPLIED }`, null, STATES[STATES_ENUM.WAIT_APPLIED].label )
|
|
44
|
+
|
|
48
45
|
},
|
|
49
46
|
unknown: {
|
|
50
|
-
count:
|
|
51
|
-
color:
|
|
52
|
-
label:
|
|
53
|
-
status: STATES_ENUM.UNKNOWN
|
|
47
|
+
count: 0,
|
|
48
|
+
color: STATES[STATES_ENUM.UNKNOWN].color,
|
|
49
|
+
label: labelGetter(`${ stateKey }.${ STATES_ENUM.UNKNOWN }`, null, STATES[STATES_ENUM.UNKNOWN].label )
|
|
54
50
|
}
|
|
55
51
|
};
|
|
56
52
|
};
|
|
@@ -84,7 +80,7 @@ export default {
|
|
|
84
80
|
},
|
|
85
81
|
|
|
86
82
|
bundleCounts() {
|
|
87
|
-
const resources = this.bundles.filter((item) => item.
|
|
83
|
+
const resources = this.bundles.filter((item) => item.metadata.name.startsWith(`${ this.repoName }-`));
|
|
88
84
|
|
|
89
85
|
if (!resources.length) {
|
|
90
86
|
return [];
|
|
@@ -178,6 +174,7 @@ export default {
|
|
|
178
174
|
|
|
179
175
|
},
|
|
180
176
|
|
|
177
|
+
methods: { capitalize },
|
|
181
178
|
};
|
|
182
179
|
</script>
|
|
183
180
|
|
|
@@ -188,13 +185,11 @@ export default {
|
|
|
188
185
|
title="Bundles"
|
|
189
186
|
:values="bundleCounts"
|
|
190
187
|
value-key="count"
|
|
191
|
-
data-testid="gitrepo-bundle-summary"
|
|
192
188
|
/>
|
|
193
189
|
<FleetStatus
|
|
194
190
|
title="Resources"
|
|
195
191
|
:values="resourceCounts"
|
|
196
192
|
value-key="count"
|
|
197
|
-
data-testid="gitrepo-deployment-summary"
|
|
198
193
|
/>
|
|
199
194
|
</div>
|
|
200
195
|
</template>
|
|
@@ -56,6 +56,10 @@ export default {
|
|
|
56
56
|
type: Boolean,
|
|
57
57
|
default: true,
|
|
58
58
|
},
|
|
59
|
+
addDisabled: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: false,
|
|
62
|
+
},
|
|
59
63
|
removeLabel: {
|
|
60
64
|
type: String,
|
|
61
65
|
default() {
|
|
@@ -107,6 +111,9 @@ export default {
|
|
|
107
111
|
showAdd() {
|
|
108
112
|
return this.addAllowed;
|
|
109
113
|
},
|
|
114
|
+
disableAdd() {
|
|
115
|
+
return this.addDisabled;
|
|
116
|
+
},
|
|
110
117
|
showRemove() {
|
|
111
118
|
return this.removeAllowed;
|
|
112
119
|
},
|
|
@@ -338,7 +345,7 @@ export default {
|
|
|
338
345
|
<button
|
|
339
346
|
type="button"
|
|
340
347
|
class="btn role-tertiary add"
|
|
341
|
-
:disabled="loading"
|
|
348
|
+
:disabled="loading || disableAdd"
|
|
342
349
|
data-testid="array-list-button"
|
|
343
350
|
@click="add()"
|
|
344
351
|
>
|
|
@@ -24,10 +24,6 @@ export default {
|
|
|
24
24
|
loading: {
|
|
25
25
|
type: Boolean,
|
|
26
26
|
default: false
|
|
27
|
-
},
|
|
28
|
-
disabled: {
|
|
29
|
-
type: Boolean,
|
|
30
|
-
default: true
|
|
31
27
|
}
|
|
32
28
|
},
|
|
33
29
|
computed: {
|
|
@@ -37,18 +33,22 @@ export default {
|
|
|
37
33
|
},
|
|
38
34
|
|
|
39
35
|
addAllowed() {
|
|
40
|
-
return this.filteredOptions.length > 0;
|
|
36
|
+
return this.arrayListProps?.addAllowed || this.filteredOptions.length > 0;
|
|
41
37
|
},
|
|
42
38
|
|
|
43
39
|
defaultAddValue() {
|
|
44
40
|
return this.options[0]?.value;
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
getOptionLabel() {
|
|
44
|
+
return this.selectProps?.getOptionLabel ? (opt) => (this.selectProps?.getOptionLabel(opt) || opt) : undefined;
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
|
|
48
48
|
methods: {
|
|
49
49
|
updateRow(index, value) {
|
|
50
50
|
this.value.splice(index, 1, value);
|
|
51
|
-
this.$emit(value);
|
|
51
|
+
this.$emit('input', this.value);
|
|
52
52
|
},
|
|
53
53
|
calculateOptions(value) {
|
|
54
54
|
const valueOption = this.options.find((o) => o.value === value);
|
|
@@ -71,7 +71,6 @@ export default {
|
|
|
71
71
|
:add-allowed="addAllowed || loading"
|
|
72
72
|
:loading="loading"
|
|
73
73
|
:defaultAddValue="defaultAddValue"
|
|
74
|
-
:disabled="disabled"
|
|
75
74
|
@input="$emit('input', $event)"
|
|
76
75
|
>
|
|
77
76
|
<template v-slot:columns="scope">
|
|
@@ -79,6 +78,7 @@ export default {
|
|
|
79
78
|
:value="scope.row.value"
|
|
80
79
|
v-bind="selectProps"
|
|
81
80
|
:options="calculateOptions(scope.row.value)"
|
|
81
|
+
:get-option-label="getOptionLabel"
|
|
82
82
|
@input="updateRow(scope.i, $event)"
|
|
83
83
|
/>
|
|
84
84
|
</template>
|
|
@@ -87,6 +87,6 @@ export default {
|
|
|
87
87
|
|
|
88
88
|
<style lang="scss" scoped>
|
|
89
89
|
::v-deep .unlabeled-select {
|
|
90
|
-
|
|
91
|
-
}
|
|
90
|
+
height: 61px;
|
|
91
|
+
}
|
|
92
92
|
</style>
|