dashboard: Add version info in the left top of dashboard
This commit is contained in:
parent
4916ec35ee
commit
4c0e35fddd
|
|
@ -1,7 +1,7 @@
|
|||
<div class="header">
|
||||
<nav class="navbar navbar-fixed-top navbar-inverse" style="" role="navigation">
|
||||
<div class="navbar-brand">
|
||||
<span style="color: #fff;font-size: 26px;">Sentinel 控制台</span>
|
||||
<span style="color: #fff;font-size: 26px;" ng-model="dashboardVersion">Sentinel 控制台 {{dashboardVersion}}</span>
|
||||
</div>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li ng-show="showLogout">
|
||||
|
|
|
|||
|
|
@ -5,12 +5,18 @@
|
|||
* # adminPosHeader
|
||||
*/
|
||||
angular.module('sentinelDashboardApp')
|
||||
.directive('header', ['AuthService', function () {
|
||||
.directive('header', ['VersionService', 'AuthService', function () {
|
||||
return {
|
||||
templateUrl: 'app/scripts/directives/header/header.html',
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
controller: function ($scope, $state, $window, AuthService) {
|
||||
controller: function ($scope, $state, $window, VersionService, AuthService) {
|
||||
VersionService.version().success(function (data) {
|
||||
if (data.code == 0) {
|
||||
$scope.dashboardVersion = data.data;
|
||||
}
|
||||
});
|
||||
|
||||
if (!$window.localStorage.getItem("session_sentinel_admin")) {
|
||||
AuthService.check().success(function (data) {
|
||||
if (data.code == 0) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
var app = angular.module('sentinelDashboardApp');
|
||||
|
||||
app.service('VersionService', ['$http', function ($http) {
|
||||
this.version = function () {
|
||||
return $http({
|
||||
url: '/version',
|
||||
method: 'GET'
|
||||
});
|
||||
};
|
||||
}]);
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -43,6 +43,7 @@ const CSS_APP = [
|
|||
const JS_APP = [
|
||||
'app/scripts/app.js',
|
||||
'app/scripts/filters/filters.js',
|
||||
'app/scripts/services/version_service.js',
|
||||
'app/scripts/services/auth_service.js',
|
||||
'app/scripts/services/appservice.js',
|
||||
'app/scripts/services/flow_service_v1.js',
|
||||
|
|
|
|||
Loading…
Reference in New Issue