mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-09 00:00:01 +01:00
show only simulation models and dashboards that belong to currently selected scenario, remove users for now, show name of simulator in simulation model list
This commit is contained in:
parent
e50a43a569
commit
04265d31d7
1 changed files with 13 additions and 25 deletions
|
@ -30,7 +30,6 @@ import SimulatorStore from '../simulator/simulator-store';
|
|||
import DashboardStore from '../dashboard/dashboard-store';
|
||||
import SimulationModelStore from '../simulationmodel/simulation-model-store';
|
||||
import UserStore from '../user/user-store';
|
||||
import UsersStore from '../user/users-store';
|
||||
import AppDispatcher from '../common/app-dispatcher';
|
||||
|
||||
import Icon from '../common/icon';
|
||||
|
@ -45,7 +44,7 @@ import DeleteDialog from '../common/dialogs/delete-dialog';
|
|||
|
||||
class Scenario extends React.Component {
|
||||
static getStores() {
|
||||
return [ ScenarioStore, SimulationModelStore, UsersStore, DashboardStore, SimulatorStore];
|
||||
return [ ScenarioStore, SimulationModelStore, DashboardStore, SimulatorStore];
|
||||
}
|
||||
|
||||
static calculateState(prevState, props) {
|
||||
|
@ -61,12 +60,17 @@ class Scenario extends React.Component {
|
|||
});
|
||||
}
|
||||
|
||||
// obtain all dashboards of a scenario
|
||||
let dashboards = DashboardStore.getState().filter(dashb => dashb.scenarioID === parseInt(props.match.params.scenario, 10));
|
||||
|
||||
// obtain all simulation models of a scenario
|
||||
let simulationmodels = SimulationModelStore.getState().filter(simmodel => simmodel.scenarioID === parseInt(props.match.params.scenario, 10));
|
||||
|
||||
return {
|
||||
scenario,
|
||||
sessionToken,
|
||||
simulationModels: SimulationModelStore.getState(),
|
||||
users: UsersStore.getState(),
|
||||
dashboards: DashboardStore.getState(),
|
||||
simulationModels: simulationmodels,
|
||||
dashboards: dashboards,
|
||||
simulators: SimulatorStore.getState(),
|
||||
|
||||
deleteSimulationModelModal: false,
|
||||
|
@ -97,14 +101,6 @@ class Scenario extends React.Component {
|
|||
param: '?scenarioID='+this.state.scenario.id,
|
||||
});
|
||||
|
||||
// load users of selected scenario
|
||||
AppDispatcher.dispatch({
|
||||
type: 'scenarios/start-load',
|
||||
token: this.state.sessionToken,
|
||||
data: this.state.scenario.id,
|
||||
param: '/users'
|
||||
});
|
||||
|
||||
// load dashboards of selected scenario
|
||||
AppDispatcher.dispatch({
|
||||
type: 'dashboards/start-load',
|
||||
|
@ -321,9 +317,9 @@ class Scenario extends React.Component {
|
|||
<Table data={this.state.simulationModels}>
|
||||
<TableColumn checkbox onChecked={(index, event) => this.onSimulationModelChecked(index, event)} width='30' />
|
||||
<TableColumn title='Name' dataKey='name' link='/simulationModel/' linkKey='id' />
|
||||
<TableColumn title='Simulator' dataKey='simulator' modifier={(simulator) => this.getSimulatorName(simulator)} />
|
||||
<TableColumn title='Output' dataKey='outputLength' width='100' />
|
||||
<TableColumn title='Input' dataKey='inputLength' width='100' />
|
||||
<TableColumn title='Simulator' dataKey='simulatorID' modifier={(simulatorID) => this.getSimulatorName(simulatorID)} />
|
||||
<TableColumn title='Outputs' dataKey='outputLength' width='100' />
|
||||
<TableColumn title='Inputs' dataKey='inputLength' width='100' />
|
||||
<TableColumn
|
||||
title=''
|
||||
width='200'
|
||||
|
@ -360,7 +356,7 @@ class Scenario extends React.Component {
|
|||
{/*Dashboard table*/}
|
||||
<h2>Dashboards</h2>
|
||||
<Table data={this.state.dashboards}>
|
||||
<TableColumn title='Name' dataKey='name' link='/dashboard/' linkKey='id' />
|
||||
<TableColumn title='Name' dataKey='name' link='/dashboards/' linkKey='id' />
|
||||
<TableColumn title='Grid' dataKey='grid' />
|
||||
<TableColumn
|
||||
title=''
|
||||
|
@ -384,14 +380,6 @@ class Scenario extends React.Component {
|
|||
|
||||
<DeleteDialog title="dashboard" name={this.state.modalDashboardData.name} show={this.state.deleteDashboardModal} onClose={(e) => this.closeDeleteDashboardModal(e)}/>
|
||||
|
||||
{/*Users table*/}
|
||||
<h2>Users</h2>
|
||||
<Table data={this.state.users}>
|
||||
<TableColumn title='Username' dataKey='username' />
|
||||
<TableColumn title='ID' dataKey='id' />
|
||||
<TableColumn title='E-Mail' dataKey='mail' />
|
||||
</Table>
|
||||
|
||||
|
||||
</div>;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue