From: Remi Gacogne Date: Fri, 6 Oct 2023 07:21:26 +0000 (+0200) Subject: dnsdist: Display the rule name, if any, in the web interface X-Git-Tag: rec-5.0.0-alpha2~27^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F13335%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Display the rule name, if any, in the web interface As suggested by Sébastien Riccio. --- diff --git a/pdns/dnsdist-web.cc b/pdns/dnsdist-web.cc index 8477b765bb..69f543621e 100644 --- a/pdns/dnsdist-web.cc +++ b/pdns/dnsdist-web.cc @@ -1263,6 +1263,7 @@ static void handleStats(const YaHTTP::Request& req, YaHTTP::Response& resp) {"id", num++}, {"creationOrder", (double)a.d_creationOrder}, {"uuid", boost::uuids::to_string(a.d_id)}, + {"name", a.d_name}, {"matches", (double)a.d_rule->d_matches}, {"rule", a.d_rule->toString()}, {"action", a.d_action->toString()}, diff --git a/pdns/dnsdistdist/html/local.js b/pdns/dnsdistdist/html/local.js index cefb0a4d96..1db6999dba 100644 --- a/pdns/dnsdistdist/html/local.js +++ b/pdns/dnsdistdist/html/local.js @@ -204,10 +204,10 @@ $(document).ready(function() { bouw = bouw + ""; $("#downstreams").html(bouw); - bouw=''; + bouw='
#RuleActionMatches
'; if(data["rules"].length) { $.each(data["rules"], function(a,b) { - bouw = bouw + (""); + bouw = bouw + (""); bouw = bouw + (""); }); } @@ -216,10 +216,10 @@ $(document).ready(function() { bouw = bouw + "
#NameRuleActionMatches
"+b["id"]+""+b["rule"]+""+b["action"]+"
"+b["id"]+""+b["name"]+""+b["rule"]+""+b["action"]+""+b["matches"]+"
"; $("#rules").html(bouw); - bouw=''; + bouw='
#Response RuleActionMatches
'; if(data["response-rules"].length) { $.each(data["response-rules"], function(a,b) { - bouw = bouw + (""); + bouw = bouw + (""); bouw = bouw + (""); }); }
#NameResponse RuleActionMatches
"+b["id"]+""+b["rule"]+""+b["action"]+"
"+b["id"]+""+b["name"]+""+b["rule"]+""+b["action"]+""+b["matches"]+"