in source/idea/idea-cluster-manager/webapp/src/pages/cluster-admin/cluster-status.tsx [447:556]
buildHostInfo() {
return (
<ColumnLayout columns={1}>
<Header
variant="h2"
description="Cluster hosts and status"
actions={
<SpaceBetween size="xs" direction="horizontal">
<Button
variant="normal"
iconName="refresh"
onClick={() => {
this.loadClusterHosts();
}}
/>
</SpaceBetween>
}
>
Infrastructure Hosts
</Header>
<Table
items={this.state.instances}
loading={this.state.instances_loading}
loadingText="Retrieving cluster host information ..."
columnDefinitions={[
{
id: "instance-name",
header: "Instance Name",
cell: (item: any) => item.instance_name,
},
{
id: "module-id",
header: "Module ID",
cell: (item: any) => item.module_id,
},
{
id: "node-type",
header: "Node Type",
cell: (item: any) => <NodeType node={item} />,
},
{
id: "module-version",
header: "Version",
cell: (item: any) => {
if (item.node_type === Constants.NODE_TYPE_INFRA) {
return item.module_version;
} else {
return <ModuleVersion module={item.module_name} />;
}
},
},
{
id: "instance-type",
header: "Instance Type",
cell: (item: any) => item.instance_type,
},
{
id: "availability-zone",
header: "Availability Zone",
cell: (item: any) => item.availability_zone,
},
{
id: "instance-state",
header: "Instance State",
cell: (item: any) => {
if (item.instance_state === "running") {
return <StatusIndicator type="success">Running</StatusIndicator>;
} else if (item.instance_state === "stopped") {
return <StatusIndicator type="stopped">Stopped</StatusIndicator>;
} else if (item.instance_state === "terminated") {
return <StatusIndicator type="stopped">Terminated</StatusIndicator>;
} else {
return (
<StatusIndicator type="in-progress" colorOverride="grey">
{item.instance_state}
</StatusIndicator>
);
}
},
},
{
id: "private-ip",
header: "Private IP",
cell: (item: any) => (Utils.isEmpty(item.private_ip) ? "-" : item.private_ip),
},
{
id: "public-ip",
header: "Public IP",
cell: (item: any) => (Utils.isEmpty(item.public_ip) ? "-" : item.public_ip),
},
{
id: "connect",
header: "Connect",
cell: (item: any) => {
if (item.instance_state === "running") {
return (
<Link external={true} href={item.session_manager_url}>
Connect
</Link>
);
} else {
return "--";
}
},
},
]}
/>
</ColumnLayout>
);
}