]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Use class for hiding WebUI elements 3432/head
authormoisseev <moiseev@mezonplus.ru>
Sat, 11 Jul 2020 15:57:53 +0000 (18:57 +0300)
committermoisseev <moiseev@mezonplus.ru>
Sat, 11 Jul 2020 15:57:53 +0000 (18:57 +0300)
interface/index.html
interface/js/app/rspamd.js

index d70c557e54e40a515a2d585329790b09738cacf5..312a1956e32cf638c884d3e04e2862440ad7125e 100644 (file)
@@ -40,8 +40,8 @@
 
                <li role="presentation" class="nav-item"><a id="configuration_nav" aria-controls="configuration" role="tab" href="#configuration" data-toggle="tab" class="nav-link">Configuration</a></li>
                <li role="presentation" class="nav-item"><a id="symbols_nav" aria-controls="symbols" role="tab" href="#symbols" data-toggle="tab" class="nav-link">Symbols</a></li>
-               <li role="presentation" class="nav-item"><a id="scan_nav" aria-controls="scan" role="tab" href="#scan" data-toggle="tab" class="nav-link">Scan<span class="learn" style="display: none;">/Learn</span></a></li>
-               <li role="presentation" class="nav-item"><a id="selectors_nav" aria-controls="selectors" role="tab" href="#selectors" data-toggle="tab" class="nav-link" style="display: none;">Test selectors</a></li>
+               <li role="presentation" class="nav-item"><a id="scan_nav" aria-controls="scan" role="tab" href="#scan" data-toggle="tab" class="nav-link">Scan<span class="ro-hide" style="display: none;">/Learn</span></a></li>
+               <li role="presentation" class="nav-item"><a id="selectors_nav" aria-controls="selectors" role="tab" href="#selectors" data-toggle="tab" class="nav-link ro-hide" style="display: none;">Test selectors</a></li>
                <li role="presentation" class="nav-item"><a id="history_nav" aria-controls="history" role="tab" href="#history" data-toggle="tab" class="nav-link">History</a></li>
        </ul>
        <form class="form-inline ml-auto" id="navbar-btn-form" style="display: none;">
                                                </div>
                                        </div>
                                </div>
-                               <div class="card learn" style="display: none;">
+                               <div class="card ro-hide" style="display: none;">
                                        <div class="card-header text-secondary py-2">
                                                <span class="icon mr-3"><i class="fas fa-graduation-cap"></i></span>
                                                <span class="h6 font-weight-bolder my-2">Learn Rspamd</span>
                                                        </select>
                                                        <label for="history_page_size" class="ml-2">Rows per page:</label>
                                                        <input id="history_page_size" class="form-control ml-1" value="25" min="1" type="number">
-                                                       <button class="btn btn-danger btn-sm ml-2" id="resetHistory">
+                                                       <button class="btn btn-danger btn-sm ml-2 ro-hide" id="resetHistory">
                                                                <i class="fas fa-times-circle"></i> Reset
                                                        </button>
                                                        <button class="btn btn-info btn-sm ml-2" id="updateHistory">
                                                </div>
                                        </div>
                                </div>
-                               <div class="card bg-light shadow my-3" id="errors-history">
+                               <div class="card bg-light shadow my-3 ro-hide" id="errors-history">
                                        <div class="card-header text-secondary py-1 d-flex">
                                                <span class="icon mr-3"><i class="fas fa-exclamation-triangle"></i></span>
                                                <span class="h6 font-weight-bolder my-2 ml-0">Errors</span>
index f08363c625f5023b5ad24106426ba86be2a35a63..cfc366a5cf94d3de6e7d022c4e88f5215cfcab5a 100644 (file)
@@ -278,17 +278,9 @@ function ($, D3pie, visibility, NProgress, stickyTabs, tab_stat, tab_graph, tab_
         if (ui.read_only) {
             $(".ro-disable").attr("disabled", true);
             $(".ro-hide").hide();
-            $(".learn").hide();
-            $("#resetHistory").attr("disabled", true);
-            $("#errors-history").hide();
-            $("#selectors_nav").hide();
         } else {
             $(".ro-disable").removeAttr("disabled", true);
             $(".ro-hide").show();
-            $(".learn").show();
-            $("#resetHistory").removeAttr("disabled", true);
-            $("#errors-history").show();
-            $("#selectors_nav").show();
         }
 
         var buttons = $("#navbar-btn-form");