]> source.dussan.org Git - rspamd.git/commitdiff
[WebUI] Replace widget boxes with Bootstrap cards
authormoisseev <moiseev@mezonplus.ru>
Sat, 4 Jul 2020 14:12:06 +0000 (17:12 +0300)
committermoisseev <moiseev@mezonplus.ru>
Sat, 4 Jul 2020 14:12:06 +0000 (17:12 +0300)
interface/css/rspamd.css
interface/index.html
interface/js/app/config.js
interface/js/app/stats.js

index 81e481b4736ad7b469499517884a3a77971aa58c..5c925753c66b06b46de4336ff9a425aefc1556a0 100644 (file)
@@ -206,32 +206,7 @@ table#symbolsTable input[type="number"] {
 }
 
 /* widget */
-.widget-box {
-    background: none repeat scroll 0 0 #f9f9f9;
-    border-top: 1px solid #cdcdcd;
-    border-left: 1px solid #cdcdcd;
-    border-right: 1px solid #cdcdcd;
-    clear: both;
-    margin-top: 16px;
-    margin-bottom: 16px;
-    position: relative;
-}
-.widget-box.widget-calendar,
-.widget-box.widget-chat {
-    overflow: hidden !important;
-}
-.accordion .widget-box {
-    margin-top: -2px;
-    margin-bottom: 0;
-    border-radius: 0;
-}
-.widget-box.widget-plain {
-    background: transparent;
-    border: none;
-    margin-top: 0;
-    margin-bottom: 0;
-}
-.widget-title,
+.card-header,
 .modal-header {
     background-color: #efefef;
     background-image: -webkit-gradient(linear, 0 0%, 0 100%, from(#fdfdfd), to(#eaeaea));
@@ -242,41 +217,12 @@ table#symbolsTable input[type="number"] {
     background-image: -linear-gradient(top, #fdfdfd 0%, #eaeaea 100%);
     /* stylelint-disable-next-line function-name-case */
     filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fdfdfd', endColorstr='#eaeaea', GradientType=0); /* IE6-9 */
-    border-bottom: 1px solid #cdcdcd;
     height: 36px;
 }
-.widget-title span.icon {
-    border-right: 1px solid #cdcdcd;
-    padding: 9px 10px 7px 11px;
-    float: left;
-    opacity: .7;
-}
-.widget-title h5 {
-    color: #666666;
-    text-shadow: 0 1px 0 #ffffff;
-    /* float:left; */
-    display: block;
-    font-size: 12px;
-    font-weight: bold;
-    padding: 12px;
-    line-height: 12px;
-    margin: 0 0 0 36px;
-}
-.widget-title .buttons {
-    padding: 2px 2px 0 0;
-}
-.widget-title .label {
-    padding: 3px 5px 2px;
-    float: right;
-    margin: 9px 15px 0 0;
-    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) inset, 0 1px 0 #ffffff;
-}
-.widget-content {
-    padding: 12px 15px;
-    border-bottom: 1px solid #cdcdcd;
-    -moz-box-shadow: 0 1px 2px -1px rgba(0, 0, 0, 0.2);
-    box-shadow: 0 1px 2px -1px rgba(0, 0, 0, 0.2);
+.card-header h6 {
+    font-size: 0.857rem;
 }
+
 .stat-boxes {
     margin: 0;
     margin-right: -10px !important;
@@ -292,7 +238,6 @@ table#symbolsTable input[type="number"] {
     background-image: linear-gradient(to bottom, #f9f9f9 0%, #ededed 100%);
     border: 1px solid #d5d5d5;
     border-radius: 4px 4px 4px 4px;
-    box-shadow: 0 1px 0 0 #ffffff inset, 0 1px 0 rgba(255, 255, 255, 0.4);
     display: inline-block;
     line-height: 18px;
     margin: 0 10px 10px 0;
@@ -309,7 +254,6 @@ table#symbolsTable input[type="number"] {
     font-weight: bold;
     text-align: center;
     text-transform: capitalize;
-    text-shadow: 0 1px 0 white;
     color: #666;
 }
 .stat-box .left,
@@ -318,7 +262,6 @@ table#symbolsTable input[type="number"] {
 }
 .stat-box .left {
     border-right: 1px solid gainsboro;
-    box-shadow: 1px 0 0 0 white;
     margin-right: 14px;
     padding-right: 18px;
     font-size: 10px;
@@ -418,13 +361,13 @@ td.maps-cell {
     margin-right: 9px;
 }
 
-#throughput div.widget-content {
+#throughput div.card-body {
     text-align: center;
 }
-#throughput div.widget-content > div {
+#throughput div.card-body > div {
     display: inline-block;
 }
-#throughput div.widget-content div.row {
+#throughput div.card-body div.row {
     background: #fff;
 }
 
@@ -489,10 +432,6 @@ td.maps-cell {
     padding-right: 20px;
 }
 
-.widget-title-form label {
-    font-size: 12px;
-    font-weight: normal;
-}
 #history_page_size {
     width: 6em !important;
     text-align: center;
@@ -517,8 +456,6 @@ td.maps-cell {
 }
 
 #row-main {
-    margin-top: -12px;
-    margin-bottom: -12px;
     display: flex;
     flex-wrap: wrap;
     clear: both;
@@ -626,3 +563,19 @@ td.maps-cell {
 #navBar .navbar-nav .nav-link {
     padding: 15px;
 }
+
+#clusterTable td:last-child {
+    border-right: none;
+}
+#clusterTable tr:last-child td {
+    border-bottom: none;
+}
+#clusterTable thead th:last-child {
+    border-right: none;
+}
+#clusterTable tr:last-child td:first-child {
+    border-radius: 0 0 0 calc(.25rem - 1px);
+}
+#clusterTable tr:last-child td:last-child {
+    border-radius: 0 0 calc(.25rem - 1px) 0;
+}
index c8748a2f873cb94c2ff41c74130680fbcd14b3c7..88176624d73f720fcba3469fca7ccc02dc7043da 100644 (file)
@@ -80,7 +80,7 @@
                        <div class="tab-pane active" id="status">
                                <div class="row">
                                        <div class="col-lg-12">
