/** * Sets up a table to be a consistent style. * @param html the HTML to use to render. * @param tableId the ID of the table to set styles on. * @param innerStyles any other styles to add to the table. */ protected void setTableStyles(Page.HTML<_> html, String tableId, String... innerStyles) { List<String> styles = Lists.newArrayList(); styles.add(join('#', tableId, "_paginate span {font-weight:normal}")); styles.add(join('#', tableId, " .progress {width:8em}")); styles.add(join('#', tableId, "_processing {top:-1.5em; font-size:1em;")); styles.add(" color:#000; background:rgba(255, 255, 255, 0.8)}"); for (String style : innerStyles) { styles.add(join('#', tableId, " ", style)); } html.style(styles.toArray()); } }
/** * Warn the user that the link may not be safe! * @param resp the http response * @param link the link to point to * @param user the user that owns the link. * @throws IOException on any error. */ private static void warnUserPage(HttpServletResponse resp, String link, String user, ApplicationId id) throws IOException { //Set the cookie when we warn which overrides the query parameter //This is so that if a user passes in the approved query parameter without //having first visited this page then this page will still be displayed resp.addCookie(makeCheckCookie(id, false)); resp.setContentType(MimeType.HTML); Page p = new Page(resp.getWriter()); p.html(). h1("WARNING: The following page may not be safe!"). h3(). _("click ").a(link, "here"). _(" to continue to an Application Master web interface owned by ", user). _(). _(); }
set(initID(DATATABLES, "t4"), "{bJQueryUI:true, sDom:'t'}"); html. title("Test DataTables"). link("/static/yarn.css"). _(JQueryUI.class). style(".wrapper { padding: 1em }", ".wrapper h2 { margin: 0.5em 0 }", ".dataTables_wrapper { min-height: 1em }"). div(".wrapper"). h2("Default table init"). table("#t1"). tr().td("subc1r1").td("subc2r1")._(). tr().td("subc1r2").td("subc2r2")._(). _()._()._()._()._()._()._()._()._();
set(initID(DATATABLES, "t4"), "{bJQueryUI:true, sDom:'t'}"); html. title("Test DataTables"). link("/static/yarn.css"). _(JQueryUI.class). style(".wrapper { padding: 1em }", ".wrapper h2 { margin: 0.5em 0 }", ".dataTables_wrapper { min-height: 1em }"). div(".wrapper"). h2("Default table init"). table("#t1"). tr().td("subc1r1").td("subc2r1")._(). tr().td("subc1r2").td("subc2r2")._(). _()._()._()._()._()._()._()._()._();
@Override protected void postHead(Page.HTML<_> html) { html. style().$type("text/css"). _("#cs { padding: 0.5em 0 1em 0; margin-bottom: 1em; position: relative }", "#cs ul { list-style: none }", ".qlegend { font-weight: normal; padding: 0 1em; margin: 1em }", "table.info tr th {width: 50%}")._(). // to center info table script("/static/jt/jquery.jstree.js"). script().$type("text/javascript"). _("$(function() {", " $('#cs a span').addClass('ui-corner-all').css('position', 'absolute');", " $('#cs').show();", "});")._(). _(SchedulerPageUtil.QueueBlockUtil.class);
@Override protected void postHead(Page.HTML<_> html) { html. style().$type("text/css"). _("#cs { padding: 0.5em 0 1em 0; margin-bottom: 1em; position: relative }", "#cs ul { list-style: none }", ".qlegend { font-weight: normal; padding: 0 1em; margin: 1em }", "table.info tr th {width: 50%}")._(). // to center info table script("/static/jt/jquery.jstree.js"). script().$type("text/javascript"). _("$(function() {", " $('#cs a span').addClass('ui-corner-all').css('position', 'absolute');", " $('#cs').show();", "});")._(). _(SchedulerPageUtil.QueueBlockUtil.class);
@Override protected void postHead(Page.HTML<_> html) { html. style().$type("text/css"). _("#cs { padding: 0.5em 0 1em 0; margin-bottom: 1em; position: relative }", "#cs ul { list-style: none }", ".qlegend { font-weight: normal; padding: 0 1em; margin: 1em }", "table.info tr th {width: 50%}")._(). // to center info table script("/static/jt/jquery.jstree.js"). script().$type("text/javascript"). _("$(function() {", " $('#cs a span').addClass('ui-corner-all').css('position', 'absolute');", " $('#cs').show();", "});")._(). _(SchedulerPageUtil.QueueBlockUtil.class);
@Override protected void postHead(Page.HTML<_> html) { html. style().$type("text/css"). _("#cs { padding: 0.5em 0 1em 0; margin-bottom: 1em; position: relative }", "#cs ul { list-style: none }", ".qlegend { font-weight: normal; padding: 0 1em; margin: 1em }", "table.info tr th {width: 50%}")._(). // to center info table script("/static/jt/jquery.jstree.js"). script().$type("text/javascript"). _("$(function() {", " $('#cs a span').addClass('ui-corner-all').css('position', 'absolute');", " $('#cs').show();", "});")._(). _(SchedulerPageUtil.QueueBlockUtil.class);
@Override protected void render(Page.HTML<_> 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 }", ".leftnav .nav { float: left; width: 11em; position: relative;", " right: 12em; overflow: hidden; }"). _(JQueryUI.class); postHead(html); JQueryUI.jsnotice(html); html. div(".main.ui-widget-content"). _(header()). div(".cmask.leftnav"). _(nav()). div(".push")._()._()._()._()._(). div(".footer.ui-widget-content"). _(footer())._()._();
@Override protected void render(Page.HTML<_> 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 }", ".leftnav .nav { float: left; width: 11em; position: relative;", " right: 12em; overflow: hidden; }"). _(JQueryUI.class); postHead(html); JQueryUI.jsnotice(html); html. div(".main.ui-widget-content"). _(header()). div(".cmask.leftnav"). _(nav()). div(".push")._()._()._()._()._(). div(".footer.ui-widget-content"). _(footer())._()._();
@Override protected void postHead(Page.HTML<_> 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%}")._(). // to center info table 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();", "});")._(); }
@Override protected void render(Page.HTML<_> 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 tbody { vertical-align: top; }", "#layout tfoot td { height: 4em; }"). _(JQueryUI.class); postHead(html); JQueryUI.jsnotice(html); html. table("#layout.ui-widget-content"). thead(). tr(). _(nav())._(). td().$class("content"). _(content())._()._()._()._()._();
@Override protected void render(Page.HTML<_> 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 tbody { vertical-align: top; }", "#layout tfoot td { height: 4em; }"). _(JQueryUI.class); postHead(html); JQueryUI.jsnotice(html); html. table("#layout.ui-widget-content"). thead(). tr(). _(nav())._(). td().$class("content"). _(content())._()._()._()._()._();
@Override protected void postHead(Page.HTML<_> 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%}")._(). // to center info table 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();", "});")._(); }
/** * Warn the user that the link may not be safe! * @param resp the http response * @param link the link to point to * @param user the user that owns the link. * @throws IOException on any error. */ private static void warnUserPage(HttpServletResponse resp, String link, String user, ApplicationId id) throws IOException { //Set the cookie when we warn which overrides the query parameter //This is so that if a user passes in the approved query parameter without //having first visited this page then this page will still be displayed resp.addCookie(makeCheckCookie(id, false)); resp.setContentType(MimeType.HTML); Page p = new Page(resp.getWriter()); p.html(). h1("WARNING: The following page may not be safe!"). h3(). _("click ").a(link, "here"). _(" to continue to an Application Master web interface owned by ", user). _(). _(); }
/** * Warn the user that the link may not be safe! * @param resp the http response * @param link the link to point to * @param user the user that owns the link. * @throws IOException on any error. */ private static void warnUserPage(HttpServletResponse resp, String link, String user, ApplicationId id) throws IOException { //Set the cookie when we warn which overrides the query parameter //This is so that if a user passes in the approved query parameter without //having first visited this page then this page will still be displayed resp.addCookie(makeCheckCookie(id, false)); resp.setContentType(MimeType.HTML); Page p = new Page(resp.getWriter()); p.html(). h1("WARNING: The following page may not be safe!"). h3(). _("click ").a(link, "here"). _(" to continue to an Application Master web interface owned by ", user). _(). _(); }
/** * Sets up a table to be a consistent style. * @param html the HTML to use to render. * @param tableId the ID of the table to set styles on. * @param innerStyles any other styles to add to the table. */ protected void setTableStyles(Page.HTML<_> html, String tableId, String... innerStyles) { List<String> styles = Lists.newArrayList(); styles.add(join('#', tableId, "_paginate span {font-weight:normal}")); styles.add(join('#', tableId, " .progress {width:8em}")); styles.add(join('#', tableId, "_processing {top:-1.5em; font-size:1em;")); styles.add(" color:#000; background:rgba(255, 255, 255, 0.8)}"); for (String style : innerStyles) { styles.add(join('#', tableId, " ", style)); } html.style(styles.toArray()); } }