lib/CrashTest.pm
changeset 88 c82f5589db11
parent 79 4ae8bb6f8a96
child 108 e4e5cfaf5814
--- a/lib/CrashTest.pm	Mon Dec 28 23:07:16 2015 +0100
+++ b/lib/CrashTest.pm	Mon Dec 28 23:08:23 2015 +0100
@@ -4,6 +4,7 @@
 use CrashTest::Model::Storage;
 use CrashTest::Model::StackFilter;
 use CrashTest::Model::CrashReport;
+use CrashTest::Model::CrashGroup;
 use CrashTest::Model::CrashProcessor;
 
 # This method will run once at server start
@@ -27,9 +28,11 @@
     $self->plugin("CrashTest::Helper::DateTime");
     $self->plugin("CrashTest::Helper::Backtrace");
     $self->plugin("CrashTest::Helper::XmlEscape");
+    $self->plugin("CrashTest::Helper::Stats");
 
 
     $self->helper(crash_reports     => sub { state $crash_reports   = CrashTest::Model::CrashReport->new    (app => $self); });
+    $self->helper(crash_groups      => sub { state $crash_groups    = CrashTest::Model::CrashGroup->new     (app => $self); });
 
     $self->helper(crash_processor   => sub { state $crash_processor = CrashTest::Model::CrashProcessor->new (app => $self, config => $self->config); });
     $self->helper(stackfilter       => sub { state $crash_reports   = CrashTest::Model::StackFilter->new    (app => $self, config => $self->config); });
@@ -45,7 +48,10 @@
 
     # Normal route to controller
     $r->get('/')->to('crash_reports#index')->name('index');
-    $r->get('/report/:uuid' => [ uuid => qr/[0-9a-fA-F-]+/ ])->to('crash_reports#report')->name('report');
+    $r->get('/reports')->to('crash_reports#index')->name('reports');
+    $r->get('/groups')->to('crash_groups#index')->name('groups');
+    $r->get('/groups/:uuid' => [ uuid => qr/[0-9a-fA-F-]+/ ])->to('crash_groups#show')->name('group');
+    $r->get('/report/:uuid' => [ uuid => qr/[0-9a-fA-F-]+/ ])->to('crash_reports#show')->name('report');
 
     $r->post('/submit')->to('crash_inserter#insert');
 }