diff --git a/src/branding/branding.js b/src/branding/branding.js index 5baa395..bbc8a48 100644 --- a/src/branding/branding.js +++ b/src/branding/branding.js @@ -19,18 +19,40 @@ import brands from './brands' import config from '../config' import _ from 'lodash'; +import {villasweb_home} from './villasweb/villasweb-home'; +import {slew_home} from './slew/slew_home'; + + class Branding { constructor(chosenbrand) { var brand = _.get(brands, [chosenbrand]); if (!brand) { console.error("Branding '" + chosenbrand + "' not available, will use 'villasweb' branding"); brand = _.get(brands, ['villasweb']); + chosenbrand = 'villasweb' } this.brand = brand; + this.name = chosenbrand; } static instance = Branding.instance || new Branding(config.branding); + + getHome(username = '' , userid = '', role = '') { + var homepage = ''; + switch(this.name) { + case 'villasweb': + homepage = villasweb_home(this.brand.title, username, userid, role); + break; + case 'slew': + homepage = slew_home(); + break; + default: + homepage = villasweb_home(); + break; + } + return homepage; + } }; diff --git a/src/branding/slew/slew_home.js b/src/branding/slew/slew_home.js new file mode 100644 index 0000000..812b703 --- /dev/null +++ b/src/branding/slew/slew_home.js @@ -0,0 +1,41 @@ +/** + * This file is part of VILLASweb. + * + * VILLASweb is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * VILLASweb is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with VILLASweb. If not, see . + ******************************************************************************/ +import React from 'react'; + + +export function slew_home() { + + return ( +
+

SLEW is a learning platform for running experiments in a virtual power engineering world. + The platform enables to interact with the experiments in real time and perform analyses on the experimental results.

+ +

The motivation behind is the ongoing transformation of the energy system, which is making the system more and more complex. + Hence, understanding new phenomena and underlying interactions is getting more challenging, also because real experimental + activities for obtaining a better understanding are not possible for obvious reasons of security and safety.

+ +

The SLEW platform gives the possibility to perform experiments in a virtual infrastructure and to learn from the execution + of complex models. It provides a virtual power engineering world where complex phenomena take place while users can interact + with the system in real time.

+ +

The platform is based on the real-time simulation tool DPsim developed in RWTH, + which is available as open-source software project to the power engineering community. Besides, it integrates the interactive + computing environment Jupyter for further analysis of experimental results.

+
) + +} + diff --git a/src/img/datamodel.png b/src/branding/villasweb/img/datamodel.png similarity index 100% rename from src/img/datamodel.png rename to src/branding/villasweb/img/datamodel.png diff --git a/src/img/eonerc_rwth.svg b/src/branding/villasweb/img/eonerc_rwth.svg similarity index 100% rename from src/img/eonerc_rwth.svg rename to src/branding/villasweb/img/eonerc_rwth.svg diff --git a/src/img/erigrid2.png b/src/branding/villasweb/img/erigrid2.png similarity index 100% rename from src/img/erigrid2.png rename to src/branding/villasweb/img/erigrid2.png diff --git a/src/img/european_commission.svg b/src/branding/villasweb/img/european_commission.svg similarity index 100% rename from src/img/european_commission.svg rename to src/branding/villasweb/img/european_commission.svg diff --git a/src/img/jara.svg b/src/branding/villasweb/img/jara.svg similarity index 100% rename from src/img/jara.svg rename to src/branding/villasweb/img/jara.svg diff --git a/src/img/reserve.svg b/src/branding/villasweb/img/reserve.svg similarity index 100% rename from src/img/reserve.svg rename to src/branding/villasweb/img/reserve.svg diff --git a/src/img/uel.png b/src/branding/villasweb/img/uel.png similarity index 100% rename from src/img/uel.png rename to src/branding/villasweb/img/uel.png diff --git a/src/img/uel_efre.jpeg b/src/branding/villasweb/img/uel_efre.jpeg similarity index 100% rename from src/img/uel_efre.jpeg rename to src/branding/villasweb/img/uel_efre.jpeg diff --git a/src/branding/villasweb/img/villas_web.svg b/src/branding/villasweb/img/villas_web.svg new file mode 100644 index 0000000..ccbc714 --- /dev/null +++ b/src/branding/villasweb/img/villas_web.svg @@ -0,0 +1,158 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/src/branding/villasweb/villasweb-home.js b/src/branding/villasweb/villasweb-home.js new file mode 100644 index 0000000..0b119ad --- /dev/null +++ b/src/branding/villasweb/villasweb-home.js @@ -0,0 +1,66 @@ +/** + * This file is part of VILLASweb. + * + * VILLASweb is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * VILLASweb is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with VILLASweb. If not, see . + ******************************************************************************/ +import React from 'react'; +import { NavLink } from 'react-router-dom'; + +export function villasweb_home(title, username, userid, role) { + return ( +
+

+ Welcome to {title}! +

+

+ You are logged in as user {username} with ID {userid} and role {role}. +

+

Credits

+

VILLASweb is an open source project developed by the Institute for Automation of Complex Power Systems at RWTH Aachen University.

+ Logo ACS + +

Links

+ +

Funding

+

The development of VILLASframework projects has received funding from

+
    +

    SLEW: Second Life for Energiewende, an Exploratory Teaching Space project funded by RWTH Aachen University

    +

    ERIgrid 2.0: An EU Horizon 2020 research and innovation action project for connecting European Smart Grid Infrastructures (grant agreement No 870620)

    +

    + Logo EU + Logo ERIgrid 2.0 +

    +

    Urban Energy Lab 4.0: A project funded by EFRE.NRW (European Regional Development Fund) for the setup of a novel energy research infrastructure.

    +

    + Logo UEL OP EFRE NRW + Logo UEL +

    +

    RESERVE: An EU Horizon 2020 research and innovation project (grant agreement No 727481)

    +

    + Logo EU + Logo RESERVE +

    +

    JARA-ENERGY: Jülich-Aachen Research Alliance (JARA) is an initiative of RWTH Aachen University and Forschungszentrum Jülich.

    +
+
) +} \ No newline at end of file diff --git a/src/common/home.js b/src/common/home.js index f8aa894..e3b2fe4 100644 --- a/src/common/home.js +++ b/src/common/home.js @@ -18,9 +18,9 @@ import React from 'react'; import { Redirect } from "react-router-dom"; -import { NavLink } from 'react-router-dom'; import Branding from '../branding/branding'; +// Logo is dynamically loaded from img folder, therefore the whole folder is required at this point const images = require.context('../img', true) class Home extends React.Component { @@ -35,69 +35,21 @@ class Home extends React.Component { render() { let currentUser = JSON.parse(localStorage.getItem("currentUser")); - if (currentUser == null){ + if (currentUser == null) { console.log("HOME redirecting to logout/ login") return (); } - const brand = Branding.instance.brand; + const branding = Branding.instance; return (
- Logo VILLASweb + Logo VILLASweb

