<%@ Page Language="C#" MasterPageFile="~/Views/Shared/SimonMasterPage.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%: Html.Language("HostManagement") %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="easyui-layout" data-options="fit:true">
        <div data-options="region:'north',border:false">
            <div class="toolbar" style="height: 35px;">
                <div>
                    <label>
                        <%: Html.Language("RoomNumber")%>：</label>
                    <input id="txtRoomNumber" class="easyui-validatebox" style="width: 60px;" />
                    <select id="cbxIsSyncRoomNumber" class="easyui-combobox" style="width: 60px;" data-options="panelHeight: 'auto',editable: false,onSelect:groupTreeOnSelect">
                        <option value='2'>
                            <%: Html.Language("All")%></option>
                        <option value='1' selected="selected">
                            <%: Html.Language("Sync")%></option>
                        <option value='0'>
                            <%: Html.Language("NoSync")%></option>
                    </select>
                    <label>
                        MAC：</label>
                    <input id="txtMac" class="easyui-validatebox" style="width: 120px;" />
                    <label>
                        <%: Html.Language("RoomType")%></label>
                    <input id="txtRoomType" class="easyui-validatebox" style="width: 60px;" />
                    <a href="javascript:void(0)" class="toolbar-button tb-icon-search" onclick="groupTreeOnSelect();">
                        <%: Html.Language("Query")%></a> <a href="javascript:void(0)" class="toolbar-button tb-icon-air"
                            onclick="read_log_setting()">
                            <%: Html.Language("TFTPReading")%></a>
                    <!--添加一个日志-->
                    <a href="javascript:void(0)" class="toolbar-button tb-icon-air" onclick="setTFTP()">
                        <%: Html.Language("TFTPSetting")%></a> <a href="javascript:void(0)" class="toolbar-button tb-icon-air"
                            onclick="getVersion()">获取固件版本 </a>
                </div>
            </div>
        </div>
        <div title="" style="border-right: 1px solid #95B8E7;" data-options="region:'center',border:false">
            <table id="dg" class="easyui-datagrid" style="width: 100%;" data-options="
						border: false,
						singleSelect: false,
						pagination: true,
						pageSize: 150,
                        pageList: [100, 150, 200, 500],
						rownumbers: true,
						sortName: 'RegisterDate',
						sortOrder: 'desc',
						fit: true,
						fitColumns: true,
						striped: true,
						idField: 'ID',
						frozenColumns: [[
							{ field: 'ID', checkbox: true }
						]],
						method: 'POST',
						onDblClickRow: function(index, row) { edit(row); }
					">
                <thead>
                    <tr>
                        <th data-options="field:'HostNumber',sortable:true,align:'center'">
                            <%: Html.Language("ID") %>
                        </th>
                        <th data-options="field:'Code',sortable:true,align:'center'">
                            <%: Html.Language("Code")%>
                        </th>
                        <th data-options="field:'RoomNumber',sortable:true,align:'center'">
                            <%: Html.Language("RoomNumber") %>
                        </th>
                        <th data-options="field:'MAC',sortable:true">
                            <%: Html.Language("MAC")%>
                        </th>
                        <th data-options="field:'GroupName',sortable:true">
                            <%: Html.Language("Group") %>
                        </th>
                        <th data-options="field:'RoomType',sortable:true">
                            <%: Html.Language("RoomType") %>
                        </th>
                        <th data-options="field:'IPType',sortable:true,align:'center'">
                            <%: Html.Language("IPType")%>
                        </th>
                        <th data-options="field:'IP',sortable:true">
                            <%: Html.Language("IP")%>
                        </th>
                        <th data-options="field:'Port',sortable:true">
                            <%: Html.Language("Port")%>
                        </th>
                        <th data-options="field:'Version',sortable:true">
                            固件APP版本
                        </th>
                        <th data-options="field:'LanIP',sortable:true">
                            <%: Html.Language("LanIP")%>
                        </th>
                        <th data-options="field:'LanPort',sortable:true">
                            <%: Html.Language("LanPort")%>
                        </th>
                        <th data-options="field:'TargetDomain',sortable:true">
                            TFTP上报域名
                        </th>
                        <th data-options="field:'TargetPort',sortable:true">
                            TFTP上报端口
                        </th>
                        <th data-options="field:'LastTime',sortable:true">
                            TFTP上报时间
                        </th>
                        <th data-options="field:'IsTrigger',sortable:true">
                            TFTP是否开启
                        </th>
                        <th data-options="field:'CreateTime',sortable:true">
                            最后一次上报时间
                        </th>
                    </tr>
                </thead>
            </table>
        </div>
        <div style="width: 270px; border-left: 1px solid #95B8E7;" data-options="region: 'east',split: true,border: false">
            <div class="easyui-layout" data-options="fit:true">
                <div data-options="region:'center',border:false">
                    <table id="groupTree" class="easyui-treegrid" data-options="
							url: '/Group/LoadGroupTree/',
							method: 'post',
							idField: 'ID',
							treeField: 'Name',
							fit: true,
							fitColumns: true,
							animate: true,
							border: false,
							bodyCls: 'easyui-treegrid-no-icon',
							loadMsg: '<%: Html.Language("Loading") %>',
                            onLoadSuccess: function (row, data) {if (data[0] != null) {$('#groupTree').treegrid('select', data[0].ID);}},
							onSelect: groupTreeOnSelect
						">
                        <thead>
                            <tr>
                                <th data-options="field:'Name',width:160">
                                    <%: Html.Language("Name") %>
                                </th>
                                <th data-options="field:'Sort',align:'center',width:40">
                                    <%: Html.Language("Sort") %>
                                </th>
                            </tr>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <!--阿宝添加一个新的-->
    <div id="tftpsetting" class="easyui-window" title='<%: Html.Language("TFTPSetting")%>'
        style="width: 410px; height: 210px; padding: 5px;" data-options=" closed: true, modal: true, collapsible: false, minimizable: false, maximizable: false ">
        <div class="easyui-layout" fit="true">
            <div style="padding-top: 15px;" data-options="region:'center'">
                <input type="hidden" id="hidden_tftp_id" name="hd_tftp_id" value="0" />
                <input type="checkbox" id="t_ftp_enable" name="t_ftp_enable" />
                <label for="t_ftp_enable">
                    是否启动全部日志上传</label>
                <table>
                    <tr>
                        <td>
                            <label for="txt_server_port">
                                服务端口：</label>
                        </td>
                        <td>
                            <input type="text" id="txt_server_port" name="report_port" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label for="log_report_time">
                                日志上报时间(小时)：</label>
                        </td>
                        <td>
                            <input type="text" id="txt_log_report_time" name="report_time" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label for="domain">
                                域名：</label>
                        </td>
                        <td>
                            <input type="text" id="txt_domain" name="server_domain" />
                        </td>
                    </tr>
                </table>
            </div>
            <div data-options="region:'south',border:false" style="text-align: right; padding: 5px 0 0;">
                <a class="easyui-linkbutton" data-options="iconCls:'icon-save'" href="javascript:void(0)"
                    onclick="board_log_setting();">下发日志设置</a> <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'"
                        href="javascript:void(0)" onclick="$('#tftpsetting').window('close');">取消</a>
            </div>
        </div>
    </div>
    <input type="hidden" value="<%=Session["CurrentHotelID"] %>" id="CurrentHotelID"/>
    <script src="../../Scripts/wss.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ScriptContent" runat="server">
    <script src="/Scripts/group.js" type="text/javascript"></script>
    <script src="/Scripts/host-index.js" type="text/javascript"></script>
    <!--<script src="../../Scripts/mqtt.min.js" type="text/javascript"></script>-->
    <script src="https://unpkg.com/mqtt/dist/mqtt.min.js"></script>
    <% switch ((int)Session["isCN"])
       {
           case 1: %>
    <script type="text/javascript" src="/Scripts/en-US.js"></script>
    <% break;
           case 2: %>
    <script type="text/javascript" src="/Scripts/zh-TW.js"></script>
    <% break;
       default: %>
    <script type="text/javascript" src="/Scripts/zh-CN.js"></script>
    <% break;
       } %>
</asp:Content>
