protected override void PreHead(Hamlet.HTML <HtmlPage._> html) { string redirectUrl = $(RedirectUrl); if (redirectUrl == null || redirectUrl.IsEmpty()) { Set(Title, StringHelper.Join("Logs for ", $(YarnWebParams.ContainerId))); } else { if (redirectUrl.Equals("false")) { Set(Title, StringHelper.Join("Failed redirect for ", $(YarnWebParams.ContainerId) )); } else { //Error getting redirect url. Fall through. Set(Title, StringHelper.Join("Redirecting to log server for ", $(YarnWebParams.ContainerId ))); html.Meta_http("refresh", "1; url=" + redirectUrl); } } Set(JQueryUI.AccordionId, "nav"); Set(JQueryUI.InitID(JQueryUI.Accordion, "nav"), "{autoHeight:false, active:0}"); }
protected override void PreHead(Hamlet.HTML <HtmlPage._> html) { CommonPreHead(html); Set(DatatablesId, "jobs"); Set(JQueryUI.InitID(Datatables, "jobs"), JobsTableInit()); SetTableStyles(html, "jobs"); }
protected override void PreHead(Hamlet.HTML <HtmlPage._> html) { CommonPreHead(html); string containerId = $(YarnWebParams.ContainerId); Set(Title, containerId.IsEmpty() ? "Bad request: missing container ID" : StringHelper.Join ("Container ", $(YarnWebParams.ContainerId))); }
protected override void PreHead(Hamlet.HTML <HtmlPage._> html) { CommonPreHead(html); Set(JQueryUI.InitID(JQueryUI.Accordion, "nav"), "{autoHeight:false, active:3}"); Set(JQueryUI.DatatablesId, "attempts"); Set(JQueryUI.InitID(JQueryUI.Datatables, "attempts"), AttemptsTableInit()); SetTableStyles(html, "attempts"); }
protected override void PreHead(Hamlet.HTML <HtmlPage._> html) { CommonPreHead(html); SetTitle("Applications running on this node"); Set(JQueryUI.DatatablesId, "applications"); Set(JQueryUI.InitID(JQueryUI.Datatables, "applications"), AppsTableInit()); SetTableStyles(html, "applications"); }
protected override void PreHead(Hamlet.HTML <HtmlPage._> html) { CommonPreHead(html); SetTitle("All containers running on this node"); Set(JQueryUI.DatatablesId, "containers"); Set(JQueryUI.InitID(JQueryUI.Datatables, "containers"), ContainersTableInit()); SetTableStyles(html, "containers"); }
protected override void PreHead(Hamlet.HTML <HtmlPage._> html) { string jobID = $(AMParams.JobId); Set(Title, jobID.IsEmpty() ? "Bad request: missing job ID" : StringHelper.Join("MapReduce Job " , $(AMParams.JobId))); CommonPreHead(html); Set(JQueryUI.InitID(JQueryUI.Accordion, "nav"), "{autoHeight:false, active:2}"); }
protected override void PreHead(Hamlet.HTML <HtmlPage._> html) { CommonPreHead(html); string title = "Node labels of the cluster"; SetTitle(title); Set(JQueryUI.DatatablesId, "nodelabels"); SetTableStyles(html, "nodelabels", ".healthStatus {width:10em}", ".healthReport {width:10em}" ); }
/* * (non-Javadoc) * @see org.apache.hadoop.mapreduce.v2.hs.webapp.HsView#preHead(org.apache.hadoop.yarn.webapp.hamlet.Hamlet.HTML) */ protected override void PreHead(Hamlet.HTML <HtmlPage._> html) { CommonPreHead(html); Set(JQueryUI.DatatablesId, "tasks"); Set(JQueryUI.DatatablesSelector, ".dt-tasks"); Set(JQueryUI.InitSelector(JQueryUI.Datatables), TasksTableInit()); Set(JQueryUI.InitID(JQueryUI.Accordion, "nav"), "{autoHeight:false, active:1}"); Set(JQueryUI.InitID(JQueryUI.Datatables, "tasks"), TasksTableInit()); Set(JQueryUI.PostInitID(JQueryUI.Datatables, "tasks"), JobsPostTableInit()); SetTableStyles(html, "tasks"); }
protected internal override void Render(Hamlet.HTML <HtmlPage._> html) { Set(JQueryUI.AccordionId, "msg"); string title = "Sorry, got error " + Status(); html.Title(title).Link(Root_url("static", "yarn.css")).(typeof(JQueryUI)).Style("#msg { margin: 1em auto; width: 88%; }" , "#msg h1 { padding: 0.2em 1.5em; font: bold 1.3em serif; }").Div("#msg").H1(title ).Div().("Please consult").A("http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html" , "RFC 2616").(" for meanings of the error code.").().H1("Error Details").Pre(). (ErrorDetails()).().().(); }
/* * (non-Javadoc) * @see org.apache.hadoop.mapreduce.v2.hs.webapp.HsView#preHead(org.apache.hadoop.yarn.webapp.hamlet.Hamlet.HTML) */ protected override void PreHead(Hamlet.HTML <HtmlPage._> html) { CommonPreHead(html); //override the nav config from commonPReHead Set(JQueryUI.InitID(JQueryUI.Accordion, "nav"), "{autoHeight:false, active:2}"); //Set up the java script and CSS for the attempts table Set(JQueryUI.DatatablesId, "attempts"); Set(JQueryUI.InitID(JQueryUI.Datatables, "attempts"), AttemptsTableInit()); Set(JQueryUI.PostInitID(JQueryUI.Datatables, "attempts"), AttemptsPostTableInit() ); SetTableStyles(html, "attempts"); }
// Do NOT rename/refactor this to AHSView as it will wreak havoc // on Mac OS HFS // direct table rendering // inline js array protected override void PreHead(Hamlet.HTML <HtmlPage._> html) { CommonPreHead(html); Set(JQueryUI.DatatablesId, "apps"); Set(JQueryUI.InitID(JQueryUI.Datatables, "apps"), WebPageUtils.AppsTableInit()); SetTableStyles(html, "apps", ".queue {width:6em}", ".ui {width:8em}"); // Set the correct title. string reqState = $(YarnWebParams.AppState); reqState = (reqState == null || reqState.IsEmpty() ? "All" : reqState); SetTitle(StringHelper.Sjoin(reqState, "Applications")); }
/* * (non-Javadoc) * @see org.apache.hadoop.mapreduce.v2.hs.webapp.HsView#preHead(org.apache.hadoop.yarn.webapp.hamlet.Hamlet.HTML) */ protected override void PreHead(Hamlet.HTML <HtmlPage._> html) { string jobID = $(AMParams.JobId); Set(Title, jobID.IsEmpty() ? "Bad request: missing job ID" : StringHelper.Join("Configuration for MapReduce Job " , $(AMParams.JobId))); CommonPreHead(html); Set(JQueryUI.InitID(JQueryUI.Accordion, "nav"), "{autoHeight:false, active:2}"); Set(JQueryUI.DatatablesId, "conf"); Set(JQueryUI.InitID(JQueryUI.Datatables, "conf"), ConfTableInit()); Set(JQueryUI.PostInitID(JQueryUI.Datatables, "conf"), ConfPostTableInit()); SetTableStyles(html, "conf"); }
/* * (non-Javadoc) * @see org.apache.hadoop.yarn.webapp.view.HtmlPage#render(org.apache.hadoop.yarn.webapp.hamlet.Hamlet.HTML) */ protected internal override void Render(Hamlet.HTML <HtmlPage._> html) { PreHead(html); html.Title($(Title)).Link(Root_url("static", "yarn.css")).Style("#layout { height: 100%; }" , "#layout thead td { height: 3em; }", "#layout #navcell { width: 11em; padding: 0 1em; }" , "#layout td.content { padding-top: 0 }", "#layout tbody { vertical-align: top; }" , "#layout tfoot td { height: 4em; }").(typeof(JQueryUI)); PostHead(html); JQueryUI.Jsnotice(html); html.Table("#layout.ui-widget-content").Thead().Tr().Td().$colspan(2).(Header()). ().().().Tfoot().Tr().Td().$colspan(2).(Footer()).().().().Tbody().Tr().Td().$id ("navcell").(Nav()).().Td().$class("content").(Content()).().().().().(); }
protected override void PreHead(Hamlet.HTML <HtmlPage._> html) { CommonPreHead(html); string appAttemptId = $(YarnWebParams.ApplicationAttemptId); Set(Title, appAttemptId.IsEmpty() ? "Bad request: missing application attempt ID" : StringHelper.Join("Application Attempt ", $(YarnWebParams.ApplicationAttemptId ))); Set(JQueryUI.DatatablesId, "containers"); Set(JQueryUI.InitID(JQueryUI.Datatables, "containers"), WebPageUtils.ContainersTableInit ()); SetTableStyles(html, "containers", ".queue {width:6em}", ".ui {width:8em}"); Set(YarnWebParams.WebUiType, YarnWebParams.AppHistoryWebUi); }
/* * (non-Javadoc) * * @see * org.apache.hadoop.yarn.server.applicationhistoryservice.webapp.AHSView# * preHead(org.apache.hadoop .yarn.webapp.hamlet.Hamlet.HTML) */ protected override void PreHead(Hamlet.HTML <HtmlPage._> html) { string logEntity = $(YarnWebParams.EntityString); if (logEntity == null || logEntity.IsEmpty()) { logEntity = $(YarnWebParams.ContainerId); } if (logEntity == null || logEntity.IsEmpty()) { logEntity = "UNKNOWN"; } CommonPreHead(html); }
protected override void PostHead(Hamlet.HTML <HtmlPage._> html) { html.Style().$type("text/css").("#cs { padding: 0.5em 0 1em 0; margin-bottom: 1em; position: relative }" , "#cs ul { list-style: none }", "#cs a { font-weight: normal; margin: 2px; position: relative }" , "#cs a span { font-weight: normal; font-size: 80% }", "#cs-wrapper .ui-widget-header { padding: 0.2em 0.5em }" , "table.info tr th {width: 50%}").().Script("/static/jt/jquery.jstree.js").Script ().$type("text/javascript").("$(function() {", " $('#cs a span').addClass('ui-corner-all').css('position', 'absolute');" , " $('#cs').bind('loaded.jstree', function (e, data) {", " data.inst.open_all(); })." , " jstree({", " core: { animation: 188, html_titles: true },", " plugins: ['themeroller', 'html_data', 'ui']," , " themeroller: { item_open: 'ui-icon-minus',", " item_clsd: 'ui-icon-plus', item_leaf: 'ui-icon-gear'" , " }", " });", " $('#cs').bind('select_node.jstree', function(e, data) {", " var q = $('.q', data.rslt.obj).first().text();", " if (q == 'root') q = '';" , " $('#apps').dataTable().fnFilter(q, 4);", " });", " $('#cs').show();", "});" ).(); }
protected override void PreHead(Hamlet.HTML <HtmlPage._> html) { CommonPreHead(html); string tid = $(AMParams.TaskId); string activeNav = "3"; if (tid == null || tid.IsEmpty()) { activeNav = "2"; } Set(JQueryUI.InitID(Accordion, "nav"), "{autoHeight:false, active:" + activeNav + "}"); Set(DatatablesSelector, "#counters .dt-counters"); Set(JQueryUI.InitSelector(Datatables), "{bJQueryUI:true, sDom:'t', iDisplayLength:-1}" ); }
/* (non-Javadoc) * @see org.apache.hadoop.yarn.server.nodemanager.webapp.NMView#preHead(org.apache.hadoop.yarn.webapp.hamlet.Hamlet.HTML) */ protected internal override void PreHead(Hamlet.HTML <HtmlPage._> html) { string logEntity = $(YarnWebParams.EntityString); if (logEntity == null || logEntity.IsEmpty()) { logEntity = $(YarnWebParams.ContainerId); } if (logEntity == null || logEntity.IsEmpty()) { logEntity = "UNKNOWN"; } Set(Title, StringHelper.Join("Logs for ", logEntity)); Set(JQueryUI.AccordionId, "nav"); Set(JQueryUI.InitID(JQueryUI.Accordion, "nav"), "{autoHeight:false, active:0}"); }
/* * (non-Javadoc) * @see org.apache.hadoop.mapreduce.v2.hs.webapp.HsView#preHead(org.apache.hadoop.yarn.webapp.hamlet.Hamlet.HTML) */ protected override void PreHead(Hamlet.HTML <HtmlPage._> html) { CommonPreHead(html); string tid = $(AMParams.TaskId); string activeNav = "3"; if (tid == null || tid.IsEmpty()) { activeNav = "2"; } Set(JQueryUI.InitID(Accordion, "nav"), "{autoHeight:false, active:" + activeNav + "}"); Set(DatatablesId, "singleCounter"); Set(JQueryUI.InitID(Datatables, "singleCounter"), CounterTableInit()); SetTableStyles(html, "singleCounter"); }
protected override void PreHead(Hamlet.HTML <HtmlPage._> html) { CommonPreHead(html); string type = $(YarnWebParams.NodeState); string title = "Nodes of the cluster"; if (type != null && !type.IsEmpty()) { title = title + " (" + type + ")"; } SetTitle(title); Set(JQueryUI.DatatablesId, "nodes"); Set(JQueryUI.InitID(JQueryUI.Datatables, "nodes"), NodesTableInit()); SetTableStyles(html, "nodes", ".healthStatus {width:10em}", ".healthReport {width:10em}" ); }
protected override void PostHead(Hamlet.HTML <HtmlPage._> html) { html.Style().$type("text/css").("#cs { padding: 0.5em 0 1em 0; margin-bottom: 1em; position: relative }" , "#cs ul { list-style: none }", "#cs a { font-weight: normal; margin: 2px; position: relative }" , "#cs a span { font-weight: normal; font-size: 80% }", "#cs-wrapper .ui-widget-header { padding: 0.2em 0.5em }" , ".qstats { font-weight: normal; font-size: 80%; position: absolute }", ".qlegend { font-weight: normal; padding: 0 1em; margin: 1em }" , "table.info tr th {width: 50%}").().Script("/static/jt/jquery.jstree.js").Script ().$type("text/javascript").("$(function() {", " $('#cs a span').addClass('ui-corner-all').css('position', 'absolute');" , " $('#cs').bind('loaded.jstree', function (e, data) {", " var callback = { call:reopenQueryNodes }" , " data.inst.open_node('#pq', callback);", " }).", " jstree({", " core: { animation: 188, html_titles: true }," , " plugins: ['themeroller', 'html_data', 'ui'],", " themeroller: { item_open: 'ui-icon-minus'," , " item_clsd: 'ui-icon-plus', item_leaf: 'ui-icon-gear'", " }", " });" , " $('#cs').bind('select_node.jstree', function(e, data) {", " var queues = $('.q', data.rslt.obj);" , " var q = '^' + queues.first().text();", " q += queues.length == 1 ? '$' : '\\\\.';" , " $('#apps').dataTable().fnFilter(q, 4, true);", " });", " $('#cs').show();" , "});").().(typeof(SchedulerPageUtil.QueueBlockUtil)); }
/// <summary>Sets up a table to be a consistent style.</summary> /// <param name="html">the HTML to use to render.</param> /// <param name="tableId">the ID of the table to set styles on.</param> /// <param name="innerStyles">any other styles to add to the table.</param> protected internal virtual void SetTableStyles(Hamlet.HTML <HtmlPage._> html, string tableId, params string[] innerStyles) { IList <string> styles = Lists.NewArrayList(); styles.AddItem(StringHelper.Join('#', tableId, "_paginate span {font-weight:normal}" )); styles.AddItem(StringHelper.Join('#', tableId, " .progress {width:8em}")); styles.AddItem(StringHelper.Join('#', tableId, "_processing {top:-1.5em; font-size:1em;" )); styles.AddItem(" color:#000; background:rgba(255, 255, 255, 0.8)}"); foreach (string style in innerStyles) { styles.AddItem(StringHelper.Join('#', tableId, " ", style)); } html.Style(Sharpen.Collections.ToArray(styles)); }
protected internal override void Render(Hamlet.HTML <HtmlPage._> html) { PreHead(html); html.Title($("title")).Link(Root_url("static", "yarn.css")).Style(".main { min-height: 100%; height: auto !important; height: 100%;" , " margin: 0 auto -4em; border: 0; }", ".footer, .push { height: 4em; clear: both; border: 0 }" , ".main.ui-widget-content, .footer.ui-widget-content { border: 0; }", ".cmask { position: relative; clear: both; float: left;" , " width: 100%; overflow: hidden; }", ".leftnav .c1right { float: left; width: 200%; position: relative;" , " left: 13em; border: 0; /* background: #fff; */ }", ".leftnav .c1wrap { float: right; width: 50%; position: relative;" , " right: 13em; padding-bottom: 1em; }", ".leftnav .content { margin: 0 1em 0 14em; position: relative;" , " right: 100%; overflow: hidden; }", ".leftnav .nav { float: left; width: 11em; position: relative;" , " right: 12em; overflow: hidden; }").(typeof(JQueryUI)); PostHead(html); JQueryUI.Jsnotice(html); html.Div(".main.ui-widget-content").(Header()).Div(".cmask.leftnav").Div(".c1right" ).Div(".c1wrap").Div(".content").(Content()).().().Div(".nav").(Nav()).Div(".push" ).().().().().().Div(".footer.ui-widget-content").(Footer()).().(); }
protected internal override void Render(Hamlet.HTML <HtmlPage._> html) { Set(JQueryUI.DatatablesId, "t1 t2 t3 t4"); Set(JQueryUI.InitID(JQueryUI.Datatables, "t1"), JQueryUI.TableInit().Append("}"). ToString()); Set(JQueryUI.InitID(JQueryUI.Datatables, "t2"), StringHelper.Join("{bJQueryUI:true, sDom:'t'," , "aoColumns:[null, {bSortable:false, bSearchable:false}]}")); Set(JQueryUI.InitID(JQueryUI.Datatables, "t3"), "{bJQueryUI:true, sDom:'t'}"); Set(JQueryUI.InitID(JQueryUI.Datatables, "t4"), "{bJQueryUI:true, sDom:'t'}"); html.Title("Test DataTables").Link("/static/yarn.css").(typeof(JQueryUI)).Style(".wrapper { padding: 1em }" , ".wrapper h2 { margin: 0.5em 0 }", ".dataTables_wrapper { min-height: 1em }"). Div(".wrapper").H2("Default table init").Table("#t1").Thead().Tr().Th("Column1") .Th("Column2").().().Tbody().Tr().Td("c1r1").Td("c2r1").().Tr().Td("c1r2").Td("c2r2" ).().().().H2("Nested tables").Div(JQueryUI.InfoWrap).Table("#t2").Thead().Tr(). Th(JQueryUI.Th, "Column1").Th(JQueryUI.Th, "Column2").().().Tbody().Tr().Td("r1" ).Td().$class(JQueryUI.CTable).Table("#t3").Thead().Tr().Th("SubColumn1").Th("SubColumn2" ).().().Tbody().Tr().Td("subc1r1").Td("subc2r1").().Tr().Td("subc1r2").Td("subc2r2" ).().().().().().Tr().Td("r2").Td().$class(JQueryUI.CTable).Table("#t4").Thead() .Tr().Th("SubColumn1").Th("SubColumn2").().().Tbody().Tr().Td("subc1r1").Td("subc2r1" ).().Tr().Td("subc1r2").Td("subc2r2").().().().().().().().().().(); }
/// <summary>Do what needs to be done after the header is rendered.</summary> /// <param name="html">the html to use to render.</param> protected internal virtual void PostHead(Hamlet.HTML <HtmlPage._> html) { }
protected internal override void Render(Hamlet.HTML <HtmlPage._> html) { html.Title("short test").P().("should throw"); }
protected internal override void Render(Hamlet.HTML <HtmlPage._> html) { html.Title("test").P("#testid").("test note").().(); }
protected internal override void CommonPreHead(Hamlet.HTML <HtmlPage._> html) { base.CommonPreHead(html); Set(JQueryUI.InitID(JQueryUI.Accordion, "nav"), "{autoHeight:false, active:1}"); }
protected internal virtual void CommonPreHead(Hamlet.HTML <HtmlPage._> html) { Set(AccordionId, "nav"); Set(JQueryUI.InitID(Accordion, "nav"), "{autoHeight:false, active:1}"); }