mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 01:24:38 +00:00
src: style sweep
This commit is contained in:
parent
f213bf2833
commit
4154cfcead
@ -57,7 +57,7 @@ class SettingsController extends ApiMutableModelControllerBase
|
||||
$ifconfig = json_decode((new Backend())->configdRun('interface list ifconfig'), true);
|
||||
$gateways_status = json_decode((new Backend())->configdRun('interface gateways status'), true);
|
||||
$gateways = array_values($this->getModel()->gatewaysIndexedByName(true, false, true));
|
||||
$down_gateways = !empty((string)$cfg->system->gw_switch_default) ? array_map(function ($gw){
|
||||
$down_gateways = !empty((string)$cfg->system->gw_switch_default) ? array_map(function ($gw) {
|
||||
if (str_contains($gw['status'], 'down')) {
|
||||
return $gw['name'];
|
||||
}
|
||||
@ -204,8 +204,11 @@ class SettingsController extends ApiMutableModelControllerBase
|
||||
}
|
||||
|
||||
if (!empty($groups)) {
|
||||
throw new UserException(sprintf(gettext("Gateway %s cannot be deleted because it is in use on Gateway Group(s) '%s'"),
|
||||
$gateway->name, implode(', ', $groups)));
|
||||
throw new UserException(sprintf(
|
||||
gettext("Gateway %s cannot be deleted because it is in use on Gateway Group(s) '%s'"),
|
||||
$gateway->name,
|
||||
implode(', ', $groups)
|
||||
));
|
||||
}
|
||||
|
||||
$routes = [];
|
||||
@ -218,8 +221,11 @@ class SettingsController extends ApiMutableModelControllerBase
|
||||
}
|
||||
|
||||
if (!empty($routes)) {
|
||||
throw new UserException(sprintf(gettext("Gateway %s cannot be deleted because it is in use on Static Route(s) '%s'"),
|
||||
$gateway->name, implode(', ', $routes)));
|
||||
throw new UserException(sprintf(
|
||||
gettext("Gateway %s cannot be deleted because it is in use on Static Route(s) '%s'"),
|
||||
$gateway->name,
|
||||
implode(', ', $routes)
|
||||
));
|
||||
}
|
||||
|
||||
$result = $this->delBase('gateway_item', $uuid);
|
||||
|
||||
@ -288,7 +288,7 @@ function add_gateway_to_config($interface, $gatewayip, $inet_type, $is_in_subnet
|
||||
|
||||
$gw->createOrUpdateGateway($item, $uuid);
|
||||
|
||||
/*
|
||||
/*
|
||||
* Serialize back to global config, capturing the changes made here.
|
||||
* write_config() will take care of writing the global config to disk later on
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user