services: bring back service widgets for dns

This commit is contained in:
Franco Fichtner 2016-01-18 08:49:24 +01:00
parent 07923379b6
commit d4ff81bbbc
11 changed files with 32 additions and 9 deletions

View File

@ -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';

View File

@ -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,10 +56,12 @@ function find_service_by_shortcut($name)
$services = get_services();
foreach ($shortcuts as $shortcut => $realname) {
if ($shortcut == $name) {
foreach ($services as $service)
if ($service['name'] == $realname) {
return $service;
foreach ($names as $name) {
if ($shortcut == $name) {
foreach ($services as $service)
if ($service['name'] == $realname) {
return $service;
}
}
}
}

View File

@ -139,6 +139,7 @@ if ($_GET['act'] == "del") {
}
}
$shortcut_section = 'dnsmasq';
$closehead = false;
include("head.inc");

View File

@ -111,6 +111,8 @@ if ($_POST) {
}
}
$shortcut_section = 'dnsmasq';
include("head.inc");
?>

View File

@ -156,6 +156,8 @@ if ($_POST) {
}
}
$shortcut_section = 'dnsmasq';
include("head.inc");
?>

View File

@ -133,6 +133,7 @@ if ($_POST) {
}
}
$shortcut_section = 'unbound';
$closehead = false;
include_once("head.inc");

View File

@ -156,6 +156,7 @@ if ($_POST) {
}
}
$shortcut_section = 'unbound';
$closehead = false;
include("head.inc");

View File

@ -113,6 +113,7 @@ if ($_POST) {
}
}
$shortcut_section = 'unbound';
$closehead = false;
include_once("head.inc");

View File

@ -101,6 +101,8 @@ if ($_POST) {
}
}
$shortcut_section = 'unbound';
include("head.inc");
?>

View File

@ -191,6 +191,8 @@ if ($_POST) {
}
}
$shortcut_section = 'unbound';
include("head.inc");
?>

View File

@ -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");
?>