Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ type MonitoringFiltersPanelProps = {

const TIME_RANGE_OPTIONS: Array<{ value: MonitoringTimeRange; labelKey: string }> = [
{ value: 'today', labelKey: 'monitoring.range_today' },
{ value: 'yesterday', labelKey: 'monitoring.range_yesterday' },
{ value: '7d', labelKey: 'monitoring.range_7d' },
{ value: '14d', labelKey: 'monitoring.range_14d' },
{ value: '30d', labelKey: 'monitoring.range_30d' },
Expand Down
3 changes: 3 additions & 0 deletions apps/web/src/features/monitoring/model/range.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ export const getRangeBounds = (
switch (range) {
case 'today':
return { startMs: todayStart, endMs: nowMs };
case 'yesterday':
return { startMs: todayStart - 24 * 60 * 60 * 1000, endMs: todayStart };
case '7d':
return { startMs: todayStart - 6 * 24 * 60 * 60 * 1000, endMs: nowMs };
case '14d':
Expand All @@ -61,6 +63,7 @@ export const shouldUseHourlyTimeline = (
customRange?: MonitoringCustomTimeRange | null
) =>
range === 'today' ||
range === 'yesterday' ||
(range === 'custom' &&
isValidCustomTimeRange(customRange) &&
buildLocalDayKey(customRange.startMs) === buildLocalDayKey(customRange.endMs));
2 changes: 1 addition & 1 deletion apps/web/src/features/monitoring/model/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export type MonitoringAuthMeta = {
updatedAt: string;
};

export type MonitoringTimeRange = 'today' | '7d' | '14d' | '30d' | 'all' | 'custom';
export type MonitoringTimeRange = 'today' | 'yesterday' | '7d' | '14d' | '30d' | 'all' | 'custom';

export type MonitoringCustomTimeRange = {
startMs: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ describe('monitoringCenterUiState', () => {

it('normalizes persisted filter fields', () => {
expect(normalizeMonitoringTimeRange('30d')).toBe('30d');
expect(normalizeMonitoringTimeRange('yesterday')).toBe('yesterday');
expect(normalizeMonitoringTimeRange('bad')).toBe('today');
expect(normalizeMonitoringStatusFilter('failed')).toBe('failed');
expect(normalizeMonitoringStatusFilter('bad')).toBe('all');
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/features/monitoring/monitoringCenterUiState.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export type MonitoringDataTab = 'accounts' | 'apiKeys' | 'realtime';
export type MonitoringCenterTimeRange = 'today' | '7d' | '14d' | '30d' | 'all' | 'custom';
export type MonitoringCenterTimeRange = 'today' | 'yesterday' | '7d' | '14d' | '30d' | 'all' | 'custom';
export type MonitoringCenterStatusFilter = 'all' | 'success' | 'failed';

export const MONITORING_DATA_TABS: readonly MonitoringDataTab[] = [
Expand Down Expand Up @@ -37,6 +37,7 @@ export type MonitoringCenterUiState = {
const TAB_SET = new Set<MonitoringDataTab>(MONITORING_DATA_TABS);
const TIME_RANGE_SET = new Set<MonitoringCenterTimeRange>([
'today',
'yesterday',
'7d',
'14d',
'30d',
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1568,6 +1568,7 @@
"realtime_console_eyebrow": "Realtime Runtime Monitor",
"console_subtitle": "Track call volume, success and failure, token structure, and spend by account within the selected time range, with a live table that behaves more like a request log console.",
"range_today": "Today",
"range_yesterday": "Yesterday",
"range_7d": "7d",
"range_14d": "14d",
"range_30d": "30d",
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/i18n/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -1568,6 +1568,7 @@
"realtime_console_eyebrow": "Мониторинг в реальном времени",
"console_subtitle": "Следите за количеством вызовов, успехами, ошибками, токенами и расходами по аккаунтам за выбранный период.",
"range_today": "Сегодня",
"range_yesterday": "Вчера",
"range_7d": "7д",
"range_14d": "14д",
"range_30d": "30д",
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/i18n/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -1568,6 +1568,7 @@
"realtime_console_eyebrow": "实时运行监控",
"console_subtitle": "按账号和时间范围追踪调用规模、成功失败、Token 结构和花费,并提供接近请求日志的实时监控表。",
"range_today": "今天",
"range_yesterday": "昨天",
"range_7d": "7 天",
"range_14d": "14 天",
"range_30d": "30 天",
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/i18n/locales/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -1568,6 +1568,7 @@
"realtime_console_eyebrow": "即時運行監控",
"console_subtitle": "按帳號與時間範圍追蹤呼叫規模、成功失敗、Token 結構與花費,並提供接近請求日誌的即時監控表。",
"range_today": "今天",
"range_yesterday": "昨天",
"range_7d": "7 天",
"range_14d": "14 天",
"range_30d": "30 天",
Expand Down
Loading