<%@ page language="C#" autoeventwireup="true" inherits="ims.maint, ims.web" enableviewstatemac="false" enableEventValidation="false" %>
<!DOCTYPE html>
<html id="maint">
<head runat="server">
    <title>系统维护</title><meta http-equiv="X-UA-Compatible" content="IE=edge" /><meta name="viewport" content="width=device-width,initial-scale=1">
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="s1" runat="server" AsyncPostBackTimeout="1200" EnablePageMethods="true" OnAsyncPostBackError="AsyncError" />
    <div id="tabs" class="ui-tabs noborder">
        <ul>
            <li><a href="#clear">系统清理</a></li>
            <li><a href="#bak">系统备份和还原</a></li>
            <li><a href="#dev">系统开发</a></li>
            <li><a href="#other">其它操作</a></li>
            <li class="nav-right"><img src="images/help1.gif" class="pointer" onclick="return showHelp();" /></li>
        </ul>
        <div id="clear">
            <div id="loading1" class="hide"><img class="promptIcon" src="images/loading.gif" alt="" />正在处理，请稍候…</div>
            <div id="options">
                <ul>
                    <li>清理： <asp:CheckBox ID="cbCleanFiles" runat="server" Text="垃圾文件" /></li>
                    <li>　　　 <asp:CheckBox ID="cbLog" runat="server" Text="日志文件" /></li>
                    <li>　　　 <asp:CheckBox ID="cbDelThumbs" runat="server" Text="缩略图缓存" /></li>
                    <li>　　　 <asp:CheckBox ID="cbDelInactiveAnonys" runat="server" Checked="true" Text="匿名用户" /><img src="images/what.gif" title="说明" onclick="What('anonyUser')" class="what" /></li>
                </ul>
                <div class="center">
                    <asp:Button ID="btnExe" runat="server" OnClick="ExeClean" OnClientClick="return doClean();" CssClass="btn" Text="开始清理" />　　
                </div>
            </div>
        </div>
        <div id="bak">
            <div class="hide" id="loading2"><img src="images/loading.gif" class="promptIcon" alt="" />正在处理，请稍候……</div>
            <asp:UpdatePanel ID="upBackup" UpdateMode="conditional" RenderMode="Block" class="vbottom" runat="server">
            <ContentTemplate>
                <asp:Button ID="btnBackup" ToolTip="生成并下载系统备份文件" OnClick="BackupAll" OnClientClick="setUpg(true,'loading2','upBackup');" CssClass="btn" runat="server" Text="备份" />&nbsp;
                <input type="button" value="自动备份…" class="btn" onclick="ShowPop('ab_popup');" />
                <label class="btn" title="选择备份文件来还原系统">还原<input id="fileToUpload" name="fileToUpload" type="file" onchange="return ajaxFileUpload();" /></label>
                <input type="button" runat="server" id="btnRestoreDb" visible="false" value="还原数据库" class="btn" onclick="return askRestore();" onserverclick="OnlyRestoreDB" />
                <input type="button" onclick="return showHelp('manualBakRes');" value="手工备份/还原" class="btn" />
            </ContentTemplate>
                <Triggers><asp:AsyncPostBackTrigger ControlID="btnDb" EventName="Click" /></Triggers>
            </asp:UpdatePanel>
        </div>
        <div id="dev">
            <div id="btns4">
                <asp:Button ID="btnJs" runat="server" OnClick="ShowPluginJs" Text="编辑外挂脚本" CssClass="btn" />
                <asp:Button ID="btnCss" runat="server" OnClick="ShowPluginCss" Text="编辑外挂样式" CssClass="btn" />
                <asp:Button ID="btnApi" runat="server" OnClick="ShowApiDemo" Text="编辑API演示页面" CssClass="btn" />
                <input runat="server" id="btnResource" type="button" onclick="window.open('https://landian.cc/content.aspx?p=resource');" value="在线资源下载" class="btn" />
            </div>
        </div>
        <div id="other">
            <div id="loading3" class="hide"><img class="promptIcon" src="images/loading.gif" alt="" />正在执行，请稍候…</div>
            <div id="btns3">
            <asp:Button ID="btnRestartApp" OnClick="RestartApp" runat="server" CssClass="btn" OnClientClick="setUpg(true,'loading3','btns3');" Text="重新启动系统" />
            <asp:Button ID="btnCloseSys" OnClick="CloseSystem" runat="server" Text="关闭系统" CssClass="btn" ToolTip="停止系统的运行。&#13;注：关闭后只能通过移除系统的 app_offline.htm 文件来恢复运行" OnClientClick="return confirm('关闭系统后只能通过移除系统的 app_offline.htm 文件来恢复运行！\n确定要关闭系统吗？');" />
            <asp:Button ID="btnSwitchDatabase" runat="server" OnClick="SwitchDatabase" OnClientClick="return confirm('切换数据库，相当于切换到另一套独立的系统，当前的用户和数据不会自动迁移。\n\n确定要切换数据库吗？');" CssClass="btn" Text="切换数据库" />
            <asp:Button ID="btnDbZip" runat="server" OnClick="ZipDatabase" OnClientClick="return toZipDb();" CssClass="btn" Text="压缩数据库" />
            <asp:Button ID="viewSysLog" runat="server" Text="查看系统日志" CssClass="btn" />
            <asp:Button ID="btnDb" ToolTip="点击下载系统数据库及调试信息" OnClick="BackupDB" OnClientClick="setUpg(true,'loading3','btns3');" CssClass="btn" runat="server" Text="下载调试数据" />
            </div>
        </div>
    </div>
    <ims:Pop runat="server" ID="ab" Width="420" OnOkClick="SaveAutoBackup" OnOkClientClick="return preSave();" HideOnOkClientClick="false" HelpSubject="autoBackup" CustomCss="noline" ShowProgress="false">
        <ContentTemplate>
            <asp:CheckBox runat="server" ID="cbAutoBackup" onclick="autoBackupToggled();" Text="启用自动备份" />
            <div class="sepline2"></div>
            <div style="padding-left:15px">
            存储位置： <asp:TextBox runat="server" ID="tbTarget" Width="75%" ToolTip="输入服务器上的备份文件存储路径，或网络共享文件夹路径"></asp:TextBox><br />
            备份时机： 从 <asp:TextBox runat="server" ID="tbStart" Width="115" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'});"></asp:TextBox> 起，每 <asp:TextBox runat="server" ID="tbFqcy" Width="24" Text="1"></asp:TextBox> <asp:DropDownList runat="server" ID="ddlTimeUnit"></asp:DropDownList> 一次
            <div class="sepline2"></div>
            <asp:CheckBox runat="server" ID="cbDbOnly" Text="仅备份数据库" /><br />
            <asp:CheckBox runat="server" ID="cbKeep" Text="仅保留最近" /><asp:DropDownList runat="server" ID="ddlKeep">
                    <asp:ListItem Value="1">1</asp:ListItem>
                    <asp:ListItem Value="2">2</asp:ListItem>
                    <asp:ListItem Value="3">3</asp:ListItem>
                    <asp:ListItem Selected="True" Value="5">5</asp:ListItem>
                    <asp:ListItem Value="10">10</asp:ListItem>
                    <asp:ListItem Value="20">20</asp:ListItem>
                    <asp:ListItem Value="50">50</asp:ListItem>
                    <asp:ListItem Value="100">100</asp:ListItem>
                    <asp:ListItem Value="500">500</asp:ListItem>
                </asp:DropDownList> 个备份　<a href="###" class="u" onclick="__doPostBack('lbShowBaks', '');">查看备份文件</a>
            </div>
            <div class="sepline2 mtop_l"></div>
            <div class="gray middle"><img src="images/info.gif" /> 请确保服务器的 <asp:Label runat="server" ID="account"></asp:Label> 帐户对存储位置有“修改”权限。</div>
        </ContentTemplate>
    </ims:Pop>
    <ims:Pop runat="server" ID="baks" Title="备份文件列表" ShowOkButton="false" CanelButtonText="关闭" Width="400" CustomCss="noline" ShowProgress="false">
        <ContentTemplate>
            <div runat="server" id="msg" class="mtop_l red indent"></div>
            <asp:ListBox runat="server" ID="ddlBaks"></asp:ListBox>
            <div class="right mtop_s mright_s"><a href="#" runat="server" class="u" id="aSysLog">查看系统日志</a></div>
        </ContentTemplate>
    </ims:Pop>
    <ims:Pop runat="server" ID="js" Title="编辑外挂脚本" Width="585" OnOkClick="SaveJs" OnOkClientClick="UpdateEditorElement();" OkButtonText="保存" HelpSubject="jsplugin" CustomCss="noline" ShowProgress="false">
        <ContentTemplate>
            <asp:TextBox runat="server" TextMode="MultiLine" Rows="12" ID="tbJs"></asp:TextBox>
            <div class="notezone">外挂脚本用于对系统进行一些特殊处理，其基于jQuery框架，每个页面都会载入运行。</div>
        </ContentTemplate>
    </ims:Pop>
    <ims:Pop runat="server" ID="css" Title="编辑外挂样式" Width="585" OnOkClick="SaveCss" OnOkClientClick="UpdateEditorElement();" OkButtonText="保存" HelpSubject="cssplugin" CustomCss="noline" ShowProgress="false">
        <ContentTemplate>
            <asp:TextBox runat="server" TextMode="MultiLine" Rows="12" ID="tbCss"></asp:TextBox>
            <div class="notezone">外挂样式用于对系统进行自定义样式设置，每个页面都会载入。</div>
        </ContentTemplate>
    </ims:Pop>
    <ims:Pop runat="server" ID="apidemo" Title="编辑API演示页面" Width="640" OnOkClick="SaveApiDemo" CustomButtonA_OnClick="window.open('api_demo.htm');" CustomButtonA_Text="打开API演示页面" OnOkClientClick="UpdateEditorElement();" OkButtonText="保存" HelpSubject="api" CustomCss="noline" ShowProgress="false">
        <ContentTemplate>
            <asp:TextBox runat="server" TextMode="MultiLine" Rows="15" ID="tbApiDemo"></asp:TextBox>
        </ContentTemplate>
    </ims:Pop>
    <asp:LinkButton runat="server" ID="lbShowBaks" CssClass="hide" OnClick="ShowBaks"></asp:LinkButton>
    <script src="js/comm.js"></script><script src="js/maint.js"></script>
    </form>
</body>
</html>