{$layout} 
{$template "menu"}

<div class="margin"></div>
<div class="audit-message info">
    <i class="icon info circle"></i>
    <div>刷新缓存指的是标记URL列表或目录为失效状态，当有新的用户请求这些URL时，会再次从源站读取最新的内容。</div>
</div>

<div>
    <form class="ui form http-config-form" method="post" data-tea-action="$" data-tea-success="success" data-tea-before="before" data-tea-done="done">
        <csrf-token></csrf-token>
        
        <div class="config-section">
            <div class="section-title">基本设置</div>
            <div class="config-item">
                <div class="item-label">刷新类型 *</div>
                <div class="item-content">
                    <b-select
                        name="keyType"
                        v-model="keyType"
                        auto-width
                        :options="[
                            {label: 'URL', value: 'key'},
                            {label: '目录', value: 'prefix'},
                        ]"
                    ></b-select>
                </div>
            </div>
            <div class="config-item">
                <div class="item-label">
                    <span v-if="keyType == 'key'">URL列表 *</span>
                    <span v-if="keyType == 'prefix'">目录列表 *</span>
                </div>
                <div class="item-content">
                    <textarea rows="20" name="urlList" ref="keysBox"></textarea>
                    <p class="comment">
                        每行一条，每次最多提交{{maxKeysPerTask}}个URL，每天最多提交{{maxKeysPerDay}}个<span v-if="quotaKeysToday > 0">，今日剩余{{quotaKeysToday}}个</span>。
                    </p>
                </div>
            </div>
        </div>

        <div class="config-item">
            <submit-btn v-if="!isRequesting">刷新缓存</submit-btn>
            <button class="ui button disabled" type="button" v-if="isRequesting">处理中...</button>
        </div>
    </form>
</div>
