mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
auto-refresh menu, no-clusters page + navigation fixes
Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
1 parent
408f64c184
commit
fe06643a8e
13 files changed
+109
-90
No files matched your search
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user