mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 20:00:43 -03:30
Added custom info, fixed logout bug
This commit is contained in:
parent
805d4d1ed6
commit
dc4217944d
@ -232,6 +232,29 @@ export default [
|
||||
}
|
||||
};
|
||||
|
||||
function loginUpdate() {
|
||||
// Updates the logo and app config so that logos and info are properly shown
|
||||
// on logout after modifying.
|
||||
if($scope.CUSTOM_LOGO) {
|
||||
$rootScope.custom_logo = $scope.CUSTOM_LOGO;
|
||||
global.$AnsibleConfig.custom_logo = true;
|
||||
} else {
|
||||
$rootScope.custom_logo = '';
|
||||
global.$AnsibleConfig.custom_logo = false;
|
||||
}
|
||||
|
||||
if($scope.CUSTOM_LOGIN_INFO) {
|
||||
$rootScope.custom_login_info = $scope.CUSTOM_LOGIN_INFO;
|
||||
global.$AnsibleConfig.custom_login_info = $scope.CUSTOM_LOGIN_INFO;
|
||||
} else {
|
||||
$rootScope.custom_login_info = '';
|
||||
global.$AnsibleConfig.custom_login_info = false;
|
||||
}
|
||||
|
||||
Store('AnsibleConfig', global.$AnsibleConfig);
|
||||
|
||||
$scope.$broadcast('loginUpdated');
|
||||
}
|
||||
|
||||
$scope.resetValue = function(key) {
|
||||
Wait('start');
|
||||
@ -275,21 +298,6 @@ export default [
|
||||
}
|
||||
}
|
||||
|
||||
function loginUpdate() {
|
||||
// Updates the logo and app config so that logos are properly shown
|
||||
// on logout after modifying.
|
||||
if($scope.CUSTOM_LOGO) {
|
||||
$rootScope.custom_logo = $scope.$parent.CUSTOM_LOGO;
|
||||
global.$AnsibleConfig.custom_logo = true;
|
||||
Store('AnsibleConfig', global.$AnsibleConfig);
|
||||
} else {
|
||||
$rootScope.custom_logo = '';
|
||||
global.$AnsibleConfig.custom_logo = false;
|
||||
Store('AnsibleConfig', global.$AnsibleConfig);
|
||||
}
|
||||
$scope.$broadcast('loginUpdated');
|
||||
}
|
||||
|
||||
// Some dropdowns are listed as "list" type in the API even though they're a dropdown:
|
||||
var multiselectDropdowns = ['AD_HOC_COMMANDS'];
|
||||
var formSave = function() {
|
||||
|
||||
@ -22,6 +22,11 @@ export default function() {
|
||||
reset: 'CUSTOM_LOGO',
|
||||
control: `<image-upload key="CUSTOM_LOGO"></image-upload>`
|
||||
},
|
||||
CUSTOM_LOGIN_INFO: {
|
||||
type: 'textarea',
|
||||
reset: 'CUSTOM_LOGIN_INFO',
|
||||
rows: 6
|
||||
}
|
||||
},
|
||||
|
||||
buttons: {
|
||||
|
||||
@ -85,11 +85,19 @@ angular.module('LoadConfigHelper', ['Utilities'])
|
||||
if(response.custom_logo) {
|
||||
configSettings.custom_logo = true;
|
||||
$rootScope.custom_logo = response.custom_logo;
|
||||
configInit();
|
||||
} else {
|
||||
configSettings.custom_logo = false;
|
||||
configInit();
|
||||
}
|
||||
|
||||
if(response.custom_login_info) {
|
||||
configSettings.custom_login_info = response.custom_login_info;
|
||||
$rootScope.custom_login_info = response.custom_login_info;
|
||||
} else {
|
||||
configSettings.custom_login_info = false;
|
||||
}
|
||||
|
||||
configInit();
|
||||
|
||||
}).error(function(error) {
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
@ -99,7 +99,6 @@ export default ['$log', '$cookieStore', '$compile', '$window', '$rootScope',
|
||||
scope.customLogo = "tower-logo-login.svg";
|
||||
scope.customLogoPresent = false;
|
||||
}
|
||||
|
||||
scope.customLoginInfo = $AnsibleConfig.custom_login_info;
|
||||
scope.customLoginInfoPresent = (scope.customLoginInfo) ? true : false;
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user