]> source.dussan.org Git - rspamd.git/commitdiff
[WebUI] Rename Throughput time intervals 3021/head
authormoisseev <moiseev@mezonplus.ru>
Fri, 30 Aug 2019 11:10:24 +0000 (14:10 +0300)
committermoisseev <moiseev@mezonplus.ru>
Fri, 30 Aug 2019 11:26:17 +0000 (14:26 +0300)
<hourly|daily|weekly|monthly> -> <by day|by week|by month|by year>

interface/index.html
interface/js/app/rspamd.js
src/controller.c

index 84aa211cd7349fa46149018b7d439980dea14f9f..a14e6f5f600c01c2d495e1fe8aa27b4cb6ddf4c5 100644 (file)
                                                        <form id="graph_controls" action="#">
                                                                Dataset:
                                                                <select id="selData" class="form-control">
-                                                                       <option value="hourly" selected>Hourly</option>
-                                                                       <option value="daily">Daily</option>
-                                                                       <option value="weekly">Weekly</option>
-                                                                       <option value="monthly">Monthly</option>
+                                                                       <option value="day" selected>By day</option>
+                                                                       <option value="week">By week</option>
+                                                                       <option value="month">By month</option>
+                                                                       <option value="year">By year</option>
                                                                </select>
                                                                Y-scale:
                                                                <select id="selYScale" class="form-control">
index 155a544e1fc42ccc008526cf72440ba6568240a3..c58b3803ca70c595de5fc42830a32672c7c5b62c 100644 (file)
@@ -105,8 +105,8 @@ function ($, D3pie, visibility, NProgress, stickyTabs, tab_stat, tab_graph, tab_
                 tab_graph.draw(ui, graphs, tables, neighbours, checked_server, selData);
 
                 var autoRefresh = {
-                    hourly: 60000,
-                    daily: 300000
+                    day: 60000,
+                    week: 300000
                 };
                 timer_id.throughput = Visibility.every(autoRefresh[selData] || 3600000, function () {
                     tab_graph.draw(ui, graphs, tables, neighbours, checked_server, selData);
index 108f558e0c351049248f3df6d04102be4e80c6c1..450c730dc5cb27c984caf024c0f1f89f3ec4d25f 100644 (file)
@@ -1201,7 +1201,7 @@ rspamd_controller_graph_point (gulong t, gulong step,
 
 /*
  * Graph command handler:
- * request: /graph?type=<hourly|daily|weekly|monthly>
+ * request: /graph?type=<day|week|month|year>
  * headers: Password
  * reply: json [
  *      { label: "Foo", data: 11 },
@@ -1223,10 +1223,10 @@ rspamd_controller_handle_graph (
        gdouble *acc;
        ucl_object_t *res, *elt[METRIC_ACTION_MAX];
        enum {
-               rra_hourly = 0,
-               rra_daily,
-               rra_weekly,
-               rra_monthly,
+               rra_day = 0,
+               rra_week,
+               rra_month,
+               rra_year,
                rra_invalid
        } rra_num = rra_invalid;
        /* How many points are we going to send to display */
@@ -1260,17 +1260,17 @@ rspamd_controller_handle_graph (
                return 0;
        }
 
-       if (value->len == 6 && rspamd_lc_cmp (value->begin, "hourly", value->len) == 0) {
-               rra_num = rra_hourly;
+       if (value->len == 3 && rspamd_lc_cmp (value->begin, "day", value->len) == 0) {
+               rra_num = rra_day;
        }
-       else if (value->len == 5 && rspamd_lc_cmp (value->begin, "daily", value->len) == 0) {
-               rra_num = rra_daily;
+       else if (value->len == 4 && rspamd_lc_cmp (value->begin, "week", value->len) == 0) {
+               rra_num = rra_week;
        }
-       else if (value->len == 6 && rspamd_lc_cmp (value->begin, "weekly", value->len) == 0) {
-               rra_num = rra_weekly;
+       else if (value->len == 5 && rspamd_lc_cmp (value->begin, "month", value->len) == 0) {
+               rra_num = rra_month;
        }
-       else if (value->len == 7 && rspamd_lc_cmp (value->begin, "monthly", value->len) == 0) {
-               rra_num = rra_monthly;
+       else if (value->len == 4 && rspamd_lc_cmp (value->begin, "year", value->len) == 0) {
+               rra_num = rra_year;
        }
 
        g_hash_table_unref (query);