mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 09:57:35 -02:30
Added custom info, fixed logout bug
This commit is contained in:
@@ -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) {
|
$scope.resetValue = function(key) {
|
||||||
Wait('start');
|
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:
|
// Some dropdowns are listed as "list" type in the API even though they're a dropdown:
|
||||||
var multiselectDropdowns = ['AD_HOC_COMMANDS'];
|
var multiselectDropdowns = ['AD_HOC_COMMANDS'];
|
||||||
var formSave = function() {
|
var formSave = function() {
|
||||||
|
|||||||
@@ -22,6 +22,11 @@ export default function() {
|
|||||||
reset: 'CUSTOM_LOGO',
|
reset: 'CUSTOM_LOGO',
|
||||||
control: `<image-upload key="CUSTOM_LOGO"></image-upload>`
|
control: `<image-upload key="CUSTOM_LOGO"></image-upload>`
|
||||||
},
|
},
|
||||||
|
CUSTOM_LOGIN_INFO: {
|
||||||
|
type: 'textarea',
|
||||||
|
reset: 'CUSTOM_LOGIN_INFO',
|
||||||
|
rows: 6
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
buttons: {
|
buttons: {
|
||||||
|
|||||||
@@ -85,11 +85,19 @@ angular.module('LoadConfigHelper', ['Utilities'])
|
|||||||
if(response.custom_logo) {
|
if(response.custom_logo) {
|
||||||
configSettings.custom_logo = true;
|
configSettings.custom_logo = true;
|
||||||
$rootScope.custom_logo = response.custom_logo;
|
$rootScope.custom_logo = response.custom_logo;
|
||||||
configInit();
|
|
||||||
} else {
|
} else {
|
||||||
configSettings.custom_logo = false;
|
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) {
|
}).error(function(error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -99,7 +99,6 @@ export default ['$log', '$cookieStore', '$compile', '$window', '$rootScope',
|
|||||||
scope.customLogo = "tower-logo-login.svg";
|
scope.customLogo = "tower-logo-login.svg";
|
||||||
scope.customLogoPresent = false;
|
scope.customLogoPresent = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
scope.customLoginInfo = $AnsibleConfig.custom_login_info;
|
scope.customLoginInfo = $AnsibleConfig.custom_login_info;
|
||||||
scope.customLoginInfoPresent = (scope.customLoginInfo) ? true : false;
|
scope.customLoginInfoPresent = (scope.customLoginInfo) ? true : false;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user