@rancher/shell 3.0.12-rc.3 → 3.0.12-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/styles/global/_layout.scss +4 -0
- package/assets/translations/en-us.yaml +144 -41
- package/assets/translations/zh-hans.yaml +1 -7
- package/chart/monitoring/ClusterSelector.vue +0 -21
- package/chart/monitoring/prometheus/index.vue +6 -3
- package/components/CruResource.vue +161 -14
- package/components/ExplorerMembers.vue +8 -4
- package/components/ExplorerProjectsNamespaces.vue +10 -6
- package/components/GrowlManager.vue +4 -0
- package/components/MgmtNodeList.vue +184 -0
- package/components/Resource/Detail/Card/StateCard/__tests__/composables.test.ts +90 -1
- package/components/Resource/Detail/Card/StateCard/composables.ts +57 -87
- package/components/Resource/Detail/Card/StatusCard/__tests__/StatusCard.test.ts +61 -0
- package/components/Resource/Detail/Card/StatusCard/index.vue +61 -15
- package/components/Resource/Detail/Metadata/IdentifyingInformation/index.vue +2 -0
- package/components/Resource/Detail/Metadata/KeyValue.vue +5 -2
- package/components/Resource/Detail/Metadata/KeyValueRow.vue +2 -6
- package/components/ResourceDetail/index.vue +1 -1
- package/components/ResourceList/Masthead.vue +7 -1
- package/components/ResourceList/index.vue +82 -1
- package/components/RichTranslation.vue +5 -2
- package/components/Setting.vue +1 -0
- package/components/SubtleLink.vue +31 -6
- package/components/Tabbed/Tab.vue +29 -3
- package/components/Tabbed/index.vue +25 -3
- package/components/TableOfContents/TableOfContents.vue +109 -0
- package/components/TableOfContents/composables.ts +258 -0
- package/components/Window/ContainerShell.vue +21 -11
- package/components/Window/__tests__/ContainerShell.test.ts +107 -37
- package/components/Wizard.vue +9 -4
- package/components/fleet/AppCoChartGrid.vue +401 -0
- package/components/fleet/AppCoEmptyState.vue +127 -0
- package/components/fleet/AppCoPageHeader.vue +119 -0
- package/components/fleet/AppCoVersionSelect.vue +70 -0
- package/components/fleet/FleetClusterTargets/ClusterSelectionFields.vue +217 -0
- package/components/fleet/FleetClusterTargets/TargetsList.vue +123 -35
- package/components/fleet/FleetClusterTargets/index.vue +189 -146
- package/components/fleet/FleetIntro.vue +7 -3
- package/components/fleet/FleetNoWorkspaces.vue +7 -3
- package/components/fleet/FleetSecretSelector.vue +5 -3
- package/components/fleet/FleetValuesFrom.vue +8 -2
- package/components/fleet/GitRepoTargetTab.vue +0 -2
- package/components/fleet/HelmOpAdvancedTab.vue +19 -53
- package/components/fleet/HelmOpAppCoConfigTab.vue +593 -0
- package/components/fleet/HelmOpAppCoResourcesSection.vue +162 -0
- package/components/fleet/HelmOpResourcesSection.vue +82 -0
- package/components/fleet/HelmOpTargetOptionsSection.vue +89 -0
- package/components/fleet/HelmOpTargetTab.vue +64 -60
- package/components/fleet/HelmOpValuesTab.vue +129 -105
- package/components/fleet/__tests__/AppCoEmptyState.test.ts +71 -0
- package/components/fleet/__tests__/AppCoVersionSelect.test.ts +36 -0
- package/components/fleet/__tests__/ClusterSelectionFields.test.ts +62 -0
- package/components/fleet/__tests__/FleetClusterTargets.test.ts +253 -0
- package/components/fleet/__tests__/FleetSecretSelector.test.ts +16 -0
- package/components/fleet/__tests__/FleetValuesFrom.test.ts +44 -0
- package/components/fleet/__tests__/HelmOpAppCoConfigTab.test.ts +59 -0
- package/components/fleet/__tests__/HelmOpAppCoResourcesSection.test.ts +62 -0
- package/components/fleet/__tests__/HelmOpResourcesSection.test.ts +43 -0
- package/components/fleet/__tests__/HelmOpTargetOptionsSection.test.ts +34 -0
- package/components/fleet/__tests__/HelmOpValuesTab.test.ts +39 -0
- package/components/fleet/__tests__/__snapshots__/AppCoEmptyState.test.ts.snap +97 -0
- package/components/fleet/__tests__/__snapshots__/AppCoVersionSelect.test.ts.snap +30 -0
- package/components/fleet/__tests__/__snapshots__/ClusterSelectionFields.test.ts.snap +209 -0
- package/components/fleet/__tests__/__snapshots__/HelmOpTargetOptionsSection.test.ts.snap +140 -0
- package/components/fleet/dashboard/Empty.vue +8 -4
- package/components/fleet/dashboard/ResourceCard.vue +28 -0
- package/components/fleet/dashboard/ResourceDetails.vue +28 -0
- package/components/fleet/dashboard/__tests__/ResourceCard.test.ts +87 -0
- package/components/form/ArrayList.vue +61 -4
- package/components/form/KeyValue.vue +23 -2
- package/components/form/LabeledSelect.vue +39 -1
- package/components/form/Labels.vue +22 -3
- package/components/form/NameNsDescription.vue +13 -5
- package/components/form/ResourceTabs/index.vue +1 -0
- package/components/form/__tests__/NameNsDescription.test.ts +75 -0
- package/components/formatter/InternalExternalIP.vue +10 -4
- package/components/formatter/ServiceTargets.vue +26 -7
- package/components/formatter/__tests__/InternalExternalIP.test.ts +132 -0
- package/components/formatter/__tests__/ServiceTargets.test.ts +412 -0
- package/components/nav/Header.vue +4 -0
- package/components/nav/TopLevelMenu.vue +7 -2
- package/components/nav/__tests__/Header.test.ts +15 -0
- package/components/nav/__tests__/TopLevelMenu.test.ts +120 -2
- package/components/templates/default.vue +9 -4
- package/components/templates/home.vue +9 -4
- package/components/templates/plain.vue +9 -4
- package/composables/useHelmOpResources.test.ts +56 -0
- package/composables/useHelmOpResources.ts +32 -0
- package/composables/useStateColor.test.ts +325 -0
- package/composables/useStateColor.ts +128 -0
- package/config/home-links.js +1 -1
- package/config/labels-annotations.js +1 -0
- package/config/product/explorer.js +17 -4
- package/config/product/manager.js +2 -0
- package/config/router/index.js +16 -0
- package/config/router/navigation-guards/__tests__/authentication.test.ts +130 -0
- package/config/router/navigation-guards/authentication.js +10 -4
- package/config/router/routes.js +20 -6
- package/config/settings.ts +0 -2
- package/config/table-headers.js +3 -4
- package/config/types.js +9 -0
- package/core/plugin-products-base.ts +3 -3
- package/core/plugin-types.ts +83 -30
- package/core/plugin.ts +3 -0
- package/core/types-provisioning.ts +34 -1
- package/core/types.ts +15 -2
- package/detail/__tests__/provisioning.cattle.io.cluster.test.ts +114 -0
- package/detail/__tests__/workload.test.ts +3 -152
- package/detail/catalog.cattle.io.clusterrepo.vue +1 -1
- package/detail/provisioning.cattle.io.cluster.vue +30 -4
- package/detail/workload/index.vue +12 -55
- package/edit/__tests__/catalog.cattle.io.clusterrepo.test.ts +248 -0
- package/edit/__tests__/fleet.cattle.io.helmop.test.ts +105 -0
- package/edit/auditlog.cattle.io.auditpolicy/__tests__/__snapshots__/General.test.ts.snap +6 -0
- package/edit/auditlog.cattle.io.auditpolicy/__tests__/__snapshots__/index.test.ts.snap +1 -0
- package/edit/auth/__tests__/azuread.test.ts +34 -9
- package/edit/auth/__tests__/github.test.ts +234 -0
- package/edit/auth/__tests__/oidc.test.ts +26 -6
- package/edit/auth/__tests__/saml.test.ts +196 -0
- package/edit/auth/azuread.vue +128 -95
- package/edit/auth/github.vue +72 -13
- package/edit/auth/ldap/__tests__/index.test.ts +206 -0
- package/edit/auth/ldap/config.vue +8 -0
- package/edit/auth/ldap/index.vue +75 -1
- package/edit/auth/oidc.vue +119 -73
- package/edit/auth/saml.vue +76 -12
- package/edit/catalog.cattle.io.clusterrepo.vue +140 -32
- package/edit/fleet.cattle.io.helmop.vue +491 -136
- package/edit/management.cattle.io.user.vue +5 -2
- package/edit/provisioning.cattle.io.cluster/rke2.vue +84 -10
- package/edit/provisioning.cattle.io.cluster/tabs/MachinePool.vue +11 -0
- package/list/group.principal.vue +5 -4
- package/list/harvesterhci.io.management.cluster.vue +8 -9
- package/list/management.cattle.io.user.vue +12 -9
- package/list/provisioning.cattle.io.cluster.vue +16 -10
- package/mixins/__tests__/auth-config.test.ts +90 -0
- package/mixins/__tests__/chart.test.ts +94 -0
- package/mixins/__tests__/resource-fetch-api-pagination.test.ts +48 -0
- package/mixins/auth-config.js +7 -0
- package/mixins/chart.js +11 -2
- package/mixins/child-hook.js +12 -6
- package/mixins/create-edit-view/impl.js +5 -3
- package/mixins/resource-fetch-api-pagination.js +21 -1
- package/models/__tests__/catalog.cattle.io.clusterrepo.test.ts +57 -0
- package/models/__tests__/compliance.cattle.io.clusterscan.test.ts +144 -0
- package/models/__tests__/fleet-application.test.ts +175 -0
- package/models/__tests__/fleet.cattle.io.bundle.test.ts +169 -0
- package/models/__tests__/fleet.cattle.io.helmop.test.ts +84 -0
- package/models/__tests__/management.cattle.io.node.ts +22 -0
- package/models/__tests__/namespace.test.ts +36 -0
- package/models/__tests__/provisioning.cattle.io.cluster.test.ts +49 -0
- package/models/__tests__/workload.test.ts +401 -26
- package/models/catalog.cattle.io.clusterrepo.js +28 -4
- package/models/compliance.cattle.io.clusterscan.js +39 -4
- package/models/fleet-application.js +4 -0
- package/models/fleet.cattle.io.helmop.js +20 -1
- package/models/management.cattle.io.cluster.js +18 -2
- package/models/management.cattle.io.node.js +44 -3
- package/models/namespace.js +1 -1
- package/models/pod.js +33 -1
- package/models/provisioning.cattle.io.cluster.js +5 -5
- package/models/workload.js +108 -13
- package/models/workload.service.js +5 -0
- package/package.json +14 -13
- package/pages/about.vue +5 -6
- package/pages/auth/login.vue +0 -35
- package/pages/auth/setup.vue +11 -0
- package/pages/c/_cluster/apps/charts/AppChartCardFooter.vue +2 -2
- package/pages/c/_cluster/apps/charts/AppChartCardSubHeader.vue +10 -1
- package/pages/c/_cluster/apps/charts/__tests__/index.test.ts +93 -0
- package/pages/c/_cluster/apps/charts/chart.vue +2 -1
- package/pages/c/_cluster/apps/charts/index.vue +48 -10
- package/pages/c/_cluster/apps/charts/install.vue +122 -116
- package/pages/c/_cluster/auth/roles/index.vue +5 -4
- package/pages/c/_cluster/explorer/workload-dashboard/ByNamespaceSection.vue +31 -0
- package/pages/c/_cluster/explorer/workload-dashboard/ByStateSection.vue +138 -0
- package/pages/c/_cluster/explorer/workload-dashboard/ByTypeSection.vue +30 -0
- package/pages/c/_cluster/explorer/workload-dashboard/WorkloadCard.vue +155 -0
- package/pages/c/_cluster/explorer/workload-dashboard/WorkloadNamespaceCard.vue +142 -0
- package/pages/c/_cluster/explorer/workload-dashboard/WorkloadTypeCard.vue +159 -0
- package/pages/c/_cluster/explorer/workload-dashboard/__tests__/composable.test.ts +561 -0
- package/pages/c/_cluster/explorer/workload-dashboard/composable.ts +440 -0
- package/pages/c/_cluster/explorer/workload-dashboard/index.vue +187 -0
- package/pages/c/_cluster/explorer/workload-dashboard/types.ts +80 -0
- package/pages/c/_cluster/fleet/application/create.vue +187 -136
- package/pages/c/_cluster/fleet/application/index.vue +5 -3
- package/pages/c/_cluster/fleet/application/suse-app-collection/ChartDetailBody.vue +338 -0
- package/pages/c/_cluster/fleet/application/suse-app-collection/ChartDetailHeader.vue +121 -0
- package/pages/c/_cluster/fleet/application/suse-app-collection/chart.vue +369 -0
- package/pages/c/_cluster/fleet/application/suse-app-collection/charts.vue +248 -0
- package/pages/c/_cluster/fleet/application/suse-app-collection/credentials.vue +310 -0
- package/pages/c/_cluster/fleet/index.vue +2 -2
- package/pages/c/_cluster/uiplugins/__tests__/index.test.ts +96 -0
- package/pages/c/_cluster/uiplugins/index.vue +15 -0
- package/pages/fail-whale.vue +16 -11
- package/pages/home.vue +16 -46
- package/plugins/clean-html.d.ts +9 -0
- package/plugins/dashboard-store/__tests__/resource-class.test.ts +93 -0
- package/plugins/dashboard-store/resource-class.js +62 -7
- package/plugins/steve/__tests__/actions.test.ts +212 -0
- package/plugins/steve/actions.js +96 -0
- package/plugins/steve/steve-pagination-utils.ts +1 -1
- package/rancher-components/Accordion/Accordion.vue +53 -9
- package/rancher-components/Form/Checkbox/Checkbox.vue +14 -0
- package/rancher-components/Form/Radio/RadioButton.vue +17 -1
- package/rancher-components/Form/Radio/RadioGroup.vue +10 -0
- package/rancher-components/Pill/RcTag/RcTag.vue +3 -2
- package/rancher-components/RcButton/RcButton.test.ts +103 -0
- package/rancher-components/RcButton/RcButton.vue +94 -15
- package/rancher-components/RcButton/types.ts +3 -0
- package/rancher-components/RcItemCard/RcItemCard.test.ts +18 -0
- package/rancher-components/RcItemCard/RcItemCard.vue +2 -2
- package/rancher-components/RcSection/RcSection.vue +28 -3
- package/scripts/extension/helm/package/Dockerfile +1 -1
- package/scripts/test-plugins-build.sh +2 -1
- package/store/__tests__/notifications.test.ts +434 -0
- package/store/catalog.js +57 -0
- package/store/plugins.js +7 -4
- package/types/components/buttonGroup.ts +5 -0
- package/types/shell/index.d.ts +104 -70
- package/utils/__tests__/auth.test.ts +273 -0
- package/utils/__tests__/computed.test.ts +193 -0
- package/utils/__tests__/cspAdaptor.test.ts +163 -0
- package/utils/__tests__/dom.test.ts +81 -0
- package/utils/__tests__/duration.test.ts +37 -1
- package/utils/__tests__/dynamic-importer.test.ts +102 -0
- package/utils/__tests__/fleet-appco.test.ts +312 -0
- package/utils/__tests__/monitoring.test.ts +130 -0
- package/utils/__tests__/object.test.ts +22 -0
- package/utils/__tests__/platform.test.ts +91 -0
- package/utils/__tests__/position.test.ts +237 -0
- package/utils/__tests__/provider.test.ts +51 -1
- package/utils/__tests__/queue.test.ts +232 -0
- package/utils/__tests__/release-notes.test.ts +221 -0
- package/utils/__tests__/router.test.js +254 -1
- package/utils/__tests__/select.test.ts +208 -0
- package/utils/__tests__/time.test.ts +265 -1
- package/utils/__tests__/title.test.ts +47 -0
- package/utils/__tests__/width.test.ts +53 -0
- package/utils/__tests__/window.test.ts +158 -0
- package/utils/__tests__/xccdf.test.ts +126 -6
- package/utils/crypto/__tests__/browserHashUtils.test.ts +98 -0
- package/utils/crypto/__tests__/index.test.ts +144 -0
- package/utils/duration.ts +104 -0
- package/utils/dynamic-content/__tests__/notification-handler.test.ts +196 -0
- package/utils/dynamic-content/info.ts +2 -1
- package/utils/error.js +13 -0
- package/utils/fleet-appco.ts +323 -0
- package/utils/object.js +22 -2
- package/utils/provider.ts +12 -0
- package/utils/validators/__tests__/container-images.test.ts +104 -0
- package/utils/validators/__tests__/flow-output.test.ts +91 -0
- package/utils/validators/__tests__/logging-outputs.test.ts +58 -0
- package/utils/validators/__tests__/monitoring-route.test.ts +119 -0
- package/utils/xccdf.ts +39 -42
- package/vue.config.js +1 -1
- package/pages/support/index.vue +0 -264
- package/utils/duration.js +0 -43
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, ref, watch, onMounted } from 'vue';
|
|
3
|
+
import { useStore } from 'vuex';
|
|
4
|
+
import { useRoute, useRouter } from 'vue-router';
|
|
5
|
+
import type { RouteLocationRaw } from 'vue-router';
|
|
6
|
+
|
|
7
|
+
import { useI18n } from '@shell/composables/useI18n';
|
|
8
|
+
import Loading from '@shell/components/Loading';
|
|
9
|
+
import { Banner } from '@components/Banner';
|
|
10
|
+
import { RcButton } from '@components/RcButton';
|
|
11
|
+
import ChartDetailHeader from './ChartDetailHeader.vue';
|
|
12
|
+
import ChartDetailBody from './ChartDetailBody.vue';
|
|
13
|
+
|
|
14
|
+
import { REPO_TYPE, REPO, CHART, VERSION } from '@shell/config/query-params';
|
|
15
|
+
import { FLEET, ZERO_TIME, CATALOG as CATALOG_TYPES } from '@shell/config/types';
|
|
16
|
+
import { CATALOG as CATALOG_ANNOTATIONS } from '@shell/config/labels-annotations';
|
|
17
|
+
import { addParams } from '@shell/utils/url';
|
|
18
|
+
import { compareChartVersions } from '@shell/utils/chart';
|
|
19
|
+
import { isPrerelease } from '@shell/utils/version';
|
|
20
|
+
import { LINUX } from '@shell/store/catalog';
|
|
21
|
+
|
|
22
|
+
import isEqual from 'lodash/isEqual';
|
|
23
|
+
import difference from 'lodash/difference';
|
|
24
|
+
import day from 'dayjs';
|
|
25
|
+
|
|
26
|
+
interface CatalogVersion {
|
|
27
|
+
version: string;
|
|
28
|
+
created?: string;
|
|
29
|
+
icon?: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
appVersion?: string;
|
|
32
|
+
home?: string;
|
|
33
|
+
maintainers?: Array<{ name?: string; url?: string; email?: string }>;
|
|
34
|
+
sources?: string[];
|
|
35
|
+
urls?: string[];
|
|
36
|
+
keywords?: string[];
|
|
37
|
+
annotations?: Record<string, string>;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
interface ChartData {
|
|
41
|
+
chartNameDisplay: string;
|
|
42
|
+
icon: string;
|
|
43
|
+
versions: CatalogVersion[];
|
|
44
|
+
repoNameDisplay: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
interface MappedVersion {
|
|
48
|
+
label: string;
|
|
49
|
+
version: string;
|
|
50
|
+
originalVersion: string;
|
|
51
|
+
id: string;
|
|
52
|
+
created: string | null;
|
|
53
|
+
disabled: boolean;
|
|
54
|
+
keywords: string[];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
interface VersionInfo {
|
|
58
|
+
appReadme?: string;
|
|
59
|
+
readme?: string;
|
|
60
|
+
chart?: {
|
|
61
|
+
appVersion?: string;
|
|
62
|
+
home?: string;
|
|
63
|
+
maintainers?: Array<{ name?: string; url?: string; email?: string }>;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
interface RepoObj {
|
|
68
|
+
nameDisplay?: string;
|
|
69
|
+
detailLocation: RouteLocationRaw;
|
|
70
|
+
links: { info: string };
|
|
71
|
+
followLink: (rel: string, opts: { url: string }) => Promise<VersionInfo>;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const store = useStore();
|
|
75
|
+
const route = useRoute();
|
|
76
|
+
const router = useRouter();
|
|
77
|
+
const { t } = useI18n(store);
|
|
78
|
+
|
|
79
|
+
const loading = ref(true);
|
|
80
|
+
const chart = ref<ChartData | null>(null);
|
|
81
|
+
const version = ref<CatalogVersion | null>(null);
|
|
82
|
+
const versionInfo = ref<VersionInfo | null>(null);
|
|
83
|
+
const versionInfoError = ref('');
|
|
84
|
+
const chartLoadError = ref(false);
|
|
85
|
+
const activeVersionName = ref('');
|
|
86
|
+
|
|
87
|
+
const currentCluster = computed(() => store.getters.currentCluster);
|
|
88
|
+
|
|
89
|
+
const query = computed(() => ({
|
|
90
|
+
repoType: (route.query[REPO_TYPE] as string) || '',
|
|
91
|
+
repoName: (route.query[REPO] as string) || '',
|
|
92
|
+
chartName: (route.query[CHART] as string) || '',
|
|
93
|
+
versionName: (route.query[VERSION] as string) || '',
|
|
94
|
+
}));
|
|
95
|
+
|
|
96
|
+
const secretName = computed(() => (route.query.secret as string) || '');
|
|
97
|
+
|
|
98
|
+
const repoObj = ref<RepoObj | null>(null);
|
|
99
|
+
|
|
100
|
+
const mappedVersions = computed((): MappedVersion[] => {
|
|
101
|
+
const versions = (chart.value?.versions || []).slice();
|
|
102
|
+
|
|
103
|
+
versions.sort((a, b) => compareChartVersions(b.version, a.version));
|
|
104
|
+
|
|
105
|
+
const OSs = currentCluster.value?.workerOSs;
|
|
106
|
+
const out: MappedVersion[] = [];
|
|
107
|
+
const seen = new Set<string>();
|
|
108
|
+
|
|
109
|
+
versions.forEach((v) => {
|
|
110
|
+
if (seen.has(v.version)) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
seen.add(v.version);
|
|
114
|
+
|
|
115
|
+
if (isPrerelease(v.version)) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const nue: MappedVersion = {
|
|
120
|
+
label: v.version,
|
|
121
|
+
version: v.version,
|
|
122
|
+
originalVersion: v.version,
|
|
123
|
+
id: v.version,
|
|
124
|
+
created: v.created || null,
|
|
125
|
+
disabled: false,
|
|
126
|
+
keywords: v.keywords || [],
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const permittedSystems = (v?.annotations?.[CATALOG_ANNOTATIONS.PERMITTED_OS] || LINUX).split(',');
|
|
130
|
+
|
|
131
|
+
if (difference(OSs, permittedSystems).length > 0) {
|
|
132
|
+
nue.disabled = true;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (permittedSystems.length === 1) {
|
|
136
|
+
nue.label = t(`catalog.install.versions.${ permittedSystems[0] }`, { ver: v.version });
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
out.push(nue);
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
const selectedMatch = out.find((v) => v.id === query.value.versionName);
|
|
143
|
+
|
|
144
|
+
if (!selectedMatch && query.value.versionName) {
|
|
145
|
+
out.unshift({
|
|
146
|
+
label: query.value.versionName,
|
|
147
|
+
version: query.value.versionName,
|
|
148
|
+
originalVersion: query.value.versionName,
|
|
149
|
+
id: query.value.versionName,
|
|
150
|
+
created: null,
|
|
151
|
+
disabled: false,
|
|
152
|
+
keywords: [],
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return out;
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
const headerSubItems = computed(() => {
|
|
160
|
+
if (!version.value) {
|
|
161
|
+
return [];
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const items: { icon: string; iconTooltip: { key: string }; label: string }[] = [];
|
|
165
|
+
|
|
166
|
+
const versionLabel = activeVersionName.value || query.value.versionName;
|
|
167
|
+
|
|
168
|
+
if (versionLabel) {
|
|
169
|
+
items.push({
|
|
170
|
+
icon: 'icon-version-alt',
|
|
171
|
+
iconTooltip: { key: 'tableHeaders.version' },
|
|
172
|
+
label: versionLabel,
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
if (version.value.created && version.value.created !== ZERO_TIME) {
|
|
177
|
+
items.push({
|
|
178
|
+
icon: 'icon-refresh-alt',
|
|
179
|
+
iconTooltip: { key: 'tableHeaders.lastUpdated' },
|
|
180
|
+
label: day(version.value.created).format('MMM D, YYYY'),
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
return items;
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
const appVersion = computed(() => version.value?.appVersion || versionInfo.value?.chart?.appVersion);
|
|
188
|
+
const home = computed(() => version.value?.home || versionInfo.value?.chart?.home);
|
|
189
|
+
|
|
190
|
+
const maintainers = computed(() => {
|
|
191
|
+
const list = version.value?.maintainers || versionInfo.value?.chart?.maintainers || [];
|
|
192
|
+
|
|
193
|
+
return list.map((m, i) => {
|
|
194
|
+
const label = m.name || m.url || m.email || t('generic.unknown');
|
|
195
|
+
let href: string | null = null;
|
|
196
|
+
|
|
197
|
+
if (m.url) {
|
|
198
|
+
href = m.url;
|
|
199
|
+
} else if (m.email) {
|
|
200
|
+
href = `mailto:${ m.email }`;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return {
|
|
204
|
+
id: `${ m.name }-${ i }`, label, href, name: m.name
|
|
205
|
+
};
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
const fetchChartData = async(versionOverride?: string) => {
|
|
210
|
+
loading.value = true;
|
|
211
|
+
versionInfoError.value = '';
|
|
212
|
+
chartLoadError.value = false;
|
|
213
|
+
|
|
214
|
+
try {
|
|
215
|
+
await store.dispatch('catalog/loadRepo', { repoName: query.value.repoName });
|
|
216
|
+
|
|
217
|
+
const inStore = store.getters.currentCluster ? store.getters['currentProduct'].inStore : 'management';
|
|
218
|
+
|
|
219
|
+
repoObj.value = store.getters[`${ inStore }/byId`](CATALOG_TYPES.CLUSTER_REPO, query.value.repoName);
|
|
220
|
+
|
|
221
|
+
const catalogChart = store.getters['catalog/chart']({
|
|
222
|
+
repoType: query.value.repoType,
|
|
223
|
+
repoName: query.value.repoName,
|
|
224
|
+
chartName: query.value.chartName,
|
|
225
|
+
includeHidden: true,
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
const chartVersions = catalogChart?.versions as CatalogVersion[] | undefined;
|
|
229
|
+
|
|
230
|
+
if (!chartVersions?.length) {
|
|
231
|
+
chartLoadError.value = true;
|
|
232
|
+
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
chart.value = {
|
|
237
|
+
chartNameDisplay: catalogChart.chartNameDisplay || query.value.chartName,
|
|
238
|
+
icon: catalogChart.icon || chartVersions[0]?.icon || '',
|
|
239
|
+
versions: chartVersions,
|
|
240
|
+
repoNameDisplay: repoObj.value?.nameDisplay || query.value.repoName,
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
let versionName = versionOverride || query.value.versionName;
|
|
244
|
+
|
|
245
|
+
if (!versionName) {
|
|
246
|
+
const firstRelease = chartVersions.find((v) => !isPrerelease(v.version));
|
|
247
|
+
|
|
248
|
+
versionName = firstRelease?.version || chartVersions[0].version;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
const matchedVersion = chartVersions.find((v) => v.version === versionName);
|
|
252
|
+
|
|
253
|
+
version.value = matchedVersion || chartVersions[0];
|
|
254
|
+
activeVersionName.value = version.value.version;
|
|
255
|
+
|
|
256
|
+
if (repoObj.value) {
|
|
257
|
+
try {
|
|
258
|
+
versionInfo.value = await repoObj.value.followLink('info', {
|
|
259
|
+
url: addParams(repoObj.value.links.info, {
|
|
260
|
+
chartName: query.value.chartName,
|
|
261
|
+
version: activeVersionName.value,
|
|
262
|
+
}),
|
|
263
|
+
});
|
|
264
|
+
} catch (e: unknown) {
|
|
265
|
+
versionInfoError.value = e instanceof Error ? e.message : String(e);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
} finally {
|
|
269
|
+
loading.value = false;
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
const install = () => {
|
|
274
|
+
router.push({
|
|
275
|
+
name: 'c-cluster-fleet-application-resource-create',
|
|
276
|
+
params: {
|
|
277
|
+
cluster: route.params.cluster as string,
|
|
278
|
+
resource: FLEET.HELM_OP,
|
|
279
|
+
},
|
|
280
|
+
query: {
|
|
281
|
+
type: FLEET.SUSE_APP_COLLECTION,
|
|
282
|
+
chart: query.value.chartName,
|
|
283
|
+
version: activeVersionName.value,
|
|
284
|
+
secret: secretName.value,
|
|
285
|
+
},
|
|
286
|
+
});
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
const onSelectVersion = (vers: MappedVersion) => {
|
|
290
|
+
router.push({
|
|
291
|
+
name: route.name as string,
|
|
292
|
+
params: route.params,
|
|
293
|
+
query: {
|
|
294
|
+
...route.query,
|
|
295
|
+
[VERSION]: vers.id,
|
|
296
|
+
},
|
|
297
|
+
});
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
watch(() => route.query, (neu, old) => {
|
|
301
|
+
if (!isEqual(neu, old) && Object.keys(neu).length > 0) {
|
|
302
|
+
const newVersion = neu[VERSION] as string;
|
|
303
|
+
|
|
304
|
+
fetchChartData(newVersion);
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
onMounted(() => fetchChartData());
|
|
309
|
+
</script>
|
|
310
|
+
|
|
311
|
+
<template>
|
|
312
|
+
<Loading v-if="loading" />
|
|
313
|
+
<div
|
|
314
|
+
v-else
|
|
315
|
+
class="appco-chart-detail"
|
|
316
|
+
>
|
|
317
|
+
<Banner
|
|
318
|
+
v-if="chartLoadError"
|
|
319
|
+
color="error"
|
|
320
|
+
:label="t('fleet.appCo.chart.loadError')"
|
|
321
|
+
/>
|
|
322
|
+
|
|
323
|
+
<ChartDetailHeader
|
|
324
|
+
v-if="chart"
|
|
325
|
+
:icon="chart.icon"
|
|
326
|
+
:chart-name="chart.chartNameDisplay"
|
|
327
|
+
:sub-header-items="headerSubItems"
|
|
328
|
+
:description="version && version.description ? version.description : ''"
|
|
329
|
+
>
|
|
330
|
+
<template #back-link>
|
|
331
|
+
<router-link :to="{ name: 'c-cluster-fleet-application-appco-charts', params: { cluster: route.params.cluster }, query: { secret: secretName } }">
|
|
332
|
+
{{ t('fleet.appCo.chart.title') }}
|
|
333
|
+
</router-link>
|
|
334
|
+
</template>
|
|
335
|
+
<template #action>
|
|
336
|
+
<RcButton
|
|
337
|
+
data-testid="appco-chart-install-btn"
|
|
338
|
+
size="large"
|
|
339
|
+
@click.prevent="install"
|
|
340
|
+
>
|
|
341
|
+
<i class="icon icon-plus mmr-2" />
|
|
342
|
+
{{ t('catalog.chart.chartButton.action.install') }}
|
|
343
|
+
</RcButton>
|
|
344
|
+
</template>
|
|
345
|
+
</ChartDetailHeader>
|
|
346
|
+
|
|
347
|
+
<div class="dashed-spacer" />
|
|
348
|
+
|
|
349
|
+
<ChartDetailBody
|
|
350
|
+
:version="version"
|
|
351
|
+
:version-info="versionInfo"
|
|
352
|
+
:version-info-error="versionInfoError"
|
|
353
|
+
:versions="mappedVersions"
|
|
354
|
+
:repo="repoObj"
|
|
355
|
+
:chart="chart"
|
|
356
|
+
:app-version="appVersion || ''"
|
|
357
|
+
:home="home || ''"
|
|
358
|
+
:maintainers="maintainers"
|
|
359
|
+
@select-version="onSelectVersion"
|
|
360
|
+
/>
|
|
361
|
+
</div>
|
|
362
|
+
</template>
|
|
363
|
+
|
|
364
|
+
<style lang="scss" scoped>
|
|
365
|
+
.appco-chart-detail {
|
|
366
|
+
display: flex;
|
|
367
|
+
flex-direction: column;
|
|
368
|
+
}
|
|
369
|
+
</style>
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
computed, ref, shallowRef, onMounted, onBeforeUnmount
|
|
4
|
+
} from 'vue';
|
|
5
|
+
import { useStore } from 'vuex';
|
|
6
|
+
import { useRoute, useRouter } from 'vue-router';
|
|
7
|
+
|
|
8
|
+
import { SECRET, CATALOG as CATALOG_TYPES } from '@shell/config/types';
|
|
9
|
+
import {
|
|
10
|
+
FLEET_APPCO_AUTH_GENERATE_NAME, fetchAppCoCharts, deriveRepoName, ensureAppCoResources, ensureAppCoImagePullSecret
|
|
11
|
+
} from '@shell/utils/fleet-appco';
|
|
12
|
+
import { CATALOG } from '@shell/config/labels-annotations';
|
|
13
|
+
import { REPO_TYPE, REPO, CHART } from '@shell/config/query-params';
|
|
14
|
+
import AppCoPageHeader from '@shell/components/fleet/AppCoPageHeader.vue';
|
|
15
|
+
import AppCoChartGrid from '@shell/components/fleet/AppCoChartGrid.vue';
|
|
16
|
+
import AppCoEmptyState from '@shell/components/fleet/AppCoEmptyState.vue';
|
|
17
|
+
import Loading from '@shell/components/Loading';
|
|
18
|
+
import { useI18n } from '@shell/composables/useI18n';
|
|
19
|
+
import type { RepoState } from '@shell/utils/fleet-appco';
|
|
20
|
+
import { RcIcon } from '@components/RcIcon';
|
|
21
|
+
|
|
22
|
+
interface ChartVersion {
|
|
23
|
+
version: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
icon?: string;
|
|
26
|
+
appVersion?: string;
|
|
27
|
+
created?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const store = useStore();
|
|
31
|
+
const route = useRoute();
|
|
32
|
+
const router = useRouter();
|
|
33
|
+
const { t } = useI18n(store);
|
|
34
|
+
const chartEntries = ref<Record<string, ChartVersion[]>>({});
|
|
35
|
+
const chartsLoading = ref(true);
|
|
36
|
+
const chartsFetchError = ref(false);
|
|
37
|
+
const repoState = ref<RepoState | null>(null);
|
|
38
|
+
const secretName = ref((route.query.secret as string) || '');
|
|
39
|
+
const abortController = shallowRef<AbortController | null>(null);
|
|
40
|
+
const repoCreationAttempted = ref(false);
|
|
41
|
+
|
|
42
|
+
onBeforeUnmount(() => {
|
|
43
|
+
abortController.value?.abort();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const namespace = computed(() => store.getters.workspace);
|
|
47
|
+
const repoName = computed(() => deriveRepoName(secretName.value));
|
|
48
|
+
|
|
49
|
+
const getSecrets = () => store.getters[`${ CATALOG._MANAGEMENT }/all`](SECRET) || [];
|
|
50
|
+
|
|
51
|
+
const secretUsername = computed(() => {
|
|
52
|
+
if (!secretName.value) {
|
|
53
|
+
return '';
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const ns = namespace.value;
|
|
57
|
+
const match = getSecrets().find((s: any) => s.metadata?.namespace === ns && s.metadata?.name === secretName.value);
|
|
58
|
+
|
|
59
|
+
return match?.decodedData?.username || '';
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const repoListRoute = computed(() => ({
|
|
63
|
+
name: 'c-cluster-product-resource-id',
|
|
64
|
+
params: {
|
|
65
|
+
cluster: 'local',
|
|
66
|
+
product: 'apps',
|
|
67
|
+
resource: CATALOG_TYPES.CLUSTER_REPO,
|
|
68
|
+
id: repoName.value,
|
|
69
|
+
},
|
|
70
|
+
}));
|
|
71
|
+
|
|
72
|
+
const repoBadgeState = computed(() => repoState.value || undefined);
|
|
73
|
+
|
|
74
|
+
const isRepoTransitioning = computed(() => repoState.value?.transitioning && !chartsFetchError.value);
|
|
75
|
+
const isRepoError = computed(() => repoState.value?.error && !chartsFetchError.value);
|
|
76
|
+
|
|
77
|
+
const editCredentials = () => {
|
|
78
|
+
router.push({
|
|
79
|
+
name: 'c-cluster-fleet-application-appco-credentials',
|
|
80
|
+
params: { cluster: route.params.cluster as string },
|
|
81
|
+
query: { secret: secretName.value },
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const loadCharts = async() => {
|
|
86
|
+
abortController.value?.abort();
|
|
87
|
+
abortController.value = new AbortController();
|
|
88
|
+
chartsLoading.value = true;
|
|
89
|
+
chartsFetchError.value = false;
|
|
90
|
+
repoState.value = null;
|
|
91
|
+
|
|
92
|
+
try {
|
|
93
|
+
const result = await fetchAppCoCharts(store, repoName.value, (state) => {
|
|
94
|
+
repoState.value = state;
|
|
95
|
+
}, abortController.value.signal);
|
|
96
|
+
|
|
97
|
+
repoState.value = result.repoState;
|
|
98
|
+
|
|
99
|
+
if (!result.entries) {
|
|
100
|
+
if (result.repoState?.error || result.repoState?.transitioning) {
|
|
101
|
+
chartsFetchError.value = false;
|
|
102
|
+
} else if (result.notFound && !repoCreationAttempted.value && !abortController.value?.signal.aborted) {
|
|
103
|
+
// The repo genuinely doesn't exist (404) but a secret was supplied: create
|
|
104
|
+
// the image-pull secret + ClusterRepo (same as the credentials page) and
|
|
105
|
+
// retry. A real connection error (non-404) falls through to the error state
|
|
106
|
+
// below instead of being mistaken for an absent repo.
|
|
107
|
+
repoCreationAttempted.value = true;
|
|
108
|
+
|
|
109
|
+
const ensured = await ensureAppCoResources(store, secretName.value, namespace.value, t);
|
|
110
|
+
|
|
111
|
+
if (ensured) {
|
|
112
|
+
return loadCharts();
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
chartsFetchError.value = true;
|
|
116
|
+
} else {
|
|
117
|
+
chartsFetchError.value = true;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
chartEntries.value = result.entries;
|
|
124
|
+
|
|
125
|
+
// The repo exists, but its image-pull secret may have been removed (or never
|
|
126
|
+
// created if the repo was added outside this flow). Ensure it idempotently so
|
|
127
|
+
// chart installs can still pull images. A failure here must not block listing.
|
|
128
|
+
try {
|
|
129
|
+
await ensureAppCoImagePullSecret(store, secretName.value, namespace.value);
|
|
130
|
+
} catch (e) {
|
|
131
|
+
console.error('Failed to ensure AppCo image-pull secret:', e); // eslint-disable-line no-console
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
await store.dispatch('catalog/loadRepo', { repoName: repoName.value });
|
|
135
|
+
} catch (e) {
|
|
136
|
+
console.error('Failed to fetch AppCo chart list:', e); // eslint-disable-line no-console
|
|
137
|
+
chartsFetchError.value = true;
|
|
138
|
+
} finally {
|
|
139
|
+
chartsLoading.value = false;
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
const selectChart = (chartValue: { name: string }) => {
|
|
144
|
+
if (!chartValue) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
router.push({
|
|
149
|
+
name: 'c-cluster-fleet-application-appco-chart',
|
|
150
|
+
params: { cluster: route.params.cluster as string },
|
|
151
|
+
query: {
|
|
152
|
+
[REPO_TYPE]: 'cluster',
|
|
153
|
+
[REPO]: repoName.value,
|
|
154
|
+
[CHART]: chartValue.name,
|
|
155
|
+
secret: secretName.value,
|
|
156
|
+
},
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
onMounted(async() => {
|
|
161
|
+
if (!secretName.value) {
|
|
162
|
+
const ns = namespace.value;
|
|
163
|
+
const match = getSecrets().find((s: any) => s.metadata?.namespace === ns && s.metadata?.name?.startsWith(FLEET_APPCO_AUTH_GENERATE_NAME));
|
|
164
|
+
|
|
165
|
+
if (match) {
|
|
166
|
+
secretName.value = match.metadata.name;
|
|
167
|
+
} else {
|
|
168
|
+
router.replace({
|
|
169
|
+
name: 'c-cluster-fleet-application-appco-credentials',
|
|
170
|
+
params: { cluster: route.params.cluster as string },
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
await loadCharts();
|
|
178
|
+
});
|
|
179
|
+
</script>
|
|
180
|
+
|
|
181
|
+
<template>
|
|
182
|
+
<div class="appco-charts-page">
|
|
183
|
+
<AppCoPageHeader
|
|
184
|
+
:subtitle="false"
|
|
185
|
+
:show-secret-info="true"
|
|
186
|
+
:secret-label="secretUsername"
|
|
187
|
+
@edit-credentials="editCredentials"
|
|
188
|
+
/>
|
|
189
|
+
|
|
190
|
+
<AppCoEmptyState
|
|
191
|
+
v-if="isRepoTransitioning"
|
|
192
|
+
:title="t('fleet.helmOp.add.steps.selection.repoLoading.title')"
|
|
193
|
+
:badge-state="repoBadgeState"
|
|
194
|
+
data-testid="appco-charts-repo-loading"
|
|
195
|
+
>
|
|
196
|
+
{{ t('fleet.helmOp.add.steps.selection.repoLoading.description') }}
|
|
197
|
+
</AppCoEmptyState>
|
|
198
|
+
|
|
199
|
+
<Loading
|
|
200
|
+
v-else-if="chartsLoading"
|
|
201
|
+
/>
|
|
202
|
+
|
|
203
|
+
<AppCoEmptyState
|
|
204
|
+
v-else-if="isRepoError"
|
|
205
|
+
:title="t('fleet.helmOp.add.steps.selection.repoLoading.title')"
|
|
206
|
+
:badge-state="repoBadgeState"
|
|
207
|
+
data-testid="appco-charts-repo-error"
|
|
208
|
+
>
|
|
209
|
+
{{ t('fleet.helmOp.add.steps.selection.repoError.description') }}
|
|
210
|
+
<router-link :to="repoListRoute">
|
|
211
|
+
{{ t('fleet.helmOp.add.steps.selection.repoError.link') }}
|
|
212
|
+
<RcIcon
|
|
213
|
+
type="external-link"
|
|
214
|
+
size="small"
|
|
215
|
+
/>
|
|
216
|
+
</router-link>
|
|
217
|
+
</AppCoEmptyState>
|
|
218
|
+
|
|
219
|
+
<AppCoEmptyState
|
|
220
|
+
v-else-if="chartsFetchError"
|
|
221
|
+
:title="t('fleet.helmOp.add.steps.selection.emptyState.connectionError.title')"
|
|
222
|
+
data-testid="appco-charts-fetch-error"
|
|
223
|
+
>
|
|
224
|
+
{{ t('fleet.helmOp.add.steps.selection.emptyState.connectionError.descriptionPre') }}<br>
|
|
225
|
+
{{ t('fleet.helmOp.add.steps.selection.emptyState.connectionError.please') }}
|
|
226
|
+
<a
|
|
227
|
+
href="#"
|
|
228
|
+
@click.prevent="loadCharts"
|
|
229
|
+
>{{ t('fleet.helmOp.add.steps.selection.emptyState.connectionError.tryAgain') }}</a>
|
|
230
|
+
{{ t('fleet.helmOp.add.steps.selection.emptyState.connectionError.descriptionPost') }}
|
|
231
|
+
</AppCoEmptyState>
|
|
232
|
+
|
|
233
|
+
<AppCoChartGrid
|
|
234
|
+
v-else
|
|
235
|
+
:charts="chartEntries"
|
|
236
|
+
:search-placeholder="t('fleet.helmOp.add.steps.selection.searchPlaceholder')"
|
|
237
|
+
@select-chart="selectChart"
|
|
238
|
+
/>
|
|
239
|
+
</div>
|
|
240
|
+
</template>
|
|
241
|
+
|
|
242
|
+
<style lang="scss" scoped>
|
|
243
|
+
.appco-charts-page {
|
|
244
|
+
display: flex;
|
|
245
|
+
flex-direction: column;
|
|
246
|
+
min-height: 100%;
|
|
247
|
+
}
|
|
248
|
+
</style>
|