29 lines
908 B
TypeScript
29 lines
908 B
TypeScript
import { Controller, Get, Inject, Query } from '@nestjs/common';
|
|
import { ApiTags } from '@nestjs/swagger';
|
|
import { RequirePermissions } from '../security/security.metadata.js';
|
|
import { DashboardService } from './dashboard.service.js';
|
|
|
|
@ApiTags('dashboard')
|
|
@Controller('dashboard')
|
|
export class DashboardController {
|
|
constructor(@Inject(DashboardService) private readonly dashboardService: DashboardService) {}
|
|
|
|
@Get('summary')
|
|
@RequirePermissions('dashboard.view')
|
|
summary() {
|
|
return this.dashboardService.summary();
|
|
}
|
|
|
|
@Get('overview')
|
|
@RequirePermissions('dashboard.view')
|
|
overview(@Query() query: { hours?: string; bucketMinutes?: string }) {
|
|
return this.dashboardService.overview(query);
|
|
}
|
|
|
|
@Get('trends')
|
|
@RequirePermissions('dashboard.view')
|
|
trends(@Query() query: { hours?: string; bucketMinutes?: string }) {
|
|
return this.dashboardService.trends(query);
|
|
}
|
|
}
|