-                                               <div class="widget-box widget-plain">
+                                               <div class="card border-0">
                                                        <ul id="statWidgets" class="stat-boxes" style="display: none;">
                                                        </ul>
                                                </div>
                                </div>
                                <div class="row">
                                        <div class="col-lg-6">
-                                               <div class="widget-box">
-                                                       <div class="widget-title">
-                                                               <span class="icon"><i class="glyphicon glyphicon-tasks"></i></span>
-                                                               <h5>Servers</h5>
+                                               <div class="card bg-light shadow my-3">
+                                                       <div class="card-header text-secondary">
+                                                               <span class="icon float-left mr-3"><i class="glyphicon glyphicon-tasks"></i></span>
+                                                               <h6 class="font-weight-bolder">Servers</h6>
                                                        </div>
-                                                               <div class="widget-content nopadding table-responsive">
+                                                               <div class="card-body nopadding table-responsive">
                                                                        <table class="table table-sm table-hover table-bordered text-nowrap mb-0" id="clusterTable">
                                                                                <thead>
                                                                                        <tr>
                                                </div>
                                        </div>
                                        <div class="col-lg-6">
-                                               <div class="widget-box">
-                                                       <div class="widget-title">
-                                                               <span class="icon"><i class="glyphicon glyphicon-signal"></i></span>
-                                                               <h5>Statistics</h5>
+                                               <div class="card bg-light shadow my-3">
+                                                       <div class="card-header text-secondary">
+                                                               <span class="icon float-left mr-3"><i class="glyphicon glyphicon-signal"></i></span>
+                                                               <h6 class="font-weight-bolder">Statistics</h6>
                                                        </div>
-                                                       <div class="widget-content chart-content">
+                                                       <div class="card-body chart-content">
                                                                <div class="row">
                                                                        <div class="chart" id="chart">
                                                                                <span class="notice">Loading..</span>
                        </div>
 
                        <div class="tab-pane" id="throughput">
