Skip to content

Commit

Permalink
Merge branch 'release/3.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jcarvalho committed May 28, 2014
2 parents 89ae3c2 + 0a8cf34 commit 18248fb
Show file tree
Hide file tree
Showing 32 changed files with 205 additions and 38 deletions.
2 changes: 1 addition & 1 deletion bennu-portal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.fenixedu</groupId>
<artifactId>bennu</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>
</parent>

<artifactId>bennu-portal</artifactId>
Expand Down
9 changes: 8 additions & 1 deletion bennu-portal/src/main/webapp/bennu-portal/portal.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,13 @@
if (val[currentLanguage]) {
return val[currentLanguage];
}

//search for other specific currentLanguage
for (var lang in val) {
if(lang.indexOf(currentLanguage) === 0) {
return val[lang];
}
}
var fallbackLanguage = undefined;
$(langs).each(function() {
var eachlang = this.tag;
Expand All @@ -76,6 +81,8 @@
if (fallbackLanguage != undefined && val[fallbackLanguage] != undefined) {
return val[fallbackLanguage];
}
// Fallback, return the first key in the object...
return val[Object.keys(val)[0]];
}
return "_mls!!" + val + "!!";
};
Expand Down
2 changes: 1 addition & 1 deletion client/bennu-admin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<artifactId>bennu-admin</artifactId>
<name>Bennu Admin</name>
<version>3.0.1</version>
<version>3.1.0</version>

<repositories>
<repository>
Expand Down
17 changes: 14 additions & 3 deletions client/bennu-admin/src/main/webapp/bennu-admin/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ bennuAdmin.config(['$compileProvider', function($compileProvider) {
}]);

