<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sptg="http://www.thymeleaf.org">
    <head>
        <script th:replace="common/head"></script>
        <style>
            .layui-layer.alert_content .layui-layer-content {
                padding: 0;
            }
            .layui-layer.alert_content .layui-layer-btn{
                padding: 0 30px 12px;
            }
            .xm-toolbar .toolbar-tag {
                width: 100%;
                display: flex;
                justify-content: center;
                background-color: #1E9FFF!important;
                color: #fff!important;
            }
        </style>
    </head>

    <body style="position: absolute;top:0;bottom: 0;left:0;right: 0;">
        <div class="layui-fluid">
            <input type="hidden" id="user_org_id" th:value="${onLineUser.orgId}" />
            <!-- 下拉树 -->
            <div class="x-body">
                <div class="layui-card">
                    <!-- 查询条件 -->
                    <div class="layui-form layui-card-header layuiadmin-card-header-auto"  style="padding:0;">
                        <div class="layui-form-item border-b">
                            <div class="layui-inline">
                                <label class="layui-form-label">账号</label>
                                <div class="layui-input-block">
                                    <input type="text" id="account_name" placeholder="请输入账号" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">设备名称</label>
                                <div class="layui-input-block">
                                    <input type="text" id="device_name" placeholder="请输入设备名称" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">设备号</label>
                                <div class="layui-input-block">
                                    <input type="text" id="device_num" placeholder="请输入设备号" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">是否在线</label>
                                <div class="layui-input-block">
                                    <select id="online_status" >
                                        <option value="" selected>全部</option>
                                        <option value="1" >在线</option>
                                        <option value="0" >不在线</option>
                                    </select>
                                </div>
                            </div>

                            <div class="layui-inline">
                                <label class="layui-form-label">推流状态</label>
                                <div class="layui-input-block">
                                    <select id="pusher_status" >
                                        <option value="" selected>全部</option>
                                        <option value="0" >推流中</option>
                                        <option value="1" >流不存在</option>
                                    </select>
                                </div>
                            </div>
                            <div class="layui-inline" style="margin-left: 38px;">
                                <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="query">查询</button>
                                <button class="layui-btn  layui-btn-primary" lay-submit lay-filter="reset">重置</button>
                            </div>
                        </div>
                        <!-- 表格+头部按钮 -->
                        <div class="layui-card-body" style="padding:0;">
                            <div style="padding-bottom: 10px;">
                                <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="syncRtspUrlAll" sptg:security="videoCloud:device:syncRtspUrlAll">全量同步播放地址</button>
                            </div>
                            <table id="data_entity_table" lay-filter="table_event"></table>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- javascript -->
        <script type="text/javascript" th:src="@{'/layui/layui.js'}" charset="utf-8"></script>
        <script type="text/javascript">
            layui.config({
                base: '/' //静态资源所在路径
            });
            var selectDeviceIds = new Set();
        </script>
        <script type="text/javascript" th:src="@{'/js/videoCloud/vc-device-manage.js'}" charset="utf-8"></script>

        <!-- 设备类型 -->
        <script type="text/html" id="device_type">
            {{#  if(d.deviceType == 132){ }}
            <span>IPC</span>
            {{# } else if(d.deviceType == 111){ }}
            <span>DVR</span>
            {{# } else if(d.deviceType == 118){ }}
            <span>NVR</span>
            {{# } else if(d.deviceType == 114){ }}
            <span>解码器</span>
            {{#  } }}
        </script>

        <!-- 设备类型 -->
        <script type="text/html" id="equip_type">
            {{#  if(d.equipType == 'G'){ }}
            <span>枪机</span>
            {{# } else if(d.equipType == 'D'){ }}
            <span>球机</span>
            {{# } else { }}
            <span>未知</span>
            {{#  } }}
        </script>

        <!-- 是否在线 -->
        <script type="text/html" id="is_online">
            {{#  if(d.isOnline == 1){ }}
            <span class="layui-badge layui-bg-green">在线</span>
            {{# } else if(d.isOnline == 0){ }}
            <span class="layui-badge layui-bg-black">不在线</span>
            {{#  } }}
        </script>

        <!-- 设备类型 -->
        <script type="text/html" id="is_pusher_status">
            {{#  if(d.pusherStatus == 0){ }}
            <span class="layui-badge layui-bg-green">推流中</span>
            {{# } else if(d.pusherStatus == 1){ }}
            <span class="layui-badge layui-bg-black">流不存在</span>
            {{# } else if(d.pusherStatus == 3){ }}
            <span class="layui-badge layui-bg-orange">等待调度推流中</span>
            {{# } else { }}
            <span></span>
            {{#  } }}
        </script>


        <!--操作-->
        <script type="text/html" id="table-operate">
            <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="info">详情</a>
            <a class="layui-btn layui-btn-xs layui-bg-black" data-dropdown="#dropUser{{d.LAY_INDEX}}" lay-event="more" no-shade="true">
                更多<i class="layui-icon layui-icon-drop" style="font-size: 12px;margin-right: 0;"></i>
            </a>
            <a class="layui-btn layui-bg-red layui-btn-xs" lay-event="zlmStreamClose" sptg:security="videoCloud:device:info:manage">关流</a>
            <!-- 下拉菜单 -->
            <ul class="dropdown-menu-nav dropdown-bottom-right layui-hide" id="dropUser{{d.LAY_INDEX}}">
                <div class="dropdown-anchor"></div>
                <li><a  lay-event="syncDevice" sptg:security="videoCloud:device:info:manage">同步设备信息</a></li>
                <li><a  lay-event="getRtspUrl" sptg:security="videoCloud:device:info:manage">获取rtsp地址</a></li>
<!--                <li><a  lay-event="pusher" sptg:security="videoCloud:device:info:manage">推流</a></li>-->
<!--                <li><a  lay-event="pusherStatus" sptg:security="videoCloud:device:info:manage">推流查询</a></li>-->
<!--                <li><a  lay-event="pusherDelete" sptg:security="videoCloud:device:info:manage">推流停止</a></li>-->
                <li><a  lay-event="zlmStreamOnline" sptg:security="videoCloud:device:info:manage">流查询</a></li>
                <li><a  lay-event="zlmStreamPush" sptg:security="videoCloud:device:info:manage">推流</a></li>
            </ul>
        </script>

    </body>

</html>
