From 827b723bcf31c9a1cf4fc4713f5467393b130cdd Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 29 May 2017 19:19:43 +0200 Subject: [PATCH] Quagga: New tab in general diagnostics (#168) * Update actions_quagga.conf * Update DiagnosticsController.php * Update diagnosticsgeneral.volt * Update diagnosticsgeneral.volt * Update diagnosticsgeneral.volt * Update DiagnosticsController.php * Update DiagnosticsController.php --- .../OPNsense/Quagga/Api/DiagnosticsController.php | 6 ++++++ .../mvc/app/views/OPNsense/Quagga/diagnosticsgeneral.volt | 8 +++++++- .../opnsense/service/conf/actions.d/actions_quagga.conf | 6 ++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/net/quagga/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/DiagnosticsController.php b/net/quagga/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/DiagnosticsController.php index 07a4a4121..9a79a4a54 100644 --- a/net/quagga/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/DiagnosticsController.php +++ b/net/quagga/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/DiagnosticsController.php @@ -59,6 +59,12 @@ class DiagnosticsController extends ApiControllerBase $response = $backend->configdRun("quagga diag-bgp summary"); return array("response" => $response); } + public function showrunningconfigAction() + { + $backend = new Backend(); + $response = $backend->configdRun("quagga general-runningconfig"); + return array("response" => $response); + } private function get_ospf_information($name) { $backend = new Backend(); diff --git a/net/quagga/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsgeneral.volt b/net/quagga/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsgeneral.volt index 89b4467cc..c03193925 100644 --- a/net/quagga/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsgeneral.volt +++ b/net/quagga/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsgeneral.volt @@ -109,7 +109,9 @@ $(document).ready(function() { $('#routing6').html(content) //$('#routing6 table').bootgrid({converters: dataconverters}) }); - + ajaxCall(url="/api/quagga/diagnostics/showrunningconfig", sendData={}, callback=function(data,status) { + $("#runningconfig").text(data['response']); + }); }); @@ -118,9 +120,13 @@ $(document).ready(function() {
+
+

+    
diff --git a/net/quagga/src/opnsense/service/conf/actions.d/actions_quagga.conf b/net/quagga/src/opnsense/service/conf/actions.d/actions_quagga.conf index af1e2a60e..7dca79606 100644 --- a/net/quagga/src/opnsense/service/conf/actions.d/actions_quagga.conf +++ b/net/quagga/src/opnsense/service/conf/actions.d/actions_quagga.conf @@ -111,3 +111,9 @@ command:/usr/local/opnsense/scripts/quagga/quagga.rb --general-routes6 parameters: type:script_output message: Print IPv6 Routing Table + +[general-runningconfig] +command:/usr/local/bin/vtysh -c "show run" +parameters: +type:script_output +message: Show running configuration