mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 23:07:42 -02:30
Added Callback checkbox and Host Config Key field to Job Template. Also added button to generate a config key value using md5 hash. Added button to select-all on key so user can ctrl-c copy to clipboard.
This commit is contained in:
40
ansibleworks/ui/static/js/helpers/md5.js
Normal file
40
ansibleworks/ui/static/js/helpers/md5.js
Normal file
@@ -0,0 +1,40 @@
|
||||
/*********************************************
|
||||
* Copyright (c) 2013 AnsibleWorks, Inc.
|
||||
*
|
||||
* md5helper
|
||||
*
|
||||
* Run md5Setup({ scope: , master:, check_field:, default_val: })
|
||||
* to initialize md5 fields (checkbox and text field).
|
||||
*
|
||||
*/
|
||||
|
||||
angular.module('md5Helper', ['RestServices', 'Utilities'])
|
||||
.factory('md5Setup', ['Alert', 'Rest', 'GetBasePath','ProcessErrors',
|
||||
function(Alert, Rest, GetBasePath, ProcessErrors) {
|
||||
return function(params) {
|
||||
|
||||
var scope = params.scope;
|
||||
var master = params.master;
|
||||
var check_field = params.check_field;
|
||||
var default_val = params.default_val; //default(true/false) for the checkbox
|
||||
|
||||
scope[check_field] = default_val;
|
||||
master[check_field] = default_val;
|
||||
|
||||
scope.genMD5 = function(fld) {
|
||||
var now = new Date();
|
||||
scope[fld] = $.md5('AnsibleWorks' + now.getTime());
|
||||
}
|
||||
|
||||
scope.toggleCallback = function(fld) {
|
||||
if (scope.allow_callbacks == 'false') {
|
||||
scope[fld] = null;
|
||||
}
|
||||
}
|
||||
|
||||
scope.selectAll = function(fld) {
|
||||
$('input[name="' + fld +'"]').focus().select();
|
||||
}
|
||||
|
||||
}
|
||||
}]);
|
||||
Reference in New Issue
Block a user