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

<second-menu>
    <menu-item @click.prevent="createInstance">
        <i class="pi pi-pen-to-square"></i>
        创建媒介
    </menu-item>
</second-menu>

<b-empty v-if="instances.length == 0">暂时还没有媒介接收人。</b-empty>

<table class="ui table selectable celled" v-if="instances.length > 0">
    <thead>
        <tr>
            <th>媒介名称</th>
            <th class="three wide">媒介类型</th>
            <th>备注</th>
            <th class="two wide">状态</th>
            <th class="two op">操作</th>
        </tr>
    </thead>
    <tr v-for="instance in instances">
        <td><a :href="'/admins/recipients/instances/instance?instanceId=' + instance.id">{{instance.name}}</a></td>
        <td>{{instance.media.name}}</td>
        <td>
            <span v-if="instance.description.length > 0">{{instance.description}}</span>
            <span v-else class="disabled">-</span>
        </td>
        <td>
            <label-on :v-is-on="instance.isOn"></label-on>
        </td>
        <td>
            <a :href="'/admins/recipients/instances/instance?instanceId=' + instance.id">详情</a> &nbsp;
            <a href="" @click.prevent="deleteInstance(instance.id)">删除</a>
        </td>
    </tr>
</table>

<div class="page" v-html="filterPageContent(page)"></div>