Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-cox committed Nov 13, 2023
1 parent c3bef11 commit 1bea25a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 6 additions & 0 deletions dashboard/pkg/epinio/models/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import Resource from '@shell/plugins/dashboard-store/resource-class';
import { EPINIO_TYPES } from '../types';
import epinioAuth, { EpinioAuthConfig, EpinioAuthLocalConfig, EpinioAuthTypes } from '../utils/auth';

export const EpinioInfoPath = `/api/v1/info`;

export default class EpinioCluster extends Resource {
type = EPINIO_TYPES.CLUSTER;

Expand Down Expand Up @@ -41,6 +43,10 @@ export default class EpinioCluster extends Resource {
];
}

get infoUrl() {
return this.api + EpinioInfoPath;
}

async logOut() {
try {
await epinioAuth.logout(this.createAuthConfig(EpinioAuthTypes.AGNOSTIC));
Expand Down
10 changes: 4 additions & 6 deletions dashboard/pkg/epinio/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ import { EPINIO_MGMT_STORE, EPINIO_TYPES } from '../types';
import AsyncButton from '@shell/components/AsyncButton.vue';
import { _MERGE } from '@shell/plugins/dashboard-store/actions';
import epinioAuth, { EpinioAuthTypes } from '../utils/auth';
import EpinioCluster from '../models/cluster';
import EpinioCluster, { EpinioInfoPath } from '../models/cluster';
import PromptModal from '@shell/components/PromptModal.vue';
interface Data {
clustersSchema: any;
}
const infoUrl = `/api/v1/info`;
// Data, Methods, Computed, Props
export default Vue.extend<Data, any, any, any>({
components: {
Expand All @@ -36,7 +34,7 @@ export default Vue.extend<Data, any, any, any>({
return {
clustersSchema: this.$store.getters[`${ EPINIO_MGMT_STORE }/schemaFor`](EPINIO_TYPES.CLUSTER),
version: null,
infoUrl
infoUrl: EpinioInfoPath
};
},
Expand Down Expand Up @@ -93,7 +91,7 @@ export default Vue.extend<Data, any, any, any>({
}
});
this.$store.dispatch(`epinio/request`, { opt: { url: infoUrl, redirectUnauthorized: false }, clusterId: c.id })
this.$store.dispatch(`epinio/request`, { opt: { url: this.infoUrl, redirectUnauthorized: false }, clusterId: c.id })
.then((res: any) => {
Vue.set(c, 'version', res?.version);
Vue.set(c, 'oidcEnabled', res?.oidc_enabled);
Expand Down Expand Up @@ -187,7 +185,7 @@ export default Vue.extend<Data, any, any, any>({
<Link
v-if="row.state !== 'available'"
:row="row"
:value="{ text: row.api, url: infoUrl }"
:value="{ text: row.api, url: row.infoUrl }"
/>
<template v-else>
{{ row.api }}
Expand Down

0 comments on commit 1bea25a

Please sign in to comment.