diff --git a/awx/ui/static/js/helpers/Jobs.js b/awx/ui/static/js/helpers/Jobs.js
index d18b88626a..70dce3ccc1 100644
--- a/awx/ui/static/js/helpers/Jobs.js
+++ b/awx/ui/static/js/helpers/Jobs.js
@@ -84,6 +84,10 @@ angular.module('JobsHelper', ['Utilities', 'RestServices', 'FormGenerator', 'Job
list = scope.jobs;
}
job = Find({ list: list, key: 'id', val: id });
+<<<<<<< HEAD
+=======
+ // console.log('job type: ' + job.type);
+>>>>>>> added functionality for resizing graphs/jobs table, and changed dummy data to better reflect actual expected server response
if (job.type === 'job') {
$location.url('/jobs/' + job.id);
}
diff --git a/awx/ui/static/js/hostcount.json b/awx/ui/static/js/hostcount.json
index b22981e51f..0ef475d16d 100644
--- a/awx/ui/static/js/hostcount.json
+++ b/awx/ui/static/js/hostcount.json
@@ -1,7 +1,7 @@
[
{
"key" : "Hosts" ,
- "color" : "#00aa00",
+ "color" : "#1778c3",
"values" : [
[1340755200000 , 2] , [1340762400000 , 4] ,
[1340769600000 , 8] , [1340776800000 , 16] ,
diff --git a/awx/ui/static/js/jobstatusdata.json b/awx/ui/static/js/jobstatusdata.json
index 4cae136a29..5d8ff06e3a 100644
--- a/awx/ui/static/js/jobstatusdata.json
+++ b/awx/ui/static/js/jobstatusdata.json
@@ -1,7 +1,7 @@
[
{
- "key" : "OK" ,
- "color" : "#00aa00",
+ "key" : "Successful" ,
+ "color" : "#1778c3",
"values" : [
[1340755200000 , 100] , [1340762400000 , 101] ,
[1340769600000 , 102] , [1340776800000 , 103] ,
@@ -13,8 +13,8 @@
]
},
{
- "key" : "Changed" ,
- "color" : "#FF9900",
+ "key" : "Failed" ,
+ "color" : "#aa0000",
"values" : [
[1340755200000 , 50] , [1340762400000 , 50] ,
[1340769600000 , 50] , [1340776800000 , 50] ,
@@ -24,19 +24,6 @@
[1340827200000 , 50] , [1340834400000 , 50] ,
[1343347200000 , 50]
]
- },
- {
- "key" : "Failed" ,
- "color" : "#aa0000",
- "values" : [
- [1340755200000 , 15] , [1340762400000 , 15] ,
- [1340769600000 , 15] , [1340776800000 , 15] ,
- [1340784000000 , 15] , [1340791200000 , 15] ,
- [1340798400000 , 15] , [1340805600000 , 15] ,
- [1340812800000 , 15] , [1340820000000 , 15] ,
- [1340827200000 , 15] , [1340834400000 , 15] ,
- [1343347200000 , 15]
- ]
}
]
diff --git a/awx/ui/static/js/widgets/DashboardCharts.js b/awx/ui/static/js/widgets/DashboardCharts.js
index 733bad0c52..d7c9ac94fc 100644
--- a/awx/ui/static/js/widgets/DashboardCharts.js
+++ b/awx/ui/static/js/widgets/DashboardCharts.js
@@ -20,20 +20,21 @@ angular.module('DashboardChartsWidget', ['RestServices', 'Utilities'])
html, element;
- html = "
\n";
- html += "
\n";
+ // html = "
\n";
+ html = "
\n";
- html += "
\n";
- html += "\n";
- html += "| Job Status Graph | \n";
- html += "Hosts | \n";
+ html += "\n";
+ html += " \n";
+ html += "| Job Status | \n";
+ html += "Hosts vs License Agreement | \n";
html += "
\n";
html += "\n";
html += " | \n";
html += " | \n";
html += "
\n";
html += "
\n";
-
+ html += "\n";
+ // html += "\n";
function makeJobStatusGraph(){
d3.json("static/js/jobstatusdata.json",function(error,data) {
@@ -45,61 +46,57 @@ angular.module('DashboardChartsWidget', ['RestServices', 'Utilities'])
nv.addGraph({
generate: function() {
- var width = nv.utils.windowSize().width - 40,
- height = nv.utils.windowSize().height - 40,
+ var width = nv.utils.windowSize().width/3,
+ height = nv.utils.windowSize().height/4,
chart = nv.models.lineChart()
- // .margin({top: 20, right: 80, bottom: 50, left: 50}) //Adjust chart margins to give the x-axis some breathing room.
+ .margin({top: 5, right: 75, bottom: 40, left: 80}) //Adjust chart margins to give the x-axis some breathing room.
.x(function(d,i) { return i; })
.useInteractiveGuideline(true) //We want nice looking tooltips and a guideline!
.transitionDuration(350) //how fast do you want the lines to transition?
.showLegend(true) //Show the legend, allowing users to turn on/off line series.
.showYAxis(true) //Show the y-axis
.showXAxis(true) //Show the x-axis
+ // .width(width)
+ // .height(height)
;
chart.xAxis
- .axisLabel("time")
+ .axisLabel("Tme").showMaxMin(true)
.tickFormat(function(d) {
var dx = data[0].values[d] && data[0].values[d].x || 0;
- return dx ? d3.time.format('%x')(new Date(dx)) : '';
+ return dx ? d3.time.format('%m/%d')(new Date(dx)) : '';
});
chart.yAxis //Chart y-axis settings
.axisLabel('Jobs')
.tickFormat(d3.format('.f'));
- d3.select('.job-status-graph svg')
- .attr('width', width)
- .attr('height', height)
- .datum(data)
- .call(chart);
+ // d3.select('.job-status-graph svg')
+ // .attr('width', width)
+ // .attr('height', height)
+ // .datum(data)
+ // .call(chart);
+ d3.select('.job-status-graph svg')
+ .datum(data).transition()
+ .attr('width', width)
+ .attr('height', height)
+ .duration(500)
+ .call(chart)
+ .style({
+ // 'width': width,
+ // 'height': height,
+ "font-family": 'Open Sans',
+ "font-style": "normal",
+ "font-weight":400,
+ "src": "url(/static/fonts/OpenSans-Regular.ttf)"
+ });
+
+
+ nv.utils.windowResize(chart.update);
return chart;
},
- // callback: function(graph) {
- // window.onresize = function() {
- // var width = nv.utils.windowSize().width - 40,
- // height = nv.utils.windowSize().height - 40,
- // margin = graph.margin();
-
- // if (width < margin.left + margin.right + 20)
- // width = margin.left + margin.right + 20;
-
- // if (height < margin.top + margin.bottom + 20)
- // height = margin.top + margin.bottom + 20;
-
-
- // graph
- // .width(width)
- // .height(height);
-
- // d3.select('.job-status-graph svg')
- // .attr('width', width)
- // .attr('height', height)
- // .call(graph);
- // };
- // }
});
});
}
@@ -114,10 +111,10 @@ angular.module('DashboardChartsWidget', ['RestServices', 'Utilities'])
nv.addGraph({
generate: function() {
- var width = nv.utils.windowSize().width - 40,
- height = nv.utils.windowSize().height - 40,
+ var width = nv.utils.windowSize().width/3,
+ height = nv.utils.windowSize().height/4,
chart = nv.models.lineChart()
- // .margin({top: 20, right: 80, bottom: 50, left: 50}) //Adjust chart margins to give the x-axis some breathing room.
+ .margin({top: 15, right: 75, bottom: 40, left: 80})
.x(function(d,i) { return i ;})
.useInteractiveGuideline(true) //We want nice looking tooltips and a guideline!
.transitionDuration(350) //how fast do you want the lines to transition?
@@ -126,93 +123,38 @@ angular.module('DashboardChartsWidget', ['RestServices', 'Utilities'])
.showXAxis(true) //Show the x-axis
;
- chart.xAxis
- .axisLabel("time")
+ chart.xAxis
+ .axisLabel("Time")
.tickFormat(function(d) {
- var dx = data[0].values[d] && data[0].values[d].x || 0;
- return dx ? d3.time.format('%x')(new Date(dx)) : '';
- });
+ var dx = data[0].values[d] && data[0].values[d].x || 0;
+ return dx ? d3.time.format('%m/%d')(new Date(dx)) : '';
+ });
- chart.yAxis //Chart y-axis settings
- .axisLabel('Jobs')
+ chart.yAxis //Chart y-axis settings
+ .axisLabel('Hosts')
.tickFormat(d3.format('.f'));
- d3.select('.host-count-graph svg')
- .attr('width', width)
- .attr('height', height)
- .datum(data)
- .call(chart);
+ d3.select('.host-count-graph svg')
+ .datum(data).transition()
+ .attr('width', width)
+ .attr('height', height)
+ .duration(500)
+ .call(chart)
+ .style({
+ // 'width': width,
+ // 'height': height,
+ "font-family": 'Open Sans',
+ "font-style": "normal",
+ "font-weight":400,
+ "src": "url(/static/fonts/OpenSans-Regular.ttf)"
+ });
+ nv.utils.windowResize(chart.update);
+ return chart;
+ },
- return chart;
- },
- // callback: function(graph) {
- // window.onresize = function() {
- // var width = nv.utils.windowSize().width - 40,
- // height = nv.utils.windowSize().height - 40,
- // margin = graph.margin();
-
-
- // if (width < margin.left + margin.right + 20)
- // width = margin.left + margin.right + 20;
-
- // if (height < margin.top + margin.bottom + 20)
- // height = margin.top + margin.bottom + 20;
-
-
- // graph
- // .width(width)
- // .height(height);
-
- // d3.select('.job-status-graph svg')
- // .attr('width', width)
- // .attr('height', height)
- // .call(graph);
- // };
- // }
});
});
}
- // var chart = nv.models.lineChart()
- // // .margin({top: 20, right: 80, bottom: 50, left: 50}) //Adjust chart margins to give the x-axis some breathing room.
- // .x(function(d,i) { return i })
- // .useInteractiveGuideline(true) //We want nice looking tooltips and a guideline!
- // .transitionDuration(350) //how fast do you want the lines to transition?
- // .showLegend(true) //Show the legend, allowing users to turn on/off line series.
- // .showYAxis(true) //Show the y-axis
- // .showXAxis(true) //Show the x-axis
- // ;
-
- // chart.width(($(window).width())/3);
- // chart.height(($(window).height())/3);
- // chart.xAxis
- // .axisLabel("time")
- // .tickFormat(function(d) {
- // var dx = data[0].values[d] && data[0].values[d].x || 0;
- // return dx ? d3.time.format('%x')(new Date(dx)) : '';
- // });
-
- // chart.yAxis //Chart y-axis settings
- // .axisLabel('Jobs')
- // .tickFormat(d3.format('.f'));
-
- // /* Done setting the chart up? Time to render it!*/
- // //var myData = sinAndCos(); //You need data...
-
- // d3.select('.job-status-graph svg') //Select the