Dispatcher Service settings (#11760)

* Poller settings WIP

* Poller settings WIP2

* working on SettingMultiple

* setting multiple working

* settings sent with all required info

* fix translation

* Fix keys

* fix groups setting

* Apply settings to service
fixes and validations for setting

* don't error when no poller_cluster entry exists

* hid tab when no poller cluster entries

* Authorization

* make prod

* daily maintenance toggle should be advanced

* Update schema def
This commit is contained in:
Tony Murray
2020-06-08 08:27:03 -05:00
committed by GitHub
parent 946e90b68d
commit 300645388f
29 changed files with 1134 additions and 86 deletions
+22
View File
@@ -8,6 +8,7 @@ use App\Models\PollerCluster;
use App\Models\PollerGroup;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use LibreNMS\Config;
class PollerController extends Controller
@@ -21,6 +22,7 @@ class PollerController extends Controller
public function logTab(Request $request)
{
$this->authorize('viewAny', PollerCluster::class);
return view('poller.log', [
'current_tab' => 'log',
'filter' => $request->input('filter', 'active')
@@ -29,6 +31,7 @@ class PollerController extends Controller
public function groupsTab()
{
$this->authorize('manage', PollerCluster::class);
return view('poller.groups', [
'current_tab' => 'groups',
'poller_groups' => PollerGroup::query()->withCount('devices')->get(),
@@ -39,6 +42,7 @@ class PollerController extends Controller
public function pollerTab()
{
$this->authorize('viewAny', PollerCluster::class);
return view('poller.poller', [
'current_tab' => 'poller',
'pollers' => $this->poller(),
@@ -46,8 +50,20 @@ class PollerController extends Controller
]);
}
public function settingsTab()
{
$this->authorize('manage', PollerCluster::class);
$pollerClusters = PollerCluster::all()->keyBy('id');
return view('poller.settings', [
'current_tab' => 'settings',
'settings' => $this->pollerSettings($pollerClusters),
'poller_cluster' => $pollerClusters,
]);
}
public function performanceTab()
{
$this->authorize('viewAny', PollerCluster::class);
return view('poller.performance', ['current_tab' => 'performance']);
}
@@ -85,4 +101,10 @@ class PollerController extends Controller
return 'success';
}
private function pollerSettings($pollers): Collection
{
$groups = PollerGroup::list();
return $pollers->map->configDefinition($groups);
}
}