 
 {React, Actions, Store, flux, rtypes, rclass, FluxComponent} = require('flux')
 
-{Button, Well, Col, Row, Accordion, Panel} = require('react-bootstrap')
+{Well, Col, Row, Accordion, Panel} = require('react-bootstrap')
 
 {Icon, Loading} = require('r_misc')
 

    render : ->
        <div>
            <h3>
                <Icon name='dashboard' /> Usage {@refresh_button()}
            </h3>
            <ul>


update_server_stats = () ->
    flux.getActions('server_stats').setTo(loading : true)
    {salvus_client} = require('salvus_client')
    misc = require('misc')

    template =
        timestamp           : null
        hub_servers         : null
        accounts            : null
        projects            : null
        active_projects     : null
        last_day_projects   : null
        last_week_projects  : null
        last_month_projects : null
    salvus_client.query
        changes : true
        query   : stats:[template]
        cb      : (err, q) ->
            if err
                return
            else
                v = q.get()
                v.sort (a,b) -> misc.cmp(a.timestamp, b.timestamp)
                stats = misc.copy(v[v.length-1])
                stats.loading = false
                flux.getActions('server_stats').setTo(stats)
                q.on 'change', (change) ->
                    flux.getActions('server_stats').setTo(change.new_val)

li_style =
    lineHeight : "inherit"
