Skip to content

Commit

Permalink
HBASE-28832 Migrated inline forms - Log levels, table.jsp
Browse files Browse the repository at this point in the history
Breaking change in Bootstrap 5: Dropped form-specific layout classes for our grid system. Use our grid and utilities instead of .form-group, .form-row, or .form-inline.
  • Loading branch information
PDavid committed Nov 22, 2024
1 parent 5f51cae commit f2c49c1
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ public void doGet(HttpServletRequest request, HttpServletResponse response)
String[] readOnlyLogLevels = conf.getStrings(READONLY_LOGGERS_CONF_KEY);

if (logName != null) {
out.println("<p>Results:</p>");
out.println("<h2>Results</h2>");
out.println(MARKER + "Submitted Log Name: <b>" + logName + "</b><br />");

Logger log = LoggerFactory.getLogger(logName);
Expand Down Expand Up @@ -374,18 +374,24 @@ private void sendError(HttpServletResponse response, int code, String message)
static final String FORMS = "<div class='container-fluid content'>\n"
+ "<div class='row inner_header top_header'>\n" + "<div class='page-header'>\n"
+ "<h1>Get/Set Log Level</h1>\n" + "</div>\n" + "</div>\n" + "\n" + "<h2>Actions</h2>\n"
+ "\n" + "<div class='row'>\n" + "<div class='col'>\n" + "<section>\n"
+ "<form class='form-inline'>\n"
+ "<button type='submit' class='btn btn-primary'>Get Log Level</button>\n"
+ "<input type='text' name='log' class='form-control mx-sm-3' size='50' required='required' placeholder='Log Name (required)'>\n"
+ "<span>Gets the current log level for the specified log name.</span>\n" + "</form>\n"
+ "</section>\n" + "</div>\n" + "</div>\n" + "\n" + "<div class='row'>\n"
+ "<div class='col'>\n" + "<section>\n" + "<form class='form-inline'>\n"
+ "<button type='submit' class='btn btn-primary'>Set Log Level</button>\n"
+ "<input type='text' name='log' class='form-control mx-sm-3' size='50' required='required' placeholder='Log Name (required)'>\n"
+ "<input type='text' name='level' class='form-control mx-sm-3' size='50' required='required' placeholder='Log Level (required)'>\n"
+ "<span>Sets the specified log level for the specified log name.</span>\n" + "</form>\n"
+ " </section>\n" + "</div>\n" + "</div>\n" + "<hr>\n";
+ "\n" + "<div class='row mb-4'>\n" + "<div class='col'>\n"
+ "<form class='row g-3 align-items-center justify-content-center'>\n"
+ "<div class='col-sm-auto'>\n"
+ "<button type='submit' class='btn btn-primary'>Get Log Level</button>\n" + "</div>\n"
+ " <div class='col-sm-auto'>\n"
+ "<input type='text' name='log' class='form-control' size='50' required='required' placeholder='Log Name (required)'>\n"
+ "</div>\n" + " <div class='col-sm-auto'>\n"
+ "<span>Gets the current log level for the specified log name.</span>\n" + "</div>\n"
+ "</form>\n" + "</div>\n" + "</div>\n" + "\n" + "<div class='row'>\n" + "<div class='col'>\n"
+ "\n" + "<form class='row g-3 align-items-center justify-content-center'>\n"
+ "<div class='col-sm-auto'>\n"
+ "<button type='submit' class='btn btn-primary'>Set Log Level</button>\n" + "</div>\n"
+ "<div class='col-sm-auto'>\n"
+ "<input type='text' name='log' class='form-control mb-2' size='50' required='required' placeholder='Log Name (required)'>\n"
+ "<input type='text' name='level' class='form-control' size='50' required='required' placeholder='Log Level (required)'>\n"
+ "</div>\n" + "<div class='col-sm-auto'>\n"
+ "<span>Sets the specified log level for the specified log name.</span>\n" + "</div>\n"
+ "</form>\n" + "\n" + "</div>\n" + "</div>" + "<hr>\n";

private static void process(Logger logger, String levelName, PrintWriter out) {
if (levelName != null) {
Expand Down
34 changes: 23 additions & 11 deletions hbase-server/src/main/resources/hbase-webapps/master/table.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -625,27 +625,37 @@
</ul>
</div>
<div class="col-md-8">
<form action="/table.jsp" method="get" class="form-inline justify-content-end" style="margin: 20px 0">
<form action="/table.jsp" method="get" class="row g-1 justify-content-end align-items-center" style="margin: 20px 0">
<input type="hidden" name="name" value="<%= TableName.META_TABLE_NAME %>" />
<div class="form-group">
<label for="scan-limit" class="mx-sm-1">Scan Limit</label>
<div class="col-sm-auto">
<label for="scan-limit" class="form-label">Scan Limit</label>
</div>
<div class="col-sm-auto">
<input type="text" id="scan-limit" name="<%= MetaBrowser.SCAN_LIMIT_PARAM %>"
class="form-control mx-sm-1" placeholder="<%= MetaBrowser.SCAN_LIMIT_DEFAULT %>"
class="form-control" placeholder="<%= MetaBrowser.SCAN_LIMIT_DEFAULT %>"
<%= metaBrowser.getScanLimit() != null
? "value=\"" + metaBrowser.getScanLimit() + "\""
: ""
%>
aria-describedby="scan-limit" />
<label for="table-name-filter" class="mx-sm-1">Table</label>
</div>
<div class="col-sm-auto">
<label for="table-name-filter" class="form-label">Table</label>
</div>
<div class="col-sm-auto">
<input type="text" id="table-name-filter" name="<%= MetaBrowser.SCAN_TABLE_PARAM %>"
class="form-control mx-sm-1"
class="form-control"
<%= metaBrowser.getScanTable() != null
? "value=\"" + metaBrowser.getScanTable() + "\""
: ""
%>
aria-describedby="scan-filter-table" />
<label for="region-state-filter" class="mx-sm-1">Region State</label>
<select class="form-control mx-sm-1" id="region-state-filter"
</div>
<div class="col-sm-auto">
<label for="region-state-filter" class="form-label">Region State</label>
</div>
<div class="col-sm-auto">
<select class="form-control" id="region-state-filter"
name="<%= MetaBrowser.SCAN_REGION_STATE_PARAM %>">
<option></option>
<%
Expand All @@ -657,13 +667,15 @@
}
%>
</select>
<button type="submit" class="btn btn-primary mx-sm-1">
</div>
<div class="col-sm-auto">
<button type="submit" class="btn btn-primary">
Filter Results
</button>
</div>
</form>
</div>
</div>
</div><!--/.col-md-8 -->
</div><!--/.row .mb-5 -->
<%} else {
//Common tables
RegionStates states = master.getAssignmentManager().getRegionStates();
Expand Down

0 comments on commit f2c49c1

Please sign in to comment.