<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sptg="http://www.thymeleaf.org">
    <head>
        <script th:replace="common/head"></script>
    </head>
    <body>
        <div class="layui-fluid">
            <!-- 表格+头部按钮 -->
            <div class="layui-card">
                <div class="layui-form layui-card-header layuiadmin-card-header-auto" style="padding:0;">
                    <div class="layui-card-body" style="padding:0;">
                        <div style="padding-bottom: 10px;">
                            <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="add" sptg:security="mq:server:add">添加服务器</button>
                        </div>
                        <table id="data_entity_table" lay-filter="data_table_event"></table>
                    </div>
                </div>
            </div>
        </div>
    </body>
    <!-- javascript -->
    <script type="text/javascript" th:src="@{'/layui/layui.js'}" charset="utf-8"></script>
    <script type="text/javascript">
        layui.config({
            base: '/' //静态资源所在路径
        });
    </script>
    <script type="text/javascript" th:src="@{'/js/device/mq-manage.js'}" charset="utf-8"></script>

    <!-- 工具栏 -->
    <script type="text/html" id="table-useradmin-webuser">
        {{# if(d.onLineStatus == 1 ){ }}
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="stop" sptg:security="mq:server:enable">
            <span>停用</span>
        </a>
        {{# }else{ }}
        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="start" sptg:security="mq:server:enable">
            <span>启用</span>
        </a>
        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit" sptg:security="mq:server:update">
            <span>修改</span>
        </a>
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete" sptg:security="mq:server:delete">
            <span>删除</span>
        </a>
        {{# } }}
    </script>

    <!-- 状态 -->
    <script type="text/html" id="entity_is_enable">
        {{# if(d.onLineStatus == 1 ){ }}
        <span class="layui-badge layui-bg-green">启用中</span>
        {{# }else if(d.onLineStatus == 0 ){ }}
        <span class="layui-badge layui-bg-cyan">停用中</span>
        {{# }else{ }}
        <span class="layui-badge layui-bg-orange">故障</span>
        {{# } }}
    </script>
</html>