瀏覽代碼

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


Loading…
取消
儲存