         active_projects        : rtypes.number
         last_day_projects      : rtypes.number
         last_week_projects     : rtypes.number
-        update_server_stats_cb : rtypes.func.isRequired
 
     getDefaultProps : ->
        loading : true
-
-    refresh_button : ->
-        if @props.loading
-            # server_stats store is still loading data
-            <Button disabled bsStyle='default'><Loading /></Button>
-        else
-            <Button bsStyle='default' onClick={@update_server_stats_cb}><Icon name='refresh' /></Button>
 
     number_of_clients : ->
         if @props.hub_servers.length == 0


{React, Actions, Store, flux, rtypes, rclass, FluxComponent} = require('flux')

{Button, Well, Col, Row, Accordion, Panel} = require('react-bootstrap')

{Icon, Loading} = require('r_misc')


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"
