{$layout}
{$template "/code_editor"}
{$template "reporter_menu"}

<table class="ui table definition selectable">
    <tr>
        <td class="title">终端名称</td>
        <td>
            {{reporter.name}}
        </td>
    </tr>
    <tr>
        <td>状态</td>
        <td>
            <span v-if="!reporter.isOn" class="red">禁用</span>
            <span v-else-if="!reporter.isActive" class="red">离线</span>
            <span v-else class="green">在线</span>
        </td>
    </tr>
    <tr>
        <td>所属分组</td>
        <td>
            <div v-if="reporter.groups.length > 0">
                <span v-for="group in reporter.groups" class="ui label basic tiny">{{group.name}}</span>
            </div>
            <span v-else class="disabled">全部分组</span>
        </td>
    </tr>
    <tr>
        <td>区域</td>
        <td>
            <span v-if="reporter.location.length > 0">{{reporter.location}}</span>
            <span v-else-if="reporter.status.location.length > 0" class="grey">{{reporter.status.location}}</span>
            <span v-else class="disabled">没有设置</span>
        </td>
    </tr>
    <tr>
        <td>网络提供商</td>
        <td>
            <span v-if="reporter.isp.length > 0">{{reporter.isp}}</span>
            <span v-else-if="reporter.status.isp.length > 0" class="grey">{{reporter.status.isp}}</span>
            <span v-else class="disabled">没有设置</span>
        </td>
    </tr>
    <tr>
        <td>允许的终端IP</td>
        <td>
            <div v-if="reporter.allowIPs != null && reporter.allowIPs.length > 0">
                <span v-for="ip in reporter.allowIPs" class="ui label tiny basic">{{ip}}</span>
            </div>
            <span v-else class="disabled">没有设置</span>
        </td>
    </tr>
    <tr v-if="reporter.status.buildVersion.length > 0">
        <td>版本号</td>
        <td>v{{reporter.status.buildVersion}}</td>
    </tr>
</table>

<b-settings-header>安装信息</b-settings-header>
<!-- <h4>安装信息</h4> -->
<table class="ui table definition selectable">
    <tr>
        <td class="title">节点ID</td>
        <td>{{reporter.uniqueId}}</td>
    </tr>
    <tr>
        <td>节点Secret</td>
        <td>{{reporter.secret}}</td>
    </tr>
    <tr>
        <td>配置文件</td>
        <td>
            configs/api_reporter.yaml&nbsp;
            <download-link :v-element="'rpc-code'" :v-file="'api_reporter.yaml'">[下载]</download-link >
        </td>
    </tr>
    <tr>
        <td>配置内容</td>
        <td>
            <source-code-box id="rpc-code" type="text/yaml">rpc.endpoints: [ {{apiEndpoints}} ]
nodeId: "{{reporter.uniqueId}}"
secret: "{{reporter.secret}}"</source-code-box>
        </td>
    </tr>
</table>