Skip to content
This repository has been archived by the owner on Dec 17, 2019. It is now read-only.

Commit

Permalink
Merge pull request #12 from aerogear/AEROGEAR-7693
Browse files Browse the repository at this point in the history
Aerogear 7693 - Create Mobile Client Service Chart
  • Loading branch information
sedroche committed Jul 26, 2018
2 parents 29775e5 + 277cee1 commit 1f93af1
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 1 deletion.
Binary file modified ui/public/favicon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion ui/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>Mobile Client</title>
</head>
<body>
<noscript>
Expand Down
44 changes: 44 additions & 0 deletions ui/src/components/MobileClientServiceChart.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import React, { Component } from 'react';
import { DonutChart } from 'patternfly-react';

import '../style/MobileClientServiceChart.css'

class MobileClientServiceChart extends Component {
viewAllServices(){
return (
<a>View All Mobile Services</a>
)
}

render = () => {
const mobileServices = Object.values(this.props.mobileServices || {})
return (
<div>
<div className="donut-label section-label">
Mobile Services
</div>
<div>
<DonutChart
id="donunt-chart-2"
size={{width: 270,height: 91}}
data={{colors: {
'Bound Mobile Services' : '#0088ce',
'Unbound Mobile Services': '#ec7a08',
},columns: [
['Bound Mobile Services', mobileServices[0].bound],
['Unbound Mobile Services',mobileServices[0].unbound],
],type: 'donut'}}
tooltip={{show: true}}
title={{type: 'total'}}
legend={{show: true,position: 'right'}}
/>
</div>
<div>
{this.viewAllServices(this.mobileClients)}
</div>
</div>
)
}
}

export default MobileClientServiceChart;
10 changes: 10 additions & 0 deletions ui/src/components/Overview.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
import React, { Component } from 'react';
import MobileClientOverviewList from './MobileClientOverviewList';
import MobileClientServiceChart from './MobileClientServiceChart';

const listClientsUrl = `/apis/mobile.k8s.io/v1alpha1/namespaces/test1/mobileclients`;

// todo
const mobileServices = {
"mobileServices": {
"bound": 1,
"unbound": 2
}
};

class Overview extends Component {

constructor(props) {
Expand All @@ -28,6 +37,7 @@ class Overview extends Component {
return (
<div>
<MobileClientOverviewList mobileClients={this.state.mobileClients}></MobileClientOverviewList>
<MobileClientServiceChart mobileServices={mobileServices}></MobileClientServiceChart>
</div>
);
}
Expand Down
6 changes: 6 additions & 0 deletions ui/src/style/MobileClientServiceChart.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.donut-label.section-label {
border-bottom: 1px solid #dcdcdc;
line-height: 1;
margin-bottom: 10px;
padding-bottom: 5px;
}

0 comments on commit 1f93af1

Please sign in to comment.