{$layout}
{$template "../menu"}
{$template "/left_menu_with_menu"}

<div class="right-box with-menu">
    <first-menu>
        <menu-item :href="'.?clusterId=' + clusterId">设置</menu-item>
        <menu-item :href="'.status?clusterId=' + clusterId" class="active">状态</menu-item>
    </first-menu>

    <loading-message v-if="isLoading">检查中，请耐心等待完成...</loading-message>

    <p class="comment" v-if="!isLoading && results.length == 0">当前集群下暂时还没有节点。</p>

    <table class="ui table selectable" v-if="results.length > 0">
        <thead>
            <tr>
                <th class="three wide">节点名称</th>
                <th>检查结果</th>
                <th class="two op">独立设置</th>
            </tr>
        </thead>
        <tbody v-for="result in results">
            <tr>
                <td>
                    <a :href="'/clusters/cluster/node?clusterId=' + clusterId + '&nodeId=' + result.nodeId">{{result.nodeName}}</a>
                    <div v-if="result.isPrior">
                        <a :href="'/clusters/cluster/node/settings/ddos-protection?clusterId=' + clusterId + '&nodeId=' + result.nodeId"><grey-label>定制</grey-label></a>
                    </div>
                </td>
                <td>
                    <span class="green" v-if="result.isOk">{{result.message}}</span>
                    <span class="red" v-if="!result.isOk">{{result.message}}</span>
                </td>
                <td>
                    <a :href="'/clusters/cluster/node/settings/ddos-protection?clusterId=' + clusterId + '&nodeId=' + result.nodeId">设置</a>
                </td>
            </tr>
        </tbody>
    </table>

    <div class="margin"></div>
    <a href="" @click.prevent="reload">[刷新]</a>
</div>