This is an automated email from the ASF dual-hosted git repository.
nihaljain pushed a commit to branch branch-2.6
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.6 by this push:
new 1f31d895f82 HBASE-28983 Static resources are not loaded on REST web UI
pages in dev mode (#6491) (#6849)
1f31d895f82 is described below
commit 1f31d895f82d28a48f0d352542cbcb81508177ce
Author: Dávid Paksy <[email protected]>
AuthorDate: Tue Mar 25 17:35:02 2025 +0100
HBASE-28983 Static resources are not loaded on REST web UI pages in dev
mode (#6491) (#6849)
This way the `hbase-webapps/static` source directory (which holds JS, CSS,
image files) is not duplicated anymore. It is only present under
`hbase-server`. This directory is then coped by maven-resources-plugin to the
target directory of the REST and Thrift projects.
For this deleted the static directory below the Thrift project.
Signed-off-by: Nihal Jain <[email protected]>
Reviewed-by: Andrew Purtell <[email protected]>
(cherry picked from commit 4e40bd5e6b8e87051ae0a961a805d59d0ca0a59f)
---
hbase-rest/pom.xml | 23 +++++
hbase-thrift/pom.xml | 23 +++++
.../hbase-webapps/static/css/bootstrap.min.css | 6 --
.../resources/hbase-webapps/static/css/hbase.css | 102 ---------------------
.../resources/hbase-webapps/static/favicon.ico | Bin 1150 -> 0 bytes
.../resources/hbase-webapps/static/hbase_logo.png | Bin 2997 -> 0 bytes
.../hbase-webapps/static/hbase_logo_med.gif | Bin 3592 -> 0 bytes
.../hbase-webapps/static/hbase_logo_small.png | Bin 3206 -> 0 bytes
.../hbase-webapps/static/js/bootstrap.min.js | 7 --
.../hbase-webapps/static/js/jquery.min.js | 2 -
.../main/resources/hbase-webapps/static/js/tab.js | 38 --------
11 files changed, 46 insertions(+), 155 deletions(-)
diff --git a/hbase-rest/pom.xml b/hbase-rest/pom.xml
index 198ae40c4e0..f5d07da0577 100644
--- a/hbase-rest/pom.xml
+++ b/hbase-rest/pom.xml
@@ -280,6 +280,29 @@
<skipAssembly>true</skipAssembly>
</configuration>
</plugin>
+ <!-- Copy the static web resources (JS, CSS, images, etc.) from
hbase-server sources -->
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-static-resources</id>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <phase>generate-resources</phase>
+ <configuration>
+
<outputDirectory>${project.build.outputDirectory}/hbase-webapps/static</outputDirectory>
+
<outputDirectory>${project.build.directory}/hbase-webapps/static</outputDirectory>
+ <overwrite>true</overwrite>
+ <resources>
+ <resource>
+
<directory>../hbase-server/src/main/resources/hbase-webapps/static</directory>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
diff --git a/hbase-thrift/pom.xml b/hbase-thrift/pom.xml
index b94a2ea7414..1db636fe201 100644
--- a/hbase-thrift/pom.xml
+++ b/hbase-thrift/pom.xml
@@ -198,6 +198,29 @@
<skipAssembly>true</skipAssembly>
</configuration>
</plugin>
+ <!-- Copy the static web resources (JS, CSS, images, etc.) from
hbase-server sources -->
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-static-resources</id>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <phase>generate-resources</phase>
+ <configuration>
+
<outputDirectory>${project.build.outputDirectory}/hbase-webapps/static</outputDirectory>
+
<outputDirectory>${project.build.directory}/hbase-webapps/static</outputDirectory>
+ <overwrite>true</overwrite>
+ <resources>
+ <resource>
+
<directory>../hbase-server/src/main/resources/hbase-webapps/static</directory>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
diff --git
a/hbase-thrift/src/main/resources/hbase-webapps/static/css/bootstrap.min.css
b/hbase-thrift/src/main/resources/hbase-webapps/static/css/bootstrap.min.css
deleted file mode 100644
index 46dc7faa2e9..00000000000
--- a/hbase-thrift/src/main/resources/hbase-webapps/static/css/bootstrap.min.css
+++ /dev/null
@@ -1,6 +0,0 @@
-@charset "UTF-8";/*!
- * Bootstrap v5.3.3 (https://getbootstrap.com/)
- * Copyright 2011-2024 The Bootstrap Authors
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
-
*/:root,[data-bs-theme=light]{--bs-blue:#0d6efd;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:#dc3545;--bs-orange:#fd7e14;--bs-yellow:#ffc107;--bs-green:#198754;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-black:#000;--bs-white:#fff;--bs-gray:#6c757d;--bs-gray-dark:#343a40;--bs-gray-100:#f8f9fa;--bs-gray-200:#e9ecef;--bs-gray-300:#dee2e6;--bs-gray-400:#ced4da;--bs-gray-500:#adb5bd;--bs-gray-600:#6c757d;--bs-gray-700:#495057;--bs-gray-800:#343a40;--bs-gray-900:#212529;--
[...]
-/*# sourceMappingURL=bootstrap.min.css.map */
diff --git a/hbase-thrift/src/main/resources/hbase-webapps/static/css/hbase.css
b/hbase-thrift/src/main/resources/hbase-webapps/static/css/hbase.css
deleted file mode 100644
index a0b4bae80b6..00000000000
--- a/hbase-thrift/src/main/resources/hbase-webapps/static/css/hbase.css
+++ /dev/null
@@ -1,102 +0,0 @@
-/**
- * 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.
- */
-
-/* General styling */
-
-/* Preserve original HBase UI colors */
-:root,
-[data-bs-theme=light] {
- --bs-blue: #337ab7;
- --bs-primary: #337ab7;
- --bs-link-color: #337ab7;
- --bs-link-color-rgb: #337ab7;
- --bs-link-hover-color: #23527c;
- --bs-link-hover-color-rgb: #23527c;
-}
-.nav-pills {
- --bs-nav-pills-link-active-bg: #337ab7;
-}
-.btn-primary {
- --bs-btn-bg: #337ab7;
- --bs-btn-border-color: #337ab7;
- --bs-btn-hover-bg: #265a88;
- --bs-btn-hover-border-color: #204d74;
- --bs-btn-disabled-bg: #337ab7;
- --bs-btn-disabled-border-color: #337ab7;
-}
-.form-control:focus {
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233,
.6);
-}
-/* Avoid links with black color. */
-a {
- color: var(--bs-link-color-rgb);
-}
-.pagination {
- --bs-pagination-active-border-color: #337ab7;
-}
-/* Restore active navbar link background-color */
-.navbar-nav .nav-link.active {
- background: linear-gradient(to bottom, #dbdbdb 0, #e2e2e2 100%);
-}
-@media (min-width: 768px) {
- /* With Bootstrap 5 the navbar has 8px vertical padding and the links are
smaller vertically.
- For desktop view only we "grow" the link to the same height as navbar
- and "position it to reach" navbar. */
- .navbar-nav .nav-link.active {
- height: calc(100% + 16px);
- margin: -8px 0;
- padding-top: 16px;
- }
-}
-/* End of Preserve original HBase UI colors */
-
-body { padding-top: 50px; }
-html .content {
- padding: 0 2.0em;
-}
-.navbar-brand img {
- margin-top: -7px;
-}
-.inner_header { margin-bottom: 1em;}
-section {
- width: 100%;
- margin-bottom: 3em;
-}
-.page-header {
- padding-bottom: 9px;
- margin: 40px 0 20px;
- border-bottom: 1px solid #eee;
-}
-
-.page-header small {
- font-size: 65%;
- color: #6c757d;
-}
-
-
-/* Master page styling */
-#tab_catalogTables table {
- /*
- Catalog tab on master doesn't have any content before
- it. Make sure there is some padding so it
- doesn't look crowded.
- */
- margin-top: 1.2em;
-}
-
-/* Region Server page styling */
diff --git a/hbase-thrift/src/main/resources/hbase-webapps/static/favicon.ico
b/hbase-thrift/src/main/resources/hbase-webapps/static/favicon.ico
deleted file mode 100644
index 6e4d0f71831..00000000000
Binary files a/hbase-thrift/src/main/resources/hbase-webapps/static/favicon.ico
and /dev/null differ
diff --git
a/hbase-thrift/src/main/resources/hbase-webapps/static/hbase_logo.png
b/hbase-thrift/src/main/resources/hbase-webapps/static/hbase_logo.png
deleted file mode 100644
index e962ce04975..00000000000
Binary files
a/hbase-thrift/src/main/resources/hbase-webapps/static/hbase_logo.png and
/dev/null differ
diff --git
a/hbase-thrift/src/main/resources/hbase-webapps/static/hbase_logo_med.gif
b/hbase-thrift/src/main/resources/hbase-webapps/static/hbase_logo_med.gif
deleted file mode 100644
index 36d3e3c9127..00000000000
Binary files
a/hbase-thrift/src/main/resources/hbase-webapps/static/hbase_logo_med.gif and
/dev/null differ
diff --git
a/hbase-thrift/src/main/resources/hbase-webapps/static/hbase_logo_small.png
b/hbase-thrift/src/main/resources/hbase-webapps/static/hbase_logo_small.png
deleted file mode 100644
index 60452b67720..00000000000
Binary files
a/hbase-thrift/src/main/resources/hbase-webapps/static/hbase_logo_small.png and
/dev/null differ
diff --git
a/hbase-thrift/src/main/resources/hbase-webapps/static/js/bootstrap.min.js
b/hbase-thrift/src/main/resources/hbase-webapps/static/js/bootstrap.min.js
deleted file mode 100644
index d705b8dac58..00000000000
--- a/hbase-thrift/src/main/resources/hbase-webapps/static/js/bootstrap.min.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/*!
- * Bootstrap v5.3.3 (https://getbootstrap.com/)
- * Copyright 2011-2024 The Bootstrap Authors
(https://github.com/twbs/bootstrap/graphs/contributors)
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
- */
-!function(t,e){"object"==typeof exports&&"undefined"!=typeof
module?module.exports=e():"function"==typeof
define&&define.amd?define(e):(t="undefined"!=typeof
globalThis?globalThis:t||self).bootstrap=e()}(this,(function(){"use
strict";const t=new Map,e={set(e,i,n){t.has(e)||t.set(e,new Map);const
s=t.get(e);s.has(i)||0===s.size?s.set(i,n):console.error(`Bootstrap doesn't
allow more than one instance per element. Bound instance:
${Array.from(s.keys())[0]}.`)},get:(e,i)=>t.has(e)&&t.get(e). [...]
-//# sourceMappingURL=bootstrap.bundle.min.js.map
diff --git
a/hbase-thrift/src/main/resources/hbase-webapps/static/js/jquery.min.js
b/hbase-thrift/src/main/resources/hbase-webapps/static/js/jquery.min.js
deleted file mode 100644
index b0614034ad3..00000000000
--- a/hbase-thrift/src/main/resources/hbase-webapps/static/js/jquery.min.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! jQuery v3.5.1 | (c) JS Foundation and other contributors |
jquery.org/license */
-!function(e,t){"use strict";"object"==typeof module&&"object"==typeof
module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw
new Error("jQuery requires a window with a document");return
t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use
strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return
t.flat.call(e)}:function(e){return
t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=
[...]
diff --git a/hbase-thrift/src/main/resources/hbase-webapps/static/js/tab.js
b/hbase-thrift/src/main/resources/hbase-webapps/static/js/tab.js
deleted file mode 100644
index 31438a1b36f..00000000000
--- a/hbase-thrift/src/main/resources/hbase-webapps/static/js/tab.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright The Apache Software Foundation
- *
- * 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.
- */
-
-$(document).ready(
- function(){
- var prefix = "tab_";
- $('.tabbable .nav-pills a').click(function (e) {
- e.preventDefault();
- location.hash = $(e.target).attr('href').substr(1).replace(prefix, "");
- $(this).tab('show');
- });
-
- if (location.hash !== '') {
- var tabItem = $('a[href="' + location.hash.replace("#", "#"+prefix) +
'"]');
- tabItem.tab('show');
- $(document).scrollTop(0);
- return false;
- }
- return true;
- }
-);
\ No newline at end of file