<%@ Page Title="" Language="C#" MasterPageFile="~/Management/SiteManage.Master" AutoEventWireup="true"
    CodeBehind="CacheServer.aspx.cs" Inherits="Amr.SuperSiteGroup.Web.Management.CacheServer" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="right" style="text-align: center; margin-top: 10px;">
        <table width="100%" border="0" cellspacing="1" cellpadding="1" class="edit">
            <tr>
                <td class="title_edit">
                    <h1 style="float: left">
                        突破防盗链设置</h1>
                </td>
            </tr>
            <tr>
                <td class="edit_main">
                    <table width="100%" border="0" cellspacing="1" cellpadding="1" class="table_list">
                        <tr class="tr1">
                            <td colspan="2">
                                <asp:Label ID="laTitle" runat="server" Text="添加图片服务器"></asp:Label><br />
                                <asp:Label ID="laErrorInfo" runat="server" ForeColor="Red"></asp:Label>
                                <asp:Label ID="laSuccessInfo" runat="server" ForeColor="Green"></asp:Label>
                            </td>
                        </tr>
                        <tr class="tr_a">
                            <td colspan="2">
                                <div style="text-align: left; padding: 10px;">
                                    如果您采集的站图片有防盗链功能，分为两种情况：<br />
                                    1. 图片和目标站属于同一根域名，那么只需要在<a href="SiteSettings.aspx">站点设置</a>中开启图片下载到本地功能和开启二级域名查询即可；<br />
                                    2.如果防盗链的图片来自和目标站不同的域名，则将图片所在的域名添加到下面的列表，即可突破图片盗链。<br />
                                    注意：这些图片将会下载到本站服务器上面。</div>
                            </td>
                        </tr>
                        <tr class="tr_b">
                            <td>
                                <div align="right">
                                    图片服务器域名<font color="red">*</font>：</div>
                            </td>
                            <td align="left">
                                <asp:TextBox ID="tbServerName" runat="server" Wrap="False" />
                                <validation targetid="<%=tbServerName.ClientID%>" targetname="突破防盗链地址" type="text" />
                                请输入全域名或者根域名，如img1.imgcache.com, 全域名请输全，根域名请输入 imagecache.com，根域名请不要再前面加点，如.imgecache.com是不正确的，将无法工作。
                            </td>
                        </tr>
                        <tr class="tr_a">
                            <td>
                                <div align="right">
                                    选项：</div>
                            </td>
                            <td align="left">
                                <asp:CheckBox ID="cbIsEnable" CssClass="checkbox" runat="server" Text="是否激活" />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <asp:LinkButton ID="lbSubmit" runat="server" Text="【提交】" OnClick="lbSubmit_Click"
                                    OnClientClick="return validateForm()" />
                                &nbsp;<asp:LinkButton ID="lbCancel" runat="server" Text="【取消】" OnClick="lbCancel_Click" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>
    <div class="clear">
    </div>
    <div class="right" style="text-align: center; margin-top: 10px;">
        <div class="clear">
        </div>
        <table width="100%" border="0" cellspacing="1" cellpadding="1" class="edit">
            <tr>
                <td class="title_edit">
                    <h1 style="float: left">
                        突破防盗链列表</h1>
                </td>
            </tr>
            <tr>
                <td class="edit_main">
                    <asp:GridView ID="gvCacheServers" runat="server" AutoGenerateColumns="False" GridLines="None"
                        CssClass="table_list" Width="100%" EnableModelValidation="True">
                        <Columns>
                            <asp:TemplateField HeaderText="操作" ShowHeader="False">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lbEdit" runat="server" CausesValidation="False" Text="【编辑】" CommandArgument='<%# Bind("ServerId") %>'
                                        OnClick="lbEdit_Click"></asp:LinkButton>
                                    &nbsp;<asp:LinkButton ID="lbDelete" runat="server" CausesValidation="False" CommandArgument='<%# Bind("ServerId") %>'
                                        Text="【删除】" OnClick="lbDelete_Click" OnClientClick="if(confirm('确认删除记录?')){eval(this.attributes['href'].value)}else{return false}"></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="ServerId" HeaderText="编号" SortExpression="ServerId" />
                            <asp:BoundField DataField="ServerName" HeaderText="图片服务器域名" SortExpression="ServerName" />
                            <asp:BoundField DataField="CreatedOn" HeaderText="创建时间" SortExpression="CreatedOn" />
                            <asp:BoundField DataField="UpdatedOn" HeaderText="修改时间" SortExpression="UpdatedOn" />
                        </Columns>
                        <HeaderStyle CssClass="tr1" />
                        <RowStyle CssClass="tr_a" />
                        <AlternatingRowStyle CssClass="tr_b" />
                        <EmptyDataTemplate>
                            没有找到该站点的突破防盗链规则，请先添加！
                        </EmptyDataTemplate>
                        <FooterStyle CssClass="dg_header" />
                    </asp:GridView>
                </td>
            </tr>
        </table>
    </div>
    <div class="clear" style="margin-top: 10px;">
    </div>
</asp:Content>
