feat: add local auth billing and usage management
This commit is contained in:
1 parent
f642b5e71f
commit
196fdde83f
119 files changed
+15695
-2650
No files matched your search
@@ -21,8 +21,6 @@ type LogEntry = {
|
||||
|
||||
type LogPayload = {
|
||||
entries: LogEntry[];
|
||||
logPath: string;
|
||||
maxBytes: number;
|
||||
};
|
||||
|
||||
const LEVEL_TABS: Array<{ id: LogLevel | "all"; label: string }> = [
|
||||
@@ -165,21 +163,6 @@ export function LogManager() {
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
<section className="panel log-storage" data-animate>
|
||||
<div>
|
||||
<span>日志文件</span>
|
||||
<strong>{payload?.logPath || ".runtime/logs/server-events.jsonl"}</strong>
|
||||
</div>
|
||||
<div>
|
||||
<span>单文件上限</span>
|
||||
<strong>{formatBytes(payload?.maxBytes || 0)}</strong>
|
||||
</div>
|
||||
<div>
|
||||
<span>当前筛选</span>
|
||||
<strong>{levelLabel(level)} / {query || "全部"}</strong>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section className="panel log-list" data-animate ref={contentRef}>
|
||||
{loading && !payload ? (
|
||||
<div className="settings-loading">
|
||||
@@ -236,10 +219,3 @@ function formatTime(value: string): string {
|
||||
if (Number.isNaN(date.getTime())) return value;
|
||||
return date.toLocaleString("zh-CN", { hour12: false });
|
||||
}
|
||||
|
||||
function formatBytes(value: number): string {
|
||||
if (!value) return "-";
|
||||
if (value >= 1024 * 1024) return `${(value / 1024 / 1024).toFixed(1)} MB`;
|
||||
if (value >= 1024) return `${(value / 1024).toFixed(1)} KB`;
|
||||
return `${value} B`;
|
||||
}
|
||||
Reference in new issue
Block a user