mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 09:53:28 +02:00
* fix bug on email separator Signed-off-by: Denis barbaron <denis.barbaron@orange.com> * allow group name change Signed-off-by: Denis barbaron <denis.barbaron@orange.com> * add maintenance banner on UI Signed-off-by: Denis barbaron <denis.barbaron@orange.com> * removes unnecessary comments Signed-off-by: Denis barbaron <denis.barbaron@orange.com> --------- Signed-off-by: Denis barbaron <denis.barbaron@orange.com>
42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
/**
|
|
* Copyright © 2024 code initially contributed by Orange SA, authors: Denis Barbaron - Licensed under the Apache license 2.0
|
|
**/
|
|
|
|
module.exports = function AlertMessageCtrl(
|
|
$scope
|
|
, SettingsService
|
|
) {
|
|
|
|
$scope.defaultAlertMessage = {
|
|
data: '*** This site is currently under maintenance, please wait ***'
|
|
, activation: 'False'
|
|
, level: 'Critical'
|
|
}
|
|
|
|
SettingsService.bind($scope, {
|
|
target: 'alertMessage'
|
|
, source: 'alertMessage'
|
|
, defaultValue: $scope.defaultAlertMessage
|
|
})
|
|
|
|
$scope.alertMessageActivationOptions = ['True', 'False']
|
|
$scope.alertMessageLevelOptions = ['Information', 'Warning', 'Critical']
|
|
|
|
$scope.$watch(
|
|
function() {
|
|
return SettingsService.get('alertMessage')
|
|
}
|
|
, function(newvalue) {
|
|
if (typeof newvalue === 'undefined') {
|
|
SettingsService.set('alertMessage', $scope.defaultAlertMessage)
|
|
}
|
|
}
|
|
)
|
|
|
|
$scope.$on('user.menu.users.updated', function(event, message) {
|
|
if (message.user.privilege === 'admin') {
|
|
$scope.alertMessage = message.user.settings.alertMessage
|
|
}
|
|
})
|
|
}
|