Skip to content

Commit

Permalink
JVM tab will now only appear when there is a JVM running
Browse files Browse the repository at this point in the history
  • Loading branch information
dzautner committed Sep 3, 2014
1 parent f46598f commit 238cd19
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
13 changes: 10 additions & 3 deletions osv/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,16 @@ OSv.App = Davis(function() {
profilerHandler.handler();
});

this.get("/dashboard/jvm", function() {
jvmHandler.handler();
});
var self = this;
OSv.API.JVM.version()
.then(function () {
self.get("/dashboard/jvm", function() {
jvmHandler.handler();
});
})
.fail(function () {
baseHandler.removeJVMTab();
});

this.bind('runRoute', function (data) {
runRoute.initCustomEvent('runRoute', true, true, data);
Expand Down
4 changes: 4 additions & 0 deletions osv/PageHandlers/BaseHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ OSv.PageHandlers.BaseHandler = (function() {
$("[data-swagger-href]").attr("href", OSv.Settings.BasePath);
};

BaseHandler.prototype.removeJVMTab = function() {
$("a[href='/dashboard/jvm']").parent("li").remove();
};

BaseHandler.prototype.subscribe = function() {
var self = this;

Expand Down

0 comments on commit 238cd19

Please sign in to comment.