mirror of
https://github.com/ansible/awx.git
synced 2026-02-21 13:10:11 -03:30
linted previous 2 pushes
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
angular.module('HostGraphWidget', ['RestServices', 'Utilities'])
|
angular.module('HostGraphWidget', ['RestServices', 'Utilities'])
|
||||||
.factory('HostGraph', ['$rootScope', '$compile', '$location', 'Rest', 'GetBasePath', 'ProcessErrors', 'Wait',
|
.factory('HostGraph', ['$rootScope', '$compile', '$location', 'Rest', 'GetBasePath', 'ProcessErrors', 'Wait',
|
||||||
function ($rootScope, $compile, $location, Rest, GetBasePath, ProcessErrors, Wait) {
|
function ($rootScope, $compile, $location, Rest, GetBasePath, ProcessErrors) {
|
||||||
return function (params) {
|
return function (params) {
|
||||||
|
|
||||||
var scope = params.scope,
|
var scope = params.scope,
|
||||||
@@ -45,53 +45,53 @@ angular.module('HostGraphWidget', ['RestServices', 'Utilities'])
|
|||||||
});
|
});
|
||||||
|
|
||||||
//return license;
|
//return license;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
function makeHostCountGraph(license){
|
function makeHostCountGraph(license){
|
||||||
url = GetBasePath('dashboard')+'graphs/';
|
url = GetBasePath('dashboard')+'graphs/';
|
||||||
var graphData = [];
|
var graphData = [];
|
||||||
|
|
||||||
//d3.json("static/js/jobstatusdata.json",function(error,data) {
|
//d3.json("static/js/jobstatusdata.json",function(error,data) {
|
||||||
d3.json(url, function(error,data) {
|
d3.json(url, function(error,data) {
|
||||||
// console.log(data);
|
|
||||||
graphData = [
|
|
||||||
{
|
|
||||||
"key" : "Hosts" ,
|
|
||||||
"color" : "#1778c3",
|
|
||||||
"values": data.hosts
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key" : "License" ,
|
|
||||||
"color" : "#171717",
|
|
||||||
"values": data.hosts
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
graphData.map(function(series) {
|
graphData = [
|
||||||
if(series.key==="Hosts"){
|
{
|
||||||
series.values = series.values.map(function(d) {
|
"key" : "Hosts" ,
|
||||||
return {
|
"color" : "#1778c3",
|
||||||
x: d[0],
|
"values": data.hosts
|
||||||
y: d[1]
|
},
|
||||||
};
|
{
|
||||||
});
|
"key" : "License" ,
|
||||||
}
|
"color" : "#171717",
|
||||||
if(series.key==="License"){
|
"values": data.hosts
|
||||||
series.values = series.values.map(function(d) {
|
}
|
||||||
return {
|
];
|
||||||
x: d[0],
|
|
||||||
y: license
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
graphData.map(function(series) {
|
||||||
return series;
|
if(series.key==="Hosts"){
|
||||||
|
series.values = series.values.map(function(d) {
|
||||||
|
return {
|
||||||
|
x: d[0],
|
||||||
|
y: d[1]
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if(series.key==="License"){
|
||||||
|
series.values = series.values.map(function(d) {
|
||||||
|
return {
|
||||||
|
x: d[0],
|
||||||
|
y: license
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
});
|
}
|
||||||
|
return series;
|
||||||
|
|
||||||
nv.addGraph({
|
});
|
||||||
generate: function() {
|
|
||||||
|
nv.addGraph({
|
||||||
|
generate: function() {
|
||||||
var width = nv.utils.windowSize().width/3,
|
var width = nv.utils.windowSize().width/3,
|
||||||
height = nv.utils.windowSize().height/5,
|
height = nv.utils.windowSize().height/5,
|
||||||
chart = nv.models.lineChart()
|
chart = nv.models.lineChart()
|
||||||
@@ -138,9 +138,9 @@ angular.module('HostGraphWidget', ['RestServices', 'Utilities'])
|
|||||||
return chart;
|
return chart;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
}
|
|
||||||
|
|
||||||
element = angular.element(document.getElementById(target));
|
element = angular.element(document.getElementById(target));
|
||||||
element.html(html);
|
element.html(html);
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
angular.module('JobStatusGraphWidget', ['RestServices', 'Utilities'])
|
angular.module('JobStatusGraphWidget', ['RestServices', 'Utilities'])
|
||||||
.factory('JobStatusGraph', ['$rootScope', '$compile', '$location' , 'Rest', 'GetBasePath', 'ProcessErrors', 'Wait',
|
.factory('JobStatusGraph', ['$rootScope', '$compile', '$location' , 'Rest', 'GetBasePath', 'ProcessErrors', 'Wait',
|
||||||
function ($rootScope, $compile , $location, Rest, GetBasePath, ProcessErrors, Wait) {
|
function ($rootScope, $compile , $location, Rest, GetBasePath) {
|
||||||
return function (params) {
|
return function (params) {
|
||||||
|
|
||||||
var scope = params.scope,
|
var scope = params.scope,
|
||||||
@@ -73,7 +73,7 @@ angular.module('JobStatusGraphWidget', ['RestServices', 'Utilities'])
|
|||||||
//d3.json("static/js/jobstatusdata.json",function(error,data) {
|
//d3.json("static/js/jobstatusdata.json",function(error,data) {
|
||||||
d3.json(url, function(error,data) {
|
d3.json(url, function(error,data) {
|
||||||
//console.log(data);
|
//console.log(data);
|
||||||
graphData = [
|
graphData = [
|
||||||
{
|
{
|
||||||
"color": "#1778c3",
|
"color": "#1778c3",
|
||||||
"key": "Successful",
|
"key": "Successful",
|
||||||
|
|||||||
Reference in New Issue
Block a user