-                               <div class="widget-box">
-                                       <div class="widget-title">
-                                               <span class="icon"><i class="glyphicon glyphicon-stats"></i></span>
-                                               <h5>Throughput</h5>
+                               <div class="card bg-light shadow my-3">
+                                       <div class="card-header text-secondary">
+                                               <span class="icon float-left mr-3"><i class="glyphicon glyphicon-stats"></i></span>
+                                               <h6 class="font-weight-bolder">Throughput</h6>
                                        </div>
-                                       <div class="widget-content">
+                                       <div class="card-body">
                                                <div>
                                                        <div class="row">
                                                                <div id="graph" class="mx-auto">
                        </div>
 
                        <div class="tab-pane" id="configuration">
-                               <div class="widget-box">
-                                       <div class="widget-title">
-                                               <span class="icon"><i class="glyphicon glyphicon-tasks"></i></span><h5>Actions</h5>
+                               <div class="card bg-light shadow my-3">
+                                       <div class="card-header text-secondary">
+                                               <span class="icon float-left mr-3"><i class="glyphicon glyphicon-tasks"></i></span>
+                                               <h6 class="font-weight-bolder">Actions</h6>
                                        </div>
-                                       <div class="widget-content actions-content" id="actionsBody"></div>
+                                       <div class="card-body actions-content" id="actionsBody"></div>
                                </div>
-                               <div class="widget-box">
-                                       <div class="widget-title">
-                                               <span class="icon"><i class="glyphicon glyphicon-list"></i></span><h5>Lists</h5>
+                               <div class="card bg-light shadow my-3">
+                                       <div class="card-header text-secondary">
+                                               <span class="icon float-left mr-3"><i class="glyphicon glyphicon-list"></i></span>
+                                               <h6 class="font-weight-bolder">Lists</h6>
                                        </div>
-                                       <div class="widget-content nopadding">
+                                       <div class="card-body nopadding">
                                                <table class="table table-sm table-hover" id="listMaps">
                                                </table>
                                        </div>
                        </div>
 
                        <div class="tab-pane" id="symbols">
-                               <div class="widget-box">
-                                       <div class="widget-title  d-flex">
-                                               <span class="icon"><i class="glyphicon glyphicon-tasks"></i></span>
-                                               <h5 class="ml-0">Symbols and rules</h5>
-                                               <div class="buttons align-self-center ml-auto mr-1">
+                               <div class="card bg-light shadow my-3">
+                                       <div class="card-header text-secondary  d-flex">
+                                               <span class="icon float-left mr-3"><i class="glyphicon glyphicon-tasks"></i></span>
+                                               <h6 class="font-weight-bolder" class="ml-0">Symbols and rules</h6>
+                                               <div class="align-self-center ml-auto mr-1">
                                                        <button class="btn btn-info btn-sm" id="updateSymbols">
                                                                <i class="glyphicon glyphicon-refresh"></i> Update
                                                        </button>
                                                </div>
                                        </div>
-                                       <div class="widget-content nopadding">
+                                       <div class="card-body nopadding">
                                                <table class="table table-hover" id="symbolsTable"></table>
                                        </div>
                                </div>
                        </div>
 
                        <div class="tab-pane" id="scan">
-                               <div class="widget-box">
-                                       <div class="widget-title">
-                                               <span class="icon"><i class="glyphicon glyphicon-envelope"></i></span>
-                                               <h5>Scan suspected message</h5>
+                               <div class="card bg-light shadow my-3">
+                                       <div class="card-header text-secondary">
+                                               <span class="icon float-left mr-3"><i class="glyphicon glyphicon-envelope"></i></span>
+                                               <h6 class="font-weight-bolder">Scan suspected message</h6>
                                        </div>
-                                       <div class="widget-content">
+                                       <div class="card-body">
                                                <div class="row">
                                                        <form class="col-lg-12" id="scanForm">
                                                                <div class="form-group">
                                                </div>
                                        </div>
                                </div>
