mirror of
https://github.com/ansible/awx.git
synced 2026-01-16 12:20:45 -03:30
fixed resizing error with graphs on page load
This commit is contained in:
parent
91f26c294a
commit
50d962d666
@ -72,6 +72,13 @@ function Home($scope, $compile, $routeParams, $rootScope, $location, Wait, Dashb
|
||||
$scope.removeDashboardReady();
|
||||
}
|
||||
$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({
|
||||
scope: $scope,
|
||||
target: 'dash-counts',
|
||||
|
||||
@ -19,14 +19,14 @@ angular.module('HostGraphWidget', ['RestServices', 'Utilities'])
|
||||
html, element, url, license;
|
||||
|
||||
|
||||
html = "<div class=\"graph-container\">\n";
|
||||
html +="<div class=\"row\">\n";
|
||||
// html = "<div class=\"graph-container\">\n";
|
||||
html ="<div class=\"row\">\n";
|
||||
html += "<div class=\"h6 col-xs-8 text-center\"><b>Host Count</b></div>\n";
|
||||
html += "</div>\n";
|
||||
html +="<div class=\"row\">\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,
|
||||
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>\n";
|
||||
|
||||
@ -32,7 +32,7 @@ angular.module('HostPieChartWidget', ['RestServices', 'Utilities'])
|
||||
html += "<div class=\"host-pie-chart text-center\"><svg></svg></div>\n";
|
||||
html += "</div>\n";
|
||||
|
||||
html += "</div>\n";
|
||||
// html += "</div>\n";
|
||||
|
||||
|
||||
|
||||
@ -56,7 +56,7 @@ angular.module('HostPieChartWidget', ['RestServices', 'Utilities'])
|
||||
|
||||
nv.addGraph(function() {
|
||||
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()
|
||||
.margin({top: 5, right: 75, bottom: 40, left: 85})
|
||||
.x(function(d) { return d.label; })
|
||||
|
||||
@ -21,9 +21,9 @@ angular.module('JobStatusGraphWidget', ['RestServices', 'Utilities'])
|
||||
period="month",
|
||||
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 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>\n";
|
||||
|
||||
html += "</div>\n";
|
||||
// html += "</div>\n";
|
||||
|
||||
function createGraph(){
|
||||
|
||||
|
||||
@ -12,12 +12,12 @@
|
||||
<div id="dash-counts" class="col-sm-12 col-xs-12"></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div id="dash-job-status-graph" class="left-side col-sm-6 col-xs-12"></div>
|
||||
<div id="dash-host-status-graph" class="right-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 class="right-side col-sm-6 col-xs-12"><div id="dash-host-status-graph" class="graph-container"></div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user