1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Add Open Cluster Settings link

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2022-04-13 15:48:37 +03:00
parent 31d49bb751
commit 4eb54a9296

View File

@ -3,20 +3,33 @@
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import styles from "./cluster-no-metrics.module.scss";
import React from "react"; import React from "react";
import { Icon } from "../icon"; import { Icon } from "../icon";
import { cssNames } from "../../utils"; import { cssNames } from "../../utils";
import { broadcastMessage } from "../../../common/ipc";
import { IpcRendererNavigationEvents } from "../../navigation/events";
import { catalogEntityRegistry } from "../../api/catalog-entity-registry";
export interface ClusterNoMetricsProps { export interface ClusterNoMetricsProps {
className: string; className: string;
} }
export function ClusterNoMetrics({ className }: ClusterNoMetricsProps) { export function ClusterNoMetrics({ className }: ClusterNoMetricsProps) {
function getClusterId() {
return catalogEntityRegistry.activeEntity;
}
function openSettingsPage() {
broadcastMessage(IpcRendererNavigationEvents.NAVIGATE_IN_APP, `/entity/${getClusterId()?.getId()}/settings`);
}
return ( return (
<div className={cssNames("ClusterNoMetrics flex column box grow justify-center align-center", className)}> <div className={cssNames(styles.ClusterNoMetrics, className)}>
<Icon material="info"/> <Icon material="info"/>
<p>Metrics are not available due to missing or invalid Prometheus configuration.</p> <p>Metrics are not available due to missing or invalid Prometheus configuration.</p>
<p>Right click cluster icon to open cluster settings.</p> <p><span className={styles.link} onClick={openSettingsPage}>Open cluster settings</span></p>
</div> </div>
); );
} }