{$layout}
{$template "menu"}
{$template "/echarts"}

<columns-grid>
    <div class="ui column">
        <h4>用户总数<link-icon href="/users"></link-icon></h4>
        <div class="value"><span>{{board.totalUsers}}</span>
            <span v-if="board.countVerifyingUsers > 0" style="font-size: 1em">
                / <a href="/users?verifying=1"><span class="red" style="font-size: 1em">{{board.countVerifyingUsers}}待审核</span></a>
            </span>
        </div>
    </div>
    <div class="ui column">
        <h4>今日新增<link-icon href="/users"></link-icon></h4>
        <div class="value"><span>{{board.countTodayUsers}}</span></div>
    </div>
    <div class="ui column">
        <h4>本周新增<link-icon href="/users"></link-icon></h4>
        <div class="value"><span>{{board.countWeeklyUsers}}</span></div>
    </div>
    <div class="ui column">
        <h4>用户节点<link-icon href="/settings/userNodes"></link-icon></h4>
        <div class="value"><span>{{board.countUserNodes}}</span>
            <span v-if="board.countOfflineUserNodes > 0" style="font-size: 1em">
                / <a href="/settings/userNodes"><span class="red" style="font-size: 1em">{{board.countOfflineUserNodes}}离线</span></a>
            </span>
            <span v-else style="font-size: 1em">个</span>
        </div>
    </div>
</columns-grid>

<chart-columns-grid>
    <div class="ui column">
        <h4>用户增长趋势</h4>
        <div class="ui divider"></div>
        <div class="chart-box" id="daily-stat-chart"></div>
    </div>

    <div class="ui column">
        <h4>流量排行 <span>（24小时）</span></h4>
        <div class="ui divider"></div>
        <div class="chart-box" id="top-traffic-chart"></div>
    </div>

    <div class="ui column">
        <!-- 系统信息 -->
        <div class="ui menu text">
            <a href="" class="item" :class="{active: nodeStatusTab == 'cpu'}" @click.prevent="selectNodeStatusTab('cpu')">用户节点CPU</a>
            <a href="" class="item" :class="{active: nodeStatusTab == 'memory'}" @click.prevent="selectNodeStatusTab('memory')">用户节点内存</a>
            <a href="" class="item" :class="{active: nodeStatusTab == 'load'}" @click.prevent="selectNodeStatusTab('load')">用户节点负载</a>
        </div>
        <div class="ui divider"></div>

        <div class="chart-box" id="cpu-chart" v-show="nodeStatusTab == 'cpu'"></div>
        <div class="chart-box" id="memory-chart" v-show="nodeStatusTab == 'memory'"></div>
        <div class="chart-box" id="load-chart" v-show="nodeStatusTab == 'load'"></div>
    </div>
</chart-columns-grid>