<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})"></head>

<body class="timo-layout-page">
<div class="layui-card">
    <div class="layui-card-header timo-card-header">
        <span><i class="fa fa-bars"></i> 通知接收配置</span>
        <i class="layui-icon layui-icon-refresh refresh-btn"></i>
    </div>
    <div class="layui-card-body">
        <div class="layui-row timo-card-screen put-row">
            <div class="pull-right screen-btn-group">
                <div class="btn-group-right">
                    <button class="layui-btn open-popup" data-title="添加接收者" th:attr="data-url=@{/sys/notify/receiver/add}"
                            data-size="640,480">
                        <i class="fa fa-plus"></i> 添加
                    </button>
                </div>
            </div>
        </div>
        <div class="timo-table-wrap">
            <table class="layui-table timo-table">
                <thead>
                <tr>
                    <th class="sortable" data-field="notifyType">通知类型</th>
                    <th class="sortable" data-field="notifyName">通知名字</th>
                    <th class="sortable" data-field="receiver">接收地址</th>
                    <th class="sortable" data-field="setdefault">默认通知</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr th:each="item:${list}">
                    <td th:text="${item.type}">通知类型</td>
                    <td th:text="${item.name}">通知名字</td>
                    <td th:text="${item.url}">接收地址</td>
                    <td th:text="${item.setdefault}">默认通知</td>
                    <td>
                        <a class="open-popup" data-title="编辑" th:attr="data-url=@{'/sys/notify/receiver/edit/'+${item.name}}"
                           data-size="640,480" href="#">编辑</a>
                        <a class="ajax-post" th:attr="data-msg='确定使用 '+ ${item.name} + ' 接收通知?'"
                           th:href="@{'/api/sys/notify/receiver/default/' + ${item.name}}">设为默认</a>
                        <a class="ajax-delete" th:attr="data-msg='确定要删除 '+ ${item.name} + '?'"
                           th:href="@{'/api/sys/notify/receiver/delete/' + ${item.name}}">删除</a>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>

<script th:replace="/common/template :: script"></script>
<script type="text/javascript">
</script>
</body>
</html>