make production build
This commit is contained in:
10
client/app.js
Normal file
10
client/app.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import 'babel-polyfill';
|
||||
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import Layout from './dashboard/layout/layout';
|
||||
|
||||
ReactDOM.render(
|
||||
React.createElement(Layout),
|
||||
document.getElementById('root')
|
||||
);
|
||||
@@ -1 +0,0 @@
|
||||
base.widget.js
|
||||
@@ -1 +0,0 @@
|
||||
campaign_orders.widget.js
|
||||
@@ -1 +0,0 @@
|
||||
energy_time_series.widget.js
|
||||
25
client/dashboard/layout/layout.js
Normal file
25
client/dashboard/layout/layout.js
Normal file
@@ -0,0 +1,25 @@
|
||||
import layoutRt from './layout.rt.js';
|
||||
|
||||
var Layout = React.createClass({
|
||||
getInitialState: function() {
|
||||
},
|
||||
|
||||
handleResize: function(e) {
|
||||
this.setState({windowWidth: window.innerWidth});
|
||||
},
|
||||
|
||||
componentDidMount: function() {
|
||||
window.addEventListener('resize', this.handleResize);
|
||||
},
|
||||
|
||||
setView: function(event) {
|
||||
var layout = this;
|
||||
layout.setState({view: event.target.value});
|
||||
},
|
||||
|
||||
render: function() {
|
||||
return layoutRt.bind(this);
|
||||
}
|
||||
});
|
||||
|
||||
export default Layout;
|
||||
6
client/dashboard/layout/layout.rt
Normal file
6
client/dashboard/layout/layout.rt
Normal file
@@ -0,0 +1,6 @@
|
||||
<div>
|
||||
<select onChange="{this.setView}">
|
||||
<option value="savings">Savings</option>
|
||||
<option value="production">Production</option>
|
||||
</select>
|
||||
</div>
|
||||
5
client/dashboard/layout/layout.rt.js
Normal file
5
client/dashboard/layout/layout.rt.js
Normal file
@@ -0,0 +1,5 @@
|
||||
import React from 'react/addons';
|
||||
import _ from 'lodash';
|
||||
export default function () {
|
||||
return React.createElement('div', {}, React.createElement('select', { 'onChange': this.setView }, React.createElement('option', { 'value': 'savings' }, 'Savings'), React.createElement('option', { 'value': 'production' }, 'Production')));
|
||||
};
|
||||
9
client/dashboard/layout/layout.scss
Normal file
9
client/dashboard/layout/layout.scss
Normal file
@@ -0,0 +1,9 @@
|
||||
#layout {
|
||||
h1 {
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
// needless comment
|
||||
#yada {
|
||||
div { padding: 200px; }
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
import React from 'react';
|
||||
import Relay from 'react-relay';
|
||||
|
||||
class PowerTimeSeries extends React.Component {
|
||||
|
||||
get timeframes(){
|
||||
return [
|
||||
{display: "Today", value: 'today'},
|
||||
{display: "1 week", value: 'week'},
|
||||
{display: "1 month", value: 'month'},
|
||||
{display: "6 months", value: 'half_year'},
|
||||
{display: "1 year", value: 'year'}
|
||||
];
|
||||
}
|
||||
|
||||
render() {
|
||||
var power_time_series = this;
|
||||
return (
|
||||
<div>
|
||||
<h1>Power Time Series</h1>
|
||||
<ul>
|
||||
{power_time_series.props.viewer.widgets.edges.map(edge =>
|
||||
<li key={edge.node.id}>{edge.node.name} (ID: {edge.node.id})</li>
|
||||
)}
|
||||
</ul>
|
||||
<div class="spk-power-time-series-timeframes">
|
||||
{power_time_series.timeframes.map(timeframe =>
|
||||
<div data-value="{timeframe.value}" class="spk-power-time-series-timeframe">{timeframe.display}</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Relay.createContainer(PowerTimeSeries, {
|
||||
fragments: {
|
||||
viewer: () => Relay.QL`
|
||||
fragment on User {
|
||||
widgets(first: 10) {
|
||||
edges {
|
||||
node {
|
||||
id,
|
||||
name,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
`,
|
||||
},
|
||||
});
|
||||
@@ -1 +0,0 @@
|
||||
production_radiation_time_series.widget.js
|
||||
@@ -1,6 +0,0 @@
|
||||
## Dashboard Widgets
|
||||
|
||||
After initialized:
|
||||
1. They get/ check the data they need.
|
||||
2. Render default graph settings.
|
||||
3. Update graphs based on user input.
|
||||
@@ -1,15 +0,0 @@
|
||||
import 'babel-polyfill';
|
||||
|
||||
import App from './components/App';
|
||||
import AppHomeRoute from './routes/AppHomeRoute';
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import Relay from 'react-relay';
|
||||
|
||||
ReactDOM.render(
|
||||
<Relay.RootContainer
|
||||
Component={App}
|
||||
route={new AppHomeRoute()}
|
||||
/>,
|
||||
document.getElementById('root')
|
||||
);
|
||||
7
client/style.js
Normal file
7
client/style.js
Normal file
@@ -0,0 +1,7 @@
|
||||
// Vendor Stylesheets
|
||||
require('bootstrap/dist/css/bootstrap.min.css');
|
||||
require('font-awesome/css/font-awesome.min.css');
|
||||
|
||||
|
||||
// Component Stylesheets
|
||||
require(__dirname + '/dashboard/layout/layout.scss');
|
||||
Reference in New Issue
Block a user