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
+6 -7
View File
@@ -1,11 +1,10 @@
/************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* app.js
*
* Declare the Tower app, define routes and perform initialization chores.
*
*/
* All Rights Reserved
*************************************************/
var urlPrefix;
@@ -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,
browserName;
+6 -1
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';
export default
@@ -1,3 +1,9 @@
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
/* jshint unused: vars */
export default ['browserData', function(browserData) {
+8 -3
View File
@@ -1,7 +1,12 @@
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
/**********************************************************************
*
* Copyright (c) 2014 AnsibleWorks, Inc.
*
* config.js
*
* Gobal configuration variables for controlling application behavior.
+4 -6
View File
@@ -1,11 +1,9 @@
/*************************************************
* Copyright (c) 2015 AnsibleWorks, Inc.
* Copyright (c) 2015 Ansible, Inc.
*
* Adhoc.js
*
* Controller functions for the Adhoc model.
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name controllers.function:Adhoc
+6 -4
View File
@@ -1,7 +1,9 @@
/************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc overview
* @name controllers
@@ -43,4 +45,4 @@ export function AdminsList($scope, $rootScope, $location, $log, $routeParams, Re
AdminsList.$inject = ['$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'AdminList', 'generateList',
'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'GetBasePath', 'SelectionInit'
];
];
@@ -1,12 +1,8 @@
/************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
*
* Authentication.js
*
* Controller functions for user authentication.
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
+4 -6
View File
@@ -1,11 +1,9 @@
/*************************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
* Copyright (c) 2015 Ansible, Inc.
*
* Credentials.js
*
* Controller functions for the Credential model.
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name controllers.function:Credentials
+4 -9
View File
@@ -1,13 +1,8 @@
/************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
*
* Home.js
*
* Controller functions for Home tab
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
+5 -8
View File
@@ -1,12 +1,9 @@
/************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
*
* Inventories.js
*
* Controller functions for the Inventory model.
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name controllers.function:Inventories
+5 -5
View File
@@ -1,9 +1,9 @@
/************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* JobDetail.js
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name controllers.function:JobDetail
+5 -8
View File
@@ -1,12 +1,9 @@
/************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
*
* JobEvents.js
*
* Controller functions for the Job Events model.
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name controllers.function:JobEvent
+6 -9
View File
@@ -1,12 +1,9 @@
/************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
*
* JobHosts.js
*
* Controller functions for the Job Hosts Summary model.
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name controllers.function:JobHosts
@@ -127,4 +124,4 @@ export function JobHostSummaryList($scope, $rootScope, $location, $log, $routePa
JobHostSummaryList.$inject = ['$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'JobHostList',
'generateList', 'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors',
'GetBasePath', 'Refresh', 'JobStatusToolTip', 'Wait'
];
];
+5 -5
View File
@@ -1,9 +1,9 @@
/************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* JobStdout.js
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name controllers.function:JobStdout
+5 -8
View File
@@ -1,12 +1,9 @@
/************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
*
* JobTemplates.js
*
* Controller functions for the Job Template model.
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name controllers.function:JobTemplate
+5 -8
View File
@@ -1,12 +1,9 @@
/************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
*
* Jobs.js
*
* Controller functions for the Inventory model.
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name controllers.function:Jobs
-429
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'
];
@@ -1,12 +1,9 @@
/************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
*
* Organizations.js
*
* Controller functions for Organization model.
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name controllers.function:Organizations
+5 -8
View File
@@ -1,12 +1,9 @@
/************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
*
* Permissions.js
*
* Controller functions for Permissions model.
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name controllers.function:Permissions
+4 -9
View File
@@ -1,13 +1,8 @@
/************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
*
* Portal.js
*
* Controller functions for portal mode
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
+5 -8
View File
@@ -1,12 +1,9 @@
/************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
*
* Projects.js
*
* Controller functions for the Projects model.
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name controllers.function:Projects
+6 -9
View File
@@ -1,12 +1,9 @@
/************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* Schedules.js
*
* Controller functions for the Schedule model.
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name controllers.function:Schedules
@@ -98,4 +95,4 @@ GetBasePath, Wait, Breadcrumbs, Find, LoadDialogPartial, LoadSchedulesScope, Get
}
ScheduleEditController.$inject = [ '$scope', '$compile', '$location', '$routeParams', 'SchedulesList', 'Rest', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope',
'GetBasePath', 'Wait', 'Breadcrumbs', 'Find', 'LoadDialogPartial', 'LoadSchedulesScope', 'GetChoices', 'Stream' ];
'GetBasePath', 'Wait', 'Breadcrumbs', 'Find', 'LoadDialogPartial', 'LoadSchedulesScope', 'GetChoices', 'Stream' ];
+6 -7
View File
@@ -1,10 +1,9 @@
/************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
*
* Sockets.js
* SocketsController- simple test of socket connection
*
*/
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name controllers.function:Sockets
File diff suppressed because it is too large Load Diff
+5 -8
View File
@@ -1,12 +1,9 @@
/************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
*
* Teams.js
*
* Controller functions for the Team model.
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name controllers.function:Teams
+5 -7
View File
@@ -1,11 +1,9 @@
/********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* Users.js
*
* Controller functions for User model.
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name controllers.function:Users
@@ -1,3 +1,10 @@
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
export default function() {
@@ -1,4 +1,10 @@
export default
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
export default
[ '$window',
AutoSizeModule
];
@@ -1,4 +1,10 @@
export default
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
export default
[ '$compile',
'$window',
'adjustGraphSize',
@@ -1,4 +1,10 @@
export default
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
export default
[ '$rootScope',
'$compile',
'$location' ,
@@ -1,3 +1,9 @@
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
export default
["Rest",
"GetBasePath",
+6
View File
@@ -1,3 +1,9 @@
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
/*********************************************
* @ngdoc function
* @name __deferLoadIfEnabled
+6
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/route-extensions/main.js';
+6
View File
@@ -1,3 +1,9 @@
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
import sanitizeFilter from 'tower/shared/xss-sanitizer.filter';
import capitalizeFilter from 'tower/shared/capitalize.filter';
import longDateFilter from 'tower/shared/long-date.filter';
+6
View File
@@ -1,3 +1,9 @@
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
import ActivityDetail from "tower/forms/ActivityDetail";
import Credentials from "tower/forms/Credentials";
import Adhoc from "tower/forms/Adhoc";
+5 -6
View File
@@ -1,10 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* ActivityDetail.js
* Form definition for Activity Stream detail
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc overview
* @name forms
+5 -6
View File
@@ -1,10 +1,9 @@
/*********************************************
* Copyright (c) 2015 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* Adhoc.js
* Form definition for the Adhoc model.
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name forms.function:Adhoc
+5 -6
View File
@@ -1,10 +1,9 @@
/*********************************************
* Copyright (c) 2015 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* Credentials.js
* Form definition for Credential model
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name forms.function:Credentials
+5 -7
View File
@@ -1,11 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* Organization.js
* Form definition for Organization model
*
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name forms.function:CustomInventory
+5 -5
View File
@@ -1,9 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* JobEventsForm.js
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name forms.function:EventsViewer
+5 -7
View File
@@ -1,11 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* Groups.js
* Form definition for Group model
*
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name forms.function:Groups
+5 -8
View File
@@ -1,11 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* HostGroups.js
* Form definition for Host model
*
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name forms.function:HostGroups
@@ -56,4 +54,3 @@ export default
related: { }
}); //UserForm
+5 -7
View File
@@ -1,11 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* Hosts.js
* Form definition for Host model
*
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name forms.function:Hosts
+5 -7
View File
@@ -1,11 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* Inventories.js
* Form definition for User model
*
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name forms.function:Inventories
+5 -7
View File
@@ -1,11 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* InventoryStatus.js
*
* Use to show inventory sync status
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name forms.function:InventoryStatus
+5 -7
View File
@@ -1,11 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* JobEventData.js
* Form definition for Job Events -JSON view
*
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name forms.function:JobEventData
+5 -7
View File
@@ -1,11 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* JobSummary.js
*
* Display job status info in a dialog
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name forms.function:JobSummary
+5 -8
View File
@@ -1,12 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* JobTemplates.js
* Form definition for Job Template model
*
* To get the JobTemplateForm object: JobTemplateForm();
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name forms.function:JobTemplate
+5 -7
View File
@@ -1,11 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* JobVarsPrompt.js
*
* Form definition used during job submission to prompt for extra vars
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name forms.function:JobVarsPrompt
+5 -7
View File
@@ -1,11 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* Jobs.js
* Form definition for Jobs model
*
* @dict
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name forms.function:Jobs
+5 -6
View File
@@ -1,10 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* LicenseForm.js
*
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name forms.function:LicenseForm
+5 -7
View File
@@ -1,11 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* License.js
* Form definition for Organization model
*
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name forms.function:LicenseUpdate
+5 -7
View File
@@ -1,11 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* LogViewerOptions.js
*
* Form definition for LogViewer.js helper
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name forms.function:LogViewerOptions
+5 -7
View File
@@ -1,11 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* LogViewerStatus.js
*
* Form definition for LogViewer.js helper
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name forms.function:LogViewerStatus
+5 -7
View File
@@ -1,11 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* Organization.js
* Form definition for Organization model
*
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name forms.function:Organizations
+5 -8
View File
@@ -1,12 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* Permissions.js
*
* Form definition for Projects model
*
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name forms.function:Permissions
+5 -7
View File
@@ -1,11 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* ProjectStatus.js
* Form definition for Project Status -JSON view
*
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name forms.function:ProjectStatus
+5 -8
View File
@@ -1,12 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* Projects.js
*
* Form definition for Projects model
*
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name forms.function:Projects
+6 -8
View File
@@ -1,11 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* Groups.js
* Form definition for Group model
*
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name forms.function:Source
@@ -117,7 +115,7 @@ export default
ngShow: "source && source.value === 'custom'",
sourceModel: 'source_script',
sourceField: 'name',
ngClick: 'lookUpSource_script()' ,
ngClick: 'lookUpSource_script()' ,
addRequired: false,
editRequired: false,
ngRequired: "source && source.value === 'custom'",
+5 -7
View File
@@ -1,11 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* SurveyMaker.js
* Form definition for survey maker model
*
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name forms.function:SurveyMaker
+5 -7
View File
@@ -1,11 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* Inventories.js
* Form definition for question model
*
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name forms.function:Questions
+5 -7
View File
@@ -1,11 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* Teams.js
*
* Form definition for Team model
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name forms.function:Teams
+5 -7
View File
@@ -1,11 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* Users.js
* Form definition for User model
*
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name forms.function:Users
+6
View File
@@ -1,3 +1,9 @@
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
import "tower/help/ChromeSocketHelp";
import "tower/help/FirefoxSocketHelp";
import "tower/help/InventoryGroups";
+5 -7
View File
@@ -1,11 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* ChromeSocketHelp.js
*
* Help object for socket connection troubleshooting
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc overview
+5 -7
View File
@@ -1,11 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* FirefoxSocketHelp.js
*
* Help object for socket connection troubleshooting
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name help.function:FirefoxSocketHelp
+5 -8
View File
@@ -1,12 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* InventoryGroups.js
*
* Help object for inventory groups/hosts page.
*
* @dict
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name help.function:InventoryGroups
+5 -7
View File
@@ -1,11 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* SafairSocketHelp.js
*
* Help object for socket connection troubleshooting
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name help.function:SafariSocketHelp
+6
View File
@@ -1,3 +1,9 @@
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
import 'tower/forms';
import 'tower/lists';
+5 -7
View File
@@ -1,11 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* aboutansible.js
*
* The new about menu
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc overview
* @name helpers
+5 -7
View File
@@ -1,11 +1,9 @@
/******************************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* helpers/Access.js
*
* Routines for checking user access
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name helpers.function:Access
+5 -6
View File
@@ -1,10 +1,9 @@
/*********************************************
* Copyright (c) 2015 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* AdhocHelper
*
* Routines shared by adhoc related controllers:
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name helpers.function:Adhoc
+5 -5
View File
@@ -1,9 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* ChildrenHelper
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name helpers.function:Children
+7 -4
View File
@@ -1,7 +1,10 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
*/
/**
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name helpers.function:ConfigureTower
* @description
+5 -6
View File
@@ -1,10 +1,9 @@
/*********************************************
* Copyright (c) 2015 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* Credentials.js
*
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name helpers.function:Credentials
+7 -4
View File
@@ -1,7 +1,10 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
*/
/**
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name helpers.function:CustomInventory
* @description
+5 -5
View File
@@ -1,9 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* EventsViewer.js
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name helpers.function:EventViewer
+5 -7
View File
@@ -1,11 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* EventsHelper
*
*
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name helpers.function:Events
+5 -7
View File
@@ -1,11 +1,9 @@
/*********************************************
* Copyright (c) 2015 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* GroupsHelper
*
* Routines that handle group add/edit/delete on the Inventory tree widget.
*
*/
* All Rights Reserved
*************************************************/
'use strict';
/**
+5 -7
View File
@@ -1,11 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* HostEventsViewer.js
*
* View a list of events for a given job and host
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name helpers.function:HostEventsViewer
+5 -7
View File
@@ -1,11 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* HostsHelper
*
* Routines that handle host add/edit/delete on the Inventory detail page.
*
*/
* All Rights Reserved
*************************************************/
/* jshint loopfunc: true */
/**
+137 -14
View File
@@ -1,11 +1,9 @@
/************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* JobDetail.js
*
* Helper moduler for JobDetails controller
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name helpers.function:JobDetail
@@ -1135,11 +1133,12 @@ export default
};
}])
.factory('DrawGraph', [ function() {
.factory('DrawGraph', ['DonutChart', function(DonutChart) {
return function(params) {
var scope = params.scope,
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
if (scope.host_summary.ok) {
@@ -1178,27 +1177,151 @@ export default
scope.total_count_for_graph = total_count;
// Adjust the size
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_width = width;
svg_height = height;
if (svg_height > 0 && svg_width > 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 {
if ($('#graph-section svg').length > 0) {
$('#graph-section svg').remove();
}
svg = d3.select("#graph-section").append("svg").attr("width", svg_width).attr("height", svg_height);
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);
// svg = d3.select("#graph-section").append("svg").attr("width", svg_width).attr("height", svg_height);
// 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);
DonutChart({
target: '#graph-section',
height: height,
width: width,
data: graph_data,
radius: svg_radius
});
$('#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() {
return function(params) {
var scope = params.scope,
File diff suppressed because it is too large Load Diff
+6 -6
View File
@@ -1,9 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
*
* JobSubmission.js
*
*/
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name helpers.function:JobSubmission
+5 -7
View File
@@ -1,11 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* JobTemplatesHelper
*
* Routines shared by job related controllers
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name helpers.function:JobTemplatesHelper
+5 -7
View File
@@ -1,11 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* JobsHelper
*
* Routines shared by job related controllers
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name helpers.function:Jobs
+5 -7
View File
@@ -1,11 +1,9 @@
/******************************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* helpers/License.js
*
*
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name helpers.function:License
+6 -3
View File
@@ -1,6 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
*/
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name helpers.function:LoadConfig
+5 -5
View File
@@ -1,9 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* LogViewer.js
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name helpers.function:LogViewer
+5 -5
View File
@@ -1,9 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* LookupHelper
* Build a lookup dialog
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
@@ -1,9 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* PaginationHelpers.js
*
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name helpers.function:PaginationHelpers
+5 -4
View File
@@ -1,8 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* ParseHelper
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name helpers.function:Parse
+5 -4
View File
@@ -1,8 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* Permissions.js
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name helpers.function:Permissions
+5 -4
View File
@@ -1,8 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* ProjectPathHelper
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name helpers.function:ProjectPath
+5 -4
View File
@@ -1,8 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* ProjectsHelper
*/
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name helpers.function:Projects
+6 -3
View File
@@ -1,6 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
*/
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name helpers.function:Schedules
+6 -3
View File
@@ -1,6 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
*/
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name helpers.function:Selection
+6 -3
View File
@@ -1,6 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
*/
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name helpers.function:SocketHelper
+7 -4
View File
@@ -1,6 +1,9 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
*/
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name helpers.function:Survey
@@ -492,7 +495,7 @@ angular.module('SurveyHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper',
scope.removeGenerateForm = scope.$on('GenerateForm', function() {
tmpVar = scope.mode;
GenerateForm.inject(form, { id: 'question_'+index, mode: 'edit' , related: false, scope:scope, breadCrumbs: false});
scope.mode = tmpVar;
scope.mode = tmpVar;
scope.$emit('FillQuestionForm');
});

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