mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 23:39:41 +02:00
feat(global): add authentication support with single admin account
This commit is contained in:
parent
1e5207517d
commit
4e77c72fa2
35 changed files with 1475 additions and 220 deletions
34
app/components/main/mainController.js
Normal file
34
app/components/main/mainController.js
Normal file
|
@ -0,0 +1,34 @@
|
|||
angular.module('main', [])
|
||||
.controller('MainController', ['$scope', '$cookieStore',
|
||||
function ($scope, $cookieStore) {
|
||||
|
||||
/**
|
||||
* Sidebar Toggle & Cookie Control
|
||||
*/
|
||||
var mobileView = 992;
|
||||
$scope.getWidth = function() {
|
||||
return window.innerWidth;
|
||||
};
|
||||
|
||||
$scope.$watch($scope.getWidth, function(newValue, oldValue) {
|
||||
if (newValue >= mobileView) {
|
||||
if (angular.isDefined($cookieStore.get('toggle'))) {
|
||||
$scope.toggle = ! $cookieStore.get('toggle') ? false : true;
|
||||
} else {
|
||||
$scope.toggle = true;
|
||||
}
|
||||
} else {
|
||||
$scope.toggle = false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$scope.toggleSidebar = function() {
|
||||
$scope.toggle = !$scope.toggle;
|
||||
$cookieStore.put('toggle', $scope.toggle);
|
||||
};
|
||||
|
||||
window.onresize = function() {
|
||||
$scope.$apply();
|
||||
};
|
||||
}]);
|
Loading…
Add table
Add a link
Reference in a new issue