重构webui主页与好友/群组api

This commit is contained in:
HibiKier
2023-12-30 05:27:45 +08:00
parent 081c86aba0
commit 25af1802af
27 changed files with 1530 additions and 897 deletions
+7 -2
View File
@@ -1,6 +1,6 @@
import asyncio
import re
from typing import Awaitable, Callable, ClassVar, Dict, Generic, List, Set, TypeVar
from typing import Awaitable, Callable, Dict, Generic, List, Set, TypeVar
from urllib.parse import urlparse
PATTERN = r"\x1b(\[.*?[@-~]|\].*?(\x07|\x1b\\))"
@@ -10,6 +10,11 @@ LogListener = Callable[[_T], Awaitable[None]]
class LogStorage(Generic[_T]):
"""
日志存储
"""
def __init__(self, rotation: float = 5 * 60):
self.count, self.rotation = 0, rotation
self.logs: Dict[int, str] = {}
@@ -42,4 +47,4 @@ class LogStorage(Generic[_T]):
return
LOG_STORAGE = LogStorage[str]()
LOG_STORAGE: LogStorage[str] = LogStorage[str]()