\n";
html += "
\n";
@@ -84,7 +84,7 @@ angular.module('DashboardJobsWidget', ['RestServices', 'Utilities'])
});
$(window).resize(_.debounce(function() {
- resizeContainers();
+ resizeDashboardJobsWidget();
}, 500));
});
@@ -94,7 +94,7 @@ angular.module('DashboardJobsWidget', ['RestServices', 'Utilities'])
scope.removeChoicesReady = scope.$on('choicesReady', function() {
choicesCount++;
if (choicesCount === 2) {
- setHeight();
+ setDashboardJobsHeight();
scope.$emit('buildJobsList');
}
});
@@ -116,22 +116,30 @@ angular.module('DashboardJobsWidget', ['RestServices', 'Utilities'])
});
+
// Set the height of each container and calc max number of rows containers can hold
- function setHeight() {
+ function setDashboardJobsHeight() {
var docw = $(window).width(),
- //doch = $(window).height(),
+ // //doch = $(window).height(),
available_height,
search_row, page_row, height, header, row_height;
if (docw > 1000) {
- // customize the container height and # of rows based on available viewport height
- available_height = $(window).height() - $('#main-menu-container .navbar').outerHeight() - $('#graph-container').outerHeight() - $('#count-container').outerHeight() - 80;
- $('.jobs-list-container').each(function() {
- $(this).height(Math.floor(available_height / 2));
- });
+ // // customize the container height and # of rows based on available viewport height
+ // available_height = $(window).height() - $('#main-menu-container .navbar').outerHeight() - $('#count-container').outerHeight() - 93;
+
+ // available_height = $(window).height() - $('#main-menu-container .navbar').outerHeight() - $('#graph-container').outerHeight() - $('#count-container').outerHeight() - 80;
+ // $('.jobs-list-container').each(function() {
+ // $(this).height(Math.floor(available_height / 2));
+ // });
+
+ available_height = 500; // $(window).height() - $('#main-menu-container .navbar').outerHeight() - $('#count-container').outerHeight() - 93;
+ // console.log("available_height: " + available_height);
+ $('.dashboard-jobs-list-container').height(500);
+ //console.log("dashboard-jobs-list-container height: "+$('.dashboard-jobs-list-container').height());
search_row = Math.max($('.search-row:eq(0)').outerHeight(), 50);
page_row = Math.max($('.page-row:eq(0)').outerHeight(), 33);
header = Math.max($('#completed_jobs_table thead').height(), 41);
- height = Math.floor(available_height) - header - page_row ;
+ height = Math.floor(available_height) - header - page_row -search_row-30 ;
row_height = (docw < 1415) ? 47 : 27;
//$('.jobs-list-container tbody tr:eq(0)').height(); <-- only works if data is loaded
max_rows = Math.floor(height / row_height);
@@ -146,8 +154,8 @@ angular.module('DashboardJobsWidget', ['RestServices', 'Utilities'])
}
// Set container height and return the number of allowed rows
- function resizeContainers() {
- setHeight();
+ function resizeDashboardJobsWidget() {
+ setDashboardJobsHeight();
// completed_scope[CompletedJobsList.iterator + '_page_size'] = max_rows;
// completed_scope.changePageSize(CompletedJobsList.name, CompletedJobsList.iterator);
// running_scope[RunningJobsList.iterator + '_page_size'] = max_rows;
diff --git a/awx/ui/static/js/widgets/HostGraph.js b/awx/ui/static/js/widgets/HostGraph.js
index b8b4f2bace..51b32629eb 100644
--- a/awx/ui/static/js/widgets/HostGraph.js
+++ b/awx/ui/static/js/widgets/HostGraph.js
@@ -21,9 +21,11 @@ angular.module('HostGraphWidget', ['RestServices', 'Utilities'])
html = "
\n";
html +="
\n";
- html += "
Hosts Count
\n";
- html += "
\n";
+ html += "
Host Count
\n";
html += "
\n";
+ html +="
\n";
+ html += "
\n";
+
html += "
\n";
@@ -105,8 +107,8 @@ angular.module('HostGraphWidget', ['RestServices', 'Utilities'])
nv.addGraph({
generate: function() {
- var width = nv.utils.windowSize().width/3,
- height = nv.utils.windowSize().height/5,
+ var width = $('.graph-container').width(), // nv.utils.windowSize().width/3,
+ height = $('.graph-container').height()*0.8, //nv.utils.windowSize().height/5,
chart = nv.models.lineChart()
.margin({top: 15, right: 75, bottom: 40, left: 85})
.x(function(d,i) { return i ;})
@@ -150,6 +152,7 @@ angular.module('HostGraphWidget', ['RestServices', 'Utilities'])
nv.utils.windowResize(chart.update);
scope.$emit('WidgetLoaded');
return chart;
+
},
});
diff --git a/awx/ui/static/js/widgets/HostPieChart.js b/awx/ui/static/js/widgets/HostPieChart.js
index 8fdbc96dc7..601fa0787a 100644
--- a/awx/ui/static/js/widgets/HostPieChart.js
+++ b/awx/ui/static/js/widgets/HostPieChart.js
@@ -24,21 +24,6 @@ angular.module('HostPieChartWidget', ['RestServices', 'Utilities'])
html +="
\n";
html += "
Host Status
\n";
html += "
\n";
- // html += "
\n";
- // html += "
\n";
-
- // html += "
\n"; //end of filter div
-
-
html +="
\n";
html += "
\n";
@@ -86,9 +71,10 @@ angular.module('HostPieChartWidget', ['RestServices', 'Utilities'])
scope.removeCreateHostPieChart = scope.$on('createHostPieChart', function (e, data) {
data = exampleData();
nv.addGraph(function() {
- var width = nv.utils.windowSize().width/3,
- height = nv.utils.windowSize().height/5,
+ var width = $('.graph-container').width(), // nv.utils.windowSize().width/3,
+ height = $('.graph-container').height()*0.85, //nv.utils.windowSize().height/5,
chart = nv.models.pieChart()
+ .margin({top: 5, right: 75, bottom: 40, left: 85})
.x(function(d) { return d.label; })
.y(function(d) { return d.value; })
.showLabels(true);
diff --git a/awx/ui/static/js/widgets/JobStatusGraph.js b/awx/ui/static/js/widgets/JobStatusGraph.js
index 80f9a602ca..476c95e189 100644
--- a/awx/ui/static/js/widgets/JobStatusGraph.js
+++ b/awx/ui/static/js/widgets/JobStatusGraph.js
@@ -24,15 +24,15 @@ angular.module('JobStatusGraphWidget', ['RestServices', 'Utilities'])
html = "
\n";
html +="
\n";
- html += "
Job Status for All Jobs, Past Month
\n";
+ html += "
Job Status
\n"; // for All Jobs, Past Month
html += "