Enable standalone mode for harvester cluster routing

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
Francesco Torchia
2024-10-23 17:01:00 +02:00
parent cb76589e95
commit bd2d8b1878
4 changed files with 64 additions and 7 deletions
+3 -3
View File
@@ -3,11 +3,11 @@ import { PRODUCT_NAME } from '../../../config/harvester';
import { HCI } from '../../../types';
export default {
middleware({ redirect, route }) {
return redirect({
beforeCreate() {
this.$router.replace({
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: {
...route.params,
...this.$router.currentRoute.params,
product: PRODUCT_NAME,
resource: HCI.DASHBOARD
}
@@ -1,6 +1,36 @@
<script>
import ExplorerProjectsNamespaces from '@shell/components/ExplorerProjectsNamespaces';
export default { components: { ExplorerProjectsNamespaces } };
import ExplorerProjectsNamespaces from '@shell/components/ExplorerProjectsNamespaces.vue';
import { PRODUCT_NAME as HARVESTER_PRODUCT } from '../../../config/harvester';
import { MANAGEMENT, NAMESPACE } from '@shell/config/types';
export default {
components: { ExplorerProjectsNamespaces },
data() {
return {
createProjectLocation: {
name: `${ HARVESTER_PRODUCT }-c-cluster-resource-create`,
params: {
product: HARVESTER_PRODUCT,
cluster: this.$store.getters['currentCluster']?.id,
resource: MANAGEMENT.PROJECT
},
},
createNamespaceLocation: {
name: `${ HARVESTER_PRODUCT }-c-cluster-resource-create`,
params: {
product: HARVESTER_PRODUCT,
resource: NAMESPACE
},
}
};
}
};
</script>
<template><ExplorerProjectsNamespaces v-bind="$attrs" /></template>
<template>
<ExplorerProjectsNamespaces
v-bind="$attrs"
:create-project-location-override="createProjectLocation"
:create-namespace-location-override="createNamespaceLocation"
/>
</template>