mirror of
https://github.com/apache/impala.git
synced 2025-12-19 09:58:28 -05:00
Currently, the scripts in the entire webUI contain variable and function declarations using the ES5 standard. In such declarations, all the variables are attached to the browser's window object, polluting the global scope. Additionally, many unnamed functions can be represented with cleaner and concise syntax. This patch refactors such declarations, using the ES6 syntax. -> Replacing 'var' declarations with 'let' and 'const' - To improve browser's memory utilization - For better scoping, immutability and readability -> Replacing unnamed function declarations with arrow functions - Better scoping by binding 'this' object to the surrounding context These improve maintainability and browser's memory utilization. Across many instances within the webUI scripts, no particular naming scheme is being followed for variable and function identifiers. Hence, they have been revised with the following naming scheme. -> All function names have been declared using camel case. -> All constant primitive values and strings have been declared in uppercase. -> All other types of variables have been declared using snake case. This naming scheme allows easier distinction between functions, constants and other variables, based on the identifiers. These changes to code style are further enforced during code review through IMPALA-13473. Change-Id: Ie38f2c642ede14956a2c6d551a58e42538204768 Reviewed-on: http://gerrit.cloudera.org:8080/21851 Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
97 lines
3.4 KiB
Cheetah
97 lines
3.4 KiB
Cheetah
<!--
|
|
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.
|
|
-->
|
|
|
|
{{>www/common-header.tmpl}}
|
|
<style type="text/css">
|
|
.log-level{
|
|
width: 50%;
|
|
line-height: 15px
|
|
}
|
|
</style>
|
|
|
|
{{?include_log4j_handlers}}
|
|
<h2>Frontend log level configuration (log4j)</h2>
|
|
<div class="log-level">
|
|
<h5>Current frontend log level:</h5>
|
|
<span style="white-space: pre-line">{{get_java_loglevel_result}}</span>
|
|
<br>
|
|
<form action="set_java_loglevel" method="post">{{>www/form-hidden-inputs.tmpl}}
|
|
<div class="form-group" name="level">
|
|
<input type="text" class="form-control" name="class" placeholder="e.g. org.apache.impala.analysis.Analyzer">
|
|
<br>
|
|
<div class="col-xs-20">
|
|
<label>Log level:</label>
|
|
<select name="level" class="selectpicker" data-style="btn-primary btn-sm">
|
|
<option value="all">ALL</option>
|
|
<option value="debug">DEBUG</option>
|
|
<option value="error">ERROR</option>
|
|
<option value="fatal">FATAL</option>
|
|
<option value="info">INFO</option>
|
|
<option value="off">OFF</option>
|
|
<option value="trace">TRACE</option>
|
|
<option value="warn">WARN</option>
|
|
</select>
|
|
<button type="submit" class="btn btn-primary btn-sm">Set Frontend Log Level</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<form action="reset_java_loglevel" method="post">{{>www/form-hidden-inputs.tmpl}}
|
|
<div class="col-xs-20">
|
|
<button type="submit" class="btn btn-primary btn-sm">Reset Frontend Log Levels</button>
|
|
<strong>{{reset_java_loglevel_result}}</strong>
|
|
</div>
|
|
</form>
|
|
<br>
|
|
{{/include_log4j_handlers}}
|
|
|
|
<h2>Backend log level configuration (glog)</h2>
|
|
<h5>Current backend log level: <span id="glog_text"></span></h5>
|
|
<form action="set_glog_level" method="post">{{>www/form-hidden-inputs.tmpl}}
|
|
<div class="form-group" name="level">
|
|
<div class="col-xs-20">
|
|
<label>Log level:</label>
|
|
<select name="glog" class="selectpicker" data-style="btn-primary btn-sm">
|
|
<option value="0">0 - Off</option>
|
|
<option value="1">1 - Info</option>
|
|
<option value="2">2 - Debug</option>
|
|
<option value="3">3 - All</option>
|
|
</select>
|
|
<button type="submit" class="btn btn-primary btn-sm">Set Backend Log Level</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<form action="reset_glog_level" method="post">{{>www/form-hidden-inputs.tmpl}}
|
|
<div class="col-xs-20">
|
|
<button type="submit" class="btn btn-primary btn-sm">Reset Backend Log Level</button>
|
|
<strong>    Default backend log level: {{default_glog_level}}</strong>
|
|
</div>
|
|
</form>
|
|
|
|
<script>
|
|
|
|
$(document).ready(() => {
|
|
$('select[name=glog]').val({{glog_level}});
|
|
const text = $('select[name=glog]').children("option:selected").text();
|
|
document.getElementById("glog_text").innerHTML = text;
|
|
});
|
|
|
|
</script>
|
|
|
|
{{>www/common-footer.tmpl}}
|