修改日志时间
This commit is contained in:
parent
35118b438f
commit
aa2a7acaf1
@ -106,7 +106,7 @@ def register_template_filters(app: Flask) -> None:
|
||||
if not dt:
|
||||
return ""
|
||||
try:
|
||||
tz = ZoneInfo(app.config.get("SCHEDULER_TIMEZONE", "Asia/Shanghai"))
|
||||
tz = ZoneInfo(app.config.get("DISPLAY_TIMEZONE", "Asia/Shanghai"))
|
||||
# 如果是 naive datetime,认为是 UTC
|
||||
if dt.tzinfo is None:
|
||||
dt = dt.replace(tzinfo=ZoneInfo("UTC"))
|
||||
|
||||
@ -19,6 +19,8 @@ class BaseConfig:
|
||||
SCHEDULER_API_ENABLED = False
|
||||
# 默认采用中国标准时间,可通过环境变量 APP_TIMEZONE 覆盖
|
||||
SCHEDULER_TIMEZONE = os.getenv("APP_TIMEZONE", "Asia/Shanghai")
|
||||
# 页面展示时间的时区,默认中国标准时间,可用 DISPLAY_TIMEZONE 覆盖
|
||||
DISPLAY_TIMEZONE = os.getenv("DISPLAY_TIMEZONE", "Asia/Shanghai")
|
||||
ENABLE_SCHEDULER = True
|
||||
|
||||
|
||||
|
||||
@ -50,6 +50,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<a class="btn btn-sm btn-outline-primary" href="{{ url_for('apis.edit_api', api_id=api.id) }}">编辑</a>
|
||||
<a class="btn btn-sm btn-outline-secondary" href="{{ url_for('logs.list_logs', api_id=api.id) }}">查看日志</a>
|
||||
<form action="{{ url_for('apis.copy_api', api_id=api.id) }}" method="post" class="d-inline">
|
||||
<button class="btn btn-sm btn-outline-info" type="submit">复制</button>
|
||||
</form>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user