-                               <div class="widget-box learn" style="display: none;">
-                                       <div class="widget-title">
-                                               <span class="icon"><i class="glyphicon glyphicon-education"></i></span>
-                                               <h5>Learn Rspamd</h5>
+                               <div class="card learn" style="display: none;">
+                                       <div class="card-header text-secondary">
+                                               <span class="icon float-left mr-3"><i class="glyphicon glyphicon-education"></i></span>
+                                               <h6 class="font-weight-bolder">Learn Rspamd</h6>
                                        </div>
-                                       <div class="widget-content">
+                                       <div class="card-body">
                                                <div class="row">
                                                        <div class="col-lg-6">
-                                                               <div class="card bg-light card-body mb-3 card bg-faded p-2 mb-3">
+                                                               <div class="card bg-light shadow card-body card p-2">
                                                                        <p>Learn Bayessian classifier:</p>
                                                                        <form class="form-inline">
                                                                                <div class="form-group">
                                                                </div>
                                                        </div>
                                                        <div class="col-lg-6">
-                                                               <div class="card bg-light card-body mb-3 card bg-faded p-2 mb-3">
+                                                               <div class="card bg-light shadow card-body card p-2">
                                                                        <p>Learn Fuzzy storage:</p>
                                                                        <form class="form-inline">
                                                                                <div class="form-group">
                                        </div>
                                </div>
 
-                               <div class="widget-box">
-                                       <div class="widget-title d-flex">
-                                               <span class="icon"><i class="glyphicon glyphicon-eye-open"></i></span>
-                                               <h5 class="ml-0">Scan results history</h5>
-                                               <div id="scanResult" class="form-inline widget-title-form input-group-sm buttons align-self-center ml-auto mr-1">
+                               <div class="card bg-light shadow my-3">
+                                       <div class="card-header text-secondary d-flex">
+                                               <span class="icon float-left mr-3"><i class="glyphicon glyphicon-eye-open"></i></span>
+                                               <h6 class="font-weight-bolder" class="ml-0">Scan results history</h6>
+                                               <div id="scanResult" class="form-inline card-header-form input-group-sm align-self-center ml-auto mr-1">
                                                                <label for="selSymOrder_scan">Symbols order:</label>
                                                                <select id="selSymOrder_scan" class="form-control ml-1">
                                                                        <option value="magnitude" selected>Score magnitude</option>
                                                        </button>
                                                </div>
                                        </div>
-                                       <div class="widget-content nopadding">
+                                       <div class="card-body nopadding">
                                                <div id="scanLog">
                                                        <table class="table" id="historyTable_scan"></table>
                                                </div>
                        </div>
 
                        <div class="tab-pane" id="selectors">
-                               <div class="widget-box">
-                                       <div class="widget-title">
-                                               <span class="icon"><i class="glyphicon glyphicon-envelope"></i></span>
-                                               <h5>Test Rspamd selectors</h5>
+                               <div class="card bg-light shadow my-3">
+                                       <div class="card-header text-secondary">
+                                               <span class="icon float-left mr-3"><i class="glyphicon glyphicon-envelope"></i></span>
+                                               <h6 class="font-weight-bolder">Test Rspamd selectors</h6>
                                        </div>
-                                       <div class="widget-content">
+                                       <div class="card-body py-0">
                                                <div class="row" id="row-main">
                                                        <div class="col-lg-3 sidebar" id="sidebar-left">
                                                                <div class="nopadding table-responsive">
 
                        <div class="tab-pane" id="history">
 
-                               <div class="widget-box">
-                                       <div class="widget-title d-flex">
-                                               <span class="icon"><i class="glyphicon glyphicon-eye-open"></i></span>
-                                               <h5 class="ml-0">History</h5>
-                                               <div class="form-inline widget-title-form input-group-sm buttons align-self-center ml-auto mr-1">
+                               <div class="card bg-light shadow my-3">
+                                       <div class="card-header text-secondary d-flex">
+                                               <span class="icon float-left mr-3"><i class="glyphicon glyphicon-eye-open"></i></span>
+                                               <h6 class="font-weight-bolder" class="ml-0">History</h6>
+                                               <div class="form-inline card-header-form input-group-sm align-self-center ml-auto mr-1">
                                                        <label for="selSymOrder_history">Symbols order:</label>
                                                        <select id="selSymOrder_history" class="form-control ml-1">
                                                                <option value="magnitude" selected>Score magnitude</option>
                                                        </button>
                                                </div>
                                        </div>
