Skip to content

Commit

Permalink
Changes from review
Browse files Browse the repository at this point in the history
- use $router with location
- don't attempt to fetch cluster metrics if in standalone mode
  • Loading branch information
richard-cox committed Aug 21, 2023
1 parent 15d4a67 commit ce33365
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
7 changes: 4 additions & 3 deletions dashboard/pkg/epinio/pages/c/_cluster/dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,10 @@ export default Vue.extend<any, any, any, any>({
}
},
openMetricsDetails() {
const clusterMetricsLink = `/c/${ this.$store.getters['clusterId'] }/explorer#cluster-events`;
this.$router.replace(clusterMetricsLink);
this.$router.replace({
name: 'c-cluster-explorer',
params: { cluster: this.$store.getters['clusterId'] }
});
}
},
computed: {
Expand Down
16 changes: 10 additions & 6 deletions dashboard/pkg/epinio/store/epinio-store/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,18 @@ export default {
...excludeInstances,
];

try {
const nodeMetricsSchema = await dispatch(`cluster/request`, { url: `/k8s/clusters/${ clusterId }/v1/schemas/${ METRIC.NODE }` }, { root: true });
const isSingleProduct = ctx.getters['isSingleProduct'];

if (nodeMetricsSchema) {
data.push(nodeMetricsSchema);
if (!isSingleProduct) {
try {
const nodeMetricsSchema = await dispatch(`cluster/request`, { url: `/k8s/clusters/${ clusterId }/v1/schemas/${ METRIC.NODE }` }, { root: true });

if (nodeMetricsSchema) {
data.push(nodeMetricsSchema);
}
} catch (e) {
console.warn(`Unable to fetch Node metrics schema for epinio cluster: ${ clusterId }`);// eslint-disable-line no-console
}
} catch (e) {
console.warn(`Unable to fetch Node metrics schema for epinio cluster: ${ clusterId }`);// eslint-disable-line no-console
}

data.forEach((schema: any) => {
Expand Down

0 comments on commit ce33365

Please sign in to comment.