/* * * Copyright 2016 RIFT.IO Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ import React from 'react'; import './accountSidebar.scss'; import DashboardCard from 'widgets/dashboard_card/dashboard_card.jsx'; import AccountStore from '../account/accountStore.js'; import { Link } from 'react-router'; import SkyquakeComponent from 'widgets/skyquake_container/skyquakeComponent.jsx'; import Button from 'widgets/button/rw.button' class AccountSidebar extends React.Component{ constructor(props) { super(props); // this.props.store = this.props.flux.props.stores.hasOwnProperty('AccountStore') ? this.props.flux.props.stores.AccountStore : this.props.flux.createStore(AccountStore); var self = this; // this.props = this.props.store.getState(); } listenerHandler = (state) => { this.setState(state); } componentWillMount() { // this.props.store.listen(this.listenerHandler); // this.props.store.openAccountsSocket(); } componentWillUnmount() { // this.props.store.closeSocket(); // this.props.store.unlisten(this.listenerHandler); } render() { let html; let self = this; let {store, ...props} = this.props; //[this.props.cloud,this.props.sdn,this.props['config-agent']] let AccountData = [ { type: 'cloud', data: this.props.cloud }, { type: 'sdn', data: this.props.sdn }, { type: 'config', data: this.props['config-agent'] } ]; let refreshStatus = (