mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-01 00:08:27 +01:00
wrapping app-stuff
This commit is contained in:
parent
ebb1b3b0b7
commit
97afc144d4
62
public/js/UnleashApp.jsx
Normal file
62
public/js/UnleashApp.jsx
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
var React = require('react');
|
||||||
|
var TabView = require('./components/TabView');
|
||||||
|
var Menu = require('./components/Menu');
|
||||||
|
var UserStore = require('./stores/UserStore');
|
||||||
|
var ErrorMessages = require('./components/ErrorMessages');
|
||||||
|
var LogEntriesComponent = React.createFactory(require('./components/log/LogEntriesComponent'));
|
||||||
|
var FeatureTogglesComponent = React.createFactory(require('./components/feature/FeatureTogglesComponent'));
|
||||||
|
var StrategiesComponent = React.createFactory(require('./components/strategy/StrategiesComponent'));
|
||||||
|
var ArchiveFeatureComponent = React.createFactory(require('./components/feature/ArchiveFeatureComponent'));
|
||||||
|
|
||||||
|
UserStore.init();
|
||||||
|
|
||||||
|
var tabPanes = [
|
||||||
|
{
|
||||||
|
name: 'Feature Toggles',
|
||||||
|
slug: 'feature-toggles',
|
||||||
|
content: new FeatureTogglesComponent({})
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Strategies',
|
||||||
|
slug: 'strategies',
|
||||||
|
content: new StrategiesComponent({})
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Log",
|
||||||
|
slug: 'log',
|
||||||
|
content: new LogEntriesComponent({})
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Archive",
|
||||||
|
slug: 'archive',
|
||||||
|
content: new ArchiveFeatureComponent({})
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
var UnleashApp = React.createClass({
|
||||||
|
getInitialState: function() {
|
||||||
|
return {
|
||||||
|
featureToggles: [],
|
||||||
|
archivedToggles: [],
|
||||||
|
strategies: []
|
||||||
|
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
render: function () {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Menu />
|
||||||
|
<div className="container">
|
||||||
|
<div className="page">
|
||||||
|
<ErrorMessages />
|
||||||
|
<TabView tabPanes={tabPanes} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = UnleashApp;
|
@ -1,47 +1,3 @@
|
|||||||
var React = require('react');
|
var React = require('react');
|
||||||
var TabView = require('./components/TabView');
|
var UnleashApp = require('./UnleashApp');
|
||||||
var Menu = require('./components/Menu');
|
React.render(<UnleashApp />, document.getElementById('content'));
|
||||||
var UserStore = require('./stores/UserStore');
|
|
||||||
var ErrorMessages = require('./components/ErrorMessages');
|
|
||||||
var LogEntriesComponent = React.createFactory(require('./components/log/LogEntriesComponent'));
|
|
||||||
var FeatureTogglesComponent = React.createFactory(require('./components/feature/FeatureTogglesComponent'));
|
|
||||||
var StrategiesComponent = React.createFactory(require('./components/strategy/StrategiesComponent'));
|
|
||||||
var ArchiveFeatureComponent = React.createFactory(require('./components/feature/ArchiveFeatureComponent'));
|
|
||||||
|
|
||||||
UserStore.init();
|
|
||||||
|
|
||||||
var tabPanes = [
|
|
||||||
{
|
|
||||||
name: 'Feature Toggles',
|
|
||||||
slug: 'feature-toggles',
|
|
||||||
content: new FeatureTogglesComponent({pollInterval: 5000})
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Strategies',
|
|
||||||
slug: 'strategies',
|
|
||||||
content: new StrategiesComponent({})
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Log",
|
|
||||||
slug: 'log',
|
|
||||||
content: new LogEntriesComponent({})
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Archive",
|
|
||||||
slug: 'archive',
|
|
||||||
content: new ArchiveFeatureComponent({})
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
React.render(
|
|
||||||
<div>
|
|
||||||
<Menu />
|
|
||||||
<div className="container">
|
|
||||||
<div className="page">
|
|
||||||
<ErrorMessages />
|
|
||||||
<TabView tabPanes={tabPanes} />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>,
|
|
||||||
document.getElementById('content')
|
|
||||||
);
|
|
||||||
|
Loading…
Reference in New Issue
Block a user