mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Revert adding /cluster prefix, change settings navigation call
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
fd825cc441
commit
c7e5e530b5
@ -73,7 +73,7 @@ function isTopPageTest(test: CommonPageTest): test is TopPageTest {
|
|||||||
const commonPageTests: CommonPageTest[] = [{
|
const commonPageTests: CommonPageTest[] = [{
|
||||||
page: {
|
page: {
|
||||||
name: "Cluster",
|
name: "Cluster",
|
||||||
href: "/cluster/overview",
|
href: "/overview",
|
||||||
expectedSelector: "div.ClusterOverview div.label",
|
expectedSelector: "div.ClusterOverview div.label",
|
||||||
expectedText: "CPU"
|
expectedText: "CPU"
|
||||||
}
|
}
|
||||||
@ -81,7 +81,7 @@ const commonPageTests: CommonPageTest[] = [{
|
|||||||
{
|
{
|
||||||
page: {
|
page: {
|
||||||
name: "Nodes",
|
name: "Nodes",
|
||||||
href: "/cluster/nodes",
|
href: "/nodes",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Nodes"
|
expectedText: "Nodes"
|
||||||
}
|
}
|
||||||
@ -91,49 +91,49 @@ const commonPageTests: CommonPageTest[] = [{
|
|||||||
pages: [
|
pages: [
|
||||||
{
|
{
|
||||||
name: "Overview",
|
name: "Overview",
|
||||||
href: "/cluster/workloads",
|
href: "/workloads",
|
||||||
expectedSelector: "h5.box",
|
expectedSelector: "h5.box",
|
||||||
expectedText: "Overview"
|
expectedText: "Overview"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Pods",
|
name: "Pods",
|
||||||
href: "/cluster/pods",
|
href: "/pods",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Pods"
|
expectedText: "Pods"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Deployments",
|
name: "Deployments",
|
||||||
href: "/cluster/deployments",
|
href: "/deployments",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Deployments"
|
expectedText: "Deployments"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "DaemonSets",
|
name: "DaemonSets",
|
||||||
href: "/cluster/daemonsets",
|
href: "/daemonsets",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Daemon Sets"
|
expectedText: "Daemon Sets"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "StatefulSets",
|
name: "StatefulSets",
|
||||||
href: "/cluster/statefulsets",
|
href: "/statefulsets",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Stateful Sets"
|
expectedText: "Stateful Sets"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "ReplicaSets",
|
name: "ReplicaSets",
|
||||||
href: "/cluster/replicasets",
|
href: "/replicasets",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Replica Sets"
|
expectedText: "Replica Sets"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Jobs",
|
name: "Jobs",
|
||||||
href: "/cluster/jobs",
|
href: "/jobs",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Jobs"
|
expectedText: "Jobs"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "CronJobs",
|
name: "CronJobs",
|
||||||
href: "/cluster/cronjobs",
|
href: "/cronjobs",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Cron Jobs"
|
expectedText: "Cron Jobs"
|
||||||
},
|
},
|
||||||
@ -144,37 +144,37 @@ const commonPageTests: CommonPageTest[] = [{
|
|||||||
pages: [
|
pages: [
|
||||||
{
|
{
|
||||||
name: "ConfigMaps",
|
name: "ConfigMaps",
|
||||||
href: "/cluster/configmaps",
|
href: "/configmaps",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Config Maps"
|
expectedText: "Config Maps"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Secrets",
|
name: "Secrets",
|
||||||
href: "/cluster/secrets",
|
href: "/secrets",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Secrets"
|
expectedText: "Secrets"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Resource Quotas",
|
name: "Resource Quotas",
|
||||||
href: "/cluster/resourcequotas",
|
href: "/resourcequotas",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Resource Quotas"
|
expectedText: "Resource Quotas"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Limit Ranges",
|
name: "Limit Ranges",
|
||||||
href: "/cluster/limitranges",
|
href: "/limitranges",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Limit Ranges"
|
expectedText: "Limit Ranges"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "HPA",
|
name: "HPA",
|
||||||
href: "/cluster/hpa",
|
href: "/hpa",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Horizontal Pod Autoscalers"
|
expectedText: "Horizontal Pod Autoscalers"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Pod Disruption Budgets",
|
name: "Pod Disruption Budgets",
|
||||||
href: "/cluster/poddisruptionbudgets",
|
href: "/poddisruptionbudgets",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Pod Disruption Budgets"
|
expectedText: "Pod Disruption Budgets"
|
||||||
},
|
},
|
||||||
@ -185,25 +185,25 @@ const commonPageTests: CommonPageTest[] = [{
|
|||||||
pages: [
|
pages: [
|
||||||
{
|
{
|
||||||
name: "Services",
|
name: "Services",
|
||||||
href: "/cluster/services",
|
href: "/services",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Services"
|
expectedText: "Services"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Endpoints",
|
name: "Endpoints",
|
||||||
href: "/cluster/endpoints",
|
href: "/endpoints",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Endpoints"
|
expectedText: "Endpoints"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Ingresses",
|
name: "Ingresses",
|
||||||
href: "/cluster/ingresses",
|
href: "/ingresses",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Ingresses"
|
expectedText: "Ingresses"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Network Policies",
|
name: "Network Policies",
|
||||||
href: "/cluster/network-policies",
|
href: "/network-policies",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Network Policies"
|
expectedText: "Network Policies"
|
||||||
},
|
},
|
||||||
@ -214,19 +214,19 @@ const commonPageTests: CommonPageTest[] = [{
|
|||||||
pages: [
|
pages: [
|
||||||
{
|
{
|
||||||
name: "Persistent Volume Claims",
|
name: "Persistent Volume Claims",
|
||||||
href: "/cluster/persistent-volume-claims",
|
href: "/persistent-volume-claims",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Persistent Volume Claims"
|
expectedText: "Persistent Volume Claims"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Persistent Volumes",
|
name: "Persistent Volumes",
|
||||||
href: "/cluster/persistent-volumes",
|
href: "/persistent-volumes",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Persistent Volumes"
|
expectedText: "Persistent Volumes"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Storage Classes",
|
name: "Storage Classes",
|
||||||
href: "/cluster/storage-classes",
|
href: "/storage-classes",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Storage Classes"
|
expectedText: "Storage Classes"
|
||||||
},
|
},
|
||||||
@ -235,7 +235,7 @@ const commonPageTests: CommonPageTest[] = [{
|
|||||||
{
|
{
|
||||||
page: {
|
page: {
|
||||||
name: "Namespaces",
|
name: "Namespaces",
|
||||||
href: "/cluster/namespaces",
|
href: "/namespaces",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Namespaces"
|
expectedText: "Namespaces"
|
||||||
}
|
}
|
||||||
@ -243,7 +243,7 @@ const commonPageTests: CommonPageTest[] = [{
|
|||||||
{
|
{
|
||||||
page: {
|
page: {
|
||||||
name: "Events",
|
name: "Events",
|
||||||
href: "/cluster/events",
|
href: "/events",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Events"
|
expectedText: "Events"
|
||||||
}
|
}
|
||||||
@ -253,12 +253,12 @@ const commonPageTests: CommonPageTest[] = [{
|
|||||||
pages: [
|
pages: [
|
||||||
{
|
{
|
||||||
name: "Charts",
|
name: "Charts",
|
||||||
href: "/cluster/apps/charts",
|
href: "/apps/charts",
|
||||||
expectedSelector: "div.HelmCharts input",
|
expectedSelector: "div.HelmCharts input",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Releases",
|
name: "Releases",
|
||||||
href: "/cluster/apps/releases",
|
href: "/apps/releases",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Releases"
|
expectedText: "Releases"
|
||||||
},
|
},
|
||||||
@ -269,37 +269,37 @@ const commonPageTests: CommonPageTest[] = [{
|
|||||||
pages: [
|
pages: [
|
||||||
{
|
{
|
||||||
name: "Service Accounts",
|
name: "Service Accounts",
|
||||||
href: "/cluster/service-accounts",
|
href: "/service-accounts",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Service Accounts"
|
expectedText: "Service Accounts"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Roles",
|
name: "Roles",
|
||||||
href: "/cluster/roles",
|
href: "/roles",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Roles"
|
expectedText: "Roles"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Cluster Roles",
|
name: "Cluster Roles",
|
||||||
href: "/cluster/cluster-roles",
|
href: "/cluster-roles",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Cluster Roles"
|
expectedText: "Cluster Roles"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Role Bindings",
|
name: "Role Bindings",
|
||||||
href: "/cluster/role-bindings",
|
href: "/role-bindings",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Role Bindings"
|
expectedText: "Role Bindings"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Cluster Role Bindings",
|
name: "Cluster Role Bindings",
|
||||||
href: "/cluster/cluster-role-bindings",
|
href: "/cluster-role-bindings",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Cluster Role Bindings"
|
expectedText: "Cluster Role Bindings"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Pod Security Policies",
|
name: "Pod Security Policies",
|
||||||
href: "/cluster/pod-security-policies",
|
href: "/pod-security-policies",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Pod Security Policies"
|
expectedText: "Pod Security Policies"
|
||||||
},
|
},
|
||||||
@ -310,7 +310,7 @@ const commonPageTests: CommonPageTest[] = [{
|
|||||||
pages: [
|
pages: [
|
||||||
{
|
{
|
||||||
name: "Definitions",
|
name: "Definitions",
|
||||||
href: "/cluster/crd/definitions",
|
href: "/crd/definitions",
|
||||||
expectedSelector: "h5.title",
|
expectedSelector: "h5.title",
|
||||||
expectedText: "Custom Resources"
|
expectedText: "Custom Resources"
|
||||||
},
|
},
|
||||||
@ -363,8 +363,8 @@ utils.describeIf(minikubeReady(TEST_NAMESPACE))("Minikube based tests", () => {
|
|||||||
}, 10*60*1000);
|
}, 10*60*1000);
|
||||||
|
|
||||||
it("show logs and highlight the log search entries", async () => {
|
it("show logs and highlight the log search entries", async () => {
|
||||||
await frame.click(`a[href="/cluster/workloads"]`);
|
await frame.click(`a[href="/workloads"]`);
|
||||||
await frame.click(`a[href="/cluster/pods"]`);
|
await frame.click(`a[href="/pods"]`);
|
||||||
|
|
||||||
const namespacesSelector = await frame.waitForSelector(".NamespaceSelect");
|
const namespacesSelector = await frame.waitForSelector(".NamespaceSelect");
|
||||||
|
|
||||||
@ -401,13 +401,13 @@ utils.describeIf(minikubeReady(TEST_NAMESPACE))("Minikube based tests", () => {
|
|||||||
}, 10*60*1000);
|
}, 10*60*1000);
|
||||||
|
|
||||||
it("should show the default namespaces", async () => {
|
it("should show the default namespaces", async () => {
|
||||||
await frame.click('a[href="/cluster/namespaces"]');
|
await frame.click('a[href="/namespaces"]');
|
||||||
await frame.waitForSelector("div.TableCell >> text='default'");
|
await frame.waitForSelector("div.TableCell >> text='default'");
|
||||||
await frame.waitForSelector("div.TableCell >> text='kube-system'");
|
await frame.waitForSelector("div.TableCell >> text='kube-system'");
|
||||||
}, 10*60*1000);
|
}, 10*60*1000);
|
||||||
|
|
||||||
it(`should create the ${TEST_NAMESPACE} and a pod in the namespace`, async () => {
|
it(`should create the ${TEST_NAMESPACE} and a pod in the namespace`, async () => {
|
||||||
await frame.click('a[href="/cluster/namespaces"]');
|
await frame.click('a[href="/namespaces"]');
|
||||||
await frame.click("button.add-button");
|
await frame.click("button.add-button");
|
||||||
await frame.waitForSelector("div.AddNamespaceDialog >> text='Create Namespace'");
|
await frame.waitForSelector("div.AddNamespaceDialog >> text='Create Namespace'");
|
||||||
|
|
||||||
@ -418,11 +418,11 @@ utils.describeIf(minikubeReady(TEST_NAMESPACE))("Minikube based tests", () => {
|
|||||||
|
|
||||||
await frame.waitForSelector(`div.TableCell >> text=${TEST_NAMESPACE}`);
|
await frame.waitForSelector(`div.TableCell >> text=${TEST_NAMESPACE}`);
|
||||||
|
|
||||||
if ((await frame.innerText(`a[href^="/cluster/workloads"] .expand-icon`)) === "keyboard_arrow_down") {
|
if ((await frame.innerText(`a[href^="/workloads"] .expand-icon`)) === "keyboard_arrow_down") {
|
||||||
await frame.click(`a[href^="/cluster/workloads"]`);
|
await frame.click(`a[href^="/workloads"]`);
|
||||||
}
|
}
|
||||||
|
|
||||||
await frame.click(`a[href^="/cluster/pods"]`);
|
await frame.click(`a[href^="/pods"]`);
|
||||||
|
|
||||||
const namespacesSelector = await frame.waitForSelector(".NamespaceSelect");
|
const namespacesSelector = await frame.waitForSelector(".NamespaceSelect");
|
||||||
|
|
||||||
|
|||||||
@ -23,10 +23,11 @@ import { catalogCategoryRegistry } from "../catalog/catalog-category-registry";
|
|||||||
import { CatalogEntity, CatalogEntityActionContext, CatalogEntityContextMenuContext, CatalogEntityMetadata, CatalogEntityStatus } from "../catalog";
|
import { CatalogEntity, CatalogEntityActionContext, CatalogEntityContextMenuContext, CatalogEntityMetadata, CatalogEntityStatus } from "../catalog";
|
||||||
import { clusterActivateHandler, clusterDisconnectHandler } from "../cluster-ipc";
|
import { clusterActivateHandler, clusterDisconnectHandler } from "../cluster-ipc";
|
||||||
import { ClusterStore } from "../cluster-store";
|
import { ClusterStore } from "../cluster-store";
|
||||||
import { requestMain } from "../ipc";
|
import { broadcastMessage, requestMain } from "../ipc";
|
||||||
import { CatalogCategory, CatalogCategorySpec } from "../catalog";
|
import { CatalogCategory, CatalogCategorySpec } from "../catalog";
|
||||||
import { app } from "electron";
|
import { app } from "electron";
|
||||||
import type { CatalogEntitySpec } from "../catalog/catalog-entity";
|
import type { CatalogEntitySpec } from "../catalog/catalog-entity";
|
||||||
|
import { IpcRendererNavigationEvents } from "../../renderer/navigation/events";
|
||||||
|
|
||||||
export interface KubernetesClusterPrometheusMetrics {
|
export interface KubernetesClusterPrometheusMetrics {
|
||||||
address?: {
|
address?: {
|
||||||
@ -105,7 +106,10 @@ export class KubernetesCluster extends CatalogEntity<KubernetesClusterMetadata,
|
|||||||
context.menuItems.push({
|
context.menuItems.push({
|
||||||
title: "Settings",
|
title: "Settings",
|
||||||
icon: "edit",
|
icon: "edit",
|
||||||
onClick: () => context.navigate(`/entity/${this.metadata.uid}/settings`)
|
onClick: () => broadcastMessage(
|
||||||
|
IpcRendererNavigationEvents.NAVIGATE_IN_APP,
|
||||||
|
`/entity/${this.metadata.uid}/settings`,
|
||||||
|
),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import type { RouteProps } from "react-router";
|
|||||||
import { buildURL } from "../utils/buildUrl";
|
import { buildURL } from "../utils/buildUrl";
|
||||||
|
|
||||||
export const appsRoute: RouteProps = {
|
export const appsRoute: RouteProps = {
|
||||||
path: "/cluster/apps",
|
path: "/apps",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const appsURL = buildURL(appsRoute.path);
|
export const appsURL = buildURL(appsRoute.path);
|
||||||
|
|||||||
@ -28,7 +28,7 @@ export interface ClusterViewRouteParams {
|
|||||||
|
|
||||||
export const clusterViewRoute: RouteProps = {
|
export const clusterViewRoute: RouteProps = {
|
||||||
exact: true,
|
exact: true,
|
||||||
path: "/cluster/:clusterId",
|
path: "/:clusterId",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const clusterViewURL = buildURL<ClusterViewRouteParams>(clusterViewRoute.path);
|
export const clusterViewURL = buildURL<ClusterViewRouteParams>(clusterViewRoute.path);
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import type { RouteProps } from "react-router";
|
|||||||
import { buildURL } from "../utils/buildUrl";
|
import { buildURL } from "../utils/buildUrl";
|
||||||
|
|
||||||
export const clusterRoute: RouteProps = {
|
export const clusterRoute: RouteProps = {
|
||||||
path: "/cluster/overview"
|
path: "/overview"
|
||||||
};
|
};
|
||||||
|
|
||||||
export const clusterURL = buildURL(clusterRoute.path);
|
export const clusterURL = buildURL(clusterRoute.path);
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import type { RouteProps } from "react-router";
|
|||||||
import { buildURL } from "../utils/buildUrl";
|
import { buildURL } from "../utils/buildUrl";
|
||||||
|
|
||||||
export const configMapsRoute: RouteProps = {
|
export const configMapsRoute: RouteProps = {
|
||||||
path: "/cluster/configmaps"
|
path: "/configmaps"
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface ConfigMapsRouteParams {
|
export interface ConfigMapsRouteParams {
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import type { RouteProps } from "react-router";
|
|||||||
import { buildURL } from "../utils/buildUrl";
|
import { buildURL } from "../utils/buildUrl";
|
||||||
|
|
||||||
export const crdRoute: RouteProps = {
|
export const crdRoute: RouteProps = {
|
||||||
path: "/cluster/crd"
|
path: "/crd"
|
||||||
};
|
};
|
||||||
|
|
||||||
export const crdDefinitionsRoute: RouteProps = {
|
export const crdDefinitionsRoute: RouteProps = {
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import type { RouteProps } from "react-router";
|
|||||||
import { buildURL } from "../utils/buildUrl";
|
import { buildURL } from "../utils/buildUrl";
|
||||||
|
|
||||||
export const endpointRoute: RouteProps = {
|
export const endpointRoute: RouteProps = {
|
||||||
path: "/cluster/endpoints"
|
path: "/endpoints"
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface EndpointRouteParams {
|
export interface EndpointRouteParams {
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import type { RouteProps } from "react-router";
|
|||||||
import { buildURL } from "../utils/buildUrl";
|
import { buildURL } from "../utils/buildUrl";
|
||||||
|
|
||||||
export const eventRoute: RouteProps = {
|
export const eventRoute: RouteProps = {
|
||||||
path: "/cluster/events"
|
path: "/events"
|
||||||
};
|
};
|
||||||
|
|
||||||
export const eventsURL = buildURL(eventRoute.path);
|
export const eventsURL = buildURL(eventRoute.path);
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import type { RouteProps } from "react-router";
|
|||||||
import { buildURL } from "../utils/buildUrl";
|
import { buildURL } from "../utils/buildUrl";
|
||||||
|
|
||||||
export const hpaRoute: RouteProps = {
|
export const hpaRoute: RouteProps = {
|
||||||
path: "/cluster/hpa"
|
path: "/hpa"
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface HpaRouteParams {
|
export interface HpaRouteParams {
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import type { RouteProps } from "react-router";
|
|||||||
import { buildURL } from "../utils/buildUrl";
|
import { buildURL } from "../utils/buildUrl";
|
||||||
|
|
||||||
export const ingressRoute: RouteProps = {
|
export const ingressRoute: RouteProps = {
|
||||||
path: "/cluster/ingresses"
|
path: "/ingresses"
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface IngressRouteParams {
|
export interface IngressRouteParams {
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import type { RouteProps } from "react-router";
|
|||||||
import { buildURL } from "../utils/buildUrl";
|
import { buildURL } from "../utils/buildUrl";
|
||||||
|
|
||||||
export const limitRangesRoute: RouteProps = {
|
export const limitRangesRoute: RouteProps = {
|
||||||
path: "/cluster/limitranges"
|
path: "/limitranges"
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface LimitRangeRouteParams {
|
export interface LimitRangeRouteParams {
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import type { RouteProps } from "react-router";
|
|||||||
import { buildURL } from "../utils/buildUrl";
|
import { buildURL } from "../utils/buildUrl";
|
||||||
|
|
||||||
export const namespacesRoute: RouteProps = {
|
export const namespacesRoute: RouteProps = {
|
||||||
path: "/cluster/namespaces"
|
path: "/namespaces"
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface NamespacesRouteParams {
|
export interface NamespacesRouteParams {
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import type { RouteProps } from "react-router";
|
|||||||
import { buildURL } from "../utils/buildUrl";
|
import { buildURL } from "../utils/buildUrl";
|
||||||
|
|
||||||
export const networkPoliciesRoute: RouteProps = {
|
export const networkPoliciesRoute: RouteProps = {
|
||||||
path: "/cluster/network-policies"
|
path: "/network-policies"
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface NetworkPoliciesRouteParams {
|
export interface NetworkPoliciesRouteParams {
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import type { RouteProps } from "react-router";
|
|||||||
import { buildURL } from "../utils/buildUrl";
|
import { buildURL } from "../utils/buildUrl";
|
||||||
|
|
||||||
export const nodesRoute: RouteProps = {
|
export const nodesRoute: RouteProps = {
|
||||||
path: "/cluster/nodes"
|
path: "/nodes"
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface NodesRouteParams {
|
export interface NodesRouteParams {
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import type { RouteProps } from "react-router";
|
|||||||
import { buildURL } from "../utils/buildUrl";
|
import { buildURL } from "../utils/buildUrl";
|
||||||
|
|
||||||
export const pdbRoute: RouteProps = {
|
export const pdbRoute: RouteProps = {
|
||||||
path: "/cluster/poddisruptionbudgets"
|
path: "/poddisruptionbudgets"
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface PodDisruptionBudgetsRouteParams {
|
export interface PodDisruptionBudgetsRouteParams {
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import type { RouteProps } from "react-router";
|
|||||||
import { buildURL } from "../utils/buildUrl";
|
import { buildURL } from "../utils/buildUrl";
|
||||||
|
|
||||||
export const portForwardsRoute: RouteProps = {
|
export const portForwardsRoute: RouteProps = {
|
||||||
path: "/cluster/port-forwards"
|
path: "/port-forwards"
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface PortForwardsRouteParams {
|
export interface PortForwardsRouteParams {
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import type { RouteProps } from "react-router";
|
|||||||
import { buildURL } from "../utils/buildUrl";
|
import { buildURL } from "../utils/buildUrl";
|
||||||
|
|
||||||
export const resourceQuotaRoute: RouteProps = {
|
export const resourceQuotaRoute: RouteProps = {
|
||||||
path: "/cluster/resourcequotas"
|
path: "/resourcequotas"
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface ResourceQuotaRouteParams {
|
export interface ResourceQuotaRouteParams {
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import type { RouteProps } from "react-router";
|
|||||||
import { buildURL } from "../utils/buildUrl";
|
import { buildURL } from "../utils/buildUrl";
|
||||||
|
|
||||||
export const secretsRoute: RouteProps = {
|
export const secretsRoute: RouteProps = {
|
||||||
path: "/cluster/secrets"
|
path: "/secrets"
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface SecretsRouteParams {
|
export interface SecretsRouteParams {
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import type { RouteProps } from "react-router";
|
|||||||
import { buildURL } from "../utils/buildUrl";
|
import { buildURL } from "../utils/buildUrl";
|
||||||
|
|
||||||
export const servicesRoute: RouteProps = {
|
export const servicesRoute: RouteProps = {
|
||||||
path: "/cluster/services"
|
path: "/services"
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface ServicesRouteParams {
|
export interface ServicesRouteParams {
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import type { RouteProps } from "react-router";
|
|||||||
import { buildURL } from "../utils/buildUrl";
|
import { buildURL } from "../utils/buildUrl";
|
||||||
|
|
||||||
export const storageClassesRoute: RouteProps = {
|
export const storageClassesRoute: RouteProps = {
|
||||||
path: "/cluster/storage-classes"
|
path: "/storage-classes"
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface StorageClassesRouteParams {
|
export interface StorageClassesRouteParams {
|
||||||
|
|||||||
@ -24,22 +24,22 @@ import { buildURL, URLParams } from "../utils/buildUrl";
|
|||||||
|
|
||||||
// Routes
|
// Routes
|
||||||
export const serviceAccountsRoute: RouteProps = {
|
export const serviceAccountsRoute: RouteProps = {
|
||||||
path: "/cluster/service-accounts"
|
path: "/service-accounts"
|
||||||
};
|
};
|
||||||
export const podSecurityPoliciesRoute: RouteProps = {
|
export const podSecurityPoliciesRoute: RouteProps = {
|
||||||
path: "/cluster/pod-security-policies"
|
path: "/pod-security-policies"
|
||||||
};
|
};
|
||||||
export const rolesRoute: RouteProps = {
|
export const rolesRoute: RouteProps = {
|
||||||
path: "/cluster/roles"
|
path: "/roles"
|
||||||
};
|
};
|
||||||
export const clusterRolesRoute: RouteProps = {
|
export const clusterRolesRoute: RouteProps = {
|
||||||
path: "/cluster/cluster-roles"
|
path: "/cluster-roles"
|
||||||
};
|
};
|
||||||
export const roleBindingsRoute: RouteProps = {
|
export const roleBindingsRoute: RouteProps = {
|
||||||
path: "/cluster/role-bindings"
|
path: "/role-bindings"
|
||||||
};
|
};
|
||||||
export const clusterRoleBindingsRoute: RouteProps = {
|
export const clusterRoleBindingsRoute: RouteProps = {
|
||||||
path: "/cluster/cluster-role-bindings"
|
path: "/cluster-role-bindings"
|
||||||
};
|
};
|
||||||
|
|
||||||
export const usersManagementRoute: RouteProps = {
|
export const usersManagementRoute: RouteProps = {
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import type { RouteProps } from "react-router";
|
|||||||
import { buildURL } from "../utils/buildUrl";
|
import { buildURL } from "../utils/buildUrl";
|
||||||
|
|
||||||
export const volumeClaimsRoute: RouteProps = {
|
export const volumeClaimsRoute: RouteProps = {
|
||||||
path: "/cluster/persistent-volume-claims"
|
path: "/persistent-volume-claims"
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface VolumeClaimsRouteParams {
|
export interface VolumeClaimsRouteParams {
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import type { RouteProps } from "react-router";
|
|||||||
import { buildURL } from "../utils/buildUrl";
|
import { buildURL } from "../utils/buildUrl";
|
||||||
|
|
||||||
export const volumesRoute: RouteProps = {
|
export const volumesRoute: RouteProps = {
|
||||||
path: "/cluster/persistent-volumes"
|
path: "/persistent-volumes"
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface VolumesRouteParams {
|
export interface VolumesRouteParams {
|
||||||
|
|||||||
@ -25,28 +25,28 @@ import type { KubeResource } from "../rbac";
|
|||||||
|
|
||||||
// Routes
|
// Routes
|
||||||
export const overviewRoute: RouteProps = {
|
export const overviewRoute: RouteProps = {
|
||||||
path: "/cluster/workloads"
|
path: "/workloads"
|
||||||
};
|
};
|
||||||
export const podsRoute: RouteProps = {
|
export const podsRoute: RouteProps = {
|
||||||
path: "/cluster/pods"
|
path: "/pods"
|
||||||
};
|
};
|
||||||
export const deploymentsRoute: RouteProps = {
|
export const deploymentsRoute: RouteProps = {
|
||||||
path: "/cluster/deployments"
|
path: "/deployments"
|
||||||
};
|
};
|
||||||
export const daemonSetsRoute: RouteProps = {
|
export const daemonSetsRoute: RouteProps = {
|
||||||
path: "/cluster/daemonsets"
|
path: "/daemonsets"
|
||||||
};
|
};
|
||||||
export const statefulSetsRoute: RouteProps = {
|
export const statefulSetsRoute: RouteProps = {
|
||||||
path: "/cluster/statefulsets"
|
path: "/statefulsets"
|
||||||
};
|
};
|
||||||
export const replicaSetsRoute: RouteProps = {
|
export const replicaSetsRoute: RouteProps = {
|
||||||
path: "/cluster/replicasets"
|
path: "/replicasets"
|
||||||
};
|
};
|
||||||
export const jobsRoute: RouteProps = {
|
export const jobsRoute: RouteProps = {
|
||||||
path: "/cluster/jobs"
|
path: "/jobs"
|
||||||
};
|
};
|
||||||
export const cronJobsRoute: RouteProps = {
|
export const cronJobsRoute: RouteProps = {
|
||||||
path: "/cluster/cronjobs"
|
path: "/cronjobs"
|
||||||
};
|
};
|
||||||
|
|
||||||
export const workloadsRoute: RouteProps = {
|
export const workloadsRoute: RouteProps = {
|
||||||
|
|||||||
@ -221,7 +221,6 @@ export class App extends React.Component {
|
|||||||
<Route component={Apps} {...routes.appsRoute}/>
|
<Route component={Apps} {...routes.appsRoute}/>
|
||||||
{this.renderExtensionTabLayoutRoutes()}
|
{this.renderExtensionTabLayoutRoutes()}
|
||||||
{this.renderExtensionRoutes()}
|
{this.renderExtensionRoutes()}
|
||||||
<Redirect exact from="/cluster" to={this.startUrl}/>
|
|
||||||
<Redirect exact from="/" to={this.startUrl}/>
|
<Redirect exact from="/" to={this.startUrl}/>
|
||||||
<Route component={NotFound}/>
|
<Route component={NotFound}/>
|
||||||
</Switch>
|
</Switch>
|
||||||
|
|||||||
@ -45,8 +45,6 @@ import { HotbarIcon } from "../hotbar/hotbar-icon";
|
|||||||
import { makeObservable, observable } from "mobx";
|
import { makeObservable, observable } from "mobx";
|
||||||
import type { CatalogEntityContextMenuContext } from "../../../common/catalog";
|
import type { CatalogEntityContextMenuContext } from "../../../common/catalog";
|
||||||
import { HotbarStore } from "../../../common/hotbar-store";
|
import { HotbarStore } from "../../../common/hotbar-store";
|
||||||
import { broadcastMessage } from "../../../common/ipc";
|
|
||||||
import { IpcRendererNavigationEvents } from "../../navigation/events";
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
className?: string;
|
className?: string;
|
||||||
@ -57,15 +55,7 @@ export class Sidebar extends React.Component<Props> {
|
|||||||
static displayName = "Sidebar";
|
static displayName = "Sidebar";
|
||||||
@observable private contextMenu: CatalogEntityContextMenuContext = {
|
@observable private contextMenu: CatalogEntityContextMenuContext = {
|
||||||
menuItems: [],
|
menuItems: [],
|
||||||
navigate: (pathname: string) => {
|
navigate,
|
||||||
if (pathname.startsWith("/cluster/")) {
|
|
||||||
// assume in-frame navigation
|
|
||||||
// FIXME: this is not entirely correct because of extension navigation rules
|
|
||||||
navigate(pathname);
|
|
||||||
} else {
|
|
||||||
broadcastMessage(IpcRendererNavigationEvents.NAVIGATE_IN_APP, pathname);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(props: Props) {
|
constructor(props: Props) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user