Dashboard widget update (#9515)

Implemented in Laravel
Doesn't use legacy PHP session
Several widgets have new features and settings, for example:

- Multiple ports in one graph
- Maps settings are configurable and override system settings but default to system settings
- Graylog stream and/or device selection
- Much improved graph widget selection
- Many more

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.

- [x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/)

#### Testers

If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
After you are done testing, you can remove the changes with `./scripts/github-remove`.  If there are schema changes, you can ask on discord how to revert.
This commit is contained in:
Tony Murray
2018-12-16 15:18:17 -06:00
committed by Neil Lathwood
parent dd695dde53
commit 74882e3950
113 changed files with 5103 additions and 1902 deletions

View File

@@ -19,6 +19,7 @@
use LibreNMS\Authentication\LegacyAuth;
use LibreNMS\Config;
use LibreNMS\Exceptions\InvalidIpException;
use LibreNMS\Util\Html;
use LibreNMS\Util\IP;
function generate_priority_label($priority)
@@ -747,9 +748,7 @@ function c_echo($string, $enabled = true)
*/
function is_mib_graph($type, $subtype)
{
global $config;
return isset($config['graph_types'][$type][$subtype]['section']) &&
$config['graph_types'][$type][$subtype]['section'] == 'mib';
return \LibreNMS\Util\Graph::isMibGraph($type, $subtype);
} // is_mib_graph
@@ -1543,28 +1542,9 @@ function clean($value, $strip_tags = true)
* @param array $purifier_config (key, value pair)
* @return string
*/
function display($value, $purifier_config = array())
function display($value, $purifier_config = [])
{
/** @var HTMLPurifier $purifier */
global $config, $purifier;
// If $purifier_config is non-empty then we don't want
// to convert html tags and allow these to be controlled
// by purifier instead.
if (empty($purifier_config)) {
$value = htmlentities($value);
}
if (!isset($purifier)) {
// initialize HTML Purifier here since this is the only user
$p_config = HTMLPurifier_Config::createDefault();
$p_config->set('Cache.SerializerPath', $config['temp_dir']);
foreach ($purifier_config as $k => $v) {
$p_config->set($k, $v);
}
$purifier = new HTMLPurifier($p_config);
}
return $purifier->purify(stripslashes($value));
return Html::display($value, $purifier_config);
}
/**