forked from opensearch-project/dashboards-observability
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
12 changed files
with
688 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React from 'react'; | ||
import { Router, Route, Switch } from 'react-router-dom'; | ||
import { ClusterOverview } from './overview'; | ||
import { Home as ClusterDetails } from '../home'; | ||
|
||
export const clusterOverviewHome = (props) => { | ||
console.log('clusterOverviewHome props: ', props); | ||
return ( | ||
<Router | ||
history={props.AppMountParametersProp.history} | ||
> | ||
<Switch> | ||
<Route path="/:clusterName" component={ClusterDetails} /> | ||
<Route path="/" component={ClusterOverview} /> | ||
</Switch> | ||
</Router> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React from 'react'; | ||
import { Home } from './home'; | ||
|
||
export const kubernetes = (props) => { | ||
console.log('top props: ', props); | ||
return <Home /> | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React from 'react'; | ||
import { Router, Route, Switch } from 'react-router-dom'; | ||
import { NamespaceOverview } from './overview'; | ||
import { Home as ClusterDetails } from '../home'; | ||
|
||
export const NamespacesOverviewHome = (props) => { | ||
return ( | ||
<Router history={props.AppMountParametersProp.history}> | ||
<Switch> | ||
{/* <Route path="/:nodeName" component={ClusterDetails} /> */} | ||
<Route path="/" component={ NamespaceOverview } /> | ||
</Switch> | ||
</Router> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React from 'react'; | ||
import { | ||
EuiPage, | ||
EuiPageBody, | ||
EuiPageHeader, | ||
EuiPageHeaderSection, | ||
EuiTitle, | ||
EuiFlexGroup, | ||
EuiFlexItem, | ||
EuiCard, | ||
EuiPanel, | ||
EuiTable, | ||
EuiTableHeader, | ||
EuiTableHeaderCell, | ||
EuiTableBody, | ||
EuiTableRow, | ||
EuiTableRowCell, | ||
EuiBadge, | ||
EuiButton, | ||
EuiSelect, | ||
EuiFieldSearch, | ||
EuiIcon, | ||
} from '@elastic/eui'; | ||
|
||
export const NamespaceOverview = () => { | ||
const fakeData = [ | ||
{ | ||
namespace: 'argocd', | ||
cluster: 'do-nyc1-demo-infra', | ||
workloads: 7, | ||
cpuUsage: { avg: '0.0521 cores', max: '0.128 cores' }, | ||
memoryUsage: { avg: '866.37 MiB', max: '1009.99 MiB' }, | ||
alerts: 0, | ||
}, | ||
{ | ||
namespace: 'cert-manager', | ||
cluster: 'do-nyc1-demo-infra', | ||
workloads: 3, | ||
cpuUsage: { avg: '0.00199 cores', max: '0.00302 cores' }, | ||
memoryUsage: { avg: '101.07 MiB', max: '101.17 MiB' }, | ||
alerts: 0, | ||
}, | ||
{ | ||
namespace: 'ingress-nginx', | ||
cluster: 'do-nyc1-demo-infra', | ||
workloads: 1, | ||
cpuUsage: { avg: '0.176 cores', max: '0.215 cores' }, | ||
memoryUsage: { avg: '92.9 MiB', max: '95.17 MiB' }, | ||
alerts: 1, | ||
}, | ||
// Additional rows with similar structure | ||
]; | ||
|
||
return ( | ||
<EuiPage paddingSize="l"> | ||
<EuiPageBody> | ||
<EuiPageHeader> | ||
<EuiPageHeaderSection> | ||
<EuiTitle size="l"> | ||
<h1>Namespaces</h1> | ||
</EuiTitle> | ||
</EuiPageHeaderSection> | ||
</EuiPageHeader> | ||
|
||
{/* <EuiFlexGroup gutterSize="m" style={{ marginTop: '20px' }}> | ||
<EuiFlexItem> | ||
<EuiCard title="Usage" description="" /> | ||
</EuiFlexItem> | ||
<EuiFlexItem> | ||
<EuiCard title="Cost" description="" /> | ||
</EuiFlexItem> | ||
<EuiFlexItem> | ||
<EuiCard title="Explore namespaces" description="" /> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false}> | ||
<EuiFieldSearch | ||
placeholder="Filter Namespace" | ||
onChange={() => {}} | ||
isClearable={true} | ||
/> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false}> | ||
<EuiSelect | ||
options={[ | ||
{ value: 'Filter Clusters', text: 'Filter Clusters' }, | ||
{ value: 'Cluster 1', text: 'Cluster 1' }, | ||
{ value: 'Cluster 2', text: 'Cluster 2' }, | ||
]} | ||
aria-label="Select cluster filter" | ||
/> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> */} | ||
|
||
<EuiPanel paddingSize="none" style={{ marginTop: '20px' }}> | ||
<EuiTable> | ||
<EuiTableHeader> | ||
<EuiTableHeaderCell>NAMESPACE</EuiTableHeaderCell> | ||
<EuiTableHeaderCell>CLUSTER</EuiTableHeaderCell> | ||
<EuiTableHeaderCell>WORKLOADS</EuiTableHeaderCell> | ||
<EuiTableHeaderCell>CPU USAGE (Average)</EuiTableHeaderCell> | ||
<EuiTableHeaderCell>CPU USAGE (Max)</EuiTableHeaderCell> | ||
<EuiTableHeaderCell>MEMORY USAGE (Average)</EuiTableHeaderCell> | ||
<EuiTableHeaderCell>MEMORY USAGE (Max)</EuiTableHeaderCell> | ||
<EuiTableHeaderCell>ALERTS</EuiTableHeaderCell> | ||
</EuiTableHeader> | ||
|
||
<EuiTableBody> | ||
{fakeData.map((namespace, index) => ( | ||
<EuiTableRow key={index}> | ||
<EuiTableRowCell> | ||
<EuiIcon type="arrowRight" /> {namespace.namespace} | ||
</EuiTableRowCell> | ||
<EuiTableRowCell> | ||
<EuiBadge color="hollow">{namespace.cluster}</EuiBadge> | ||
</EuiTableRowCell> | ||
<EuiTableRowCell>{namespace.workloads}</EuiTableRowCell> | ||
<EuiTableRowCell>{namespace.cpuUsage.avg || 'No data'}</EuiTableRowCell> | ||
<EuiTableRowCell>{namespace.cpuUsage.max || 'No data'}</EuiTableRowCell> | ||
<EuiTableRowCell>{namespace.memoryUsage.avg || 'No data'}</EuiTableRowCell> | ||
<EuiTableRowCell>{namespace.memoryUsage.max || 'No data'}</EuiTableRowCell> | ||
<EuiTableRowCell> | ||
{namespace.alerts > 0 ? ( | ||
<EuiBadge color="warning">{namespace.alerts}</EuiBadge> | ||
) : ( | ||
<span>None</span> | ||
)} | ||
</EuiTableRowCell> | ||
</EuiTableRow> | ||
))} | ||
</EuiTableBody> | ||
</EuiTable> | ||
</EuiPanel> | ||
</EuiPageBody> | ||
</EuiPage> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React from 'react'; |
Oops, something went wrong.