From 589e5412d625b8cfac866ba045a6beb0be966f12 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Wed, 2 Jul 2014 16:08:13 -0400 Subject: [PATCH] fixed the media checking for alignment of hte graph widgets. And added drop down for job status widget --- awx/ui/static/js/widgets/DashboardCounts.js | 232 +++++++------------- awx/ui/static/js/widgets/HostGraph.js | 2 +- awx/ui/static/js/widgets/JobStatusGraph.js | 43 +++- awx/ui/static/less/new-dashboard.less | 22 +- awx/ui/static/partials/home.html | 2 +- 5 files changed, 142 insertions(+), 159 deletions(-) diff --git a/awx/ui/static/js/widgets/DashboardCounts.js b/awx/ui/static/js/widgets/DashboardCounts.js index 282b0ebcfa..4cc240562c 100644 --- a/awx/ui/static/js/widgets/DashboardCounts.js +++ b/awx/ui/static/js/widgets/DashboardCounts.js @@ -19,169 +19,107 @@ angular.module('DashboardCountsWidget', ['RestServices', 'Utilities']) dashboard = params.dashboard, html, element; - 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 += "\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 += "

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" ; -// -// -// -// -// -// -// -// - // $('.carousel').carousel({ - // interval: 2000 - // }) + 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"; - } - 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 += "\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; - } + // html = "
\n"; + // html += "\n"; + // html += "\n"; + // html += "\n"; + // html += "\n"; + // html += "\n"; + // html += "\n"; + // html += "\n"; + // html += "
\n"; + + // html = "
\n"; + // html += "
Hosts
\n"; + // html += "
Failed Hosts
\n"; + // html += "
Inventories
\n"; + // html += "
Inventory Sync Failures
\n"; + // html += "
Projects
\n"; + // html += "
Project Sync Failures
\n"; + // html += "
Users
\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+"
HostsFailed HostsInventories
\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.inventories.inventory_failed+""+dashboard.projects.total+""+dashboard.projects.failed+""+dashboard.users.total+"
Inventory Sync FailuresProjectsProject Sync FailuresUsers
\n"; + // // html += "
\n"; + // html += "
\n"; - - // html = "
\n"; - // html += "table1\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"; - -//-------------------------------------------------------------------------------------------------------------------- - // html = "
\n"; - // html += "table2\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"; -//-------------------------------------------------------------------------------------------------------------------- element = angular.element(document.getElementById(target)); - element.html(createHTML(html)); + element.html(html); $compile(element)(scope); scope.$emit('WidgetLoaded'); - //window.onresize = scaleForSmallDevices; - /*function scaleForSmallDevices(){ - var docw = $(window).width(); - if(docw<600){ - alert('success'); - } - - };*/ }; } diff --git a/awx/ui/static/js/widgets/HostGraph.js b/awx/ui/static/js/widgets/HostGraph.js index 06865ae83b..f46f3a296e 100644 --- a/awx/ui/static/js/widgets/HostGraph.js +++ b/awx/ui/static/js/widgets/HostGraph.js @@ -23,7 +23,7 @@ angular.module('HostGraphWidget', ['RestServices', 'Utilities']) html = "
\n"; html +="
\n"; - html += "
Hosts vs License Agreement
\n"; + html += "
Hosts vs License Agreement
\n"; html += "
\n"; html += "
\n"; html += "
\n"; diff --git a/awx/ui/static/js/widgets/JobStatusGraph.js b/awx/ui/static/js/widgets/JobStatusGraph.js index 6bacbae79d..313b62d0da 100644 --- a/awx/ui/static/js/widgets/JobStatusGraph.js +++ b/awx/ui/static/js/widgets/JobStatusGraph.js @@ -21,10 +21,49 @@ angular.module('JobStatusGraphWidget', ['RestServices', 'Utilities']) html, element; html = "
\n"; + + html +="
\n"; + html += "
Job Status
\n"; + + html += "
\n"; + html += "
\n"; + html += "\n"; + html += "Job Type\n"; + html += " \n"; + + html += "\n"; + html += "
\n"; + + html += "
\n"; //end of filter div + + html += "
\n"; + html += "
\n"; + html += "\n"; + html += "Period\n"; + html += " \n"; + + html += "\n"; + html += "
\n"; + html += "
\n"; //end of filter div + + html += "
\n"; // end of row + html +="
\n"; - html += "
Job Status
\n"; html += "
\n"; html += "
\n"; + + // + // html += "
\n"; + html += "\n"; @@ -53,7 +92,7 @@ angular.module('JobStatusGraphWidget', ['RestServices', 'Utilities']) ; chart.xAxis - .axisLabel("Tme").showMaxMin(true) + .axisLabel("Time").showMaxMin(true) .tickFormat(function(d) { var dx = data[0].values[d] && data[0].values[d].x || 0; return dx ? d3.time.format('%m/%d')(new Date(dx)) : ''; diff --git a/awx/ui/static/less/new-dashboard.less b/awx/ui/static/less/new-dashboard.less index b8d668f4d3..9f26ffed9e 100644 --- a/awx/ui/static/less/new-dashboard.less +++ b/awx/ui/static/less/new-dashboard.less @@ -40,19 +40,25 @@ padding: 5px; margin-bottom: 15px; } - +.count-container{ + border: 1px solid @grey; + border-radius: 4px; + padding: 5px; + margin-bottom: 15px; +} .carousel-control.left, .carousel-control.right { background-image: none } - .left-side { - padding-right: 7px; - } - - .right-side { - padding-left: 7px; - } + @media (min-width: 1024px) { + .left-side { + padding-right: 7px; + } + .right-side { + padding-left: 7px; + } +} .custon-carousel{ width:150px; height:200px; diff --git a/awx/ui/static/partials/home.html b/awx/ui/static/partials/home.html index 7efe7b1b09..ef1f4a7a65 100644 --- a/awx/ui/static/partials/home.html +++ b/awx/ui/static/partials/home.html @@ -9,7 +9,7 @@ -->
-
+