ソースを参照

dashboard: Add version info in the left top of dashboard

master
于玉桔 cdfive 5年前
コミット
4c0e35fddd
5個のファイルの変更21行の追加4行の削除
  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 ファイルの表示

@@ -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 ファイルの表示

@@ -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 ファイルの表示

@@ -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
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 1
- 0
sentinel-dashboard/src/main/webapp/resources/gulpfile.js ファイルの表示

@@ -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',


読み込み中…
キャンセル
保存