twister-react/jsx/other/Accounts.js

57 lines
2.0 KiB
JavaScript
Raw Normal View History

2016-01-21 08:57:00 +01:00
var React = require('react');
var SetIntervalMixin = require("../common/SetIntervalMixin.js");
var SafeStateChangeMixin = require('../common/SafeStateChangeMixin.js');
var EventListenerMixin = require('../common/EventListenerMixin.js');
var AppSettingsMixin = require('../common/AppSettingsMixin.js');
var ImportAccountModalButton = require('../other/ImportAccountModalButton.js');
2016-01-24 17:37:01 +01:00
var GenerateAccountModalButton = require('../other/GenerateAccountModalButton.js');
var ExportAccountModalButton = require('../other/ExportAccountModalButton.js');
var LogoutModalButton = require('../other/LogoutModalButton.js');
2016-01-21 08:57:00 +01:00
var ReactBootstrap = require('react-bootstrap')
, NavItem = ReactBootstrap.NavItem
, Nav = ReactBootstrap.Nav
, ListGroup = ReactBootstrap.ListGroup
, ListGroupItem = ReactBootstrap.ListGroupItem
, Panel = ReactBootstrap.Panel
, Glyphicon = ReactBootstrap.Glyphicon
, Button = ReactBootstrap.Button
, Input = ReactBootstrap.Input
module.exports = Accounts = React.createClass({
mixins: [
SetIntervalMixin,
SafeStateChangeMixin,
2016-01-24 17:37:01 +01:00
AppSettingsMixin
2016-01-21 08:57:00 +01:00
],
render: function() {
2016-01-22 21:01:50 +01:00
2016-01-24 17:37:01 +01:00
var thisComponent = this;
2016-01-22 21:01:50 +01:00
2016-01-21 08:57:00 +01:00
return (
<ListGroup>
2016-01-22 21:01:50 +01:00
<ListGroupItem>Accounts</ListGroupItem>
2016-01-21 08:57:00 +01:00
<ListGroupItem>
<ImportAccountModalButton/>
2016-01-24 17:37:01 +01:00
<GenerateAccountModalButton/>
2016-01-22 21:01:50 +01:00
<hr/>
{this.props.accounts.map(function(acc,index) {
//console.log(acc,index)
return (
2016-01-23 14:34:16 +01:00
<div key={"miniprofile:"+acc.name}>
<MiniProfile username={acc.name} pollIntervalProfile={thisComponent.props.pollIntervalProfile}/>
2016-01-27 09:13:32 +01:00
<p>
{acc.status}
<ExportAccountModalButton username={acc.name} accountStatus={acc.status}/>
<LogoutModalButton username={acc.name} accountStatus={acc.status}/>
2016-01-27 09:13:32 +01:00
</p>
2016-01-22 21:01:50 +01:00
</div>
);
})}
2016-01-21 08:57:00 +01:00
</ListGroupItem>
</ListGroup>
);
}
});