diff --git a/src/config.js b/src/config.js index 4ade8ce..4054518 100644 --- a/src/config.js +++ b/src/config.js @@ -1,6 +1,11 @@ const config = { - publicPathBase: 'public/' + publicPathBase: 'public/', + instance: 'frontend of the Global RT-SuperLab Demonstration', + admin: { + name: 'Steffen Vogel', + mail: 'stvogel@eonerc.rwth-aachen.de' + } } -export default config \ No newline at end of file +export default config diff --git a/src/containers/home.js b/src/containers/home.js index 64dabd3..c365f0f 100644 --- a/src/containers/home.js +++ b/src/containers/home.js @@ -22,50 +22,74 @@ import React, { Component } from 'react'; import { Container } from 'flux/utils'; -// import AppDispatcher from '../app-dispatcher'; -import UserStore from '../stores/users-store'; +import AppDispatcher from '../app-dispatcher'; + +import NodeStore from '../stores/node-store'; +import SimulationStore from '../stores/simulation-store'; +import ProjectStore from '../stores/project-store'; + +import config from '../config'; class Home extends Component { static getStores() { - return [ UserStore ]; + return [ NodeStore, SimulationStore, ProjectStore ]; } static calculateState() { return { - currentUser: UserStore.getState().currentUser - counts: { - users: UserStore.getState().users.length + nodes: NodeStore.getState(), + projects: ProjectStore.getState(), + simulations: SimulationStore.getState(), }; } + componentWillMount() { + AppDispatcher.dispatch({ + type: 'projects/start-load', + token: this.state.sessionToken + }); + + AppDispatcher.dispatch({ + type: 'simulations/start-load', + token: this.state.sessionToken + }); + } + render() { return ( -
Welcome {this.state.currentUser}! This is the VILLASweb frontend version [version] hosted by [admin].
-This instance is hosting {this.state.counts.projects} projects consisting of {this.state.counts.nodes} nodes, {this.state.counts.simulations} simulations and {this.state.counts.visualizations} visualisations.
-
There are currently {this.state.counts.users} users registered.
-VILLASweb is developed by the Institute for Automation of Complex Power Systems at the RWTH Aachen University.
-The development of VILLASframework projects have received funding from
-
+ Welcome to {config.instance}!
+ VILLASweb is a frontend for distributed real-time simulation hosted by {config.admin.name}.
+
+ This instance is hosting {this.state.projects.length} projects consisting of {this.state.nodes.length} nodes and {this.state.simulations.length} simulations.
+
VILLASweb is developed by the Institute for Automation of Complex Power Systems at the RWTH Aachen University.
+The development of VILLASframework projects have received funding from
+