var i18n = function(input) {
if(!input || typeof input === 'string') return input;
var tag = BennuPortal.locale.tag;
if(input && input[tag]) {
return input[tag];
if(input[tag]) { return input[tag]; }
tag = tag.split('-')[0];
if(input[tag]) { return input[tag]; }
for (var lang in input) {
if(lang.indexOf(tag) === 0) { return input[lang]; }
}
return '!!' + JSON.stringify(input) + '!!';
return input[Object.keys(input)[0]];
}

function chunk(arr, n) {
Expand All @@ -23,6 +27,13 @@ bennuAdmin.filter('i18n', function () {
return i18n;
});

bennuAdmin.filter('uptime', function () {
var n = function(n){ return n > 9 ? "" + n: "0" + n; };
return function(value) { value = value || 0;
var days = Math.floor(value/(24*60*60)), hours = Math.floor(value/(60*60)) % 24, mins = Math.floor(value/60) % 60;
return (value >= 86400 ? n(days) + 'd ' : '') + (value >= 3600 ? n(hours) + 'h ' : '') + (value >= 60 ? n(mins) + 'm ' : '') + n(value % 60)+ 's'; };
});

bennuAdmin.config(['$routeProvider',
function($routeProvider) {
$routeProvider.
Expand Down
16 changes: 10 additions & 6 deletions client/bennu-admin/src/main/webapp/bennu-admin/js/menu.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
bennuAdmin.controller('MenuController', [ '$scope', '$routeParams', '$http', function($scope, $routeParams, $http) {
$scope.id = $routeParams.id;
$scope.handleError = function(data) { $scope.error = data; };
$scope.deleteSelected = function() {
$scope.selected.node.remove();
if($scope.selected.id) {
$http.delete("../api/bennu-portal/menu/" + $scope.selected.id);
$http.delete("../api/bennu-portal/menu/" + $scope.selected.id).success(function (data) {
$scope.selected.node.remove(); $scope.selected = null;
}).error($scope.handleError);
} else {
$scope.selected.node.remove(); $scope.selected = null;
}
$scope.selected = null;
}
$scope.saveSelected = function() {
var data = { title: $scope.selected.title, description: $scope.selected.description, visible: $scope.selected.visible,
Expand All @@ -22,9 +25,10 @@ bennuAdmin.controller('MenuController', [ '$scope', '$routeParams', '$http', fun
$scope.selected = data;
data.node = node;
node.setTitle(i18n(data.title));
});
}).error($scope.handleError);
}
$scope.loadApps = function() {
$scope.filter = null;
if(!$scope.apps) {
$http.get("../api/bennu-portal/menu/applications/").success(function (data) {
$scope.apps = data;
Expand All @@ -34,7 +38,7 @@ bennuAdmin.controller('MenuController', [ '$scope', '$routeParams', '$http', fun
$scope.installApplication = function() {
$http.post("../api/bennu-portal/menu/applications/", { root: $scope.selected.id, key: $scope.newApp.key }).success(function (item) {
add(item, $scope.selected.node);
});
}).error($scope.handleError);
}
$scope.createChild = function() {
var mls = {};
Expand All @@ -45,7 +49,7 @@ bennuAdmin.controller('MenuController', [ '$scope', '$routeParams', '$http', fun
$scope.saveOrder = function() {
$http.post("../api/bennu-portal/menu/order", $scope.changes).success(function () {
$scope.changes = null;
});
}).error($scope.handleError);
}

var add = function(item, parent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ <h2>Menu Management</h2>
</div>

<div class="col-lg-8" ng-show="selected">
<div class="alert alert-danger" ng-if="error">
<strong>Error: </strong>{{error.message}}{{error.stacktrace}}
</div>
<h4>{{ selected.title | i18n }} ({{ selected.fullPath }})</h4>

<fieldset id="menu-form">
Expand Down Expand Up @@ -95,9 +98,10 @@ <h3>Delete Item</h3>
<h3>Install Application</h3>
</div>
<div class="modal-body">
<select ng-model="newApp" ng-required="true" ng-options="app.title group by app.group for app in apps | orderBy:'title'">
<select ng-model="newApp" ng-required="true" ng-options="app.title group by app.group for app in apps | orderBy:'title' | filter: filter">
<option value="">Select an application...</option>
</select>
<input class="pull-right" placeholder="Filter" ng-model="filter">
</div>
<div class="modal-footer">
<button ng-click="installApplication()" data-dismiss="modal" class="btn btn-success" ng-disabled="!newApp">Install</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@
<button class="btn btn-primary" ng-click="reload()">Reload</button>
<button class="btn btn-primary" ng-click="threadDump()">Thread Dump</button>
<button class="btn btn-primary" ng-click="healthcheck()">Healthchecks</button>

<span class="label label-primary pull-right">{{data.metrics.hostname}}</span>
</div>
<div class="row">
<div class="col-lg-4">
Expand Down Expand Up @@ -148,6 +150,8 @@ <h4>JVM</h4>
<p><strong>Total Loaded Classes:</strong> {{data.metrics['jvm.classloading.loaded.total']}}</p>
<p><strong>Loaded Classes:</strong> {{data.metrics['jvm.classloading.loaded']}}</p>
<p><strong>Unloaded Classes:</strong> {{data.metrics['jvm.classloading.unloaded']}}</p>
<p><strong>Start Time:</strong> {{data.metrics['jvm.runtime.start.time'] | date:'dd/MM/yyyy HH:mm:ss'}}</p>
<p><strong>Uptime:</strong> {{data.metrics['jvm.runtime.uptime'] | uptime}}</p>

</div>
<div class="col-lg-4">
Expand Down
4 changes: 2 additions & 2 deletions client/bennu-io-ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</properties>

<artifactId>bennu-io-ui</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>
<name>Bennu IO UI</name>

<build>
Expand All @@ -39,6 +39,6 @@
</repositories>

<scm>
<tag>v3.0.1</tag>
<tag>v3.1.0</tag>
</scm>
</project>
4 changes: 2 additions & 2 deletions client/bennu-scheduler-ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</properties>

<artifactId>bennu-scheduler-ui</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>
<name>Bennu Scheduler UI</name>

<repositories>
Expand All @@ -25,6 +25,6 @@
</repositories>

<scm>
<tag>v3.0.1</tag>
<tag>v3.1.0</tag>
</scm>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
<td>{{username}}</td>
</tr>
{{/username}}
{{#hostname}}
<tr>
<td>Host</td>
<td>{{hostname}}</td>
</tr>
{{/hostname}}
<tr>
<td>Status</td>
<td>
Expand Down
2 changes: 1 addition & 1 deletion client/bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.fenixedu</groupId>
<artifactId>bennu-client-aggregator</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>
</parent>

<artifactId>bennu-client</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>

<artifactId>bennu-client-aggregator</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>
<name>Bennu Framework Client Components Aggregating Pom</name>
<packaging>pom</packaging>

Expand Down
2 changes: 1 addition & 1 deletion maven/archetypes/bennu-project-archetype/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.fenixedu</groupId>
<artifactId>bennu-archetypes</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>
</parent>

<artifactId>bennu-project-archetype</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion maven/archetypes/bennu-webapp-archetype/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.fenixedu</groupId>
<artifactId>bennu-archetypes</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>
</parent>

<artifactId>bennu-webapp-archetype</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion maven/archetypes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.fenixedu</groupId>
<artifactId>bennu-maven</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>
</parent>

<artifactId>bennu-archetypes</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion maven/bennu-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.fenixedu</groupId>
<artifactId>bennu-maven</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>
</parent>

<artifactId>bennu-maven-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion maven/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>

<artifactId>bennu-maven</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>
<packaging>pom</packaging>

<name>Bennu Maven Tools</name>
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<parent>
<groupId>org.fenixedu</groupId>
<artifactId>fenix-framework-project</artifactId>
<version>1.3.0</version>
<version>1.3.2</version>
</parent>

<artifactId>bennu</artifactId>
<name>Bennu Framework</name>
<version>3.0.1</version>
<version>3.1.0</version>
<packaging>pom</packaging>

<properties>
Expand Down Expand Up @@ -41,7 +41,7 @@
<connection>scm:git:[email protected]:fenixedu/bennu.git</connection>
<developerConnection>scm:git:[email protected]:fenixedu/bennu.git</developerConnection>
<url>http://fenixedu.github.io/bennu</url>
<tag>v3.0.1</tag>
<tag>v3.1.0</tag>
</scm>

<build>
Expand Down
2 changes: 1 addition & 1 deletion server/bennu-core-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</parent>

<artifactId>bennu-core-test</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>

<properties>
<code.generator.class>pt.ist.fenixframework.backend.jvstm.JVSTMCodeGenerator</code.generator.class>
Expand Down
2 changes: 1 addition & 1 deletion server/bennu-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.fenixedu</groupId>
<artifactId>bennu-server-aggregator</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>
</parent>

<artifactId>bennu-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
import java.lang.management.ClassLoadingMXBean;
import java.lang.management.ManagementFactory;
import java.lang.management.MemoryMXBean;
import java.lang.management.RuntimeMXBean;
import java.lang.management.ThreadMXBean;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Enumeration;
Expand Down Expand Up @@ -61,6 +64,14 @@
@Path("/bennu-core/system")
public class SystemResource extends BennuRestResource {

private static String getHostName() {
try {
return InetAddress.getLocalHost().getHostName();
} catch (UnknownHostException e) {
return "<Host name unknown>";
}
}

@GET
@Path("info")
@Produces({ MediaType.APPLICATION_JSON })
Expand Down Expand Up @@ -124,6 +135,7 @@ public Response info(@Context HttpServletRequest request) {
metrics.addProperty("cacheSize", SharedIdentityMap.getCache().size());
metrics.addProperty("project", FenixFramework.getProject().getName());
metrics.addProperty("version", FenixFramework.getProject().getVersion());
metrics.addProperty("hostname", getHostName());

MemoryMXBean memoryBean = ManagementFactory.getMemoryMXBean();

Expand All @@ -146,6 +158,11 @@ public Response info(@Context HttpServletRequest request) {
metrics.addProperty("jvm.classloading.loaded", classLoading.getLoadedClassCount());
metrics.addProperty("jvm.classloading.unloaded", classLoading.getUnloadedClassCount());

RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();

metrics.addProperty("jvm.runtime.uptime", runtime.getUptime() / 1000);
metrics.addProperty("jvm.runtime.start.time", runtime.getStartTime());

json.add("metrics", metrics);

return Response.ok(toJson(json)).build();
Expand Down
Loading

0 comments on commit 18248fb

Please sign in to comment.