Copyright JS files and removing unlicensed files

Adding the Copyright and All Rights Reserved to the JS files, as well as removing pwdmeter and 3dDonut chart (in lieu of d3.js donut chart)

adding the legend and getting pie chart to donut

adding data labels to donut chart

working legend and tooltip

job detail donut

Ansible Copyright added to beginning of all JS files

removing pwdmeter and d3donut

fixing merge conflicts
This commit is contained in:
Jared Tabor
2015-05-27 11:39:16 -04:00
parent c2a5b21b9e
commit d7e2614760
214 changed files with 1366 additions and 4103 deletions

View File

@@ -1,11 +1,10 @@
/************************************ /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* app.js * All Rights Reserved
* *************************************************/
* Declare the Tower app, define routes and perform initialization chores.
*
*/
var urlPrefix; var urlPrefix;

View File

@@ -1,4 +1,9 @@
export default ['$window', function($window) { /*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
export default ['$window', function($window) {
var ua = $window.navigator.userAgent, var ua = $window.navigator.userAgent,
browserName; browserName;

View File

@@ -1,4 +1,9 @@
import getBrowserData from './browser-data.factory'; /*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
import getBrowserData from './browser-data.factory';
import ngApp from './ng-app.directive'; import ngApp from './ng-app.directive';
export default export default

View File

@@ -1,3 +1,9 @@
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
/* jshint unused: vars */ /* jshint unused: vars */
export default ['browserData', function(browserData) { export default ['browserData', function(browserData) {

View File

@@ -1,7 +1,12 @@
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
/********************************************************************** /**********************************************************************
*
* Copyright (c) 2014 AnsibleWorks, Inc.
*
* config.js * config.js
* *
* Gobal configuration variables for controlling application behavior. * Gobal configuration variables for controlling application behavior.

View File

@@ -1,11 +1,9 @@
/************************************************* /*************************************************
* Copyright (c) 2015 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* Adhoc.js * All Rights Reserved
* *************************************************/
* Controller functions for the Adhoc model.
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name controllers.function:Adhoc * @name controllers.function:Adhoc

View File

@@ -1,7 +1,9 @@
/************************************ /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
*/ * All Rights Reserved
*************************************************/
/** /**
* @ngdoc overview * @ngdoc overview
* @name controllers * @name controllers

View File

@@ -1,12 +1,8 @@
/************************************ /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* * All Rights Reserved
* Authentication.js *************************************************/
*
* Controller functions for user authentication.
*
*/
/** /**
* @ngdoc function * @ngdoc function

View File

@@ -1,11 +1,9 @@
/************************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* Credentials.js * All Rights Reserved
* *************************************************/
* Controller functions for the Credential model.
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name controllers.function:Credentials * @name controllers.function:Credentials

View File

@@ -1,13 +1,8 @@
/************************************ /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* * All Rights Reserved
* Home.js *************************************************/
*
* Controller functions for Home tab
*
*/
/** /**
* @ngdoc function * @ngdoc function

View File

@@ -1,12 +1,9 @@
/************************************ /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* * All Rights Reserved
* Inventories.js *************************************************/
*
* Controller functions for the Inventory model.
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name controllers.function:Inventories * @name controllers.function:Inventories

View File

@@ -1,9 +1,9 @@
/************************************ /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* JobDetail.js * All Rights Reserved
* *************************************************/
*/
/** /**
* @ngdoc function * @ngdoc function
* @name controllers.function:JobDetail * @name controllers.function:JobDetail

View File

@@ -1,12 +1,9 @@
/************************************ /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* * All Rights Reserved
* JobEvents.js *************************************************/
*
* Controller functions for the Job Events model.
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name controllers.function:JobEvent * @name controllers.function:JobEvent

View File

@@ -1,12 +1,9 @@
/************************************ /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* * All Rights Reserved
* JobHosts.js *************************************************/
*
* Controller functions for the Job Hosts Summary model.
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name controllers.function:JobHosts * @name controllers.function:JobHosts

View File

@@ -1,9 +1,9 @@
/************************************ /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* JobStdout.js * All Rights Reserved
* *************************************************/
*/
/** /**
* @ngdoc function * @ngdoc function
* @name controllers.function:JobStdout * @name controllers.function:JobStdout

View File

@@ -1,12 +1,9 @@
/************************************ /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* * All Rights Reserved
* JobTemplates.js *************************************************/
*
* Controller functions for the Job Template model.
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name controllers.function:JobTemplate * @name controllers.function:JobTemplate

View File

@@ -1,12 +1,9 @@
/************************************ /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* * All Rights Reserved
* Jobs.js *************************************************/
*
* Controller functions for the Inventory model.
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name controllers.function:Jobs * @name controllers.function:Jobs

View File

@@ -1,429 +0,0 @@
/************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
*
*
* Jobs.js
*
* Controller functions for the Job model.
*
*/
'use strict';
function JobsListCtrl($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, JobList, GenerateList, LoadBreadCrumbs, Prompt,
SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, LookUpInit, SubmitJob, FormatDate, Refresh,
JobStatusToolTip, Empty, Wait) {
ClearScope();
var list = JobList,
defaultUrl = GetBasePath('jobs'),
generator = GenerateList,
opt;
generator.inject(list, { mode: 'edit', scope: $scope });
$rootScope.flashMessage = null;
$scope.selected = [];
if ($scope.removePostRefresh) {
$scope.removePostRefresh();
}
$scope.removePostRefresh = $scope.$on('PostRefresh', function () {
var i, cDate;
$("tr.success").each(function () {
// Make sure no rows have a green background
var ngc = $(this).attr('ng-class');
$scope[ngc] = "";
});
if ($scope.jobs && $scope.jobs.length) {
for (i = 0; i < $scope.jobs.length; i++) {
// Convert created date to local time zone
cDate = new Date($scope.jobs[i].created);
$scope.jobs[i].created = FormatDate(cDate);
// Set tooltip and link
$scope.jobs[i].statusBadgeToolTip = JobStatusToolTip($scope.jobs[i].status) +
" Click to view status details.";
$scope.jobs[i].statusLinkTo = '/#/jobs/' + $scope.jobs[i].id;
}
}
});
if ($routeParams.job_host_summaries__host) {
defaultUrl += '?job_host_summaries__host=' + $routeParams.job_host_summaries__host;
} else if ($routeParams.inventory__int && $routeParams.status) {
defaultUrl += '?inventory__int=' + $routeParams.inventory__int + '&status=' +
$routeParams.status;
}
SearchInit({
scope: $scope,
set: 'jobs',
list: list,
url: defaultUrl
});
PaginateInit({
scope: $scope,
list: list,
url: defaultUrl
});
// Called from Inventories page, failed jobs link. Find jobs for selected inventory.
if ($routeParams.inventory__int) {
$scope[list.iterator + 'SearchField'] = 'inventory';
$scope[list.iterator + 'SearchValue'] = $routeParams.inventory__int;
$scope[list.iterator + 'SearchFieldLabel'] = 'Inventory ID';
}
if ($routeParams.id__int) {
$scope[list.iterator + 'SearchField'] = 'id';
$scope[list.iterator + 'SearchValue'] = $routeParams.id__int;
$scope[list.iterator + 'SearchFieldLabel'] = 'Job ID';
}
if ($routeParams.status) {
$scope[list.iterator + 'SearchField'] = 'status';
$scope[list.iterator + 'SelectShow'] = true;
$scope[list.iterator + 'SearchSelectOpts'] = list.fields.status.searchOptions;
$scope[list.iterator + 'SearchFieldLabel'] = list.fields.status.label.replace(/<br>/g, ' ');
for (opt in list.fields.status.searchOptions) {
if (list.fields.status.searchOptions[opt].value === $routeParams.status) {
$scope[list.iterator + 'SearchSelectValue'] = list.fields.status.searchOptions[opt];
break;
}
}
}
$scope.search(list.iterator);
LoadBreadCrumbs();
$scope.refresh = function () {
Wait('start');
$scope.jobLoading = false;
Refresh({ scope: $scope, set: 'jobs', iterator: 'job', url: $scope.current_url });
};
$scope.refreshJob = $scope.refresh;
$scope.editJob = function (id, name) {
LoadBreadCrumbs({ path: '/jobs/' + id, title: id + ' - ' + name });
$location.path($location.path() + '/' + id);
};
$scope.viewEvents = function (id, name) {
LoadBreadCrumbs({ path: '/jobs/' + id, title: id + ' - ' + name });
$location.path($location.path() + '/' + id + '/job_events');
};
$scope.viewSummary = function (id, name) {
LoadBreadCrumbs({ path: '/jobs/' + id, title: id + ' - ' + name });
$location.path($location.path() + '/' + id + '/job_host_summaries');
};
$scope.deleteJob = function (id) {
Rest.setUrl(defaultUrl + id + '/');
Rest.get()
.success(function (data) {
var action, url, action_label, hdr;
if (data.status === 'pending' || data.status === 'running' || data.status === 'waiting') {
url = data.related.cancel;
action_label = 'cancel';
hdr = 'Cancel Job';
} else {
url = defaultUrl + id + '/';
action_label = 'delete';
hdr = 'Delete Job';
}
action = function () {
Rest.setUrl(url);
if (action_label === 'cancel') {
Rest.post()
.success(function () {
$('#prompt-modal').modal('hide');
$scope.search(list.iterator);
})
.error(function (data, status) {
$('#prompt-modal').modal('hide');
ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Call to ' + url +
' failed. POST returned status: ' + status });
});
} else {
Rest.destroy()
.success(function () {
$('#prompt-modal').modal('hide');
$scope.search(list.iterator);
})
.error(function (data, status) {
$('#prompt-modal').modal('hide');
ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Call to ' + url +
' failed. DELETE returned status: ' + status });
});
}
};
Prompt({
hdr: hdr,
body: 'Are you sure you want to ' + action_label + ' job ' + id + '?',
action: action
});
})
.error(function (data, status) {
ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to get job details. GET returned status: ' + status });
});
};
$scope.submitJob = function (id, template) {
SubmitJob({ scope: $scope, id: id, template: template });
};
}
JobsListCtrl.$inject = ['$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'JobList',
'GenerateList', 'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope',
'ProcessErrors', 'GetBasePath', 'LookUpInit', 'SubmitJob', 'FormatDate', 'Refresh', 'JobStatusToolTip',
'Empty', 'Wait'
];
function JobsEdit($scope, $rootScope, $compile, $location, $log, $routeParams, JobForm, JobTemplateForm, GenerateForm, Rest,
Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit, RelatedPaginateInit, ReturnToCaller, ClearScope, InventoryList,
CredentialList, ProjectList, LookUpInit, PromptPasswords, GetBasePath, md5Setup, FormatDate, JobStatusToolTip, Wait, Empty,
ParseVariableString) {
ClearScope();
var defaultUrl = GetBasePath('jobs'),
generator = GenerateForm,
id = $routeParams.id,
loadingFinishedCount = 0,
templateForm = {};
generator.inject(JobForm, { mode: 'edit', related: true, scope: $scope });
$scope.job_id = id;
$scope.parseType = 'yaml';
$scope.statusSearchSpin = false;
$scope.disableParseSelection = true;
function getPlaybooks(project, playbook) {
if (!Empty(project)) {
var url = GetBasePath('projects') + project + '/playbooks/';
Rest.setUrl(url);
Rest.get()
.success(function (data) {
var i;
$scope.playbook_options = [];
for (i = 0; i < data.length; i++) {
$scope.playbook_options.push(data[i]);
}
for (i = 0; i < $scope.playbook_options.length; i++) {
if ($scope.playbook_options[i] === playbook) {
$scope.playbook = $scope.playbook_options[i];
}
}
$scope.$emit('jobTemplateLoadFinished');
})
.error(function () {
$scope.$emit('jobTemplateLoadFinished');
});
} else {
$scope.$emit('jobTemplateLoadFinished');
}
}
// Retrieve each related set and populate the playbook list
if ($scope.jobLoadedRemove) {
$scope.jobLoadedRemove();
}
$scope.jobLoadedRemove = $scope.$on('jobLoaded', function (e, related_cloud_credential, project, playbook) {
getPlaybooks(project, playbook);
//$scope[form.name + 'ReadOnly'] = ($scope.status === 'new') ? false : true;
//$('#forks-slider').slider("option", "value", $scope.forks);
//$('#forks-slider').slider("disable");
//$('input[type="checkbox"]').attr('disabled', 'disabled');
//$('input[type="radio"]').attr('disabled', 'disabled');
//$('#host_config_key-gen-btn').attr('disabled', 'disabled');
//$('textarea').attr('readonly', 'readonly');
// Get job template and display/hide host callback fields
/*Rest.setUrl($scope.template_url);
Rest.get()
.success(function (data) {
var dft = (data.host_config_key) ? 'true' : 'false';
$scope.host_config_key = data.host_config_key;
md5Setup({
scope: $scope,
master: master,
check_field: 'allow_callbacks',
default_val: dft
});
$scope.callback_url = (data.related) ? data.related.callback : '<< Job template not found >>';
$scope.$emit('jobTemplateLoadFinished');
})
.error(function () {
Wait('stop');
$scope.callback_url = '<< Job template not found >>';
});
*/
if (related_cloud_credential) {
//Get the name of the cloud credential
Rest.setUrl(related_cloud_credential);
Rest.get()
.success(function (data) {
$scope.cloud_credential_name = data.name;
$scope.$emit('jobTemplateLoadFinished');
})
.error(function (data, status) {
ProcessErrors($scope, data, status, null, { hdr: 'Error!',
msg: 'Failed to related cloud credential. GET returned status: ' + status });
});
} else {
$scope.$emit('jobTemplateLoadFinished');
}
});
// Turn off 'Wait' after both cloud credential and playbook list come back
if ($scope.removeJobTemplateLoadFinished) {
$scope.removeJobTemplateLoadFinished();
}
$scope.removeJobTemplateLoadFinished = $scope.$on('jobTemplateLoadFinished', function () {
loadingFinishedCount++;
if (loadingFinishedCount >= 2) {
// The initial template load finished. Now load related jobs, which
// will turn off the 'working' spinner.
Wait('stop');
}
});
// Our job type options
$scope.job_type_options = [{
value: 'run',
label: 'Run'
}, {
value: 'check',
label: 'Check'
}];
$scope.verbosity_options = [{
value: 0,
label: 'Default'
}, {
value: 1,
label: 'Verbose'
}, {
value: 3,
label: 'Debug'
}];
$scope.playbook_options = null;
$scope.playbook = null;
function calcRows(content) {
var n = content.match(/\n/g),
rows = (n) ? n.length : 1;
return (rows > 15) ? 15 : rows;
}
// Retrieve detail record and prepopulate the form
Wait('start');
Rest.setUrl(defaultUrl + ':id/');
Rest.get({ params: { id: id } })
.success(function (data) {
var i, fld;
LoadBreadCrumbs();
$scope.status = data.status;
$scope.created = FormatDate(data.created);
$scope.result_stdout = data.result_stdout;
$scope.result_traceback = data.result_traceback;
$scope.stdout_rows = calcRows($scope.result_stdout);
$scope.traceback_rows = calcRows($scope.result_traceback);
// Now load the job template form
templateForm.addTitle = 'Create Job Templates';
templateForm.editTitle = '{{ name }}';
templateForm.name = 'job_templates';
templateForm.twoColumns = true;
templateForm.fields = angular.copy(JobTemplateForm.fields);
for (fld in templateForm.fields) {
templateForm.fields[fld].readonly = true;
}
$('#ui-accordion-jobs-collapse-0-panel-1').find('div').attr('id','job-template-container');
generator.inject(templateForm, { mode: 'edit', id: 'job-template-container', scope: $scope, breadCrumbs: false });
for (fld in templateForm.fields) {
if (fld !== 'variables' && data[fld] !== null && data[fld] !== undefined) {
if (JobTemplateForm.fields[fld].type === 'select') {
if ($scope[fld + '_options'] && $scope[fld + '_options'].length > 0) {
for (i = 0; i < $scope[fld + '_options'].length; i++) {
if (data[fld] === $scope[fld + '_options'][i].value) {
$scope[fld] = $scope[fld + '_options'][i];
}
}
} else {
$scope[fld] = data[fld];
}
} else {
$scope[fld] = data[fld];
}
}
if (fld === 'variables') {
$scope.variables = ParseVariableString(data.extra_vars);
}
if (JobTemplateForm.fields[fld].type === 'lookup' && data.summary_fields[JobTemplateForm.fields[fld].sourceModel]) {
$scope[JobTemplateForm.fields[fld].sourceModel + '_' + JobTemplateForm.fields[fld].sourceField] =
data.summary_fields[JobTemplateForm.fields[fld].sourceModel][JobTemplateForm.fields[fld].sourceField];
}
}
$scope.id = data.id;
$scope.name = (data.summary_fields && data.summary_fields.job_template) ? data.summary_fields.job_template.name : '';
$scope.statusToolTip = JobStatusToolTip(data.status);
$scope.url = data.url;
$scope.project = data.project;
$scope.$emit('jobLoaded', data.related.cloud_credential, data.project, data.playbook);
})
.error(function (data, status) {
ProcessErrors($scope, data, status, null, { hdr: 'Error!',
msg: 'Failed to retrieve job: ' + $routeParams.id + '. GET status: ' + status });
});
$scope.refresh = function () {
Wait('start');
Rest.setUrl(defaultUrl + id + '/');
Rest.get()
.success(function (data) {
$scope.status = data.status;
$scope.result_stdout = data.result_stdout;
$scope.result_traceback = data.result_traceback;
$scope.stdout_rows = calcRows($scope.result_stdout);
$scope.traceback_rows = calcRows($scope.result_traceback);
Wait('stop');
})
.error(function (data, status) {
ProcessErrors($scope, data, status, null, { hdr: 'Error!',
msg: 'Attempt to load job failed. GET returned status: ' + status });
});
};
$scope.jobSummary = function () {
$location.path('/jobs/' + id + '/job_host_summaries');
};
$scope.jobEvents = function () {
$location.path('/jobs/' + id + '/job_events');
};
}
JobsEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'JobForm', 'JobTemplateForm',
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit', 'RelatedPaginateInit',
'ReturnToCaller', 'ClearScope', 'InventoryList', 'CredentialList', 'ProjectList', 'LookUpInit', 'PromptPasswords',
'GetBasePath', 'md5Setup', 'FormatDate', 'JobStatusToolTip', 'Wait', 'Empty', 'ParseVariableString'
];

View File

@@ -1,12 +1,9 @@
/************************************ /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* * All Rights Reserved
* Organizations.js *************************************************/
*
* Controller functions for Organization model.
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name controllers.function:Organizations * @name controllers.function:Organizations

View File

@@ -1,12 +1,9 @@
/************************************ /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* * All Rights Reserved
* Permissions.js *************************************************/
*
* Controller functions for Permissions model.
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name controllers.function:Permissions * @name controllers.function:Permissions

View File

@@ -1,13 +1,8 @@
/************************************ /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* * All Rights Reserved
* Portal.js *************************************************/
*
* Controller functions for portal mode
*
*/
/** /**
* @ngdoc function * @ngdoc function

View File

@@ -1,12 +1,9 @@
/************************************ /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* * All Rights Reserved
* Projects.js *************************************************/
*
* Controller functions for the Projects model.
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name controllers.function:Projects * @name controllers.function:Projects

View File

@@ -1,12 +1,9 @@
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
/************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
*
* Schedules.js
*
* Controller functions for the Schedule model.
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name controllers.function:Schedules * @name controllers.function:Schedules

View File

@@ -1,10 +1,9 @@
/************************************ /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* Sockets.js * All Rights Reserved
* SocketsController- simple test of socket connection *************************************************/
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name controllers.function:Sockets * @name controllers.function:Sockets

File diff suppressed because it is too large Load Diff

View File

@@ -1,12 +1,9 @@
/************************************ /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* * All Rights Reserved
* Teams.js *************************************************/
*
* Controller functions for the Team model.
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name controllers.function:Teams * @name controllers.function:Teams

View File

@@ -1,11 +1,9 @@
/******************************************** /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* Users.js * All Rights Reserved
* *************************************************/
* Controller functions for User model.
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name controllers.function:Users * @name controllers.function:Users

View File

@@ -1,3 +1,10 @@
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
export default function() { export default function() {

View File

@@ -1,4 +1,10 @@
export default /*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
export default
[ '$window', [ '$window',
AutoSizeModule AutoSizeModule
]; ];

View File

@@ -1,4 +1,10 @@
export default /*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
export default
[ '$compile', [ '$compile',
'$window', '$window',
'adjustGraphSize', 'adjustGraphSize',

View File

@@ -1,4 +1,10 @@
export default /*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
export default
[ '$rootScope', [ '$rootScope',
'$compile', '$compile',
'$location' , '$location' ,

View File

@@ -1,3 +1,9 @@
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
export default export default
["Rest", ["Rest",
"GetBasePath", "GetBasePath",

View File

@@ -1,3 +1,9 @@
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
/********************************************* /*********************************************
* @ngdoc function * @ngdoc function
* @name __deferLoadIfEnabled * @name __deferLoadIfEnabled

View File

@@ -1,2 +1,8 @@
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
import 'tower/shared/multi-select-list/main.js'; import 'tower/shared/multi-select-list/main.js';
import 'tower/shared/route-extensions/main.js'; import 'tower/shared/route-extensions/main.js';

View File

@@ -1,3 +1,9 @@
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
import sanitizeFilter from 'tower/shared/xss-sanitizer.filter'; import sanitizeFilter from 'tower/shared/xss-sanitizer.filter';
import capitalizeFilter from 'tower/shared/capitalize.filter'; import capitalizeFilter from 'tower/shared/capitalize.filter';
import longDateFilter from 'tower/shared/long-date.filter'; import longDateFilter from 'tower/shared/long-date.filter';

View File

@@ -1,3 +1,9 @@
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
import ActivityDetail from "tower/forms/ActivityDetail"; import ActivityDetail from "tower/forms/ActivityDetail";
import Credentials from "tower/forms/Credentials"; import Credentials from "tower/forms/Credentials";
import Adhoc from "tower/forms/Adhoc"; import Adhoc from "tower/forms/Adhoc";

View File

@@ -1,10 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* ActivityDetail.js * All Rights Reserved
* Form definition for Activity Stream detail *************************************************/
*
*/
/** /**
* @ngdoc overview * @ngdoc overview
* @name forms * @name forms

View File

@@ -1,10 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2015 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* Adhoc.js * All Rights Reserved
* Form definition for the Adhoc model. *************************************************/
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name forms.function:Adhoc * @name forms.function:Adhoc

View File

@@ -1,10 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2015 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* Credentials.js * All Rights Reserved
* Form definition for Credential model *************************************************/
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name forms.function:Credentials * @name forms.function:Credentials

View File

@@ -1,11 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* Organization.js * All Rights Reserved
* Form definition for Organization model *************************************************/
*
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name forms.function:CustomInventory * @name forms.function:CustomInventory

View File

@@ -1,9 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* JobEventsForm.js * All Rights Reserved
* *************************************************/
*/
/** /**
* @ngdoc function * @ngdoc function
* @name forms.function:EventsViewer * @name forms.function:EventsViewer

View File

@@ -1,11 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* Groups.js * All Rights Reserved
* Form definition for Group model *************************************************/
*
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name forms.function:Groups * @name forms.function:Groups

View File

@@ -1,11 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* HostGroups.js * All Rights Reserved
* Form definition for Host model *************************************************/
*
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name forms.function:HostGroups * @name forms.function:HostGroups
@@ -56,4 +54,3 @@ export default
related: { } related: { }
}); //UserForm }); //UserForm

View File

@@ -1,11 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* Hosts.js * All Rights Reserved
* Form definition for Host model *************************************************/
*
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name forms.function:Hosts * @name forms.function:Hosts

View File

@@ -1,11 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* Inventories.js * All Rights Reserved
* Form definition for User model *************************************************/
*
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name forms.function:Inventories * @name forms.function:Inventories

View File

@@ -1,11 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* InventoryStatus.js * All Rights Reserved
* *************************************************/
* Use to show inventory sync status
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name forms.function:InventoryStatus * @name forms.function:InventoryStatus

View File

@@ -1,11 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* JobEventData.js * All Rights Reserved
* Form definition for Job Events -JSON view *************************************************/
*
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name forms.function:JobEventData * @name forms.function:JobEventData

View File

@@ -1,11 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* JobSummary.js * All Rights Reserved
* *************************************************/
* Display job status info in a dialog
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name forms.function:JobSummary * @name forms.function:JobSummary

View File

@@ -1,12 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* JobTemplates.js * All Rights Reserved
* Form definition for Job Template model *************************************************/
*
* To get the JobTemplateForm object: JobTemplateForm();
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name forms.function:JobTemplate * @name forms.function:JobTemplate

View File

@@ -1,11 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* JobVarsPrompt.js * All Rights Reserved
* *************************************************/
* Form definition used during job submission to prompt for extra vars
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name forms.function:JobVarsPrompt * @name forms.function:JobVarsPrompt

View File

@@ -1,11 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* Jobs.js * All Rights Reserved
* Form definition for Jobs model *************************************************/
*
* @dict
*/
/** /**
* @ngdoc function * @ngdoc function
* @name forms.function:Jobs * @name forms.function:Jobs

View File

@@ -1,10 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* LicenseForm.js * All Rights Reserved
* *************************************************/
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name forms.function:LicenseForm * @name forms.function:LicenseForm

View File

@@ -1,11 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* License.js * All Rights Reserved
* Form definition for Organization model *************************************************/
*
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name forms.function:LicenseUpdate * @name forms.function:LicenseUpdate

View File

@@ -1,11 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* LogViewerOptions.js * All Rights Reserved
* *************************************************/
* Form definition for LogViewer.js helper
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name forms.function:LogViewerOptions * @name forms.function:LogViewerOptions

View File

@@ -1,11 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* LogViewerStatus.js * All Rights Reserved
* *************************************************/
* Form definition for LogViewer.js helper
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name forms.function:LogViewerStatus * @name forms.function:LogViewerStatus

View File

@@ -1,11 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* Organization.js * All Rights Reserved
* Form definition for Organization model *************************************************/
*
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name forms.function:Organizations * @name forms.function:Organizations

View File

@@ -1,12 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* Permissions.js * All Rights Reserved
* *************************************************/
* Form definition for Projects model
*
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name forms.function:Permissions * @name forms.function:Permissions

View File

@@ -1,11 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* ProjectStatus.js * All Rights Reserved
* Form definition for Project Status -JSON view *************************************************/
*
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name forms.function:ProjectStatus * @name forms.function:ProjectStatus

View File

@@ -1,12 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* Projects.js * All Rights Reserved
* *************************************************/
* Form definition for Projects model
*
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name forms.function:Projects * @name forms.function:Projects

View File

@@ -1,11 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* Groups.js * All Rights Reserved
* Form definition for Group model *************************************************/
*
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name forms.function:Source * @name forms.function:Source

View File

@@ -1,11 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* SurveyMaker.js * All Rights Reserved
* Form definition for survey maker model *************************************************/
*
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name forms.function:SurveyMaker * @name forms.function:SurveyMaker

View File

@@ -1,11 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* Inventories.js * All Rights Reserved
* Form definition for question model *************************************************/
*
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name forms.function:Questions * @name forms.function:Questions

View File

@@ -1,11 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* Teams.js * All Rights Reserved
* *************************************************/
* Form definition for Team model
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name forms.function:Teams * @name forms.function:Teams

View File

@@ -1,11 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* Users.js * All Rights Reserved
* Form definition for User model *************************************************/
*
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name forms.function:Users * @name forms.function:Users

View File

@@ -1,3 +1,9 @@
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
import "tower/help/ChromeSocketHelp"; import "tower/help/ChromeSocketHelp";
import "tower/help/FirefoxSocketHelp"; import "tower/help/FirefoxSocketHelp";
import "tower/help/InventoryGroups"; import "tower/help/InventoryGroups";

View File

@@ -1,11 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* ChromeSocketHelp.js * All Rights Reserved
* *************************************************/
* Help object for socket connection troubleshooting
*
*/
/** /**
* @ngdoc overview * @ngdoc overview

View File

@@ -1,11 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* FirefoxSocketHelp.js * All Rights Reserved
* *************************************************/
* Help object for socket connection troubleshooting
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name help.function:FirefoxSocketHelp * @name help.function:FirefoxSocketHelp

View File

@@ -1,12 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* InventoryGroups.js * All Rights Reserved
* *************************************************/
* Help object for inventory groups/hosts page.
*
* @dict
*/
/** /**
* @ngdoc function * @ngdoc function
* @name help.function:InventoryGroups * @name help.function:InventoryGroups

View File

@@ -1,11 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* SafairSocketHelp.js * All Rights Reserved
* *************************************************/
* Help object for socket connection troubleshooting
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name help.function:SafariSocketHelp * @name help.function:SafariSocketHelp

View File

@@ -1,3 +1,9 @@
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
import 'tower/forms'; import 'tower/forms';
import 'tower/lists'; import 'tower/lists';

View File

@@ -1,11 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* aboutansible.js * All Rights Reserved
* *************************************************/
* The new about menu
*
*/
/** /**
* @ngdoc overview * @ngdoc overview
* @name helpers * @name helpers

View File

@@ -1,11 +1,9 @@
/****************************************************** /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* helpers/Access.js * All Rights Reserved
* *************************************************/
* Routines for checking user access
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name helpers.function:Access * @name helpers.function:Access

View File

@@ -1,10 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2015 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* AdhocHelper * All Rights Reserved
* *************************************************/
* Routines shared by adhoc related controllers:
*/
/** /**
* @ngdoc function * @ngdoc function
* @name helpers.function:Adhoc * @name helpers.function:Adhoc

View File

@@ -1,9 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* ChildrenHelper * All Rights Reserved
* *************************************************/
*/
/** /**
* @ngdoc function * @ngdoc function
* @name helpers.function:Children * @name helpers.function:Children

View File

@@ -1,7 +1,10 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
*/ *
/** * All Rights Reserved
*************************************************/
/**
* @ngdoc function * @ngdoc function
* @name helpers.function:ConfigureTower * @name helpers.function:ConfigureTower
* @description * @description

View File

@@ -1,10 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2015 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* Credentials.js * All Rights Reserved
* *************************************************/
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name helpers.function:Credentials * @name helpers.function:Credentials

View File

@@ -1,7 +1,10 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
*/ *
/** * All Rights Reserved
*************************************************/
/**
* @ngdoc function * @ngdoc function
* @name helpers.function:CustomInventory * @name helpers.function:CustomInventory
* @description * @description

View File

@@ -1,9 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* EventsViewer.js * All Rights Reserved
* *************************************************/
*/
/** /**
* @ngdoc function * @ngdoc function
* @name helpers.function:EventViewer * @name helpers.function:EventViewer

View File

@@ -1,11 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* EventsHelper * All Rights Reserved
* *************************************************/
*
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name helpers.function:Events * @name helpers.function:Events

View File

@@ -1,11 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2015 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* GroupsHelper * All Rights Reserved
* *************************************************/
* Routines that handle group add/edit/delete on the Inventory tree widget.
*
*/
'use strict'; 'use strict';
/** /**

View File

@@ -1,11 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* HostEventsViewer.js * All Rights Reserved
* *************************************************/
* View a list of events for a given job and host
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name helpers.function:HostEventsViewer * @name helpers.function:HostEventsViewer

View File

@@ -1,11 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* HostsHelper * All Rights Reserved
* *************************************************/
* Routines that handle host add/edit/delete on the Inventory detail page.
*
*/
/* jshint loopfunc: true */ /* jshint loopfunc: true */
/** /**

View File

@@ -1,11 +1,9 @@
/************************************ /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* JobDetail.js * All Rights Reserved
* *************************************************/
* Helper moduler for JobDetails controller
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name helpers.function:JobDetail * @name helpers.function:JobDetail
@@ -1135,11 +1133,12 @@ export default
}; };
}]) }])
.factory('DrawGraph', [ function() {
.factory('DrawGraph', ['DonutChart', function(DonutChart) {
return function(params) { return function(params) {
var scope = params.scope, var scope = params.scope,
resize = params.resize, resize = params.resize,
width, height, svg_height, svg_width, svg_radius, svg, graph_data = []; width, height, svg_height, svg_width, svg_radius, graph_data = [];
// Ready the data // Ready the data
if (scope.host_summary.ok) { if (scope.host_summary.ok) {
@@ -1178,27 +1177,151 @@ export default
scope.total_count_for_graph = total_count; scope.total_count_for_graph = total_count;
// Adjust the size // Adjust the size
width = $('#job-summary-container .job_well').width(); width = $('#job-summary-container .job_well').width();
height = $('#job-summary-container .job_well').height() - $('#summary-well-top-section').height() - $('#graph-section .header').outerHeight() - 15; height = $('#job-summary-container .job_well').height() - $('#summary-well-top-section').height() - $('#graph-section .header').outerHeight() - 80;
svg_radius = Math.min(width, height); svg_radius = Math.min(width, height);
svg_width = width; svg_width = width;
svg_height = height; svg_height = height;
if (svg_height > 0 && svg_width > 0) { if (svg_height > 0 && svg_width > 0) {
if (!resize && $('#graph-section svg').length > 0) { if (!resize && $('#graph-section svg').length > 0) {
Donut3D.transition("completedHostsDonut", graph_data, Math.floor(svg_radius * 0.50), Math.floor(svg_radius * 0.25), 18, 0.4); // Donut3D.transition("completedHostsDonut", graph_data, Math.floor(svg_radius * 0.50), Math.floor(svg_radius * 0.25), 18, 0.4);
DonutChart({
target: '#graph-section',
height: height,
width: width,
data: graph_data,
radius: svg_radius
});
} }
else { else {
if ($('#graph-section svg').length > 0) { if ($('#graph-section svg').length > 0) {
$('#graph-section svg').remove(); $('#graph-section svg').remove();
} }
svg = d3.select("#graph-section").append("svg").attr("width", svg_width).attr("height", svg_height); // svg = d3.select("#graph-section").append("svg").attr("width", svg_width).attr("height", svg_height);
svg.append("g").attr("id","completedHostsDonut"); // svg.append("g").attr("id","completedHostsDonut");
Donut3D.draw("completedHostsDonut", graph_data, Math.floor(svg_width / 2), Math.floor(svg_height / 2) - 35, Math.floor(svg_radius * 0.50), Math.floor(svg_radius * 0.25), 18, 0.4); // Donut3D.draw("completedHostsDonut", graph_data, Math.floor(svg_width / 2), Math.floor(svg_height / 2) - 35, Math.floor(svg_radius * 0.50), Math.floor(svg_radius * 0.25), 18, 0.4);
DonutChart({
target: '#graph-section',
height: height,
width: width,
data: graph_data,
radius: svg_radius
});
$('#graph-section .header .legend').show(); $('#graph-section .header .legend').show();
} }
} }
}; };
}]) }])
.factory('DonutChart', [function() {
return function(params) {
var target = params.target,
height = params.height,
width = params.width,
dataset = params.data,
outerRadius = Math.min(width, height) / 2,
innerRadius = (outerRadius/3),
svg, arc, pie, legend, color,
tooltip, path,
legendRectSize = 18,
legendSpacing = 4;
color = d3.scale.ordinal()
.range(['#60D66F', '#FF9900', '#FF0000', '#ff5850']);
svg = d3.select(target)
.append('svg')
.data([dataset])
.attr('width', width)
.attr('height', height)
.append('g')
.attr('transform', 'translate(' + (width / 2) +
',' + (height / 2) + ')');
arc = d3.svg.arc()
.innerRadius(outerRadius - innerRadius)
.outerRadius(outerRadius);
pie = d3.layout.pie()
.value(function(d) { return d.value; })
.sort(function() {return null; });
// arcs = svg.selectAll("g.slice")
// .data(pie)
// .enter()
// .append("g")
// .attr("class", "slice");
tooltip = d3.select(target)
.append('div')
.attr('class', 'tooltip');
tooltip.append('div')
.attr('class', 'label');
tooltip.append('div')
.attr('class', 'count');
tooltip.append('div')
.attr('class', 'percent');
path = svg.selectAll('path')
.data(pie(dataset))
.enter()
.append('path')
.attr('d', arc)
.attr('fill', function(d) {
return color(d.data.label);
});
path.on('mouseenter', function(d) {
var total = d3.sum(dataset.map(function(d) {
return d.value;
}));
var percent = Math.round(1000 * d.data.value / total) / 10;
tooltip.select('.label').html(d.data.label)
.attr('style', 'color:black');
tooltip.select('.count').html(d.data.value);
tooltip.select('.percent').html(percent + '%');
tooltip.style('display', 'block');
});
path.on('mouseleave', function() {
tooltip.style('display', 'none');
});
// path.on('mousemove', function(d) {
// tooltip.style('top', (d3.event.pageY + 10) + 'px')
// .style('left', (d3.event.pageX + 10) + 'px');
// });
legend = svg.selectAll('.legend')
.data(color.domain())
.enter()
.append('g')
.attr('class', 'legend')
.attr('transform', function(d, i) {
var height = legendRectSize + legendSpacing;
var offset = height * color.domain().length / 2;
var horz = -2 * legendRectSize;
var vert = i * height - offset;
return 'translate(' + horz + ',' + vert + ')';
});
legend.append('rect')
.attr('width', legendRectSize)
.attr('height', legendRectSize)
.style('fill', color)
.style('stroke', color);
legend.append('text')
.attr('x', legendRectSize + legendSpacing)
.attr('y', legendRectSize - legendSpacing)
.text(function(d) {
return d;
});
};
}])
.factory('DrawPlays', [function() { .factory('DrawPlays', [function() {
return function(params) { return function(params) {
var scope = params.scope, var scope = params.scope,

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* JobSubmission.js * All Rights Reserved
* *************************************************/
*/
/** /**
* @ngdoc function * @ngdoc function
* @name helpers.function:JobSubmission * @name helpers.function:JobSubmission

View File

@@ -1,11 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* JobTemplatesHelper * All Rights Reserved
* *************************************************/
* Routines shared by job related controllers
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name helpers.function:JobTemplatesHelper * @name helpers.function:JobTemplatesHelper

View File

@@ -1,11 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* JobsHelper * All Rights Reserved
* *************************************************/
* Routines shared by job related controllers
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name helpers.function:Jobs * @name helpers.function:Jobs

View File

@@ -1,11 +1,9 @@
/****************************************************** /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* helpers/License.js * All Rights Reserved
* *************************************************/
*
*
*/
/** /**
* @ngdoc function * @ngdoc function
* @name helpers.function:License * @name helpers.function:License

View File

@@ -1,6 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
*/ *
* All Rights Reserved
*************************************************/
/** /**
* @ngdoc function * @ngdoc function
* @name helpers.function:LoadConfig * @name helpers.function:LoadConfig

View File

@@ -1,9 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* LogViewer.js * All Rights Reserved
* *************************************************/
*/
/** /**
* @ngdoc function * @ngdoc function
* @name helpers.function:LogViewer * @name helpers.function:LogViewer

View File

@@ -1,9 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* LookupHelper * All Rights Reserved
* Build a lookup dialog *************************************************/
*/
/** /**
* @ngdoc function * @ngdoc function

View File

@@ -1,9 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* PaginationHelpers.js * All Rights Reserved
* *************************************************/
*/
/** /**
* @ngdoc function * @ngdoc function
* @name helpers.function:PaginationHelpers * @name helpers.function:PaginationHelpers

View File

@@ -1,8 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* ParseHelper * All Rights Reserved
*/ *************************************************/
/** /**
* @ngdoc function * @ngdoc function
* @name helpers.function:Parse * @name helpers.function:Parse

View File

@@ -1,8 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* Permissions.js * All Rights Reserved
*/ *************************************************/
/** /**
* @ngdoc function * @ngdoc function
* @name helpers.function:Permissions * @name helpers.function:Permissions

View File

@@ -1,8 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* ProjectPathHelper * All Rights Reserved
*/ *************************************************/
/** /**
* @ngdoc function * @ngdoc function
* @name helpers.function:ProjectPath * @name helpers.function:ProjectPath

View File

@@ -1,8 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
* *
* ProjectsHelper * All Rights Reserved
*/ *************************************************/
/** /**
* @ngdoc function * @ngdoc function
* @name helpers.function:Projects * @name helpers.function:Projects

View File

@@ -1,6 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
*/ *
* All Rights Reserved
*************************************************/
/** /**
* @ngdoc function * @ngdoc function
* @name helpers.function:Schedules * @name helpers.function:Schedules

View File

@@ -1,6 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
*/ *
* All Rights Reserved
*************************************************/
/** /**
* @ngdoc function * @ngdoc function
* @name helpers.function:Selection * @name helpers.function:Selection

View File

@@ -1,6 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
*/ *
* All Rights Reserved
*************************************************/
/** /**
* @ngdoc function * @ngdoc function
* @name helpers.function:SocketHelper * @name helpers.function:SocketHelper

View File

@@ -1,6 +1,9 @@
/********************************************* /*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc. * Copyright (c) 2015 Ansible, Inc.
*/ *
* All Rights Reserved
*************************************************/
/** /**
* @ngdoc function * @ngdoc function
* @name helpers.function:Survey * @name helpers.function:Survey

Some files were not shown because too many files have changed in this diff Show More