From 034073c92cd97facacb3c02e968b6edaba0293c4 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Thu, 3 Jul 2014 11:57:25 -0400 Subject: [PATCH] linted previous 2 pushes --- awx/ui/static/js/widgets/HostGraph.js | 82 +++++++++++----------- awx/ui/static/js/widgets/JobStatusGraph.js | 4 +- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/awx/ui/static/js/widgets/HostGraph.js b/awx/ui/static/js/widgets/HostGraph.js index 28ed62bf42..8e8e0a9897 100644 --- a/awx/ui/static/js/widgets/HostGraph.js +++ b/awx/ui/static/js/widgets/HostGraph.js @@ -11,7 +11,7 @@ angular.module('HostGraphWidget', ['RestServices', 'Utilities']) .factory('HostGraph', ['$rootScope', '$compile', '$location', 'Rest', 'GetBasePath', 'ProcessErrors', 'Wait', - function ($rootScope, $compile, $location, Rest, GetBasePath, ProcessErrors, Wait) { + function ($rootScope, $compile, $location, Rest, GetBasePath, ProcessErrors) { return function (params) { var scope = params.scope, @@ -45,53 +45,53 @@ angular.module('HostGraphWidget', ['RestServices', 'Utilities']) }); //return license; - }; + } function makeHostCountGraph(license){ - url = GetBasePath('dashboard')+'graphs/'; - var graphData = []; + url = GetBasePath('dashboard')+'graphs/'; + var graphData = []; //d3.json("static/js/jobstatusdata.json",function(error,data) { - d3.json(url, function(error,data) { - // console.log(data); - graphData = [ - { - "key" : "Hosts" , - "color" : "#1778c3", - "values": data.hosts - }, - { - "key" : "License" , - "color" : "#171717", - "values": data.hosts - } - ]; + d3.json(url, function(error,data) { - graphData.map(function(series) { - if(series.key==="Hosts"){ - series.values = series.values.map(function(d) { - return { - x: d[0], - y: d[1] - }; - }); - } - if(series.key==="License"){ - series.values = series.values.map(function(d) { - return { - x: d[0], - y: license - }; - }); + graphData = [ + { + "key" : "Hosts" , + "color" : "#1778c3", + "values": data.hosts + }, + { + "key" : "License" , + "color" : "#171717", + "values": data.hosts + } + ]; - } - return series; + graphData.map(function(series) { + if(series.key==="Hosts"){ + series.values = series.values.map(function(d) { + return { + x: d[0], + y: d[1] + }; + }); + } + if(series.key==="License"){ + series.values = series.values.map(function(d) { + return { + x: d[0], + y: license + }; + }); - }); + } + return series; - nv.addGraph({ - generate: function() { + }); + + nv.addGraph({ + generate: function() { var width = nv.utils.windowSize().width/3, height = nv.utils.windowSize().height/5, chart = nv.models.lineChart() @@ -138,9 +138,9 @@ angular.module('HostGraphWidget', ['RestServices', 'Utilities']) return chart; }, + }); }); - }); - } + } element = angular.element(document.getElementById(target)); element.html(html); diff --git a/awx/ui/static/js/widgets/JobStatusGraph.js b/awx/ui/static/js/widgets/JobStatusGraph.js index 1aa0c0ec8e..097f7be982 100644 --- a/awx/ui/static/js/widgets/JobStatusGraph.js +++ b/awx/ui/static/js/widgets/JobStatusGraph.js @@ -11,7 +11,7 @@ angular.module('JobStatusGraphWidget', ['RestServices', 'Utilities']) .factory('JobStatusGraph', ['$rootScope', '$compile', '$location' , 'Rest', 'GetBasePath', 'ProcessErrors', 'Wait', - function ($rootScope, $compile , $location, Rest, GetBasePath, ProcessErrors, Wait) { + function ($rootScope, $compile , $location, Rest, GetBasePath) { return function (params) { var scope = params.scope, @@ -73,7 +73,7 @@ angular.module('JobStatusGraphWidget', ['RestServices', 'Utilities']) //d3.json("static/js/jobstatusdata.json",function(error,data) { d3.json(url, function(error,data) { //console.log(data); - graphData = [ + graphData = [ { "color": "#1778c3", "key": "Successful",