This is an automated email from the ASF dual-hosted git repository. nihaljain pushed a commit to branch branch-3 in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-3 by this push: new 102b1a59393 HBASE-20693 Refactor thrift jsp's and extract header and footer (#5732) - Fixes the way logLevel page renders in UI 102b1a59393 is described below commit 102b1a593933dda00339c71a30f7a0e1244c59f2 Author: Nihal Jain <nihalj...@apache.org> AuthorDate: Fri Mar 1 18:46:58 2024 +0530 HBASE-20693 Refactor thrift jsp's and extract header and footer (#5732) - Fixes the way logLevel page renders in UI Signed-off-by: Nick Dimiduk <ndimi...@apache.org> (cherry picked from commit ede4ccd2dc5f5690a518f97b6d28a7e18df9584a) --- .../main/resources/hbase-webapps/thrift/footer.jsp | 30 ++++++++ .../main/resources/hbase-webapps/thrift/header.jsp | 74 +++++++++++++++++++ .../main/resources/hbase-webapps/thrift/thrift.jsp | 85 +++++----------------- 3 files changed, 121 insertions(+), 68 deletions(-) diff --git a/hbase-thrift/src/main/resources/hbase-webapps/thrift/footer.jsp b/hbase-thrift/src/main/resources/hbase-webapps/thrift/footer.jsp new file mode 100644 index 00000000000..53a7d0cdbdb --- /dev/null +++ b/hbase-thrift/src/main/resources/hbase-webapps/thrift/footer.jsp @@ -0,0 +1,30 @@ +<%-- +/** +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +--%> + <script src="/static/js/jquery.min.js" type="text/javascript"></script> + <script src="/static/js/bootstrap.min.js" type="text/javascript"></script> + <script src="/static/js/tab.js" type="text/javascript"></script> + <script type="text/javascript"> + $(document).ready(function() { + $('li.active').removeClass('active'); + $('a[href="' + location.pathname + '"]').closest('li').addClass('active'); + }); + </script> + </body> +</html> diff --git a/hbase-thrift/src/main/resources/hbase-webapps/thrift/header.jsp b/hbase-thrift/src/main/resources/hbase-webapps/thrift/header.jsp new file mode 100644 index 00000000000..f43872c11af --- /dev/null +++ b/hbase-thrift/src/main/resources/hbase-webapps/thrift/header.jsp @@ -0,0 +1,74 @@ +<%-- +/** +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +--%> +<%@ page contentType="text/html;charset=UTF-8" + import="org.apache.hadoop.hbase.HBaseConfiguration"%> + +<!DOCTYPE html> +<?xml version="1.0" encoding="UTF-8" ?> +<html lang="en"> +<head> + <meta charset="utf-8"> + <title><%= request.getParameter("pageTitle")%></title> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta name="description" content=""> + + <link href="/static/css/bootstrap.min.css" rel="stylesheet"> + <link href="/static/css/bootstrap-theme.min.css" rel="stylesheet"> + <link href="/static/css/hbase.css" rel="stylesheet"> +</head> + +<body> +<div class="navbar navbar-fixed-top navbar-default"> + <div class="container-fluid"> + <div class="navbar-header"> + <button type="button" + class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="/thrift.jsp"> + <img src="/static/hbase_logo_small.png" alt="HBase Logo"/> + </a> + </div> + <div class="collapse navbar-collapse"> + <ul class="nav navbar-nav"> + <li class="active"><a href="/thrift.jsp">Home</a></li> + <li><a href="/logs/">Local logs</a></li> + <li><a href="/logLevel">Log Level</a></li> + <li class="nav-item dropdown"> + <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> + Metrics <span class="caret"></span> + </a> + <ul class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink"> + <li><a target="_blank" href="/jmx">JMX</a></li> + <li><a target="_blank" href="/jmx?description=true">JMX with description</a></li> + <li><a target="_blank" href="/prometheus">Prometheus</a></li> + <li><a target="_blank" href="/prometheus?description=true">Prometheus with description</a></li> + </ul> + </li> + <li><a href="/prof">Profiler</a></li> + <% if (HBaseConfiguration.isShowConfInServlet()) { %> + <li><a href="/conf">HBase Configuration</a></li> + <% } %> + </ul> + </div><!--/.nav-collapse --> + </div> +</div> diff --git a/hbase-thrift/src/main/resources/hbase-webapps/thrift/thrift.jsp b/hbase-thrift/src/main/resources/hbase-webapps/thrift/thrift.jsp index 6b308fc2a2d..d148df1f2e2 100644 --- a/hbase-thrift/src/main/resources/hbase-webapps/thrift/thrift.jsp +++ b/hbase-thrift/src/main/resources/hbase-webapps/thrift/thrift.jsp @@ -19,7 +19,6 @@ --%> <%@ page contentType="text/html;charset=UTF-8" import="org.apache.hadoop.conf.Configuration" - import="org.apache.hadoop.hbase.HBaseConfiguration" import="org.apache.hadoop.hbase.util.VersionInfo" import="java.util.Date" %> @@ -27,72 +26,25 @@ <%@ page import="org.apache.hadoop.hbase.util.JvmVersion" %> <% -Configuration conf = (Configuration)getServletContext().getAttribute("hbase.conf"); -String serverType = (String)getServletContext().getAttribute("hbase.thrift.server.type"); -long startcode = conf.getLong("startcode", System.currentTimeMillis()); -String listenPort = conf.get("hbase.regionserver.thrift.port", "9090"); -ImplType implType = ImplType.getServerImpl(conf); + Configuration conf = (Configuration)getServletContext().getAttribute("hbase.conf"); + String serverType = (String)getServletContext().getAttribute("hbase.thrift.server.type"); + long startcode = conf.getLong("startcode", System.currentTimeMillis()); + String listenPort = conf.get("hbase.regionserver.thrift.port", "9090"); + ImplType implType = ImplType.getServerImpl(conf); -String transport = - (implType.isAlwaysFramed() || - conf.getBoolean("hbase.regionserver.thrift.framed", false)) ? "Framed" : "Standard"; -String protocol = - conf.getBoolean("hbase.regionserver.thrift.compact", false) ? "Compact" : "Binary"; -String qop = conf.get("hbase.thrift.security.qop", "None"); + String transport = + (implType.isAlwaysFramed() || + conf.getBoolean("hbase.regionserver.thrift.framed", false)) ? "Framed" : "Standard"; + String protocol = + conf.getBoolean("hbase.regionserver.thrift.compact", false) ? "Compact" : "Binary"; + String qop = conf.get("hbase.thrift.security.qop", "None"); + pageContext.setAttribute("pageTitle", "HBase Thrift Server: " + listenPort); %> -<!DOCTYPE html> -<?xml version="1.0" encoding="UTF-8" ?> -<html lang="en"> - <head> - <meta charset="utf-8"> - <title>HBase Thrift Server: <%= listenPort %></title> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <meta name="description" content=""> - <link href="/static/css/bootstrap.min.css" rel="stylesheet"> - <link href="/static/css/bootstrap-theme.min.css" rel="stylesheet"> - <link href="/static/css/hbase.css" rel="stylesheet"> - </head> - - <body> - <div class="navbar navbar-fixed-top navbar-default"> - <div class="container-fluid"> - <div class="navbar-header"> - <button type="button" - class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - </button> - <a class="navbar-brand" href="/thrift.jsp"> - <img src="/static/hbase_logo_small.png" alt="HBase Logo"/> - </a> - </div> - <div class="collapse navbar-collapse"> - <ul class="nav navbar-nav"> - <li class="active"><a href="/">Home</a></li> - <li><a href="/logs/">Local logs</a></li> - <li><a href="/logLevel">Log Level</a></li> - <li class="nav-item dropdown"> - <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> - Metrics <span class="caret"></span> - </a> - <ul class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink"> - <li><a target="_blank" href="/jmx">JMX</a></li> - <li><a target="_blank" href="/jmx?description=true">JMX with description</a></li> - <li><a target="_blank" href="/prometheus">Prometheus</a></li> - <li><a target="_blank" href="/prometheus?description=true">Prometheus with description</a></li> - </ul> - </li> - <li><a href="/prof">Profiler</a></li> - <% if (HBaseConfiguration.isShowConfInServlet()) { %> - <li><a href="/conf">HBase Configuration</a></li> - <% } %> - </ul> - </div><!--/.nav-collapse --> - </div> - </div> +<jsp:include page="header.jsp"> + <jsp:param name="pageTitle" value="${pageTitle}"/> +</jsp:include> <div class="container-fluid content"> <div class="row inner_header"> @@ -165,8 +117,5 @@ String qop = conf.get("hbase.thrift.security.qop", "None"); </section> </div> </div> -<script src="/static/js/jquery.min.js" type="text/javascript"></script> -<script src="/static/js/bootstrap.min.js" type="text/javascript"></script> -<script src="/static/js/tab.js" type="text/javascript"></script> -</body> -</html> + +<jsp:include page="footer.jsp" />