Skip to content
This repository has been archived by the owner on Jul 22, 2020. It is now read-only.

Commit

Permalink
feat: add dashboard link to grafana
Browse files Browse the repository at this point in the history
  • Loading branch information
mvines authored and mergify[bot] committed Apr 26, 2019
1 parent 01a7ab7 commit 852260f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/BxAppBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,30 @@ import MenuItem from '@material-ui/core/MenuItem';
import Menu from '@material-ui/core/Menu';
//import MenuIcon from '@material-ui/icons/Menu';
import SearchIcon from '@material-ui/icons/Search';
import DashboardIcon from '@material-ui/icons/Dashboard';
import MapIcon from '@material-ui/icons/Map';
// import AccountCircle from '@material-ui/icons/AccountCircle';
import MoreIcon from '@material-ui/icons/MoreVert';
import Switch from '@material-ui/core/Switch';


class BxAppBar extends React.Component {
state = {
anchorEl: null,
mobileMoreAnchorEl: null,
};

handleDashboard = event => {
const matches = window.location.hostname.match('([.*]).testnet.solana.com');
let url = 'https://metrics.solana.com:3000/d/testnet-edge/testnet-monitor-edge?refresh=60s';
if (matches) {
const testnet = matches[1];
url += `&var-testnet=testnet-${testnet}`;
}

window.open(url);
};

handleMap = event => {
if (this.props.handleMap) {
this.props.handleMap(event);
Expand Down Expand Up @@ -151,6 +164,9 @@ class BxAppBar extends React.Component {
</div>
<div className={classes.grow} />
<div className={classes.sectionDesktop}>
<IconButton color="inherit" onClick={this.handleDashboard}>
<DashboardIcon />
</IconButton>
<IconButton color="inherit" onClick={this.handleMap}>
<MapIcon />
</IconButton>
Expand Down

0 comments on commit 852260f

Please sign in to comment.