feat: add createdAt timestamps to check-in logs and improve i18n translations
- Added createdAt timestamps to various check-in log entries in checkinService.ts for better tracking. - Updated i18n translations in Models.tsx to improve user experience with accurate Chinese translations. - Reduced default page size in ProgramLogs.tsx and ProxyLogs.tsx from 80 and 100 to 50 for better performance. - Enhanced ProxyLogs.tsx with memoization for filtered logs and summary statistics. - Implemented support for parsing Unix timestamps and PostgreSQL-style timezone offsets in checkinLogTime.ts. - Added comprehensive tests for database proxy query wrapper in index.proxy-wrap.test.ts to ensure functionality.
This commit is contained in:
@@ -22,6 +22,7 @@ export async function reportTokenExpired(params: {
|
||||
level: 'error',
|
||||
relatedId: params.accountId,
|
||||
relatedType: 'account',
|
||||
createdAt: new Date().toISOString(),
|
||||
}).run();
|
||||
|
||||
await db.update(schema.accounts).set({
|
||||
@@ -49,6 +50,7 @@ export async function reportProxyAllFailed(params: { model: string; reason: stri
|
||||
message: `模型=${params.model}, 原因=${params.reason}`,
|
||||
level: 'error',
|
||||
relatedType: 'route',
|
||||
createdAt: new Date().toISOString(),
|
||||
}).run();
|
||||
|
||||
await sendNotification(
|
||||
|
||||
@@ -137,6 +137,7 @@ export async function checkinAccount(accountId: number, options?: { skipEvent?:
|
||||
accountId: account.id,
|
||||
status: 'skipped',
|
||||
message: 'site disabled',
|
||||
createdAt: new Date().toISOString(),
|
||||
}).run();
|
||||
|
||||
if (!options?.skipEvent) {
|
||||
@@ -147,6 +148,7 @@ export async function checkinAccount(accountId: number, options?: { skipEvent?:
|
||||
level: 'info',
|
||||
relatedId: accountId,
|
||||
relatedType: 'account',
|
||||
createdAt: new Date().toISOString(),
|
||||
}).run();
|
||||
}
|
||||
|
||||
@@ -245,6 +247,7 @@ export async function checkinAccount(accountId: number, options?: { skipEvent?:
|
||||
status: normalizedStatus,
|
||||
message: logMessage,
|
||||
reward: logReward,
|
||||
createdAt: new Date().toISOString(),
|
||||
}).run();
|
||||
|
||||
if (!options?.skipEvent) {
|
||||
@@ -257,6 +260,7 @@ export async function checkinAccount(accountId: number, options?: { skipEvent?:
|
||||
level: effectiveSuccess ? 'info' : 'error',
|
||||
relatedId: accountId,
|
||||
relatedType: 'account',
|
||||
createdAt: new Date().toISOString(),
|
||||
}).run();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user