From 0b1308f41195f839da9a3e0a2adc01b2d69b5171 Mon Sep 17 00:00:00 2001 From: Chris Houseknecht Date: Wed, 2 Jul 2014 10:04:14 -0400 Subject: [PATCH] Dashboard Fixed boarder around job widget. Cleaned up JS lint issues. --- awx/ui/static/js/controllers/Home.js | 2 +- awx/ui/static/js/widgets/DashboardCounts.js | 163 ++++++++++---------- awx/ui/static/js/widgets/DashboardJobs.js | 2 + awx/ui/static/js/widgets/HostGraph.js | 12 +- awx/ui/static/js/widgets/JobStatusGraph.js | 9 +- awx/ui/static/less/new-dashboard.less | 11 +- awx/ui/templates/ui/index.html | 2 +- 7 files changed, 100 insertions(+), 101 deletions(-) diff --git a/awx/ui/static/js/controllers/Home.js b/awx/ui/static/js/controllers/Home.js index 84ac94b994..f48967bbaf 100644 --- a/awx/ui/static/js/controllers/Home.js +++ b/awx/ui/static/js/controllers/Home.js @@ -81,7 +81,7 @@ function Home($scope, $compile, $routeParams, $rootScope, $location, Wait, Dashb target: 'container2', dashboard: data }); - HostGraph({ + HostGraph({ scope: $scope, target: 'container3', dashboard: data diff --git a/awx/ui/static/js/widgets/DashboardCounts.js b/awx/ui/static/js/widgets/DashboardCounts.js index 8682293d2c..282b0ebcfa 100644 --- a/awx/ui/static/js/widgets/DashboardCounts.js +++ b/awx/ui/static/js/widgets/DashboardCounts.js @@ -17,58 +17,56 @@ angular.module('DashboardCountsWidget', ['RestServices', 'Utilities']) var scope = params.scope, target = params.target, dashboard = params.dashboard, - html, element; - function createHTML(html){ - var docw = $(window).width(); - if(docw<768){ + function createHTML(html){ + var docw = $(window).width(); + if (docw<768){ + html = "
\n" ; + // html += " \n"; + html += "
    \n"; + html += "
  1. \n"; + html += "
  2. \n"; + html += "
  3. \n"; + html += "
\n"; - html = "
\n" ; - // html += " \n"; - html += "
    \n"; - html += "
  1. \n"; - html += "
  2. \n"; - html += "
  3. \n"; - html += "
\n"; + // + //html += "
\n" ; + html += "
\n" ; + html += "
\n" ; + html += "\"\"\n" ; + html += "
\n" ; + html += "

Caption text here

\n" ; + html += "
\n" ; + html += "
\n" ; + html += "
\n" ; + html += "\"\"\n" ; + html += "
\n" ; + html += "

Caption text here

\n" ; + html += "
\n" ; + html += "
\n" ; + html += "
\n" ; + html += "\"\"\n" ; + html += "
\n" ; + html += "

Caption text here

\n" ; + html += "
\n" ; + html += "
\n" ; + html += "
\n" ; + html += "\"\"\n" ; + html += "
\n" ; + html += "

Caption text here

\n" ; + html += "
\n" ; + html += "
\n" ; + html += "
\n" ; - // - //html += "
\n" ; - html += "
\n" ; - html += "
\n" ; - html += "\"\"\n" ; - html += "
\n" ; - html += "

Caption text here

\n" ; - html += "
\n" ; - html += "
\n" ; - html += "
\n" ; - html += "\"\"\n" ; - html += "
\n" ; - html += "

Caption text here

\n" ; - html += "
\n" ; - html += "
\n" ; - html += "
\n" ; - html += "\"\"\n" ; - html += "
\n" ; - html += "

Caption text here

\n" ; - html += "
\n" ; - html += "
\n" ; - html += "
\n" ; - html += "\"\"\n" ; - html += "
\n" ; - html += "

Caption text here

\n" ; - html += "
\n" ; - html += "
\n" ; - html += "
\n" ; - - // html += \"\n" ; - html += "\n" ; - html += "\n" ; - html += "\n" ; - html += "\n" ; - html += "\n" ; - html += "\n" ; - html += "
\n" ; + // html += \"\n" ; + html += "\n" ; + html += "\n" ; + html += "\n" ; + html += "\n" ; + html += "\n" ; + html += "\n" ; + html += "
\n" ; // // // @@ -77,43 +75,40 @@ angular.module('DashboardCountsWidget', ['RestServices', 'Utilities']) // // //
- // $('.carousel').carousel({ - // interval: 2000 - // }) + // $('.carousel').carousel({ + // interval: 2000 + // }) - } - else{ - html = "
\n"; - html += "\n"; - html += "\n"; - html += "\n"; - html += "\n"; - html += "\n"; - html += "\n"; - html += "\n"; - html += "\n"; - html += "\n"; - html += "\n"; - - html += "\n"; - html += "\n"; - html += "\n"; - html += "\n"; - html += "\n"; - html += "\n"; - html += "\n"; - html += "\n"; - html += "\n"; - html += "
" + dashboard.hosts.total+""+dashboard.hosts.failed+""+dashboard.inventories.total+""+dashboard.inventories.inventory_failed+""+dashboard.projects.total+""+dashboard.projects.failed+""+dashboard.users.total+"
HostsFailed HostsInventoriesInventory Sync FailuresProjectsProject Sync FailuresUsers
\n"; - html += "
\n"; - // html += "
\n"; - - } - - - return html; } + else{ + html = "
\n"; + html += "\n"; + html += "\n"; + html += "\n"; + html += "\n"; + html += "\n"; + html += "\n"; + html += "\n"; + html += "\n"; + html += "\n"; + html += "\n"; + + html += "\n"; + html += "\n"; + html += "\n"; + html += "\n"; + html += "\n"; + html += "\n"; + html += "\n"; + html += "\n"; + html += "\n"; + html += "
" + dashboard.hosts.total+""+dashboard.hosts.failed+""+dashboard.inventories.total+""+dashboard.inventories.inventory_failed+""+dashboard.projects.total+""+dashboard.projects.failed+""+dashboard.users.total+"
HostsFailed HostsInventoriesInventory Sync FailuresProjectsProject Sync FailuresUsers
\n"; + html += "
\n"; + // html += "
\n"; + } + return html; + } @@ -180,13 +175,13 @@ angular.module('DashboardCountsWidget', ['RestServices', 'Utilities']) //window.onresize = scaleForSmallDevices; - function scaleForSmallDevices(){ + /*function scaleForSmallDevices(){ var docw = $(window).width(); if(docw<600){ alert('success'); } - }; + };*/ }; } diff --git a/awx/ui/static/js/widgets/DashboardJobs.js b/awx/ui/static/js/widgets/DashboardJobs.js index 9e284354a9..eef3478ff0 100644 --- a/awx/ui/static/js/widgets/DashboardJobs.js +++ b/awx/ui/static/js/widgets/DashboardJobs.js @@ -23,6 +23,7 @@ angular.module('DashboardJobsWidget', ['RestServices', 'Utilities']) html, e; html = ''; + html += "
\n"; html += "
    \n"; html += "
  • Jobs
  • \n"; @@ -39,6 +40,7 @@ angular.module('DashboardJobsWidget', ['RestServices', 'Utilities']) html += "
\n"; //list html += "
\n"; //active-jobs-tab html += "
\n"; + html += "\n"; // jobs-list-container html += "\n"; e = angular.element(document.getElementById(target)); diff --git a/awx/ui/static/js/widgets/HostGraph.js b/awx/ui/static/js/widgets/HostGraph.js index 526b82ff70..37cd684578 100644 --- a/awx/ui/static/js/widgets/HostGraph.js +++ b/awx/ui/static/js/widgets/HostGraph.js @@ -68,11 +68,11 @@ angular.module('HostGraphWidget', ['RestServices', 'Utilities']) }); chart.yAxis //Chart y-axis settings - .axisLabel('Hosts') - .tickFormat(d3.format('.f')); + .axisLabel('Hosts') + .tickFormat(d3.format('.f')); d3.select('.host-count-graph svg') - .datum(data).transition() + .datum(data).transition() .attr('width', width) .attr('height', height) .duration(500) @@ -86,9 +86,9 @@ angular.module('HostGraphWidget', ['RestServices', 'Utilities']) "src": "url(/static/fonts/OpenSans-Regular.ttf)" }); - d3.selectAll(".nv-line").on("click", function () { - alert("clicked"); - }); + d3.selectAll(".nv-line").on("click", function () { + alert("clicked"); + }); nv.utils.windowResize(chart.update); return chart; diff --git a/awx/ui/static/js/widgets/JobStatusGraph.js b/awx/ui/static/js/widgets/JobStatusGraph.js index cb2aecca6e..9090844665 100644 --- a/awx/ui/static/js/widgets/JobStatusGraph.js +++ b/awx/ui/static/js/widgets/JobStatusGraph.js @@ -101,7 +101,7 @@ angular.module('JobStatusGraphWidget', ['RestServices', 'Utilities']) }); } - function makeHostCountGraph(){ + /*function makeHostCountGraph(){ d3.json("static/js/hostcount.json",function(error,data) { data.map(function(series) { @@ -149,9 +149,9 @@ angular.module('JobStatusGraphWidget', ['RestServices', 'Utilities']) "src": "url(/static/fonts/OpenSans-Regular.ttf)" }); - d3.selectAll(".nv-line").on("click", function () { - alert("clicked"); - }); + d3.selectAll(".nv-line").on("click", function () { + alert("clicked"); + }); nv.utils.windowResize(chart.update); return chart; @@ -160,6 +160,7 @@ angular.module('JobStatusGraphWidget', ['RestServices', 'Utilities']) }); }); } + */ element = angular.element(document.getElementById(target)); element.html(html); diff --git a/awx/ui/static/less/new-dashboard.less b/awx/ui/static/less/new-dashboard.less index b4d6ca21e5..fd87a7cfdb 100644 --- a/awx/ui/static/less/new-dashboard.less +++ b/awx/ui/static/less/new-dashboard.less @@ -27,11 +27,12 @@ stroke: steelblue; stroke-width: 1.5px; } -.jobs-list-container { - border: 1px solid @grey; - border-radius: 4px; - padding: 5px; - } + +.dashboard-jobs-list-container { + border: 1px solid @grey; + border-radius: 4px; + padding: 5px; +} .carousel-control.left, .carousel-control.right { background-image: none diff --git a/awx/ui/templates/ui/index.html b/awx/ui/templates/ui/index.html index 0dab0915ab..28ffc3f860 100644 --- a/awx/ui/templates/ui/index.html +++ b/awx/ui/templates/ui/index.html @@ -201,7 +201,7 @@ - +