From d1e49accf9ee939b10e173c985de8b8d58859296 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 23 Mar 2016 10:13:01 +0000 Subject: [PATCH] [Feature] Show map URLs in webui --- interface/js/rspamd.js | 17 +++++++++++------ src/controller.c | 6 ++++-- src/libserver/cfg_utils.c | 1 - src/libserver/dynamic_cfg.c | 2 +- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/interface/js/rspamd.js b/interface/js/rspamd.js index 5f276f5f5..0f01dccd9 100644 --- a/interface/js/rspamd.js +++ b/interface/js/rspamd.js @@ -191,13 +191,15 @@ saveMaps(data); getMapById(); $.each(data, function (i, item) { + var caption; + var label; if ((item.editable == false)) { - var caption = 'View'; - var label = 'Read'; + caption = 'View'; + label = 'Read'; } else { - var caption = 'Edit'; - var label = 'Read Write'; + caption = 'Edit'; + label = 'Read Write'; } items.push('' + '' + label + '' + @@ -206,8 +208,11 @@ 'data-source="#' + item.map + '" ' + 'data-editable="' + item.editable + '" ' + 'data-target="#modalDialog" ' + - 'data-title="' + item.description + - '" data-toggle="modal">' + item.description + '' + + 'data-title="' + item.uri + + '" data-toggle="modal">' + item.uri + '' + + '' + + '' + + item.description + '' + ''); }); diff --git a/src/controller.c b/src/controller.c index f5a624b7c..b20e6a8f7 100644 --- a/src/controller.c +++ b/src/controller.c @@ -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); diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c index 5e49d3a3d..0685dc800 100644 --- a/src/libserver/cfg_utils.c +++ b/src/libserver/cfg_utils.c @@ -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) { diff --git a/src/libserver/dynamic_cfg.c b/src/libserver/dynamic_cfg.c index 8845032f5..3a76f20f9 100644 --- a/src/libserver/dynamic_cfg.c +++ b/src/libserver/dynamic_cfg.c @@ -477,7 +477,7 @@ remove_dynamic_symbol (struct rspamd_config *cfg, apply_dynamic_conf (cfg->current_dynamic_conf, cfg); } - return TRUE; + return ret; } -- 2.39.5