Skip to content

Commit

Permalink
#23 Get cortex version from status API and display it on the footer
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani committed May 10, 2017
1 parent cb73cb0 commit c499a23
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/models/MispModule.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package models

case class MispModule(
name: String,
name: String,
version: String,
description: String,
author: String,
Expand Down
2 changes: 1 addition & 1 deletion ui/app/scripts/app.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

$urlRouterProvider.otherwise('/analyzers');

$stateProvider
$stateProvider
.state('analyzers', {
url: '/analyzers',
templateUrl: 'views/analyzers.html',
Expand Down
14 changes: 12 additions & 2 deletions ui/app/scripts/components/app-container.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@
.directive('appContainer', function() {
return {
restrict: 'E',
templateUrl: 'views/components/app-container.component.html'
templateUrl: 'views/components/app-container.component.html' ,
controller: function(VersionSrv) {
var self = this;
self.config = {};

VersionSrv.get()
.then(function(response) {
self.config = response.data;
});
},
controllerAs: '$vm'
};
});
})();
})();
13 changes: 13 additions & 0 deletions ui/app/scripts/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@
return Notification.error(sanitized);
};
})
.service('VersionSrv', function($q, $http) {
this.get = function() {
var deferred = $q.defer();

$http.get('./api/status').then(function(response) {
deferred.resolve(response);
}, function(rejection) {
deferred.reject(rejection);
});
return deferred.promise;
}

})
.service('AnalyzerSrv', function($q, $http) {
var self = this;

Expand Down
11 changes: 4 additions & 7 deletions ui/app/views/components/app-container.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<header class="main-header"></header>
<!--<main-sidebar class="main-sidebar"></main-sidebar>-->
<div class="content-wrapper" fixed-height>
<div class="container">
<ui-view></ui-view>
Expand All @@ -8,12 +7,10 @@
<footer class="main-footer">
<div class="container">
<div class="pull-right hidden-xs">
<strong>Version</strong>: 1.0.2
<strong>Version</strong>: {{$vm.config.versions.Cortex || '-'}}
</div>
<div>
<strong><a href="http://www.thehive-project.org" target="_blank">TheHive Project</a> 2016-2017, <a href="https://www.gnu.org/licenses/agpl-3.0.en.html" target="_blank">AGPL-V3</a></strong>
</div>
<strong>Copyright &copy; 2016-2017 <a href="http://www.thehive-project.org" target="_blank">TheHive Project</a></strong> All rights reserved.
</div>
</footer>
<!--
<control-sidebar class="control-sidebar control-sidebar-dark"></control-sidebar>
<div class="control-sidebar-bg"></div>
-->

0 comments on commit c499a23

Please sign in to comment.