|
@@ -18,7 +18,11 @@
|
|
|
|
|
|
package org.apache.hadoop.yarn.server.resourcemanager.webapp;
|
|
|
|
|
|
+import com.google.inject.Inject;
|
|
|
+import org.apache.hadoop.conf.Configuration;
|
|
|
import org.apache.hadoop.yarn.api.records.YarnApplicationState;
|
|
|
+import org.apache.hadoop.yarn.conf.YarnConfiguration;
|
|
|
+import org.apache.hadoop.yarn.server.webapp.WebPageUtils;
|
|
|
import org.apache.hadoop.yarn.util.Log4jWarningErrorMetricsAppender;
|
|
|
import org.apache.hadoop.yarn.webapp.hamlet2.Hamlet;
|
|
|
import org.apache.hadoop.yarn.webapp.hamlet2.Hamlet.DIV;
|
|
@@ -29,6 +33,12 @@ import org.apache.hadoop.yarn.webapp.view.HtmlBlock;
|
|
|
import static org.apache.hadoop.util.GenericsUtil.isLog4jLogger;
|
|
|
|
|
|
public class NavBlock extends HtmlBlock {
|
|
|
+ private Configuration conf;
|
|
|
+
|
|
|
+ @Inject
|
|
|
+ public NavBlock(Configuration conf) {
|
|
|
+ this.conf = conf;
|
|
|
+ }
|
|
|
|
|
|
@Override public void render(Block html) {
|
|
|
boolean addErrorsAndWarningsLink = false;
|
|
@@ -55,13 +65,14 @@ public class NavBlock extends HtmlBlock {
|
|
|
li().a(url("apps", state.toString()), state.toString()).__();
|
|
|
}
|
|
|
subAppsList.__().__();
|
|
|
- UL<DIV<Hamlet>> tools = mainList.
|
|
|
- li().a(url("scheduler"), "Scheduler").__().__().
|
|
|
- h3("Tools").ul();
|
|
|
- tools.li().a("/conf", "Configuration").__().
|
|
|
- li().a("/logs", "Local logs").__().
|
|
|
- li().a("/stacks", "Server stacks").__().
|
|
|
- li().a("/jmx?qry=Hadoop:*", "Server metrics").__();
|
|
|
+
|
|
|
+ DIV<Hamlet> sectionBefore = mainList.
|
|
|
+ li().a(url("scheduler"), "Scheduler").__().__();
|
|
|
+ UL<DIV<Hamlet>> tools = WebPageUtils.appendToolSection(sectionBefore, conf);
|
|
|
+
|
|
|
+ if (tools == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
if (addErrorsAndWarningsLink) {
|
|
|
tools.li().a(url("errors-and-warnings"), "Errors/Warnings").__();
|