Browse Source

dashboard: Add version info in the left top of dashboard

master
于玉桔 cdfive 5 years ago
parent
commit
4c0e35fddd
5 changed files with 21 additions and 4 deletions
  1. +1
    -1
      sentinel-dashboard/src/main/webapp/resources/app/scripts/directives/header/header.html
  2. +8
    -2
      sentinel-dashboard/src/main/webapp/resources/app/scripts/directives/header/header.js
  3. +10
    -0
      sentinel-dashboard/src/main/webapp/resources/app/scripts/services/version_service.js
  4. +1
    -1
      sentinel-dashboard/src/main/webapp/resources/dist/js/app.js
  5. +1
    -0
      sentinel-dashboard/src/main/webapp/resources/gulpfile.js

+ 1
- 1
sentinel-dashboard/src/main/webapp/resources/app/scripts/directives/header/header.html View File

@@ -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">


+ 8
- 2
sentinel-dashboard/src/main/webapp/resources/app/scripts/directives/header/header.js View File

@@ -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) {


+ 10
- 0
sentinel-dashboard/src/main/webapp/resources/app/scripts/services/version_service.js View File

@@ -0,0 +1,10 @@
var app = angular.module('sentinelDashboardApp');

app.service('VersionService', ['$http', function ($http) {
this.version = function () {
return $http({
url: '/version',
method: 'GET'
});
};
}]);

+ 1
- 1
sentinel-dashboard/src/main/webapp/resources/dist/js/app.js
File diff suppressed because it is too large
View File


+ 1
- 0
sentinel-dashboard/src/main/webapp/resources/gulpfile.js View File

@@ -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…
Cancel
Save