feat: add superadmin health center
This commit is contained in:
21
frontend/superadmin/src/service/HealthService.js
Normal file
21
frontend/superadmin/src/service/HealthService.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import { requestJson } from './apiClient';
|
||||
|
||||
export const HealthService = {
|
||||
async getOverview({ tenant_id, start_at, end_at, upload_stuck_hours } = {}) {
|
||||
const iso = (d) => {
|
||||
if (!d) return undefined;
|
||||
const date = d instanceof Date ? d : new Date(d);
|
||||
if (Number.isNaN(date.getTime())) return undefined;
|
||||
return date.toISOString();
|
||||
};
|
||||
|
||||
const query = {
|
||||
tenant_id,
|
||||
start_at: iso(start_at),
|
||||
end_at: iso(end_at),
|
||||
upload_stuck_hours
|
||||
};
|
||||
|
||||
return requestJson('/super/v1/health/overview', { query });
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user