]> source.dussan.org Git - rspamd.git/commitdiff
[Feature] Show map URLs in webui
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 23 Mar 2016 10:13:01 +0000 (10:13 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 23 Mar 2016 10:13:01 +0000 (10:13 +0000)
interface/js/rspamd.js
src/controller.c
src/libserver/cfg_utils.c
src/libserver/dynamic_cfg.c

index 5f276f5f50abdfa8acb6fa35feb4d4fc27c70756..0f01dccd9f22303402a55e9448a5e5c240aeb6e9 100644 (file)
                     saveMaps(data);
                     getMapById();
                     $.each(data, function (i, item) {
+                        var caption;
+                        var label;
                         if ((item.editable == false)) {
-                            var caption = 'View';
-                            var label = '<span class="label label-default">Read</span>';
+                            caption = 'View';
+                            label = '<span class="label label-default">Read</span>';
                         }
                         else {
-                            var caption = 'Edit';
-                            var label = '<span class="label label-default">Read</span>&nbsp;<span class="label label-success">Write</span>';
+                            caption = 'Edit';
+                            label = '<span class="label label-default">Read</span>&nbsp;<span class="label label-success">Write</span>';
                         }
                         items.push('<tr>' +
                             '<td class="col-md-2 maps-cell">' + label + '</td>' +
                             'data-source="#' + item.map + '" ' +
                             'data-editable="' + item.editable + '" ' +
                             'data-target="#modalDialog" ' +
-                            'data-title="' + item.description +
-                            '" data-toggle="modal">' + item.description + '</span>' +
+                            'data-title="' + item.uri +
+                            '" data-toggle="modal">' + item.uri + '</span>' +
+                            '</td>' +
+                            '<td>' +
+                            item.description +
                             '</td>' +
                             '</tr>');
                     });
index f5a624b7c889a5b887a6979f61bd8cd8a85ceb67..b20e6a8f7d5d5821ecfc5f7cc750f654adbb69d8 100644 (file)
@@ -794,13 +794,15 @@ rspamd_controller_handle_maps (struct rspamd_http_connection_entry *conn_ent,
 
                obj = ucl_object_typed_new (UCL_OBJECT);
                ucl_object_insert_key (obj,        ucl_object_fromint (map->id),
-                       "map", 0, false);
+                               "map", 0, false);
                if (map->description) {
                        ucl_object_insert_key (obj, ucl_object_fromstring (map->description),
                                        "description", 0, false);
                }
+               ucl_object_insert_key (obj, ucl_object_fromstring (map->uri),
+                               "uri", 0, false);
                ucl_object_insert_key (obj,       ucl_object_frombool (editable),
-                       "editable", 0, false);
+                               "editable", 0, false);
                ucl_array_append (top, obj);
 
                cur = g_list_next (cur);
index 5e49d3a3d57f90c9a05d531181fc7949f2e56a11..0685dc800d23a9109982eef8da9be952e71826e1 100644 (file)
@@ -1444,7 +1444,6 @@ rspamd_config_add_metric_symbol (struct rspamd_config *cfg,
 
                        *sym_def->weight_ptr = score;
                        sym_def->score = score;
-
                        sym_def->flags = flags;
 
                        if (description) {
index 8845032f539765dfdc77ac23172b8dfbc3252676..3a76f20f9b7571b6d7806e777c2871e06754edbc 100644 (file)
@@ -477,7 +477,7 @@ remove_dynamic_symbol (struct rspamd_config *cfg,
                apply_dynamic_conf (cfg->current_dynamic_conf, cfg);
        }
 
-       return TRUE;
+       return ret;
 }