Updated favicon, enhanced login/logout.

This commit is contained in:
Admin
2017-11-17 15:56:23 -06:00
parent 05b9f195d7
commit 75b925992b
5 changed files with 18 additions and 8 deletions

View File

@@ -5,7 +5,7 @@
<groupId>com.bwssystems.HABridge</groupId> <groupId>com.bwssystems.HABridge</groupId>
<artifactId>ha-bridge</artifactId> <artifactId>ha-bridge</artifactId>
<version>5.0.0rc6</version> <version>5.0.0rc7</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>HA Bridge</name> <name>HA Bridge</name>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -5,6 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>HA Bridge</title> <title>HA Bridge</title>
<link rel="shortcut icon" href="img/favicon.ico?v=2">
<link href="css/main.css" rel="stylesheet"> <link href="css/main.css" rel="stylesheet">
<link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-theme.min.css" rel="stylesheet"> <link href="css/bootstrap-theme.min.css" rel="stylesheet">

View File

@@ -109,9 +109,9 @@ app.run(function ($rootScope, $location, Auth, bridgeService) {
$rootScope.$on('securityReinit', function(event, data) { $rootScope.$on('securityReinit', function(event, data) {
event.preventDefault(); event.preventDefault();
Auth.logout();
bridgeService.state.testuser = ""; bridgeService.state.testuser = "";
$location.path("/login"); Auth.logout();
$location.path("/");
}); });
$rootScope.$on('$routeChangeStart', function (event, next) { $rootScope.$on('$routeChangeStart', function (event, next) {
@@ -1637,7 +1637,8 @@ app.controller('SecurityDialogCtrl', function ($scope, bridgeService, ngDialog)
if(bridgeService.state.loggedInUser !== undefined) if(bridgeService.state.loggedInUser !== undefined)
$scope.username = bridgeService.state.loggedInUser; $scope.username = bridgeService.state.loggedInUser;
else else
$scope.username = "" $scope.username = "";
bridgeService.getHABridgeVersion();
$scope.showPassword = $scope.isSecure; $scope.showPassword = $scope.isSecure;
}; };
@@ -3745,8 +3746,9 @@ app.filter('filterDevicesByRequester', function () {
} }
}); });
app.controller('LoginController', function ($scope, $location, Auth) { app.controller('LoginController', function ($scope, $location, Auth, bridgeService) {
$scope.failed = false; $scope.failed = false;
$scope.isSecure = bridgeService.isSecure();
$scope.loggedIn = Auth.isLoggedIn(); $scope.loggedIn = Auth.isLoggedIn();
$scope.login = function(username, password) { $scope.login = function(username, password) {
Auth.login(username, password) Auth.login(username, password)
@@ -3759,8 +3761,12 @@ app.controller('LoginController', function ($scope, $location, Auth) {
$scope.logout = function() { $scope.logout = function() {
Auth.logout(); Auth.logout();
$scope.isSecure = bridgeService.isSecure();
$scope.loggedIn = Auth.isLoggedIn(); $scope.loggedIn = Auth.isLoggedIn();
if($scope.isSecure)
$location.path("/login"); $location.path("/login");
else
$location.path("/");
}; };
}); });

View File

@@ -3,7 +3,7 @@
<h2 class="panel-title">Login</h2> <h2 class="panel-title">Login</h2>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<div ng-if="!loggedIn" class="form-container"> <div ng-if="!loggedIn && isSecure" class="form-container">
<form name="loginForm" role="form" ng-submit="login(username, password)"> <form name="loginForm" role="form" ng-submit="login(username, password)">
<legend class="form-label">Enter Credentials</legend> <legend class="form-label">Enter Credentials</legend>
@@ -25,8 +25,11 @@
</div> </div>
</div> </div>
<div ng-if="loggedIn"> <div ng-if="loggedIn && isSecure">
<button type="button" class="btn btn-danger" ng-click="logout()">Are you sure you want to Logout?</button> <button type="button" class="btn btn-danger" ng-click="logout()">Are you sure you want to Logout?</button>
</div> </div>
<div ng-if="!isSecure">
<p>This ha-bridge instance is not secured!</p>
</div>
</div> </div>
</div> </div>