-                                       <div class="widget-content nopadding">
+                                       <div class="card-body nopadding">
                                                <div id="historyLog">
                                                        <table class="table" id="historyTable_history"></table>
                                                </div>
                                        </div>
                                </div>
-                               <div class="widget-box" id="errors-history">
-                                       <div class="widget-title d-flex">
-                                               <span class="icon"><i class="glyphicon glyphicon-eye-open"></i></span>
-                                               <h5 class="ml-0">Errors</h5>
-                                               <div class="buttons align-self-center ml-auto mr-1">
+                               <div class="card bg-light shadow my-3" id="errors-history">
+                                       <div class="card-header text-secondary d-flex">
+                                               <span class="icon float-left mr-3"><i class="glyphicon glyphicon-eye-open"></i></span>
+                                               <h6 class="font-weight-bolder" class="ml-0">Errors</h6>
+                                               <div class="align-self-center ml-auto mr-1">
                                                        <button class="btn btn-info btn-sm" id="updateErrors">
                                                                <i class="glyphicon glyphicon-refresh"></i> Update
                                                        </button>
                                                </div>
                                        </div>
-                                       <div class="widget-content nopadding">
+                                       <div class="card-body nopadding">
                                                <table class="table table-hover" id="errorsLog"></table>
                                        </div>
                                </div>
 <!-- login modal -->
 <div id="connectDialog" class="modal" tabindex="-1" role="dialog" style="display: none;">
        <div class="modal-dialog">
-               <div class="modal-content">
+               <div class="modal-content shadow">
                        <div class="modal-header">
                                <h3>Login to Rspamd</h3>
                        </div>
index 05efcc7d44cb45f5bcccff3370fc3eed3011283f..431d9bb92f3c7e3e525b02c78942106e69f2d876 100644 (file)
@@ -136,7 +136,7 @@ define(["jquery"],
 
         ui.getMaps = function (rspamd, checked_server) {
             var $listmaps = $("#listMaps");
-            $listmaps.closest(".widget-box").hide();
+            $listmaps.closest(".card").hide();
             rspamd.query("maps", {
                 success: function (json) {
                     var data = json[0].data;
@@ -156,7 +156,7 @@ define(["jquery"],
                         $tr.appendTo($tbody);
                     });
                     $tbody.appendTo($listmaps);
-                    $listmaps.closest(".widget-box").show();
+                    $listmaps.closest(".card").show();
                 },
                 server: (checked_server === "All SERVERS") ? "local" : checked_server
             });
index c6c320025f7afbcab1dc3c3bec815285091fd115..1f6a1b5b2b240793f9e50da5b11df94e9b5e44e8 100644 (file)
@@ -80,7 +80,7 @@ define(["jquery", "d3pie"],
                     $(widget).appendTo(widgets);
                 } else {
                     var titleAtt = d3.format(",")(item) + " " + i;
-                    widget = "<li class=\"stat-box\"><div class=\"widget\" title=\"" + titleAtt + "\"><strong>" +
+                    widget = "<li class=\"stat-box bg-light shadow-sm\"><div class=\"widget\" title=\"" + titleAtt + "\"><strong>" +
                     d3.format(".3~s")(item) + "</strong>" + i + "</div></li>";
                     if (i === "scanned") {
                         stat_w[0] = widget;
@@ -100,7 +100,7 @@ define(["jquery", "d3pie"],
             $.each(stat_w, function (i, item) {
                 $(item).appendTo(widgets);
             });
-            $("#statWidgets .left,#statWidgets .right").wrapAll("<li class=\"stat-box float-right\"><div class=\"widget\"></div></li>");
+            $("#statWidgets .left,#statWidgets .right").wrapAll("<li class=\"stat-box bg-light shadow-sm float-right\"><div class=\"widget\"></div></li>");
             $("#statWidgets").find("li.float-right").appendTo("#statWidgets");
 
             $("#clusterTable tbody").empty();