<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="../Global.Master" CodeBehind="Default.aspx.cs" Inherits="Web.AdminManager.Servers.Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="../../Common/js/Common_RegexString.js"></script>
    <script src="../js/Servers.default.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <div id="UI_Edit" runat="server" visible="false">
        <form action="" method="post" class="ui-form ui-form-vertical">
            <%if (AgentUserId == 1)
              { %>
            <fieldset>
                <legend>基本信息</legend>
                <div class="ui-form-group">
                    <label class="ui-form-label">服务器名称</label><div class="ui-form-ctrls">
                        <input type="text" name="ServerName" id="ServerName"
                            class="ui-input-small" value="<%=ms.ServerName %>" /><span
                                class="ServerName ui-help-inline">写个方便识别的服务器名称</span>
                    </div>
                </div>
                <%--                <div class="ldiv">
                    <span class="ltit">所属机房</span><span><%=new BLL.IDC_ServerHome().GetSelectList("ServerHome",ms.ServerHome) %></span><span
                        class="ServerHome">*<a href="/Idc/Default.aspx" target="_blank">点这里设置机房</a></span></div>--%>
                <div class="ui-form-group">
                    <label class="ui-form-label">被控IP</label><div class="ui-form-ctrls">
                        <input type="text" value="<%=ms.ServerIp %>"
                            name="ServerIp" id="ServerIp" class="ui-input-small" /><span
                                class="ServerIp ui-help-inline">被控端所在服务器IP地址</span>
                    </div>
                </div>
                <div class="ui-form-group">
                    <label class="ui-form-label">被控端口</label><div class="ui-form-ctrls">
                        <input type="text" value="<%=ms.ServerPort %>"
                            name="ServerPort" id="ServerPort" class="ui-input-mini" /><span
                                class="ServerPort ui-help-inline">被控端TCP/IP端口，默认为2390</span>
                    </div>
                </div>
                <div class="ui-form-group">
                    <label class="ui-form-label">被控密码</label><div class="ui-form-ctrls">
                        <input type="password" name="ServerPass" id="ServerPass"
                            value="<%=CommonLib.Helper.DecryptDES(ms.ServerPass) %>" class="ui-input-small" /><span
                                class="ServerPass ui-help-inline">被控端连接密码</span>
                    </div>
                </div>
                <div class="ui-form-group">
                    <label class="ui-form-label">被控状态</label><div class="ui-form-ctrls">
                        <select size="1" name="ServerState" id="ServerState">
                            <option value="开启" <%=(ms.ServerState?"selected":"") %>>开启</option>
                            <option value="关闭" <%=(!ms.ServerState?"selected":"") %>>关闭</option>
                        </select><span class="ServerState ui-help-inline"></span>
                    </div>
                </div>
                <div class="ui-form-group">
                    <label class="ui-form-label">备注</label><div class="ui-form-ctrls">
                        <textarea rows="3" name="ServerInfo" id="ServerInfo"
                            cols="34"><%=ms.ServerInfo%></textarea><span class="ServerInfo ui-help-inline">对本机IP做一个简短的介绍</span>
                    </div>
                </div>
                <div class="ui-form-group">
                    <label class="ui-form-label">&nbsp;</label><div class="ui-form-ctrls">
                        <button class="testServer ui-btn ui-btn-primary" type="button">
                            测试连接</button><span class="testMsg"></span>
                    </div>
                </div>

                <legend>虚拟主机</legend>
                <div class="ui-form-group">
                    <label class="ui-form-label">(解)压缩</label><div class="ui-form-ctrls">
                        <input type="checkbox" name="Server_OpenRar"
                            id="Server_OpenRar" value="true" <%=ms.Server_OpenRar?"checked":""%> />开启<span
                                class="Server_OpenRar ui-help-inline">选中开启在线(解)压缩功能</span>
                    </div>
                </div>
                <div class="ui-form-group">
                    <label class="ui-form-label">最大压缩值</label><div class="ui-form-ctrls">
                        <input type="text" name="Server_HostRarMax"
                            id="Server_HostRarMax" value="<%=ms.Server_HostRarMax %>" class="ui-input-mini" />MB<span
                                class="Server_HostRarMax ui-help-inline">允许使用在线压缩文件夹的容量</span>
                    </div>
                </div>
                <div class="ui-form-group">
                    <label class="ui-form-label">最大解压值</label><div class="ui-form-ctrls">
                        <input type="text" name="Server_HostUnRarMax"
                            id="Server_HostUnRarMax" value="<%=ms.Server_HostUnRarMax %>" class="ui-input-mini" />MB<span
                                class="Server_HostUnRarMax ui-help-inline">允许使用在线解压缩文件的容量</span>
                    </div>
                </div>
                <div class="ui-form-group">
                    <label class="ui-form-label">赠送域名</label><div class="ui-form-ctrls">
                        <input type="text" name="Server_HostBindDomain"
                            id="Server_HostBindDomain" value="<%=ms.Server_HostBindDomain %>" class="" /><span
                                class="Server_HostBindDomain ui-help-inline">开通后赠送域名，多个选择用英文字符“,”隔开</span>
                    </div>
                </div>
                <div class="ui-form-group">
                    <label class="ui-form-label">绑定IP</label><div class="ui-form-ctrls">
                        <textarea rows="3" name="BindIp" id="BindIp"
                            cols="34"><%=ms.BindIp%></textarea><span class="BindIp ui-help-inline">虚拟主机绑定IP列表，一行一个，默认则放空</span>
                    </div>
                </div>
                <div class="ui-form-group">
                    <label class="ui-form-label">绑定审核</label><div class="ui-form-ctrls">
                        <input type="checkbox" name="DomainBindCheckBeian" id="DomainBindCheckBeian" value="true"
                            <%=ms.DomainBindCheckBeian?"checked":""%> />开启<span class="DomainBindCheckBeian ui-help-inline">是否开启域名绑定审核功能</span>
                    </div>
                </div>
                <div class="ui-form-group">
                    <label class="ui-form-label">FTP超时</label><div class="ui-form-ctrls">
                        <input type="text" name="Server_FTPFree"
                            id="Server_FTPFree" value="<%=ms.Server_FTPFree %>" class="ui-input-mini" />分钟<span
                                class="Server_FTPFree ui-help-inline">FTP登录超时时间</span>
                    </div>
                </div>
                <div class="ui-form-group">
                    <label class="ui-form-label">FTP上传</label><div class="ui-form-ctrls">
                        <input type="text" name="Server_FTPMaxUp"
                            id="Server_FTPMaxUp" value="<%=ms.Server_FTPMaxUp %>" class="ui-input-mini" />KB/S<span
                                class="Server_FTPMaxUp ui-help-inline">FTP最大上传速率</span>
                    </div>
                </div>
                <div class="ui-form-group">
                    <label class="ui-form-label">FTP下载</label><div class="ui-form-ctrls">
                        <input type="text" name="Server_FTPMaxDown"
                            id="Server_FTPMaxDown" value="<%=ms.Server_FTPMaxDown %>" class="ui-input-mini" />KB/S<span
                                class="Server_FTPMaxDown ui-help-inline">FTP最大下载速率</span>
                    </div>
                </div>
                <div class="ui-form-group">
                    <label class="ui-form-label">FTP登录</label><div class="ui-form-ctrls">
                        <input type="text" name="Server_FTPSameip"
                            id="Server_FTPSameip" value="<%=ms.Server_FTPSameip %>" class="ui-input-mini" /><span
                                class="Server_FTPSameip ui-help-inline">FTP同1IP最大连接线程</span>
                    </div>
                </div>

                <div class="ui-form-group">
                    <label class="ui-form-label">支持脚本</label><div class="ui-form-ctrls">
                        <button class="addScriptMaps ui-btn ui-btn-primary" type="button">
                            点击添加</button>
                    </div>
                </div>
                <div class="ui-form-group">
                    <label class="ui-form-label">&nbsp;</label><div class="ui-form-ctrls smps">
                        <table class="slist ui-table ui-table-bordered" style="width: 600px;">
                            <thead>
                                <tr>
                                    <td colspan="4">重复脚本将只录一个，放空则不录，默认值请自行修改，.net使用.aspx</td>
                                </tr>
                                <tr>
                                    <th>名称</th>
                                    <th>路径</th>
                                    <th>动作</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <%=GetInputStr(ms.Id)%>
                        </table>
                        <span></span>
                    </div>

                </div>

                <legend>Microsoft SQL Server</legend>
                <div class="ui-form-group">
                    <label class="ui-form-label">管理帐号</label><div class="ui-form-ctrls">
                        <input type="text" name="Server_SQLAdmin" id="Server_SQLAdmin"
                            value="<%=ms.Server_SQLAdmin %>" class="ui-input-small" /><span
                                class="Server_SQLAdmin ui-help-inline">SQL管理员帐号，默认sa</span>
                    </div>
                </div>
                <div class="ui-form-group">
                    <label class="ui-form-label">管理密码</label><div class="ui-form-ctrls">
                        <input type="password" name="Server_SQLPwd" id="Server_SQLPwd"
                            value="<%=CommonLib.Helper.DecryptDES(ms.Server_SQLPwd) %>" class="ui-input-small" /><span
                                class="Server_SQLPwd ui-help-inline">SQL管理员密码</span>
                    </div>
                </div>
                <div class="ui-form-group">
                    <label class="ui-form-label">SQL端口</label><div class="ui-form-ctrls">
                        <input type="text" name="Server_SQLPort" id="Server_SQLPort"
                            value="<%=ms.Server_SQLPort %>" class="ui-input-mini" /><span
                                class="Server_SQLPort ui-help-inline">SQL服务端口，默认1433</span>
                    </div>
                </div>
                <div class="ui-form-group">
                    <label class="ui-form-label">SQL版本</label><div class="ui-form-ctrls">
                        <select name="Server_SQLEdition"><%=CommonLib.Helper.StringFromEnum(typeof(CommonLib.Enums.SqlEdition), "<option value=\"{1}\" {2}>{0}</option>", ms.Server_SQLEdition, "selected") %></select><span
                            class="Server_SQLEdition ui-help-inline">服务器上的SQL版本</span>
                    </div>
                </div>
                <div class="ui-form-group">
                    <label class="ui-form-label">&nbsp;</label><div class="ui-form-ctrls">
                        <button class="testSQL ui-btn ui-btn-primary" type="button">
                            测试连接</button><span class="sqlTestMsg"></span>
                    </div>
                </div>

                <legend>MySQL Server</legend>
                <div class="ui-form-group">
                    <label class="ui-form-label">管理帐号</label><div class="ui-form-ctrls">
                        <input type="text" name="Server_MySQLAdmin" id="Server_MySQLAdmin"
                            value="<%=ms.Server_MySQLAdmin %>" class="ui-input-small" /><span
                                class="Server_MySQLAdmin ui-help-inline">MySQL管理帐号，默认root</span>
                    </div>
                </div>
                <div class="ui-form-group">
                    <label class="ui-form-label">管理密码</label><div class="ui-form-ctrls">
                        <input type="password" name="Server_MySQLPwd" id="Server_MySQLPwd"
                            value="<%=CommonLib.Helper.DecryptDES(ms.Server_MySQLPwd) %>" class="ui-input-small" /><span
                                class="Server_MySQLPwd ui-help-inline">MySQL管理密码</span>
                    </div>
                </div>
                <div class="ui-form-group">
                    <label class="ui-form-label">端口</label><div class="ui-form-ctrls">
                        <input type="text" name="Server_MySQLPort" id="Server_MySQLPort"
                            value="<%=ms.Server_MySQLPort %>" class="ui-input-mini" /><span
                                class="Server_MySQLPort ui-help-inline">MySQL服务端口，默认3306</span>
                    </div>
                </div>
                <div class="ui-form-group">
                    <label class="ui-form-label">数据库路径</label><div class="ui-form-ctrls">
                        <input type="text" name="Server_MySQLDataPath"
                            id="Server_MySQLDataPath" value="<%=ms.Server_MySQLDataPath %>" class="" /><span
                                class="Server_MySQLDataPath ui-help-inline">MySQL数据库存放路径，即MySQL.ini配置文件里的Data目录</span>
                    </div>
                </div>
                <div class="ui-form-group">
                    <label class="ui-form-label">管理地址</label><div class="ui-form-ctrls">
                        <input type="text" name="Server_phpmyadminurl"
                            class="" id="Server_phpmyadminurl" value="<%=ms.Server_phpmyadminurl %>" /><span
                                class="Server_phpmyadminurl ui-help-inline">该地址为PhpMyAdmin地址</span>
                    </div>
                </div>
                <div class="ui-form-group">
                    <label class="ui-form-label">&nbsp;</label><div class="ui-form-ctrls">
                        <button class="testMySQL ui-btn ui-btn-primary" type="button">
                            测试连接</button><span class="mysqlTestMsg"></span>
                    </div>
                </div>

                <legend>企业邮局(WinWebMail)</legend>
                <div class="ui-form-group">
                    <label class="ui-form-label">安装路径</label><div class="ui-form-ctrls">
                        <input type="text" name="Server_MailSetupPath"
                            id="Server_MailSetupPath" value="<%=ms.Server_MailSetupPath %>" class="" /><span
                                class="Server_MailSetupPath ui-help-inline">WinWebMail安装路径</span>
                    </div>
                </div>
                <div class="ui-form-group">
                    <label class="ui-form-label">访问网址</label><div class="ui-form-ctrls">
                        <input type="text" name="Server_MailUrl" id="Server_MailUrl"
                            value="<%=ms.Server_MailUrl %>" class="" /><span
                                class="Server_MailUrl ui-help-inline">企业邮局访问地址</span>
                    </div>
                </div>
                <div class="ui-form-group">
                    <label class="ui-form-label">&nbsp;</label><div class="ui-form-ctrls">
                        <button class="testMail ui-btn ui-btn-primary" type="button">
                            测试接口</button><span class="testMailMsg"></span>
                    </div>
                </div>
            </fieldset>
            <%} %>
            <fieldset>
                <legend>IIS价格（用户升级产品时使用，请填写大于0的数值，单位：元/10个）&nbsp;&nbsp;<a href="../Setting/Class.aspx?ClassType=<%=CommonLib.Enums.ClassType.会员级别.GetHashCode() %>"
                    target="_blank">点击设置会员级别</a></legend>
                <%=new BLL.ProductPrice().GetPriceHTML(GetLMPP(ms.Id, Web.Lib.ArtType.HostIISPrice), "<div class=\"ui-form-group\"><label class=\"ui-form-label\">{0}</label><div class=\"ui-form-ctrls\">月付：<input type=\"text\" style=\"width:50px;\" value=\"{2}\" name=\"HostIISPrice_MonPrice_{1}\" class=\"\" value=\"\" />&nbsp;季付：<input type=\"text\" style=\"width:50px;\" value=\"{3}\" name=\"HostIISPrice_ThPrice_{1}\" class=\"\" value=\"\" />&nbsp;半年：<input style=\"width:50px;\" value=\"{4}\" type=\"text\" name=\"HostIISPrice_HfPrice_{1}\" class=\"\" value=\"\" />&nbsp;年付：<input style=\"width:50px;\" value=\"{5}\" type=\"text\" name=\"HostIISPrice_YearPrice_{1}\" class=\"\" value=\"\" /></div></div>", AgentUserId)%>

                <legend>容量价格（用户升级产品时使用，请填写大于0的数值，单位：元/MB）&nbsp;&nbsp;<a href="../Setting/Class.aspx?ClassType=<%=CommonLib.Enums.ClassType.会员级别.GetHashCode() %>"
                    target="_blank">点击设置会员级别</a></legend>

                <%=new BLL.ProductPrice().GetPriceHTML(GetLMPP(ms.Id, Web.Lib.ArtType.HostSpacePrice), "<div class=\"ui-form-group\"><label class=\"ui-form-label\">{0}</label><div class=\"ui-form-ctrls\">月付：<input type=\"text\" style=\"width:50px;\" value=\"{2}\" name=\"HostSpacePrice_MonPrice_{1}\" class=\"\" value=\"\" />&nbsp;季付：<input type=\"text\" style=\"width:50px;\" value=\"{3}\" name=\"HostSpacePrice_ThPrice_{1}\" class=\"\" value=\"\" />&nbsp;半年：<input style=\"width:50px;\" value=\"{4}\" type=\"text\" name=\"HostSpacePrice_HfPrice_{1}\" class=\"\" value=\"\" />&nbsp;年付：<input style=\"width:50px;\" value=\"{5}\" type=\"text\" name=\"HostSpacePrice_YearPrice_{1}\" class=\"\" value=\"\" /></div></div>", AgentUserId)%>

                <legend>子目录价格（用户升级产品时使用，请填写大于0的数值，单位：元/个）&nbsp;&nbsp;<a href="../Setting/Class.aspx?ClassType=<%=CommonLib.Enums.ClassType.会员级别.GetHashCode() %>"
                    target="_blank">点击设置会员级别</a></legend>
                <%=new BLL.ProductPrice().GetPriceHTML(GetLMPP(ms.Id, Web.Lib.ArtType.HostvPathPrice), "<div class=\"ui-form-group\"><label class=\"ui-form-label\">{0}</label><div class=\"ui-form-ctrls\">月付：<input type=\"text\" style=\"width:50px;\" value=\"{2}\" name=\"HostvPathPrice_MonPrice_{1}\" class=\"\" value=\"\" />&nbsp;季付：<input type=\"text\" style=\"width:50px;\" value=\"{3}\" name=\"HostvPathPrice_ThPrice_{1}\" class=\"\" value=\"\" />&nbsp;半年：<input style=\"width:50px;\" value=\"{4}\" type=\"text\" name=\"HostvPathPrice_HfPrice_{1}\" class=\"\" value=\"\" />&nbsp;年付：<input style=\"width:50px;\" value=\"{5}\" type=\"text\" name=\"HostvPathPrice_YearPrice_{1}\" class=\"\" value=\"\" /></div></div>", AgentUserId)%>

                <legend>带宽价格（用户升级产品时使用，请填写大于0的数值，单位：元/100KB/S）&nbsp;&nbsp;<a href="../Setting/Class.aspx?ClassType=<%=CommonLib.Enums.ClassType.会员级别.GetHashCode() %>"
                    target="_blank">点击设置会员级别</a></legend>
                <%=new BLL.ProductPrice().GetPriceHTML(GetLMPP(ms.Id, Web.Lib.ArtType.HostBWPrice), "<div class=\"ui-form-group\"><label class=\"ui-form-label\">{0}</label><div class=\"ui-form-ctrls\">月付：<input type=\"text\" style=\"width:50px;\" value=\"{2}\" name=\"HostBWPrice_MonPrice_{1}\" class=\"\" value=\"\" />&nbsp;季付：<input type=\"text\" style=\"width:50px;\" value=\"{3}\" name=\"HostBWPrice_ThPrice_{1}\" class=\"\" value=\"\" />&nbsp;半年：<input style=\"width:50px;\" value=\"{4}\" type=\"text\" name=\"HostBWPrice_HfPrice_{1}\" class=\"\" value=\"\" />&nbsp;年付：<input style=\"width:50px;\" value=\"{5}\" type=\"text\" name=\"HostBWPrice_YearPrice_{1}\" class=\"\" value=\"\" /></div></div>", AgentUserId)%>

                <legend>流量价格（用户升级产品时使用，请填写大于0的数值，单位：元/GB/月）&nbsp;&nbsp;<a href="../Setting/Class.aspx?ClassType=<%=CommonLib.Enums.ClassType.会员级别.GetHashCode() %>"
                    target="_blank">点击设置会员级别</a></legend>
                <%=new BLL.ProductPrice().GetPriceHTML(GetLMPP(ms.Id, Web.Lib.ArtType.HostFlowPrice), "<div class=\"ui-form-group\"><label class=\"ui-form-label\">{0}</label><div class=\"ui-form-ctrls\">月付：<input type=\"text\" style=\"width:50px;\" value=\"{2}\" name=\"HostFlowPrice_MonPrice_{1}\" class=\"\" value=\"\" />&nbsp;季付：<input type=\"text\" style=\"width:50px;\" value=\"{3}\" name=\"HostFlowPrice_ThPrice_{1}\" class=\"\" value=\"\" />&nbsp;半年：<input style=\"width:50px;\" value=\"{4}\" type=\"text\" name=\"HostFlowPrice_HfPrice_{1}\" class=\"\" value=\"\" />&nbsp;年付：<input style=\"width:50px;\" value=\"{5}\" type=\"text\" name=\"HostFlowPrice_YearPrice_{1}\" class=\"\" value=\"\" /></div></div>", AgentUserId)%>

                <legend>邮局用户数（用户升级产品时使用，请填写大于0的数值，单位：元/个）&nbsp;&nbsp;<a href="../Setting/Class.aspx?ClassType=<%=CommonLib.Enums.ClassType.会员级别.GetHashCode() %>"
                    target="_blank">点击设置会员级别</a></legend>
                <%=new BLL.ProductPrice().GetPriceHTML(GetLMPP(ms.Id, Web.Lib.ArtType.MailNumPrice), "<div class=\"ui-form-group\"><label class=\"ui-form-label\">{0}</label><div class=\"ui-form-ctrls\">月付：<input type=\"text\" style=\"width:50px;\" value=\"{2}\" name=\"MailNumPrice_MonPrice_{1}\" class=\"\" value=\"\" />&nbsp;季付：<input type=\"text\" style=\"width:50px;\" value=\"{3}\" name=\"MailNumPrice_ThPrice_{1}\" class=\"\" value=\"\" />&nbsp;半年：<input style=\"width:50px;\" value=\"{4}\" type=\"text\" name=\"MailNumPrice_HfPrice_{1}\" class=\"\" value=\"\" />&nbsp;年付：<input style=\"width:50px;\" value=\"{5}\" type=\"text\" name=\"MailNumPrice_YearPrice_{1}\" class=\"\" value=\"\" /></div></div>", AgentUserId)%>
            </fieldset>
            <div class="ui-form-group">
                <label class="ui-form-label">&nbsp;</label><div class="ui-form-ctrls">
                    <button class="ui-btn ui-btn-primary" type="submit">提交保存</button>
                    <button type="button" class="ui-btn" onclick="history.back();">返回</button>
                </div>
            </div>
        </form>
    </div>
    <div id="UI_Default" runat="server" visible="false">
        <form action="" method="post">
            <table class="ui-table ui-table-bordered">
                <thead>
                    <%if (AgentUserId == 1)
                      { %>
                    <tr>
                        <td colspan="5">
                            <a href="?Action=Add" class="ui-btn ui-btn-primary">添加服务器</a>
                        </td>
                    </tr>
                    <%} %>
                    <tr>
                        <th>服务器名称
                        </th>
                        <th>受控IP
                        </th>
                        <th>状态
                        </th>
                        <th>排序</th>
                        <th>操作
                        </th>
                    </tr>
                </thead>
                <%=ShowList%>
                <%if (AgentUserId == 1)
                  { %>
                <tr>
                    <td colspan="5">
                        <button type="submit" class="ui-btn ui-btn-primary">保存排序</button></td>
                </tr>
                <%} %>
            </table>
        </form>
    </div>
</asp:Content>
