Commit d4ff81bb authored by Franco Fichtner's avatar Franco Fichtner

services: bring back service widgets for dns

parent 07923379
......@@ -3,4 +3,7 @@
$logfile = '/var/log/resolver.log';
$logclog = true;
require_once 'services.inc';
$shortcut_section = array('dnsmasq', 'unbound');
require_once 'diag_logs_template.inc';
......@@ -29,21 +29,26 @@
POSSIBILITY OF SUCH DAMAGE.
*/
function find_service_by_shortcut($name)
function find_service_by_shortcut($names)
{
$shortcuts = array();
/* WIP unify mapping so "shortcuts" are no longer needed */
if (!is_array($names)) {
$names = array($names);
}
$shortcuts['dhcpd'] = 'dhcpd';
$shortcuts['dhcrelay'] = 'dhcrelay';
$shortcuts['dhcrelay6'] = 'dhcrelay6';
$shortcuts['forwarder'] = 'dnsmasq';
$shortcuts['dnsmasq'] = 'dnsmasq';
$shortcuts['unbound'] = 'unbound';
/* WIP unify mapping so "shortcuts" are no longer needed */
$shortcuts['gateways'] = 'apinger';
$shortcuts['ipsec'] = 'ipsec';
$shortcuts['ntp'] = 'ntpd';
$shortcuts['openvpn'] = 'openvpn';
$shortcuts['relayd'] = 'relayd';
$shortcuts['resolver'] = 'unbound';
$shortcuts['snmp'] = 'bsnmpd';
$shortcuts['squid'] = 'squid';
$shortcuts['upnp'] = 'miniupnpd';
......@@ -51,6 +56,7 @@ function find_service_by_shortcut($name)
$services = get_services();
foreach ($shortcuts as $shortcut => $realname) {
foreach ($names as $name) {
if ($shortcut == $name) {
foreach ($services as $service)
if ($service['name'] == $realname) {
......@@ -58,6 +64,7 @@ function find_service_by_shortcut($name)
}
}
}
}
return array();
}
......
......@@ -139,6 +139,7 @@ if ($_GET['act'] == "del") {
}
}
$shortcut_section = 'dnsmasq';
$closehead = false;
include("head.inc");
......
......@@ -111,6 +111,8 @@ if ($_POST) {
}
}
$shortcut_section = 'dnsmasq';
include("head.inc");
?>
......
......@@ -156,6 +156,8 @@ if ($_POST) {
}
}
$shortcut_section = 'dnsmasq';
include("head.inc");
?>
......
......@@ -133,6 +133,7 @@ if ($_POST) {
}
}
$shortcut_section = 'unbound';
$closehead = false;
include_once("head.inc");
......
......@@ -156,6 +156,7 @@ if ($_POST) {
}
}
$shortcut_section = 'unbound';
$closehead = false;
include("head.inc");
......
......@@ -113,6 +113,7 @@ if ($_POST) {
}
}
$shortcut_section = 'unbound';
$closehead = false;
include_once("head.inc");
......
......@@ -101,6 +101,8 @@ if ($_POST) {
}
}
$shortcut_section = 'unbound';
include("head.inc");
?>
......
......@@ -191,6 +191,8 @@ if ($_POST) {
}
}
$shortcut_section = 'unbound';
include("head.inc");
?>
......
......@@ -88,8 +88,9 @@ if ($_GET['act'] == "del") {
}
}
$shortcut_section = 'unbound';
$closehead = false;
$pgtitle = array(gettext('Services'), gettext('DNS Resolver'), gettext('Overrides'));
include_once("head.inc");
?>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment