New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override default device grouping radius #8485

Merged
merged 3 commits into from Mar 29, 2018

Conversation

Projects
None yet
4 participants
@jepke
Contributor

jepke commented Mar 28, 2018

Added an option to override the default group_radius 80. Usefull in fullscreenmap

DO NOT DELETE THIS TEXT

Please note

Please read this information carefully. You can run ./scripts/pre-commit.php to check your code before submitting.

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926

Override default device grouping radius
Added an option to override the default group_radius 80. Usefull in fullscreenmap
@@ -121,6 +121,8 @@
}
if (!empty($widget_settings['group_radius'])) {
$group_radius = $widget_settings['group_radius'];
} elseif (!empty($config['custom_worldmap'])) {
$group_radius = $config['custom_worldmap']['group_radius'];
} else {
$group_radius = 80;

This comment has been minimized.

@murrant

murrant Mar 29, 2018

Member

You can use this instead (Config is our new config access class):

use LibreNMS\Config;
if (!empty($widget_settings['group_radius'])) {
    $group_radius = $widget_settings['group_radius'];
} else {
    $group_radius = Config::get('leaflet.group_radius', 80);
}

You also need to add it to the docs. https://docs.librenms.org/Extensions/World-Map/

Looks like some other leaflet settings are missing there if you don't mind adding them.

@jepke jepke referenced this pull request Mar 29, 2018

Merged

Update World-Map.md #8488

0 of 1 task complete
@scrutinizer-notifier

This comment has been minimized.

scrutinizer-notifier commented Mar 29, 2018

The inspection completed: No new issues

@laf

laf approved these changes Mar 29, 2018

Fixed the missing ) now LGTM

@laf laf merged commit b1ec1d1 into librenms:master Mar 29, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details

TheMysteriousX added a commit to TheMysteriousX/librenms that referenced this pull request May 20, 2018

webui: Added override default device grouping radius (librenms#8485)
* Override default device grouping radius

Added an option to override the default group_radius 80. Usefull in fullscreenmap

* Update worldmap.inc.php

* Update worldmap.inc.php

@lock lock bot locked as resolved and limited conversation to collaborators May 28, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.