mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2025-12-06 15:22:47 +01:00
@@ -14,6 +14,7 @@ func dashboardResponseID(doc *model.DashboardResponse) []driver.DocumentID {
|
||||
if doc == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return templateID(doc.ID)
|
||||
}
|
||||
|
||||
@@ -27,6 +28,7 @@ func (s *Service) ListDashboards(ctx context.Context) ([]*model.DashboardRespons
|
||||
|
||||
func (s *Service) CreateDashboard(ctx context.Context, dashboard *model.Dashboard) (doc *model.DashboardResponse, err error) {
|
||||
defer s.publishRequest(ctx, err, "CreateDashboard", dashboardResponseID(doc))
|
||||
|
||||
return s.database.DashboardCreate(ctx, dashboard)
|
||||
}
|
||||
|
||||
@@ -36,14 +38,16 @@ func (s *Service) GetDashboard(ctx context.Context, id string) (*model.Dashboard
|
||||
|
||||
func (s *Service) UpdateDashboard(ctx context.Context, id string, form *model.Dashboard) (doc *model.DashboardResponse, err error) {
|
||||
defer s.publishRequest(ctx, err, "UpdateDashboard", dashboardResponseID(doc))
|
||||
|
||||
return s.database.DashboardUpdate(ctx, id, form)
|
||||
}
|
||||
|
||||
func (s *Service) DeleteDashboard(ctx context.Context, id string) (err error) {
|
||||
defer s.publishRequest(ctx, err, "DeleteDashboard", dashboardID(id))
|
||||
|
||||
return s.database.DashboardDelete(ctx, id)
|
||||
}
|
||||
|
||||
func (s *Service) DashboardData(ctx context.Context, aggregation string, filter *string) (map[string]interface{}, error) {
|
||||
func (s *Service) DashboardData(ctx context.Context, aggregation string, filter *string) (map[string]any, error) {
|
||||
return s.database.WidgetData(ctx, aggregation, filter)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user