auto-refresh menu, no-clusters page + navigation fixes

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman committed 2020-07-24 16:33:20 +03:00
1 parent 408f64c184
commit fe06643a8e
13 files changed
+109 -90

No files matched your search

+2 -2
View File
@@ -8,7 +8,7 @@ import type { KubeObjectStore } from "../kube-object.store";
import { KubeApi } from "./kube-api";
import { apiManager } from "./api-manager";
import { apiPrefix, isDevelopment } from "../../common/vars";
import { clusterStore } from "../../common/cluster-store";
import { getHostedCluster } from "../../common/cluster-store";
export interface IKubeWatchEvent<T = any> {
type: "ADDED" | "MODIFIED" | "DELETED";
@@ -61,7 +61,7 @@ export class KubeWatchApi {
}
protected getQuery(): Partial<IKubeWatchRouteQuery> {
const { isAdmin, allowedNamespaces } = clusterStore.activeCluster;
const { isAdmin, allowedNamespaces } = getHostedCluster();
return {
api: this.activeApis.map(api => {
if (isAdmin) return api.getWatchUrl();
+2 -2
View File
@@ -1,4 +1,4 @@
import { clusterStore } from "../../common/cluster-store";
import { getHostedCluster } from "../../common/cluster-store";
// todo: refactor / move to cluster-store.ts?
@@ -6,7 +6,7 @@ export function isAllowedResource(resources: string | string[]) {
if (!Array.isArray(resources)) {
resources = [resources];
}
const allowedResources = clusterStore.activeCluster?.allowedResources || [];
const { allowedResources } = getHostedCluster();
for (const resource of resources) {
if (!allowedResources.includes(resource)) {
return false;