Skip to content

Commit

Permalink
Merge pull request #6 from Zhangxinguo/master
Browse files Browse the repository at this point in the history
html show Mesos role
  • Loading branch information
hanahmily authored May 31, 2017
2 parents 3ea47de + bfcd040 commit f3d914c
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package com.dangdang.ddframe.job.cloud.scheduler.restful;

import com.dangdang.ddframe.job.cloud.scheduler.env.BootstrapEnvironment;
import com.dangdang.ddframe.job.cloud.scheduler.mesos.MesosStateService;
import com.dangdang.ddframe.job.cloud.scheduler.mesos.ReconcileService;
import com.dangdang.ddframe.job.reg.base.CoordinatorRegistryCenter;
Expand Down Expand Up @@ -100,4 +101,15 @@ public JsonArray sandbox(@QueryParam("appName") final String appName) throws JSO
Preconditions.checkArgument(!Strings.isNullOrEmpty(appName), "Lack param 'appName'");
return mesosStateService.sandbox(appName);
}

/**
* 获取作业云Mesos角色信息.
*
* @return mesos role
*/
@GET
@Path("/mesosRole")
public String getMesosRole() {
return BootstrapEnvironment.getInstance().getMesosRole().orNull();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
<span class="logo-lg">Elastic Job Cloud Console</span>
</a>
<nav class="navbar navbar-static-top" role="navigation">
<div class="navbar-header">
<span class="navbar-brand">
<i class="fa fa-server"></i>
<span id="mesos-role"></span>
</span>
</div>
<div id="navbar" class="navbar-custom-menu">
<ul class="nav navbar-nav">
<li class="dropdown">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,15 @@ function authorityControl() {
}
});
}

function getMesosRole() {
$.ajax({
url: "/api/operate/mesosRole",
type: "GET",
success: function (data) {
if (null !== data) {
$("#mesos-role").text(data);
}
}
});
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
$(function() {
$("#content-right").load("/html/app/apps_overview.html");
$("#content-right").load("/html/app/apps_overview.html", function() {
getMesosRole();
});
refreshJobNavTag();
refreshAppNavTag();
$("#register-app").click(function() {
Expand Down

0 comments on commit f3d914c

Please sign in to comment.