Download app/templates/runtime_logs.html from bg5/zai: direct link, hf CLI and curl.
- Browser
- Download file 3.54 kB
-
https://huggingface.co/spaces/bg5/zai/resolve/main/app/templates/runtime_logs.html
- Command line
-
hf download hf://spaces/bg5/zai/app/templates/runtime_logs.html
-
curl -L -o runtime_logs.html https://huggingface.co/spaces/bg5/zai/resolve/main/app/templates/runtime_logs.html
3.54 kB
| {% extends "base.html" %} | |
| {% block title %}运行日志{% endblock %} | |
| {% block content %} | |
| <div class="flex-1 flex flex-col min-h-0 space-y-6"> | |
| <div class="flex items-center justify-between flex-shrink-0"> | |
| <div> | |
| <h2 class="text-3xl font-bold text-gray-900">运行日志</h2> | |
| <p class="mt-1 text-sm text-gray-600">展示当前日志文件尾部内容,不读取整个文件。</p> | |
| </div> | |
| <div class="flex items-center space-x-3"> | |
| <label | |
| class="flex items-center space-x-2 cursor-pointer bg-gray-50 px-3 py-1.5 rounded border border-gray-200 hover:bg-gray-100 transition-colors"> | |
| <input type="checkbox" id="runtime-logs-auto-refresh" | |
| class="form-checkbox h-4 w-4 text-slate-800 transition duration-150 ease-in-out" checked> | |
| <span class="text-sm text-gray-700 select-none">自动刷新</span> | |
| </label> | |
| <button onclick="loadRuntimeLogs()" | |
| class="px-3 py-1.5 bg-slate-800 text-white text-sm rounded hover:bg-slate-700 transition-colors flex items-center"> | |
| <svg class="w-4 h-4 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"> | |
| <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" | |
| d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"> | |
| </path> | |
| </svg> | |
| 刷新 | |
| </button> | |
| </div> | |
| </div> | |
| <div class="bg-white shadow rounded-lg flex-1 flex flex-col min-h-0 overflow-hidden"> | |
| <div class="px-6 py-4 border-b border-gray-200 flex-shrink-0"> | |
| <h3 class="text-lg font-medium text-gray-900">日志尾部</h3> | |
| </div> | |
| <div class="p-6 flex-1 flex flex-col min-h-0 overflow-hidden"> | |
| <div id="runtime-log-tail" class="flex-1 min-h-0" | |
| hx-get="{{ root_path }}/admin/api/runtime-log-tail?max_bytes=65536" hx-trigger="load" hx-swap="innerHTML"> | |
| <div class="flex justify-center items-center py-12"> | |
| <svg class="animate-spin h-8 w-8 text-indigo-600" xmlns="http://www.w3.org/2000/svg" fill="none" | |
| viewBox="0 0 24 24"> | |
| <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"> | |
| </circle> | |
| <path class="opacity-75" fill="currentColor" | |
| d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"> | |
| </path> | |
| </svg> | |
| <span class="ml-3 text-gray-500">加载中...</span> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| {% endblock %} | |
| {% block extra_scripts %} | |
| <script> | |
| const RUNTIME_LOG_MAX_BYTES = 65536; | |
| function loadRuntimeLogs() { | |
| const url = window.adminPath(`/admin/api/runtime-log-tail?max_bytes=${RUNTIME_LOG_MAX_BYTES}`); | |
| htmx.ajax('GET', url, { | |
| target: '#runtime-log-tail', | |
| swap: 'innerHTML' | |
| }); | |
| } | |
| setInterval(() => { | |
| const checkbox = document.getElementById('runtime-logs-auto-refresh'); | |
| if (checkbox && checkbox.checked) { | |
| loadRuntimeLogs(); | |
| } | |
| }, 3000); | |
| </script> | |
| {% endblock %} | |