Skip to content

Commit

Permalink
[#22] Split Angular services and modules, cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tonythomas01 committed Jul 1, 2017
1 parent 2acb016 commit 82248d4
Show file tree
Hide file tree
Showing 9 changed files with 700 additions and 649 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,24 @@
*
* Created by [email protected] on 11/4/17.
*/
app = angular.module(
'browserperfdash.dashboard.controller',
[
'browserperfdash.dashboard.services',
'ngAnimate',
'ngSanitize',
'ui.bootstrap'
]
);

app = angular.module('browserperfdash.dashboard.static', ['ngResource','ngAnimate', 'ngSanitize', 'ui.bootstrap']);

app.factory('botReportsImprovementFactory', function($resource) {
return $resource('/dash/report/improvement/:days_since/:platform/:gpu/:cpu/:browser/:test/:bot/:limit');
});

app.factory('botReportsRegressionFactory', function($resource) {
return $resource('/dash/report/regression/:days_since/:platform/:gpu/:cpu/:browser/:test/:bot/:limit');
});

app.factory('browserFactory', function($resource) {
return $resource('/dash/browser_results_exist');
});

app.factory('botFullDetailsForResultsExistFactory', function($resource) {
return $resource('/dash/bot_full_details_for_exist/:browser');
});

app.factory('platformFactory', function($resource) {
return $resource('/dash/platform_results_exist');
});

app.factory('gpuFactory', function($resource) {
return $resource('/dash/gpu_results_exist');
});

app.factory('cpuArchFactory', function($resource) {
return $resource('/dash/cpu_results_exist');
});

app.factory('testsForBrowserAndBotFactory', function ($resource) {
return $resource('/dash/tests_for_browser_bot/:browser/:bot');
});


app.controller('DeltaController', function($scope, botReportsImprovementFactory, botReportsRegressionFactory,
browserFactory, botFullDetailsForResultsExistFactory, platformFactory, gpuFactory,
cpuArchFactory, testsForBrowserAndBotFactory, $interval, $sce, $filter) {
app.controller(
'DeltaController',
function(
$scope, botReportsImprovementFactory, botReportsRegressionFactory,
browserFactory, botFullDetailsForResultsExistFactory, platformFactory,
gpuFactory, cpuArchFactory, testsForBrowserAndBotFactory, $interval,
$sce, $filter
) {
$scope.browsers = browserFactory.query();
$scope.bots = botFullDetailsForResultsExistFactory.query({
browser: 'all'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/**
* Angular services for dashboard controls on index.html
*
* Created by [email protected] on 01/07/17.
*/
app = angular.module('browserperfdash.dashboard.services', ['ngResource']);

app.factory('botReportsImprovementFactory', function($resource) {
return $resource('/dash/report/improvement/:days_since/:platform/:gpu/:cpu/:browser/:test/:bot/:limit');
});

app.factory('botReportsRegressionFactory', function($resource) {
return $resource('/dash/report/regression/:days_since/:platform/:gpu/:cpu/:browser/:test/:bot/:limit');
});

app.factory('browserFactory', function($resource) {
return $resource('/dash/browser_results_exist');
});

app.factory('botFullDetailsForResultsExistFactory', function($resource) {
return $resource('/dash/bot_full_details_for_exist/:browser');
});

app.factory('platformFactory', function($resource) {
return $resource('/dash/platform_results_exist');
});

app.factory('gpuFactory', function($resource) {
return $resource('/dash/gpu_results_exist');
});

app.factory('cpuArchFactory', function($resource) {
return $resource('/dash/cpu_results_exist');
});

app.factory('testsForBrowserAndBotFactory', function ($resource) {
return $resource('/dash/tests_for_browser_bot/:browser/:bot');
});
Loading

0 comments on commit 82248d4

Please sign in to comment.