@rancher/shell 3.0.5-rc.8 → 3.0.5
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/base/_color.scss +4 -1
- package/assets/styles/global/_tooltip.scss +7 -4
- package/assets/styles/themes/_dark.scss +11 -0
- package/assets/styles/themes/_light.scss +13 -1
- package/assets/styles/themes/_modern.scss +22 -0
- package/assets/translations/en-us.yaml +147 -19
- package/assets/translations/zh-hans.yaml +0 -1
- package/chart/monitoring/grafana/index.vue +8 -2
- package/components/ActionMenuShell.vue +3 -1
- package/components/Cron/CronExpressionEditor.vue +299 -0
- package/components/Cron/CronExpressionEditorModal.vue +247 -0
- package/components/Cron/CronTooltip.vue +87 -0
- package/components/Cron/types.ts +13 -0
- package/components/ForceDirectedTreeChart/composable.ts +11 -0
- package/components/PodSecurityAdmission.vue +2 -0
- package/components/PromptModal.vue +1 -1
- package/components/Resource/Detail/Card/__tests__/StateCard.test.ts +1 -0
- package/components/Resource/Detail/CopyToClipboard.vue +78 -0
- package/components/Resource/Detail/FetchLoader/__tests__/composables.test.ts +69 -0
- package/components/Resource/Detail/FetchLoader/composables.ts +27 -0
- package/components/Resource/Detail/Metadata/Annotations/__tests__/index.test.ts +1 -1
- package/components/Resource/Detail/Metadata/Annotations/index.vue +1 -1
- package/components/Resource/Detail/Metadata/IdentifyingInformation/__tests__/identifying-fields.test.ts +13 -61
- package/components/Resource/Detail/Metadata/IdentifyingInformation/__tests__/index.test.ts +33 -6
- package/components/Resource/Detail/Metadata/IdentifyingInformation/identifying-fields.ts +24 -38
- package/components/Resource/Detail/Metadata/IdentifyingInformation/index.vue +25 -5
- package/components/Resource/Detail/Metadata/KeyValue.vue +12 -23
- package/components/Resource/Detail/Metadata/KeyValueRow.vue +144 -0
- package/components/Resource/Detail/Metadata/Labels/__tests__/index.test.ts +1 -0
- package/components/Resource/Detail/Metadata/Labels/index.vue +1 -0
- package/components/Resource/Detail/Metadata/__tests__/KeyValue.test.ts +30 -32
- package/components/Resource/Detail/Metadata/__tests__/KeyValueRow.test.ts +108 -0
- package/components/Resource/Detail/Metadata/__tests__/composables.test.ts +0 -3
- package/components/Resource/Detail/Metadata/__tests__/index.test.ts +12 -5
- package/components/Resource/Detail/Metadata/composables.ts +1 -4
- package/components/Resource/Detail/Metadata/index.vue +1 -0
- package/components/Resource/Detail/Preview/Content.vue +63 -0
- package/components/Resource/Detail/Preview/Preview.vue +128 -0
- package/components/Resource/Detail/Preview/__tests__/Content.spec.ts +71 -0
- package/components/Resource/Detail/Preview/__tests__/Preview.spec.ts +121 -0
- package/components/Resource/Detail/ResourcePopover/ResourcePopoverCard.vue +141 -0
- package/components/Resource/Detail/ResourcePopover/__tests__/ResourcePopoverCard.test.ts +136 -0
- package/components/Resource/Detail/ResourcePopover/__tests__/index.test.ts +245 -0
- package/components/Resource/Detail/ResourcePopover/index.vue +226 -0
- package/components/Resource/Detail/SpacedRow.vue +1 -0
- package/components/Resource/Detail/TitleBar/__tests__/composables.test.ts +0 -5
- package/components/Resource/Detail/TitleBar/__tests__/index.test.ts +1 -1
- package/components/Resource/Detail/TitleBar/composables.ts +1 -3
- package/components/Resource/Detail/TitleBar/index.vue +2 -29
- package/components/Resource/Detail/ViewOptions/composable.ts +9 -0
- package/components/Resource/Detail/ViewOptions/index.vue +41 -0
- package/components/Resource/Detail/__tests__/CopyToClipboard.spec.ts +82 -0
- package/components/ResourceDetail/Masthead/legacy.vue +0 -19
- package/components/ResourceDetail/index.vue +1 -26
- package/components/ResourceTable.vue +24 -0
- package/components/SortableTable/index.vue +7 -1
- package/components/SortableTable/paging.js +3 -0
- package/components/Tabbed/Tab.vue +43 -1
- package/components/Tabbed/index.vue +3 -1
- package/components/__tests__/Cron/CronExpressionEditor.test.ts +151 -0
- package/components/__tests__/Cron/CronExpressionEditorModal.test.ts +81 -0
- package/components/auth/login/saml.vue +86 -0
- package/components/form/LabeledSelect.vue +8 -8
- package/components/form/ProjectMemberEditor.vue +2 -0
- package/components/form/ResourceTabs/composable.ts +54 -0
- package/components/form/ResourceTabs/index.vue +10 -7
- package/components/form/Select.vue +13 -10
- package/components/form/__tests__/LabeledSelect.test.ts +133 -0
- package/components/form/__tests__/Select.test.ts +134 -0
- package/components/nav/Header.vue +6 -5
- package/composables/useExtensionManager.ts +17 -0
- package/config/home-links.js +12 -0
- package/config/labels-annotations.js +0 -1
- package/config/page-actions.js +0 -1
- package/config/product/explorer.js +3 -1
- package/config/product/fleet.js +2 -7
- package/config/product/manager.js +0 -5
- package/config/query-params.js +1 -0
- package/config/router/navigation-guards/clusters.js +2 -1
- package/config/router/navigation-guards/products.js +1 -1
- package/config/store.js +2 -0
- package/core/extension-manager-impl.js +518 -0
- package/core/plugins.js +35 -468
- package/core/types.ts +8 -2
- package/detail/__tests__/autoscaling.horizontalpodautoscaler.test.ts +1 -0
- package/detail/catalog.cattle.io.app.vue +7 -4
- package/detail/fleet.cattle.io.bundle.vue +1 -5
- package/detail/fleet.cattle.io.cluster.vue +3 -2
- package/detail/fleet.cattle.io.gitrepo.vue +76 -49
- package/detail/fleet.cattle.io.helmop.vue +78 -49
- package/dialog/AddonConfigConfirmationDialog.vue +1 -1
- package/dialog/GenericPrompt.vue +1 -1
- package/dialog/ImportDialog.vue +9 -2
- package/dialog/InstallExtensionDialog.vue +18 -10
- package/dialog/SloDialog.vue +1 -1
- package/edit/__tests__/fleet.cattle.io.gitrepo.test.ts +2 -1
- package/edit/__tests__/resources.cattle.io.restore.test.ts +106 -0
- package/edit/auth/oidc.vue +106 -6
- package/edit/auth/saml.vue +5 -5
- package/edit/cloudcredential.vue +31 -17
- package/edit/constraints.gatekeeper.sh.constraint/index.vue +10 -2
- package/edit/fleet.cattle.io.cluster.vue +19 -0
- package/edit/fleet.cattle.io.gitrepo.vue +23 -16
- package/edit/monitoring.coreos.com.alertmanagerconfig/index.vue +12 -11
- package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +11 -1
- package/edit/provisioning.cattle.io.cluster/index.vue +14 -19
- package/edit/provisioning.cattle.io.cluster/rke2.vue +11 -3
- package/edit/provisioning.cattle.io.cluster/tabs/AddOnAdditionalManifest.vue +1 -0
- package/edit/provisioning.cattle.io.cluster/tabs/AddOnConfig.vue +1 -0
- package/edit/provisioning.cattle.io.cluster/tabs/Basics.vue +1 -0
- package/edit/provisioning.cattle.io.cluster/tabs/etcd/S3Config.vue +1 -0
- package/edit/provisioning.cattle.io.cluster/tabs/registries/index.vue +2 -0
- package/edit/provisioning.cattle.io.cluster/tabs/upgrade/DrainOptions.vue +6 -0
- package/edit/resources.cattle.io.restore.vue +5 -8
- package/initialize/install-plugins.js +1 -3
- package/list/__tests__/workload.test.ts +1 -0
- package/list/workload.vue +8 -1
- package/machine-config/components/GCEImage.vue +6 -5
- package/machine-config/google.vue +11 -6
- package/mixins/__tests__/auth-config.test.ts +4 -6
- package/mixins/__tests__/chart.test.ts +139 -1
- package/mixins/auth-config.js +33 -10
- package/mixins/chart.js +58 -18
- package/models/__tests__/namespace.test.ts +69 -0
- package/models/apps.statefulset.js +8 -10
- package/models/chart.js +5 -1
- package/models/fleet-application.js +16 -46
- package/models/fleet.cattle.io.bundle.js +1 -38
- package/models/fleet.cattle.io.gitrepo.js +4 -0
- package/models/fleet.cattle.io.helmop.js +4 -0
- package/models/management.cattle.io.cluster.js +1 -1
- package/models/management.cattle.io.project.js +12 -0
- package/models/namespace.js +30 -0
- package/models/workload.js +4 -1
- package/package.json +10 -10
- package/pages/auth/login.vue +8 -3
- package/pages/auth/logout.vue +6 -5
- package/pages/c/_cluster/apps/charts/AppChartCardFooter.vue +26 -11
- package/pages/c/_cluster/apps/charts/chart.vue +29 -20
- package/pages/c/_cluster/apps/charts/index.vue +1 -0
- package/pages/c/_cluster/apps/charts/install.vue +6 -5
- package/pages/c/_cluster/explorer/tools/__tests__/index.test.ts +102 -12
- package/pages/c/_cluster/explorer/tools/index.vue +145 -254
- package/pages/c/_cluster/manager/cloudCredential/index.vue +18 -1
- package/pages/c/_cluster/manager/drivers/kontainerDriver/index.vue +12 -2
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +1 -1
- package/pages/c/_cluster/uiplugins/__tests__/index.spec.ts +318 -0
- package/pages/c/_cluster/uiplugins/index.vue +221 -363
- package/pages/home.vue +1 -9
- package/plugins/axios.js +3 -2
- package/plugins/dashboard-store/resource-class.js +49 -0
- package/plugins/ember-cookie.js +7 -3
- package/plugins/steve/subscribe.js +4 -2
- package/public/index.html +2 -1
- package/rancher-components/Card/Card.vue +1 -1
- package/rancher-components/Form/Checkbox/Checkbox.vue +1 -1
- package/rancher-components/Form/Radio/RadioButton.vue +1 -1
- package/rancher-components/Form/Radio/RadioGroup.vue +1 -1
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +1 -11
- package/rancher-components/Pill/RcCounterBadge/RcCounterBadge.test.ts +53 -0
- package/rancher-components/Pill/RcCounterBadge/RcCounterBadge.vue +65 -0
- package/rancher-components/Pill/RcCounterBadge/index.ts +1 -0
- package/rancher-components/Pill/RcCounterBadge/types.ts +7 -0
- package/rancher-components/Pill/RcStatusBadge/RcStatusBadge.vue +1 -1
- package/rancher-components/Pill/RcStatusBadge/index.ts +1 -1
- package/rancher-components/Pill/RcStatusIndicator/RcStatusIndicator.vue +3 -3
- package/rancher-components/Pill/RcStatusIndicator/types.ts +1 -1
- package/rancher-components/Pill/RcTag/RcTag.test.ts +64 -0
- package/rancher-components/Pill/RcTag/RcTag.vue +94 -0
- package/rancher-components/Pill/RcTag/index.ts +1 -0
- package/rancher-components/Pill/RcTag/types.ts +9 -0
- package/rancher-components/Pill/types.ts +1 -0
- package/rancher-components/RcItemCard/RcItemCard.vue +1 -0
- package/rancher-components/RcItemCard/RcItemCardAction.vue +12 -0
- package/scripts/test-plugins-build.sh +0 -1
- package/store/__tests__/catalog.test.ts +63 -0
- package/store/__tests__/cookies.test.ts +72 -0
- package/store/auth.js +33 -10
- package/store/catalog.js +2 -2
- package/store/cookies.ts +30 -0
- package/store/prefs.js +10 -5
- package/store/type-map.js +3 -15
- package/types/extension-manager.ts +26 -0
- package/types/shell/index.d.ts +123 -27
- package/utils/__tests__/product.test.ts +129 -0
- package/utils/__tests__/resource.test.ts +87 -0
- package/utils/alertmanagerconfig.js +2 -2
- package/utils/auth.js +4 -77
- package/utils/product.ts +39 -0
- package/utils/resource.ts +35 -0
- package/utils/select.js +0 -24
- package/utils/validators/formRules/__tests__/index.test.ts +3 -0
- package/utils/validators/formRules/index.ts +2 -1
- package/vue.config.js +1 -1
- package/components/Resource/Detail/Metadata/Rectangle.vue +0 -34
- package/components/Resource/Detail/Metadata/__tests__/Rectangle.test.ts +0 -24
- package/components/ResourceDetail/Masthead/__tests__/legacy.test.ts +0 -65
- package/utils/cookie-universal.js +0 -10
- /package/components/{ForceDirectedTreeChart.vue → ForceDirectedTreeChart/index.vue} +0 -0
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { mapState } from 'vuex';
|
|
3
|
-
import Loading from '@shell/components/Loading';
|
|
4
3
|
import ResourceTabs from '@shell/components/form/ResourceTabs';
|
|
5
4
|
import FleetSummary from '@shell/components/fleet/FleetSummary';
|
|
6
5
|
import { Banner } from '@components/Banner';
|
|
7
6
|
import FleetResources from '@shell/components/fleet/FleetResources';
|
|
8
7
|
import Tab from '@shell/components/Tabbed/Tab';
|
|
9
|
-
import { FLEET
|
|
8
|
+
import { FLEET } from '@shell/config/types';
|
|
10
9
|
import { isHarvesterCluster } from '@shell/utils/cluster';
|
|
11
10
|
import FleetBundles from '@shell/components/fleet/FleetBundles.vue';
|
|
12
11
|
import { checkSchemasForFindAllHash } from '@shell/utils/auth';
|
|
12
|
+
import DetailPage from '@shell/components/Resource/Detail/Page.vue';
|
|
13
|
+
import Masthead from '@shell/components/Resource/Detail/Masthead/index.vue';
|
|
14
|
+
import { useDefaultMastheadProps } from '@shell/components/Resource/Detail/Masthead/composable';
|
|
15
|
+
import ViewOptions from '@shell/components/Resource/Detail/ViewOptions/index.vue';
|
|
16
|
+
import { useCurrentView } from '@shell/components/Resource/Detail/ViewOptions/composable';
|
|
17
|
+
import { _GRAPH } from '@shell/config/query-params';
|
|
18
|
+
import ForceDirectedTreeChart from '@shell/components/ForceDirectedTreeChart';
|
|
19
|
+
import { useDefaultForceDirectTreeChartProps } from '@shell/components/ForceDirectedTreeChart/composable';
|
|
13
20
|
|
|
14
21
|
export default {
|
|
15
22
|
name: 'DetailGitRepo',
|
|
@@ -17,13 +24,16 @@ export default {
|
|
|
17
24
|
emits: ['input'],
|
|
18
25
|
|
|
19
26
|
components: {
|
|
20
|
-
Loading,
|
|
21
27
|
FleetResources,
|
|
22
28
|
FleetSummary,
|
|
23
29
|
Banner,
|
|
24
30
|
ResourceTabs,
|
|
25
31
|
Tab,
|
|
26
32
|
FleetBundles,
|
|
33
|
+
DetailPage,
|
|
34
|
+
Masthead,
|
|
35
|
+
ViewOptions,
|
|
36
|
+
ForceDirectedTreeChart
|
|
27
37
|
},
|
|
28
38
|
|
|
29
39
|
props: {
|
|
@@ -33,6 +43,16 @@ export default {
|
|
|
33
43
|
},
|
|
34
44
|
},
|
|
35
45
|
|
|
46
|
+
setup(props) {
|
|
47
|
+
const defaultMastheadProps = useDefaultMastheadProps(props.value);
|
|
48
|
+
const currentView = useCurrentView();
|
|
49
|
+
const forceDirectedTreeChartProps = useDefaultForceDirectTreeChartProps(props.value);
|
|
50
|
+
|
|
51
|
+
return {
|
|
52
|
+
defaultMastheadProps, currentView, forceDirectedTreeChartProps, _GRAPH
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
|
|
36
56
|
data() {
|
|
37
57
|
return {
|
|
38
58
|
allFleetClusters: [],
|
|
@@ -100,10 +120,6 @@ export default {
|
|
|
100
120
|
}
|
|
101
121
|
}, this.$store);
|
|
102
122
|
|
|
103
|
-
if (this.value.authorId && this.$store.getters['management/schemaFor'](MANAGEMENT.USER)) {
|
|
104
|
-
await this.$store.dispatch(`management/findAll`, { type: MANAGEMENT.USER }, { root: true });
|
|
105
|
-
}
|
|
106
|
-
|
|
107
123
|
this.allBundles = allDispatches.allBundles || [];
|
|
108
124
|
this.allFleetClusters = allDispatches.allFleetClusters || [];
|
|
109
125
|
},
|
|
@@ -112,46 +128,57 @@ export default {
|
|
|
112
128
|
</script>
|
|
113
129
|
|
|
114
130
|
<template>
|
|
115
|
-
<
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
131
|
+
<DetailPage :loading="$fetchState.pending">
|
|
132
|
+
<template #top-area>
|
|
133
|
+
<Masthead v-bind="defaultMastheadProps">
|
|
134
|
+
<template #additional-actions>
|
|
135
|
+
<ViewOptions />
|
|
136
|
+
</template>
|
|
137
|
+
</Masthead>
|
|
138
|
+
</template>
|
|
139
|
+
<template #bottom-area>
|
|
140
|
+
<template v-if="currentView === _GRAPH">
|
|
141
|
+
<ForceDirectedTreeChart v-bind="forceDirectedTreeChartProps" />
|
|
142
|
+
</template>
|
|
143
|
+
|
|
144
|
+
<template v-else>
|
|
145
|
+
<FleetSummary
|
|
146
|
+
v-if="gitRepoHasClusters"
|
|
147
|
+
:value="value"
|
|
148
|
+
:bundles="bundles"
|
|
149
|
+
class="mb-20"
|
|
150
|
+
/>
|
|
151
|
+
<Banner
|
|
152
|
+
v-else
|
|
153
|
+
color="info"
|
|
154
|
+
class="mb-20"
|
|
155
|
+
>
|
|
156
|
+
{{ t('fleet.fleetSummary.noClusters.gitRepo') }}
|
|
157
|
+
</Banner>
|
|
158
|
+
<ResourceTabs
|
|
159
|
+
:value="value"
|
|
160
|
+
mode="view"
|
|
161
|
+
class="mt-20"
|
|
162
|
+
:need-related="false"
|
|
163
|
+
@update:value="$emit('input', $event)"
|
|
164
|
+
>
|
|
165
|
+
<Tab
|
|
166
|
+
v-if="!!allBundles.length"
|
|
167
|
+
label="Bundles"
|
|
168
|
+
name="bundles"
|
|
169
|
+
:weight="30"
|
|
170
|
+
>
|
|
171
|
+
<FleetBundles :value="value" />
|
|
172
|
+
</Tab>
|
|
173
|
+
<Tab
|
|
174
|
+
label="Resources"
|
|
175
|
+
name="resources"
|
|
176
|
+
:weight="20"
|
|
177
|
+
>
|
|
178
|
+
<FleetResources :rows="value.resourcesStatuses" />
|
|
179
|
+
</Tab>
|
|
180
|
+
</ResourceTabs>
|
|
181
|
+
</template>
|
|
182
|
+
</template>
|
|
183
|
+
</DetailPage>
|
|
157
184
|
</template>
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { mapState } from 'vuex';
|
|
3
|
-
import Loading from '@shell/components/Loading';
|
|
4
3
|
import ResourceTabs from '@shell/components/form/ResourceTabs';
|
|
5
4
|
import FleetSummary from '@shell/components/fleet/FleetSummary';
|
|
6
5
|
import { Banner } from '@components/Banner';
|
|
7
6
|
import FleetResources from '@shell/components/fleet/FleetResources';
|
|
8
7
|
import Tab from '@shell/components/Tabbed/Tab';
|
|
9
|
-
import { FLEET
|
|
8
|
+
import { FLEET } from '@shell/config/types';
|
|
10
9
|
import { isHarvesterCluster } from '@shell/utils/cluster';
|
|
11
10
|
import FleetBundles from '@shell/components/fleet/FleetBundles.vue';
|
|
12
11
|
import { checkSchemasForFindAllHash } from '@shell/utils/auth';
|
|
12
|
+
import DetailPage from '@shell/components/Resource/Detail/Page.vue';
|
|
13
|
+
import Masthead from '@shell/components/Resource/Detail/Masthead/index.vue';
|
|
14
|
+
import { useDefaultMastheadProps } from '@shell/components/Resource/Detail/Masthead/composable';
|
|
15
|
+
import ViewOptions from '@shell/components/Resource/Detail/ViewOptions/index.vue';
|
|
16
|
+
import { useCurrentView } from '@shell/components/Resource/Detail/ViewOptions/composable';
|
|
17
|
+
import { _GRAPH } from '@shell/config/query-params';
|
|
18
|
+
import ForceDirectedTreeChart from '@shell/components/ForceDirectedTreeChart';
|
|
19
|
+
import { useDefaultForceDirectTreeChartProps } from '@shell/components/ForceDirectedTreeChart/composable';
|
|
13
20
|
|
|
14
21
|
export default {
|
|
15
22
|
name: 'DetailsHelmOp',
|
|
@@ -17,13 +24,16 @@ export default {
|
|
|
17
24
|
emits: ['input'],
|
|
18
25
|
|
|
19
26
|
components: {
|
|
20
|
-
Loading,
|
|
21
27
|
FleetResources,
|
|
22
28
|
FleetSummary,
|
|
23
29
|
Banner,
|
|
24
30
|
ResourceTabs,
|
|
25
31
|
Tab,
|
|
26
32
|
FleetBundles,
|
|
33
|
+
DetailPage,
|
|
34
|
+
Masthead,
|
|
35
|
+
ViewOptions,
|
|
36
|
+
ForceDirectedTreeChart
|
|
27
37
|
},
|
|
28
38
|
|
|
29
39
|
props: {
|
|
@@ -33,6 +43,16 @@ export default {
|
|
|
33
43
|
},
|
|
34
44
|
},
|
|
35
45
|
|
|
46
|
+
setup(props) {
|
|
47
|
+
const defaultMastheadProps = useDefaultMastheadProps(props.value);
|
|
48
|
+
const currentView = useCurrentView();
|
|
49
|
+
const forceDirectedTreeChartProps = useDefaultForceDirectTreeChartProps(props.value);
|
|
50
|
+
|
|
51
|
+
return {
|
|
52
|
+
defaultMastheadProps, currentView, forceDirectedTreeChartProps, _GRAPH
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
|
|
36
56
|
data() {
|
|
37
57
|
return {
|
|
38
58
|
allFleetClusters: [],
|
|
@@ -100,10 +120,6 @@ export default {
|
|
|
100
120
|
}
|
|
101
121
|
}, this.$store);
|
|
102
122
|
|
|
103
|
-
if (this.value.authorId && this.$store.getters['management/schemaFor'](MANAGEMENT.USER)) {
|
|
104
|
-
await this.$store.dispatch(`management/findAll`, { type: MANAGEMENT.USER }, { root: true });
|
|
105
|
-
}
|
|
106
|
-
|
|
107
123
|
this.allBundles = allDispatches.allBundles || [];
|
|
108
124
|
this.allFleetClusters = allDispatches.allFleetClusters || [];
|
|
109
125
|
},
|
|
@@ -112,46 +128,59 @@ export default {
|
|
|
112
128
|
</script>
|
|
113
129
|
|
|
114
130
|
<template>
|
|
115
|
-
<
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
131
|
+
<DetailPage :loading="$fetchState.pending">
|
|
132
|
+
<template #top-area>
|
|
133
|
+
<Masthead v-bind="defaultMastheadProps">
|
|
134
|
+
<template #additional-actions>
|
|
135
|
+
<ViewOptions />
|
|
136
|
+
</template>
|
|
137
|
+
</Masthead>
|
|
138
|
+
</template>
|
|
139
|
+
<template #bottom-area>
|
|
140
|
+
<template v-if="currentView === _GRAPH">
|
|
141
|
+
<ForceDirectedTreeChart v-bind="forceDirectedTreeChartProps" />
|
|
142
|
+
</template>
|
|
143
|
+
|
|
144
|
+
<template v-else>
|
|
145
|
+
<div class="mt-20">
|
|
146
|
+
<FleetSummary
|
|
147
|
+
v-if="helmOpHasClusters"
|
|
148
|
+
:value="value"
|
|
149
|
+
:bundles="bundles"
|
|
150
|
+
class="mb-20"
|
|
151
|
+
/>
|
|
152
|
+
<Banner
|
|
153
|
+
v-else
|
|
154
|
+
color="info"
|
|
155
|
+
class="mb-20"
|
|
156
|
+
>
|
|
157
|
+
{{ t('fleet.fleetSummary.noClusters.helmOp') }}
|
|
158
|
+
</Banner>
|
|
159
|
+
<ResourceTabs
|
|
160
|
+
:value="value"
|
|
161
|
+
mode="view"
|
|
162
|
+
class="mt-20"
|
|
163
|
+
:need-related="false"
|
|
164
|
+
@update:value="$emit('input', $event)"
|
|
165
|
+
>
|
|
166
|
+
<Tab
|
|
167
|
+
v-if="!!allBundles.length"
|
|
168
|
+
label="Bundles"
|
|
169
|
+
name="bundles"
|
|
170
|
+
:weight="30"
|
|
171
|
+
>
|
|
172
|
+
<FleetBundles :value="value" />
|
|
173
|
+
</Tab>
|
|
174
|
+
<Tab
|
|
175
|
+
label="Resources"
|
|
176
|
+
name="resources"
|
|
177
|
+
:weight="20"
|
|
178
|
+
>
|
|
179
|
+
<FleetResources :rows="value.resourcesStatuses" />
|
|
180
|
+
</Tab>
|
|
181
|
+
</ResourceTabs>
|
|
182
|
+
</div>
|
|
183
|
+
</template>
|
|
184
|
+
</template>
|
|
185
|
+
</DetailPage>
|
|
157
186
|
</template>
|
package/dialog/GenericPrompt.vue
CHANGED
package/dialog/ImportDialog.vue
CHANGED
|
@@ -28,12 +28,19 @@ export default {
|
|
|
28
28
|
props: {
|
|
29
29
|
defaultNamespace: {
|
|
30
30
|
type: String,
|
|
31
|
-
default:
|
|
31
|
+
default: undefined
|
|
32
32
|
},
|
|
33
33
|
},
|
|
34
34
|
|
|
35
35
|
async fetch() {
|
|
36
|
-
this.allNamespaces = await this.$store.dispatch('cluster/findAll', { type: NAMESPACE, opt: { url: 'namespaces' } });
|
|
36
|
+
this.allNamespaces = (await this.$store.dispatch('cluster/findAll', { type: NAMESPACE, opt: { url: 'namespaces' } })) || [];
|
|
37
|
+
|
|
38
|
+
if (this.selectedNamespace === undefined) {
|
|
39
|
+
const defaultNamespace = 'default';
|
|
40
|
+
const hasAccessToDefaultNamespace = this.allNamespaces.some((ns) => ns.name === defaultNamespace);
|
|
41
|
+
|
|
42
|
+
this.selectedNamespace = hasAccessToDefaultNamespace ? defaultNamespace : this.allNamespaces[0]?.name;
|
|
43
|
+
}
|
|
37
44
|
},
|
|
38
45
|
|
|
39
46
|
data() {
|
|
@@ -29,9 +29,9 @@ export default {
|
|
|
29
29
|
required: true
|
|
30
30
|
},
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* The action to perform (install, update, rollback)
|
|
33
33
|
*/
|
|
34
|
-
|
|
34
|
+
action: {
|
|
35
35
|
type: String,
|
|
36
36
|
default: '',
|
|
37
37
|
required: true
|
|
@@ -68,14 +68,14 @@ export default {
|
|
|
68
68
|
// Default to latest version on install (this is default on the plugin)
|
|
69
69
|
this.version = chartVersion;
|
|
70
70
|
|
|
71
|
-
if (this.
|
|
71
|
+
if (this.action === 'update') {
|
|
72
72
|
this.currentVersion = chartVersion;
|
|
73
73
|
|
|
74
74
|
// Update to latest version, so take the first version
|
|
75
75
|
if (this.plugin?.installableVersions?.length > 0) {
|
|
76
76
|
this.version = this.plugin?.installableVersions?.[0]?.version;
|
|
77
77
|
}
|
|
78
|
-
} else if (this.
|
|
78
|
+
} else if (this.action === 'rollback') {
|
|
79
79
|
// Find the newest version once we remove the current version
|
|
80
80
|
const versionNames = this.plugin.installableVersions.filter((v) => v.version !== chartVersion);
|
|
81
81
|
|
|
@@ -94,7 +94,7 @@ export default {
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
this.busy = false;
|
|
97
|
-
this.update = this.
|
|
97
|
+
this.update = this.action !== 'install';
|
|
98
98
|
|
|
99
99
|
this.defaultRegistrySetting = await this.$store.dispatch('management/find', {
|
|
100
100
|
type: MANAGEMENT.SETTING,
|
|
@@ -141,7 +141,15 @@ export default {
|
|
|
141
141
|
},
|
|
142
142
|
|
|
143
143
|
buttonMode() {
|
|
144
|
-
|
|
144
|
+
if (this.action === 'rollback') {
|
|
145
|
+
return 'rollback';
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (this.action === 'update') {
|
|
149
|
+
return 'update';
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return 'install';
|
|
145
153
|
},
|
|
146
154
|
|
|
147
155
|
chartVersionLoadsWithoutAuth() {
|
|
@@ -149,7 +157,7 @@ export default {
|
|
|
149
157
|
},
|
|
150
158
|
|
|
151
159
|
returnFocusSelector() {
|
|
152
|
-
return `[data-testid="extension-card-${ this.
|
|
160
|
+
return `[data-testid="extension-card-${ this.action }-btn-${ this.plugin?.name }"]`;
|
|
153
161
|
}
|
|
154
162
|
},
|
|
155
163
|
|
|
@@ -190,7 +198,7 @@ export default {
|
|
|
190
198
|
|
|
191
199
|
const plugin = this.plugin;
|
|
192
200
|
|
|
193
|
-
this.updateStatus(plugin.name,
|
|
201
|
+
this.updateStatus(plugin.name, this.action);
|
|
194
202
|
|
|
195
203
|
// Find the version that the user wants to install
|
|
196
204
|
const version = plugin.versions?.find((v) => v.version === this.version);
|
|
@@ -287,12 +295,12 @@ export default {
|
|
|
287
295
|
<template>
|
|
288
296
|
<div class="plugin-install-dialog">
|
|
289
297
|
<h4 class="mt-10">
|
|
290
|
-
{{ t(`plugins.${
|
|
298
|
+
{{ t(`plugins.${ action }.title`, { name: plugin?.label }) }}
|
|
291
299
|
</h4>
|
|
292
300
|
<div class="custom mt-10">
|
|
293
301
|
<div class="dialog-panel">
|
|
294
302
|
<p>
|
|
295
|
-
{{ t(`plugins.${
|
|
303
|
+
{{ t(`plugins.${ action }.prompt`) }}
|
|
296
304
|
</p>
|
|
297
305
|
<Banner
|
|
298
306
|
v-if="chartVersionLoadsWithoutAuth"
|
package/dialog/SloDialog.vue
CHANGED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { nextTick } from 'vue';
|
|
2
|
+
import { mount } from '@vue/test-utils';
|
|
3
|
+
import RestoreComponent from '@shell/edit/resources.cattle.io.restore.vue';
|
|
4
|
+
import { _CREATE } from '@shell/config/query-params';
|
|
5
|
+
|
|
6
|
+
describe('view: restore storage source switching', () => {
|
|
7
|
+
let wrapper: any;
|
|
8
|
+
|
|
9
|
+
const mockStore = {
|
|
10
|
+
getters: {
|
|
11
|
+
currentStore: () => 'cluster',
|
|
12
|
+
'cluster/schemaFor': jest.fn(),
|
|
13
|
+
'cluster/all': jest.fn(),
|
|
14
|
+
'cluster/paginationEnabled': jest.fn().mockReturnValue(false),
|
|
15
|
+
'cluster/urlFor': jest.fn(),
|
|
16
|
+
'i18n/t': (val: string) => val,
|
|
17
|
+
'i18n/exists': jest.fn(),
|
|
18
|
+
},
|
|
19
|
+
dispatch: jest.fn().mockResolvedValue([])
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const createWrapper = (propsOverride = {}) => {
|
|
23
|
+
const defaultProps = {
|
|
24
|
+
value: {
|
|
25
|
+
metadata: { name: '', generateName: 'restore-' },
|
|
26
|
+
spec: { prune: true, deleteTimeoutSeconds: 10 }
|
|
27
|
+
},
|
|
28
|
+
mode: _CREATE,
|
|
29
|
+
...propsOverride
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return mount(RestoreComponent, {
|
|
33
|
+
global: {
|
|
34
|
+
mocks: {
|
|
35
|
+
$store: mockStore,
|
|
36
|
+
$route: { query: {}, name: 'restore_route' },
|
|
37
|
+
$router: { applyQuery: jest.fn() },
|
|
38
|
+
$fetchState: { pending: false }
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
propsData: defaultProps
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
beforeEach(() => {
|
|
46
|
+
jest.clearAllMocks();
|
|
47
|
+
mockStore.dispatch.mockResolvedValue([]);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
afterEach(() => {
|
|
51
|
+
if (wrapper) {
|
|
52
|
+
wrapper.unmount();
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('should not include S3 storageLocation when creating with useDefault', async() => {
|
|
57
|
+
wrapper = createWrapper();
|
|
58
|
+
await wrapper.vm.$nextTick();
|
|
59
|
+
|
|
60
|
+
wrapper.vm.storageSource = 'useDefault';
|
|
61
|
+
await nextTick();
|
|
62
|
+
|
|
63
|
+
expect(wrapper.vm.value.spec).toStrictEqual({
|
|
64
|
+
prune: true,
|
|
65
|
+
deleteTimeoutSeconds: 10
|
|
66
|
+
});
|
|
67
|
+
expect(wrapper.vm.value.spec.storageLocation).toBeUndefined();
|
|
68
|
+
expect(wrapper.vm.s3).toStrictEqual({});
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it('should include S3 storageLocation when creating with An S3-compatible object store', async() => {
|
|
72
|
+
wrapper = createWrapper();
|
|
73
|
+
await wrapper.vm.$nextTick();
|
|
74
|
+
|
|
75
|
+
wrapper.vm.storageSource = 'configureS3';
|
|
76
|
+
await nextTick();
|
|
77
|
+
|
|
78
|
+
expect(wrapper.vm.value.spec.storageLocation).toBeDefined();
|
|
79
|
+
expect(wrapper.vm.value.spec.storageLocation.s3).toBeDefined();
|
|
80
|
+
expect(wrapper.vm.value.spec.prune).toBe(true);
|
|
81
|
+
expect(wrapper.vm.value.spec.deleteTimeoutSeconds).toBe(10);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it('should not include S3 storageLocation when switching from S3-compatible object store back to useDefault', async() => {
|
|
85
|
+
wrapper = createWrapper();
|
|
86
|
+
await wrapper.vm.$nextTick();
|
|
87
|
+
|
|
88
|
+
wrapper.vm.storageSource = 'configureS3';
|
|
89
|
+
wrapper.vm.s3 = {
|
|
90
|
+
bucketName: 'test-bucket',
|
|
91
|
+
endpoint: 'test-endpoint'
|
|
92
|
+
};
|
|
93
|
+
wrapper.vm.value.spec.storageLocation = { s3: wrapper.vm.s3 };
|
|
94
|
+
await nextTick();
|
|
95
|
+
|
|
96
|
+
expect(wrapper.vm.value.spec.storageLocation).toBeDefined();
|
|
97
|
+
|
|
98
|
+
wrapper.vm.storageSource = 'useDefault';
|
|
99
|
+
await nextTick();
|
|
100
|
+
|
|
101
|
+
expect(wrapper.vm.value.spec.storageLocation).toBeUndefined();
|
|
102
|
+
expect(wrapper.vm.s3).toStrictEqual({});
|
|
103
|
+
expect(wrapper.vm.value.spec.prune).toBe(true);
|
|
104
|
+
expect(wrapper.vm.value.spec.deleteTimeoutSeconds).toBe(10);
|
|
105
|
+
});
|
|
106
|
+
});
|