diff options
Diffstat (limited to 'opendc-web/opendc-web-ui/src')
11 files changed, 179 insertions, 77 deletions
diff --git a/opendc-web/opendc-web-ui/src/api/routes/token-signin.js b/opendc-web/opendc-web-ui/src/api/routes/token-signin.js index e40127f2..ced5d2e0 100644 --- a/opendc-web/opendc-web-ui/src/api/routes/token-signin.js +++ b/opendc-web/opendc-web-ui/src/api/routes/token-signin.js @@ -1,5 +1,7 @@ +import config from '../../config' + export function performTokenSignIn(token) { - const apiUrl = window.$$env['API_BASE_URL'] || '' + const apiUrl = config['API_BASE_URL'] return fetch(`${apiUrl}/tokensignin`, { method: 'POST', diff --git a/opendc-web/opendc-web-ui/src/api/socket.js b/opendc-web/opendc-web-ui/src/api/socket.js index 884c4152..87facda8 100644 --- a/opendc-web/opendc-web-ui/src/api/socket.js +++ b/opendc-web/opendc-web-ui/src/api/socket.js @@ -1,5 +1,6 @@ import io from 'socket.io-client' import { getAuthToken } from '../auth/index' +import config from '../config' let socket let requestIdCounter = 0 @@ -7,8 +8,7 @@ const callbacks = {} export function setupSocketConnection(onConnect) { const apiUrl = - window.$$env['API_BASE_URL'] || - `${window.location.protocol}//${window.location.hostname}:${window.location.port}` + config['API_BASE_URL'] || `${window.location.protocol}//${window.location.hostname}:${window.location.port}` socket = io.connect(apiUrl) socket.on('connect', onConnect) diff --git a/opendc-web/opendc-web-ui/src/components/home/ContactSection.js b/opendc-web/opendc-web-ui/src/components/home/ContactSection.js index 42bdab8a..d5c6e55f 100644 --- a/opendc-web/opendc-web-ui/src/components/home/ContactSection.js +++ b/opendc-web/opendc-web-ui/src/components/home/ContactSection.js @@ -39,11 +39,12 @@ const ContactSection = () => ( <div className="col text-center disclaimer mt-5 small"> <FontAwesome name="exclamation-triangle" size="2x" className="mr-2" /> <br /> + <strong>Disclaimer: </strong> OpenDC is an experimental tool. Your data may get lost, overwritten, or otherwise become unavailable. <br /> The OpenDC authors should in no way be liable in the event this happens (see our{' '} <strong> - <a href="https://github.com/atlarge-research/opendc/blob/master/LICENSE.md">license</a> + <a href="https://github.com/atlarge-research/opendc/blob/master/LICENSE.txt">license</a> </strong> ). Sorry for the inconvenience. </div> diff --git a/opendc-web/opendc-web-ui/src/components/home/JumbotronHeader.js b/opendc-web/opendc-web-ui/src/components/home/JumbotronHeader.js index 7b410679..6a9ea00c 100644 --- a/opendc-web/opendc-web-ui/src/components/home/JumbotronHeader.js +++ b/opendc-web/opendc-web-ui/src/components/home/JumbotronHeader.js @@ -1,17 +1,28 @@ import React from 'react' +import { Container, Jumbotron, Button } from 'reactstrap' import './JumbotronHeader.sass' const JumbotronHeader = () => ( <section className="jumbotron-header"> - <div className="container"> - <div className="jumbotron text-center"> + <Container> + <Jumbotron className="text-center"> <h1> Open<span className="dc">DC</span> </h1> <p className="lead">Collaborative Datacenter Simulation and Exploration for Everybody</p> <img src="img/logo.png" className="img-responsive mt-3" alt="OpenDC" /> - </div> - </div> + <p className="lead mt-5"> + <Button + tag="a" + target="_blank" + href="https://atlarge-research.com/pdfs/ccgrid21-opendc-paper.pdf" + color="warning" + > + Read about <strong>OpenDC 2.0</strong> <i className="fa fa-external-link" /> + </Button> + </p> + </Jumbotron> + </Container> </section> ) diff --git a/opendc-web/opendc-web-ui/src/components/home/ScreenshotSection.js b/opendc-web/opendc-web-ui/src/components/home/ScreenshotSection.js index c987d5d0..263590d5 100644 --- a/opendc-web/opendc-web-ui/src/components/home/ScreenshotSection.js +++ b/opendc-web/opendc-web-ui/src/components/home/ScreenshotSection.js @@ -1,23 +1,28 @@ import classNames from 'classnames' import React from 'react' +import { Row, Col } from 'reactstrap' import ContentSection from './ContentSection' import './ScreenshotSection.sass' const ScreenshotSection = ({ name, title, imageUrl, caption, imageIsRight, children }) => ( <ContentSection name={name} title={title}> - <div className="row"> - <div - className={classNames('col-xl-5 col-lg-5 col-md-5 col-sm-12 col-12 text-left', { + <Row> + <Col + xl="5" + lg="5" + md="5" + sm="!2" + className={classNames('text-left my-auto', { 'order-1': !imageIsRight, })} > {children} - </div> - <div className="col-xl-7 col-lg-7 col-md-7 col-sm-12 col-12"> + </Col> + <Col xl="7" lg="7" md="7" sm="12"> <img src={imageUrl} className="col-12 screenshot" alt={caption} /> - <div className="row text-muted justify-content-center">{caption}</div> - </div> - </div> + <Row className="text-muted justify-content-center">{caption}</Row> + </Col> + </Row> </ContentSection> ) diff --git a/opendc-web/opendc-web-ui/src/components/home/ScreenshotSection.sass b/opendc-web/opendc-web-ui/src/components/home/ScreenshotSection.sass index 2f454cb4..6b1a6ec4 100644 --- a/opendc-web/opendc-web-ui/src/components/home/ScreenshotSection.sass +++ b/opendc-web/opendc-web-ui/src/components/home/ScreenshotSection.sass @@ -1,5 +1,4 @@ .screenshot - outline: 2px black solid padding-left: 0 padding-right: 0 margin-bottom: 5px diff --git a/opendc-web/opendc-web-ui/src/components/home/SimulationSection.js b/opendc-web/opendc-web-ui/src/components/home/SimulationSection.js index b0244cb5..8e98717a 100644 --- a/opendc-web/opendc-web-ui/src/components/home/SimulationSection.js +++ b/opendc-web/opendc-web-ui/src/components/home/SimulationSection.js @@ -1,22 +1,50 @@ import React from 'react' -import ScreenshotSection from './ScreenshotSection' +import { Col, Row } from 'reactstrap' +import ContentSection from './ContentSection' -const ModelingSection = () => ( - <ScreenshotSection - name="project" - title="Datacenter Simulation" - imageUrl="/img/screenshot-simulation-zoom.png" - caption="Running an experiment in OpenDC" - imageIsRight={false} - > - <h3>Working with OpenDC:</h3> - <ul> - <li>Seamlessly switch between construction and simulation modes</li> - <li>Choose one of several predefined workloads (Big Data, Bag of Tasks, Hadoop, etc.)</li> - <li>Play, pause, and skip around the informative simulation timeline</li> - <li>Visualize and demo live</li> - </ul> - </ScreenshotSection> -) +const SimulationSection = () => { + return ( + <ContentSection name="project" title="Datecenter Simulation"> + <Row> + <Col xl="5" lg="5" md="5" sm="2" className="text-left my-auto order-1"> + <h3>Working with OpenDC:</h3> + <ul> + <li>Seamlessly switch between construction and simulation modes</li> + <li> + Choose one of several predefined workloads (Business Critical, Workflows, Machine Learning, + Serverless, etc.) + </li> + <li>Compare datacenter topologies using automated plots and visual summaries</li> + </ul> + </Col> + <Col xl="7" lg="7" md="7" sm="12"> + <img + src="/img/screenshot-simulation.png" + className="col-12 screenshot" + alt="Running an experiment in OpenDC" + /> + <Row className="text-muted justify-content-center">Running an experiment in OpenDC</Row> + </Col> + </Row> + <Row className="mt-5"> + <Col xl="5" lg="5" md="5" sm="2" className="text-left my-auto"> + <h3>OpenDC's Simulator:</h3> + <ul> + <li>Includes a detailed operational model of modern datacenters</li> + <li> + Support for emerging datacenter technologies around <em>cloud computing</em>,{' '} + <em>serverless computing</em>, <em>big data</em>, and <em>machine learning</em> + </li> + </ul> + </Col> -export default ModelingSection + <Col xl="7" lg="7" md="7" sm="12"> + <img src="/img/opendc-architecture.png" className="col-12 screenshot" alt="OpenDC's Architecture" /> + <Row className="text-muted justify-content-center">OpenDC's Architecture</Row> + </Col> + </Row> + </ContentSection> + ) +} + +export default SimulationSection diff --git a/opendc-web/opendc-web-ui/src/components/home/TeamSection.js b/opendc-web/opendc-web-ui/src/components/home/TeamSection.js index 4b6f1e25..1ee1cbf5 100644 --- a/opendc-web/opendc-web-ui/src/components/home/TeamSection.js +++ b/opendc-web/opendc-web-ui/src/components/home/TeamSection.js @@ -1,52 +1,64 @@ import React from 'react' +import { Row, Col } from 'reactstrap' import ContentSection from './ContentSection' -const TeamMember = ({ photoId, name, description }) => ( - <div className="col-xl-4 col-lg-4 col-md-5 col-sm-6 col-12 justify-content-center"> - <img +const TeamLead = ({ photoId, name, description }) => ( + <Col xl="3" lg="3" md="4" sm="6" className="justify-content-center"> + <Col + tag="img" src={'img/portraits/' + photoId + '.png'} - className="col-xl-10 col-lg-10 col-md-10 col-sm-8 col-5 mb-2 mt-2" + xl="10" + lg="10" + md="10" + sm="8" + col="5" + className="mb-2 mt-2" alt={name} /> - <div className="col-12"> + <Col> <h4>{name}</h4> <div className="team-member-description">{description}</div> - </div> - </div> + </Col> + </Col> +) + +const TeamMember = ({ photoId, name }) => ( + <Col xl="2" lg="2" md="3" sm="4" className="justify-content-center"> + <Col + tag="img" + src={'img/portraits/' + photoId + '.png'} + xl="10" + lg="10" + md="10" + sm="8" + col="5" + className="mb-2 mt-2" + alt={name} + /> + <Col> + <h5>{name}</h5> + </Col> + </Col> ) const TeamSection = () => ( - <ContentSection name="team" title="Core Team"> - <div className="row justify-content-center"> - <TeamMember photoId="aiosup" name="Prof. dr. ir. Alexandru Iosup" description="Project Lead" /> - <TeamMember - photoId="gandreadis" - name="Georgios Andreadis" - description="Software Engineer responsible for the frontend web application" - /> - <TeamMember - photoId="fmastenbroek" - name="Fabian Mastenbroek" - description="Software Engineer responsible for the datacenter simulator" - /> - <TeamMember - photoId="jburley" - name="Jacob Burley" - description="Software Engineer responsible for prefabricated components" - /> - <TeamMember - photoId="loverweel" - name="Leon Overweel" - description="Former product lead and Software Engineer" - /> - </div> - <div className="text-center lead mt-3"> - See{' '} - <a target="_blank" href="http://atlarge.science/opendc#team" rel="noopener noreferrer"> - atlarge.science/opendc - </a>{' '} - for the full team! - </div> + <ContentSection name="team" title="OpenDC Team"> + <Row className="justify-content-center"> + <TeamLead photoId="aiosup" name="Prof. dr. ir. Alexandru Iosup" description="Project Lead" /> + <TeamLead photoId="fmastenbroek" name="Fabian Mastenbroek" description="Technology Lead" /> + <TeamLead photoId="gandreadis" name="Georgios Andreadis" description="Former Technology Lead (2018-2020)" /> + <TeamLead photoId="vvanbeek" name="Vincent van Beek" description="Former Technology Lead (2017-2018)" /> + </Row> + <Row className="justify-content-center mt-5"> + <TeamMember photoId="loverweel" name="Leon Overweel" /> + <TeamMember photoId="lfdversluis" name="Laurens Versluis" /> + <TeamMember photoId="evaneyk" name="Erwin van Eyk" /> + <TeamMember photoId="sjounaid" name="Soufiane Jounaid" /> + <TeamMember photoId="wlai" name="Wenchen Lai" /> + <TeamMember photoId="hhe" name="Hongyu He" /> + <TeamMember photoId="jburley" name="Jacob Burley" /> + <TeamMember photoId="jbosch" name="Jaro Bosch" /> + </Row> </ContentSection> ) diff --git a/opendc-web/opendc-web-ui/src/config.js b/opendc-web/opendc-web-ui/src/config.js new file mode 100644 index 00000000..13f4abf2 --- /dev/null +++ b/opendc-web/opendc-web-ui/src/config.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2021 AtLarge Research + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +function getConfig(name) { + if (process.env.NODE_ENV === 'production' && window.config_overrides) { + const value = window.config_overrides[name] + if (value !== `$${name}`) { + return value + } + } + + return process.env[name] +} + +const config = { + API_BASE_URL: getConfig('REACT_APP_API_BASE_URL'), + OAUTH_CLIENT_ID: getConfig('REACT_APP_OAUTH_CLIENT_ID'), + SENTRY_DSN: getConfig('REACT_APP_SENTRY_DSN'), +} + +export default config diff --git a/opendc-web/opendc-web-ui/src/containers/auth/Login.js b/opendc-web/opendc-web-ui/src/containers/auth/Login.js index 9201c09a..bebe015c 100644 --- a/opendc-web/opendc-web-ui/src/containers/auth/Login.js +++ b/opendc-web/opendc-web-ui/src/containers/auth/Login.js @@ -3,6 +3,7 @@ import React from 'react' import GoogleLogin from 'react-google-login' import { connect } from 'react-redux' import { logIn } from '../../actions/auth' +import config from '../../config' class LoginContainer extends React.Component { static propTypes = { @@ -32,12 +33,12 @@ class LoginContainer extends React.Component { return ( <GoogleLogin - clientId={window.$$env['OAUTH_CLIENT_ID']} + clientId={config['OAUTH_CLIENT_ID']} onSuccess={this.onAuthResponse.bind(this)} onFailure={this.onAuthFailure.bind(this)} render={(renderProps) => ( <span onClick={renderProps.onClick} className="login btn btn-primary"> - <span className="fa fa-google"/> Login with Google + <span className="fa fa-google" /> Login with Google </span> )} /> diff --git a/opendc-web/opendc-web-ui/src/index.js b/opendc-web/opendc-web-ui/src/index.js index bddf0b0e..7f60098d 100644 --- a/opendc-web/opendc-web-ui/src/index.js +++ b/opendc-web/opendc-web-ui/src/index.js @@ -6,13 +6,16 @@ import { Provider } from 'react-redux' import { setupSocketConnection } from './api/socket' import './index.sass' import Routes from './routes' +import config from './config' import configureStore from './store/configure-store' setupSocketConnection(() => { const store = configureStore() + console.log('test', config) + // Initialize Sentry if the user has configured a DSN - const dsn = window.$$env['SENTRY_DSN'] + const dsn = config['SENTRY_DSN'] if (dsn) { Sentry.init({ environment: process.env.NODE_ENV, |
