mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 09:27:36 -02:30
fixed resizing error with graphs on page load
This commit is contained in:
@@ -72,6 +72,13 @@ function Home($scope, $compile, $routeParams, $rootScope, $location, Wait, Dashb
|
|||||||
$scope.removeDashboardReady();
|
$scope.removeDashboardReady();
|
||||||
}
|
}
|
||||||
$scope.removeDashboardReady = $scope.$on('dashboardReady', function (e, data) {
|
$scope.removeDashboardReady = $scope.$on('dashboardReady', function (e, data) {
|
||||||
|
nv.dev=false;
|
||||||
|
|
||||||
|
var winHeight = $(window).height(),
|
||||||
|
available_height = winHeight - $('#main-menu-container .navbar').outerHeight() - $('#count-container').outerHeight() - 93;
|
||||||
|
$('.graph-container').height(available_height/2);
|
||||||
|
// chart.update();
|
||||||
|
|
||||||
DashboardCounts({
|
DashboardCounts({
|
||||||
scope: $scope,
|
scope: $scope,
|
||||||
target: 'dash-counts',
|
target: 'dash-counts',
|
||||||
|
|||||||
@@ -19,14 +19,14 @@ angular.module('HostGraphWidget', ['RestServices', 'Utilities'])
|
|||||||
html, element, url, license;
|
html, element, url, license;
|
||||||
|
|
||||||
|
|
||||||
html = "<div class=\"graph-container\">\n";
|
// html = "<div class=\"graph-container\">\n";
|
||||||
html +="<div class=\"row\">\n";
|
html ="<div class=\"row\">\n";
|
||||||
html += "<div class=\"h6 col-xs-8 text-center\"><b>Host Count</b></div>\n";
|
html += "<div class=\"h6 col-xs-8 text-center\"><b>Host Count</b></div>\n";
|
||||||
html += "</div>\n";
|
html += "</div>\n";
|
||||||
html +="<div class=\"row\">\n";
|
html +="<div class=\"row\">\n";
|
||||||
html += "<div class=\"host-count-graph\"><svg></svg></div>\n";
|
html += "<div class=\"host-count-graph\"><svg></svg></div>\n";
|
||||||
|
|
||||||
html += "</div>\n";
|
// html += "</div>\n";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ angular.module('HostPieChartWidget', ['RestServices', 'Utilities'])
|
|||||||
html, element, data,
|
html, element, data,
|
||||||
canvas, context, winHeight, available_height;
|
canvas, context, winHeight, available_height;
|
||||||
|
|
||||||
html = "<div class=\"graph-container\">\n";
|
// html = "<div class=\"graph-container\">\n";
|
||||||
|
|
||||||
html +="<div class=\"row\">\n";
|
html ="<div class=\"row\">\n";
|
||||||
html += "<div id=\"job-status-title\" class=\"h6 col-xs-8 text-center\"><b>Host Status</b></div>\n";
|
html += "<div id=\"job-status-title\" class=\"h6 col-xs-8 text-center\"><b>Host Status</b></div>\n";
|
||||||
html += "</div>\n";
|
html += "</div>\n";
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ angular.module('HostPieChartWidget', ['RestServices', 'Utilities'])
|
|||||||
html += "<div class=\"host-pie-chart text-center\"><svg></svg></div>\n";
|
html += "<div class=\"host-pie-chart text-center\"><svg></svg></div>\n";
|
||||||
html += "</div>\n";
|
html += "</div>\n";
|
||||||
|
|
||||||
html += "</div>\n";
|
// html += "</div>\n";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ angular.module('HostPieChartWidget', ['RestServices', 'Utilities'])
|
|||||||
|
|
||||||
nv.addGraph(function() {
|
nv.addGraph(function() {
|
||||||
var width = $('.graph-container').width(), // nv.utils.windowSize().width/3,
|
var width = $('.graph-container').width(), // nv.utils.windowSize().width/3,
|
||||||
height = $('.graph-container').height(), //nv.utils.windowSize().height/5,
|
height = $('.graph-container').height()*0.8, //nv.utils.windowSize().height/5,
|
||||||
chart = nv.models.pieChart()
|
chart = nv.models.pieChart()
|
||||||
.margin({top: 5, right: 75, bottom: 40, left: 85})
|
.margin({top: 5, right: 75, bottom: 40, left: 85})
|
||||||
.x(function(d) { return d.label; })
|
.x(function(d) { return d.label; })
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ angular.module('JobStatusGraphWidget', ['RestServices', 'Utilities'])
|
|||||||
period="month",
|
period="month",
|
||||||
job_type="all";
|
job_type="all";
|
||||||
|
|
||||||
html = "<div class=\"graph-container\">\n";
|
// html = "<div class=\"graph-container\">\n";
|
||||||
|
|
||||||
html +="<div class=\"row\">\n";
|
html = "<div class=\"row\">\n";
|
||||||
html += "<div id=\"job-status-title\" class=\"h6 col-xs-8 text-center\"><b>Job Status</b></div>\n"; // for All Jobs, Past Month
|
html += "<div id=\"job-status-title\" class=\"h6 col-xs-8 text-center\"><b>Job Status</b></div>\n"; // for All Jobs, Past Month
|
||||||
|
|
||||||
html += "<div class=\"h6 col-xs-2 \">\n";
|
html += "<div class=\"h6 col-xs-2 \">\n";
|
||||||
@@ -62,7 +62,7 @@ angular.module('JobStatusGraphWidget', ['RestServices', 'Utilities'])
|
|||||||
html += "<div class=\"job-status-graph\"><svg></svg></div>\n";
|
html += "<div class=\"job-status-graph\"><svg></svg></div>\n";
|
||||||
html += "</div>\n";
|
html += "</div>\n";
|
||||||
|
|
||||||
html += "</div>\n";
|
// html += "</div>\n";
|
||||||
|
|
||||||
function createGraph(){
|
function createGraph(){
|
||||||
|
|
||||||
|
|||||||
@@ -12,12 +12,12 @@
|
|||||||
<div id="dash-counts" class="col-sm-12 col-xs-12"></div>
|
<div id="dash-counts" class="col-sm-12 col-xs-12"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div id="dash-job-status-graph" class="left-side col-sm-6 col-xs-12"></div>
|
<div class="left-side col-sm-6 col-xs-12"><div id="dash-job-status-graph" class="graph-container"></div></div>
|
||||||
<div id="dash-host-status-graph" class="right-side col-sm-6 col-xs-12"></div>
|
<div class="right-side col-sm-6 col-xs-12"><div id="dash-host-status-graph" class="graph-container"></div></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div id="dash-jobs-list" class="left-side col-sm-6 col-xs-12"></div>
|
<div id="dash-jobs-list" class="left-side col-sm-6 col-xs-12"></div>
|
||||||
<div id="dash-host-count-graph" class="right-side col-sm-6 col-xs-12"></div>
|
<div class="right-side col-sm-6 col-xs-12"><div id="dash-host-count-graph" class="graph-container"></div></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user