Add maintenance banner on UI (#797)

* 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>
This commit is contained in:
Denis Barbaron
2024-07-19 10:33:52 +02:00
committed by GitHub
parent cf56911e9f
commit 489ba0427e
17 changed files with 446 additions and 16 deletions

View File

@@ -1,10 +1,12 @@
/**
* Copyright © 2019-2023 contains code contributed by Orange SA, authors: Denis Barbaron - Licensed under the Apache license 2.0
* Copyright © 2019-2024 contains code contributed by Orange SA, authors: Denis Barbaron - Licensed under the Apache license 2.0
**/
module.exports = function MenuCtrl(
$scope
, $rootScope
, UsersService
, AppState
, SettingsService
, $location
, $http
@@ -48,4 +50,41 @@ module.exports = function MenuCtrl(
socket.disconnect()
}, 100)
}
$scope.alertMessage = {
activation: 'False'
, data: ''
, level: ''
}
if (AppState.user.privilege === 'admin') {
$scope.alertMessage = SettingsService.get('alertMessage')
}
else {
UsersService.getUsersAlertMessage().then(function(response) {
$scope.alertMessage = response.data.alertMessage
})
}
$scope.isAlertMessageActive = function() {
return $scope.alertMessage.activation === 'True'
}
$scope.isInformationAlert = function() {
return $scope.alertMessage.level === 'Information'
}
$scope.isWarningAlert = function() {
return $scope.alertMessage.level === 'Warning'
}
$scope.isCriticalAlert = function() {
return $scope.alertMessage.level === 'Critical'
}
$scope.$on('user.menu.users.updated', function(event, message) {
if (message.user.privilege === 'admin') {
$scope.alertMessage = message.user.settings.alertMessage
}
})
}