Home

-

- Welcome to {Branding.instance.brand.title}! -

-

- You are logged in as user {currentUser.username} with ID {currentUser.id} and role {currentUser.role}. -

- -

Credits

-

VILLASweb is an open source project developed by the Institute for Automation of Complex Power Systems at RWTH Aachen University.

- Logo ACS - -

Links

- -

Funding

-

The development of VILLASframework projects has received funding from

-
    -

    SLEW: Second Life for Energiewende, an Exploratory Teaching Space project funded by RWTH Aachen University

    -

    ERIgrid 2.0: An EU Horizon 2020 research and innovation action project for connecting European Smart Grid Infrastructures (grant agreement No 870620)

    -

    - Logo EU - Logo ERIgrid 2.0 -

    -

    Urban Energy Lab 4.0: A project funded by EFRE.NRW (European Regional Development Fund) for the setup of a novel energy research infrastructure.

    -

    - Logo UEL OP EFRE NRW - Logo UEL -

    -

    RESERVE: An EU Horizon 2020 research and innovation project (grant agreement No 727481)

    -

    - Logo EU - Logo RESERVE -

    -

    JARA-ENERGY: Jülich-Aachen Research Alliance (JARA) is an initiative of RWTH Aachen University and Forschungszentrum Jülich.

    -
- - - - { - //Logo JARA + {branding.getHome(currentUser.username, currentUser.id, currentUser.role)} +
+ ); } - - ); - } } export default Home; diff --git a/src/config.js b/src/config.js index c7998c0..6ae36be 100644 --- a/src/config.js +++ b/src/config.js @@ -16,12 +16,11 @@ ******************************************************************************/ const config = { - publicPathBase: 'public/', admin: { name: 'Institute for Automation of Complex Power Systems (ACS), RWTH Aachen University, Germany', mail: 'stvogel@eonerc.rwth-aachen.de' }, - branding: 'slew', + branding: 'villasweb', } export default config