paper-burner/admin/README_NEW_TABS.md

9.5 KiB
Raw Permalink Blame History

概览

配额管理

活动日志

使用趋势最近30天

<!-- 文档状态统计 -->
<div class="mb-8">
    <h3 class="text-lg font-medium mb-4">文档状态分布</h3>
    <div id="documentsByStatus" class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4">
        <!-- 动态加载 -->
    </div>
</div>

<!-- 最活跃用户 -->
<div>
    <h3 class="text-lg font-medium mb-4">Top 10 活跃用户(本月)</h3>
    <div class="overflow-x-auto">
        <table class="min-w-full divide-y divide-gray-200">
            <thead class="bg-gray-50">
                <tr>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">排名</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">用户</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">邮箱</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">文档数</th>
                </tr>
            </thead>
            <tbody id="topUsersList" class="bg-white divide-y divide-gray-200">
                <!-- 动态加载 -->
            </tbody>
        </table>
    </div>
</div>

配额管理

为用户设置文档数量和存储空间限制(-1 表示无限制)

<!-- 用户选择 -->
<div class="mb-6">
    <label class="block text-sm font-medium text-gray-700 mb-2">选择用户</label>
    <select id="quotaUserId" onchange="loadUserQuota()"
        class="block w-full px-3 py-2 border border-gray-300 rounded-md">
        <option value="">请选择用户...</option>
    </select>
</div>

<!-- 配额设置表单 -->
<div id="quotaForm" class="hidden space-y-6">
    <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
        <div>
            <label class="block text-sm font-medium text-gray-700">每日文档限制</label>
            <input type="number" id="maxDocumentsPerDay"
                class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md">
            <p class="mt-1 text-xs text-gray-500">-1 表示无限制</p>
        </div>
        <div>
            <label class="block text-sm font-medium text-gray-700">每月文档限制</label>
            <input type="number" id="maxDocumentsPerMonth"
                class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md">
            <p class="mt-1 text-xs text-gray-500">-1 表示无限制</p>
        </div>
        <div>
            <label class="block text-sm font-medium text-gray-700">存储空间限制MB</label>
            <input type="number" id="maxStorageSize"
                class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md">
            <p class="mt-1 text-xs text-gray-500">-1 表示无限制</p>
        </div>
        <div>
            <label class="block text-sm font-medium text-gray-700">API Keys 数量限制</label>
            <input type="number" id="maxApiKeysCount"
                class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md">
            <p class="mt-1 text-xs text-gray-500">-1 表示无限制</p>
        </div>
    </div>

    <!-- 当前使用量 -->
    <div class="bg-gray-50 p-4 rounded-lg">
        <h4 class="text-sm font-medium text-gray-700 mb-3">当前使用量</h4>
        <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
            <div>
                <div class="text-sm text-gray-600">本月文档数</div>
                <div id="documentsThisMonthQuota" class="text-lg font-semibold">0</div>
                <div class="w-full bg-gray-200 rounded-full h-2 mt-2">
                    <div id="documentsProgressBar" class="bg-blue-600 h-2 rounded-full transition-all" style="width: 0%"></div>
                </div>
            </div>
            <div>
                <div class="text-sm text-gray-600">存储使用MB</div>
                <div id="currentStorageUsed" class="text-lg font-semibold">0</div>
                <div class="w-full bg-gray-200 rounded-full h-2 mt-2">
                    <div id="storageProgressBar" class="bg-green-600 h-2 rounded-full transition-all" style="width: 0%"></div>
                </div>
            </div>
        </div>
    </div>

    <div class="flex space-x-4">
        <button onclick="saveUserQuota()"
            class="bg-blue-600 text-white px-6 py-2 rounded-md hover:bg-blue-700">
            保存配额
        </button>
        <button onclick="resetUserQuota()"
            class="bg-gray-200 px-6 py-2 rounded-md hover:bg-gray-300">
            重置使用量
        </button>
    </div>
</div>

用户活动日志

请选择用户...
50 100 200
<div class="overflow-x-auto">
    <table class="min-w-full divide-y divide-gray-200">
        <thead class="bg-gray-50">
            <tr>
                <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">时间</th>
                <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">操作</th>
                <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">资源ID</th>
                <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">详情</th>
            </tr>
        </thead>
        <tbody id="activityLogsList" class="bg-white divide-y divide-gray-200">
            <tr>
                <td colspan="4" class="px-6 py-4 text-center text-gray-500">
                    请选择用户查看活动日志
                </td>
            </tr>
        </tbody>
    </table>
</div>
本周处理
-
本月处理
-
总存储使用
- MB