Add month/quarter/half-year/all list window presets with this month as default.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-08 11:22:29 +08:00
parent 189b27e076
commit f5f302b97e
8 changed files with 114 additions and 11 deletions
+10 -1
View File
@@ -238,9 +238,14 @@ from lib.hub.hub_auth import request_allowed as hub_request_allowed
from lib.instance.instance_nav_lib import request_is_hub_soft_nav
from lib.hub.hub_volume_rank_lib import resolve_daily_volume_rank
from lib.common.history_window_lib import (
PRESET_ALL,
PRESET_CUSTOM,
PRESET_DEFAULT,
PRESET_UTC_LAST24H,
PRESET_UTC_LAST3M,
PRESET_UTC_LAST6M,
PRESET_UTC_LAST7D,
PRESET_UTC_THIS_MONTH,
PRESET_UTC_TODAY,
list_window_redirect_query,
normalize_bj_datetime_storage,
@@ -1669,7 +1674,7 @@ def _count_opens_between(conn, start_td, end_td):
def _list_window_from_request():
return resolve_list_window(request.args, session, default_preset=PRESET_UTC_TODAY)
return resolve_list_window(request.args, session, default_preset=PRESET_DEFAULT)
def _redirect_records():
@@ -7078,6 +7083,10 @@ def render_main_page(page="trade", embed_mode=None):
data_export_version=3,
list_window=list_window,
list_window_presets={
"utc_this_month": PRESET_UTC_THIS_MONTH,
"utc_last3m": PRESET_UTC_LAST3M,
"utc_last6m": PRESET_UTC_LAST6M,
"all": PRESET_ALL,
"utc_today": PRESET_UTC_TODAY,
"utc_last24h": PRESET_UTC_LAST24H,
"utc_last7d": PRESET_UTC_LAST7D,