src: style sweep

This commit is contained in:
Franco Fichtner 2022-03-22 13:51:40 +01:00
parent 9dfafbc2ec
commit bf3f7ddfa9
3 changed files with 30 additions and 24 deletions

View File

@ -40,7 +40,8 @@ class SettingsController extends ApiMutableModelControllerBase
private $type = 'dot';
public function toggleSystemForwardAction() {
public function toggleSystemForwardAction()
{
if ($this->request->isPost() && $this->request->hasPost('forwarding')) {
$this->sessionClose();
Config::getInstance()->lock();
@ -58,10 +59,10 @@ class SettingsController extends ApiMutableModelControllerBase
/* save and release lock */
Config::getInstance()->save();
}
}
public function getSystemForwardAction() {
public function getSystemForwardAction()
{
$config = Config::getInstance()->object();
return array("forwarding" =>
array( "enabled" =>
@ -70,7 +71,8 @@ class SettingsController extends ApiMutableModelControllerBase
);
}
public function getNameserversAction() {
public function getNameserversAction()
{
if ($this->request->isGet()) {
$backend = new Backend();
$nameservers = json_decode(trim($backend->configdRun("system list nameservers")));
@ -132,7 +134,9 @@ class SettingsController extends ApiMutableModelControllerBase
public function addForwardAction()
{
return $this->addBase('dot', 'dots.dot',
return $this->addBase(
'dot',
'dots.dot',
[ "type" => $this->type ]
);
}
@ -144,7 +148,10 @@ class SettingsController extends ApiMutableModelControllerBase
public function setForwardAction($uuid)
{
return $this->setBase('dot', 'dots.dot', $uuid,
return $this->setBase(
'dot',
'dots.dot',
$uuid,
[ "type" => $this->type ]
);
}

View File

@ -1,17 +1,17 @@
<form>
<field>
<id>forwarding.enabled</id>
<label>Use System Nameservers</label>
<type>checkbox</type>
<style>forwarding-enabled</style>
<help>
The configured system nameservers will be used to forward queries to.
This will override any entry in the grid below.
</help>
</field>
<field>
<id>forwarding.info</id>
<type>info</type>
<label></label>
</field>
</form>
<form>
<field>
<id>forwarding.enabled</id>
<label>Use System Nameservers</label>
<type>checkbox</type>
<style>forwarding-enabled</style>
<help>
The configured system nameservers will be used to forward queries to.
This will override any entry in the grid below.
</help>
</field>
<field>
<id>forwarding.info</id>
<type>info</type>
<label></label>
</field>
</form>

View File

@ -50,4 +50,3 @@ forward-zone:
{% endfor %}
{% endif %}
{% endif %}