mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-09 00:00:01 +01:00
Dashboards are now reachable via scenarios, removed example dashboard
This commit is contained in:
parent
20967006a4
commit
e50a43a569
3 changed files with 0 additions and 89 deletions
|
@ -51,7 +51,6 @@ import Scenario from './scenario/scenario';
|
|||
import SimulationModel from './simulationmodel/simulation-model';
|
||||
import Users from './user/users';
|
||||
import User from './user/user';
|
||||
import ExDashboard from './dashboard/exdashboard';
|
||||
|
||||
import './styles/app.css';
|
||||
|
||||
|
@ -146,7 +145,6 @@ class App extends React.Component {
|
|||
<div className={`app-content app-content-margin-left`}>
|
||||
<Route exact path="/" component={Home} />
|
||||
<Route path="/home" component={Home} />
|
||||
<Route path="/exdashboard/:dashboard" component={Dashboard} />
|
||||
<Route path="/dashboards/:dashboard" component={Dashboard} />
|
||||
<Route exact path="/scenarios" component={Scenarios} />
|
||||
<Route path="/scenarios/:scenario" component={Scenario} />
|
||||
|
@ -154,7 +152,6 @@ class App extends React.Component {
|
|||
<Route path="/simulators" component={Simulators} />
|
||||
<Route path="/user" component={User} />
|
||||
<Route path="/users" component={Users} />
|
||||
<Route path="/exdashboard" component={ExDashboard} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@ class SidebarMenu extends React.Component {
|
|||
<li><NavLink to="/home" activeClassName="active" title="Home">Home</NavLink></li>
|
||||
<li><NavLink to="/scenarios" activeClassName="active" title="Scenarios">Scenarios</NavLink></li>
|
||||
<li><NavLink to="/simulators" activeClassName="active" title="Simulators">Simulators</NavLink></li>
|
||||
<li><NavLink to="/exdashboard" activeClassName="active" title="Example Dashboard">Example Dashboard</NavLink></li>
|
||||
{ this.props.currentRole === 'Admin' ?
|
||||
<li><NavLink to="/users" activeClassName="active" title="User Management">User Management</NavLink></li> : ''
|
||||
}
|
||||
|
|
|
@ -1,85 +0,0 @@
|
|||
import React, { Component } from 'react';
|
||||
import { Container } from 'flux/utils';
|
||||
import DashboardStore from './dashboard-store';
|
||||
import AppDispatcher from '../common/app-dispatcher';
|
||||
import Table from '../common/table';
|
||||
import TableColumn from '../common/table-column';
|
||||
import UserStore from '../user/user-store';
|
||||
import { Button } from 'react-bootstrap';
|
||||
import Icon from '../common/icon';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class ExDashboard extends Component {
|
||||
static getStores() {
|
||||
return [ DashboardStore ];
|
||||
}
|
||||
|
||||
static calculateState(prevState, props) {
|
||||
prevState = prevState || {};
|
||||
|
||||
console.log("calculateState has been called");
|
||||
const dashboards = DashboardStore.getState();
|
||||
let tokenState = UserStore.getState().token;
|
||||
console.log(dashboards);
|
||||
|
||||
return{
|
||||
dashboards,
|
||||
tokenState
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
AppDispatcher.dispatch({
|
||||
type: 'dashboards/start-load',
|
||||
token: this.state.tokenState,
|
||||
param: '?scenarioID=1'
|
||||
});
|
||||
}
|
||||
|
||||
loadDash(){
|
||||
console.log('bis hierhin gekommen');
|
||||
AppDispatcher.dispatch({
|
||||
type: 'dashboards/start-load',
|
||||
token: this.state.tokenState,
|
||||
param: '?scenarioID=1'
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
render() {
|
||||
const buttonStyle = {
|
||||
marginLeft: '10px'
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
<div className='section'>
|
||||
|
||||
<h1>Dashboards</h1>
|
||||
|
||||
<Table data={this.state.dashboards}>
|
||||
<TableColumn title='Name' dataKey='name' link='/exdashboard/' linkKey='id' />
|
||||
<TableColumn title='Grid' dataKey='grid' link='/edashboard/' linkKey='id' />
|
||||
<TableColumn title='ScenarioID' dataKey='scenarioID' link='/exdashboard/' linkKey='id' />
|
||||
</Table>
|
||||
|
||||
<div style={{ float: 'right' }}>
|
||||
<Button onClick={() => this.loadDash} style={buttonStyle}><Icon icon="plus" /> Add</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
let fluxContainerConverter = require('../common/FluxContainerConverter');
|
||||
export default Container.create(fluxContainerConverter.convert(ExDashboard));
|
Loading…
Add table
Reference in a new issue