mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Cluster Status view refactoring
Signed-off-by: alexfront <alex.andreev.email@gmail.com>
This commit is contained in:
parent
06d76ead74
commit
71a9306e54
@ -1,41 +1,40 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { Spinner } from "../spinner";
|
|
||||||
import { Cluster } from "../../../main/cluster";
|
import { Cluster } from "../../../main/cluster";
|
||||||
|
import { SubTitle } from "../layout/sub-title";
|
||||||
|
import { Table, TableCell, TableRow } from "../table";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
cluster: Cluster;
|
cluster: Cluster;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Status extends React.Component<Props> {
|
export class Status extends React.Component<Props> {
|
||||||
renderStatusRows(): JSX.Element[] {
|
renderStatusRows() {
|
||||||
const { cluster } = this.props;
|
const { cluster } = this.props;
|
||||||
|
const rows = [
|
||||||
const rows: [string, React.ReactNode][] = [
|
|
||||||
["Online Status", cluster.online ? "online" : `offline (${cluster.failureReason || "unknown reason"}`],
|
["Online Status", cluster.online ? "online" : `offline (${cluster.failureReason || "unknown reason"}`],
|
||||||
["Distribution", cluster.distribution],
|
["Distribution", cluster.distribution],
|
||||||
["Kerbel Version", cluster.version],
|
["Kerbel Version", cluster.version],
|
||||||
["API Address", cluster.apiUrl],
|
["API Address", cluster.apiUrl],
|
||||||
|
["Nodes Count", cluster.nodes || "0"]
|
||||||
];
|
];
|
||||||
|
return (
|
||||||
if (cluster.nodes > 0) {
|
<Table scrollable={false}>
|
||||||
rows.push(["Nodes Count", cluster.nodes]);
|
{rows.map(([name, value]) => {
|
||||||
}
|
return (
|
||||||
|
<TableRow key={name}>
|
||||||
return rows
|
<TableCell>{name}</TableCell>
|
||||||
.map(([header, value]) => [
|
<TableCell className="value">{value}</TableCell>
|
||||||
<h5 key={header+"-header"}>{header}</h5>,
|
</TableRow>
|
||||||
<span key={header + "-value"}>{value}</span>
|
);
|
||||||
])
|
})}
|
||||||
.flat();
|
</Table>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { cluster } = this.props;
|
|
||||||
|
|
||||||
return <div>
|
return <div>
|
||||||
<h2>Status</h2>
|
<h2>Status</h2>
|
||||||
<hr/>
|
<SubTitle title="Cluster Status"/>
|
||||||
<h4>Cluster status</h4>
|
|
||||||
<p>
|
<p>
|
||||||
Cluster status information including: detected distribution, kernel version, and online status.
|
Cluster status information including: detected distribution, kernel version, and online status.
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user