175 Commits

Author SHA1 Message Date
Tony Murray ce9790539f Even more widget fixes/improvements (#9561)
* Device Summary: don't count deleted ports

* General: prevent widget refresh while in settings (synchronize "show_settings" between frontend and backend)

* General: reduce reload flicker by delaying clearing of old content until the backend is complete.

* Port Select: exclude deleted and orphaned ports
2018-12-18 08:02:18 +00:00
Tony Murray 74882e3950 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.
2018-12-16 21:18:17 +00:00
Tony Murray 3e35ee0e7d Refactored and update Location Geocoding (#9359)
- Fix location so it is a regular database relation (this allows multiple devices to be accurately linked to one location and saves api calls)
- Parse coordinates from the location more consistently
- Add settings to webui
- ~~Used [PHP Geocoder](http://geocoder-php.org/), which has lots of backends and is well tested. (also includes reverse and geoip)~~
- Google Maps, Bing, Mapquest, and OpenStreetMap supported initially.
- Default to OpenStreetMap, which doesn't require a key.  They will liberally hand out bans if you exceed 1 query per second though.
- All other Geocoding APIs require an API key. (Google requires a credit card on file, but seems to be the most accurate)
- Update all (I think) sql queries to handle the new structure
- Remove final vestiges of override_sysLocation as a device attribute
- Update existing device groups and rules in DB
- Tested all APIs with good/bad location, no/bad/good key, and no connection.
- Cannot fix advanced queries that use location

This blocks #8868

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.
2018-11-28 22:49:18 +00:00
Tony Murray 14a168b2a9 Keeps the dashboard sessions from expiring. (#9263)
* Keeps the dashboard sessions from expiring.
Route dashboard ajax calls through Laravel.
Boots minimal cookies and sessions.
Does not fix other pages for now, real fix is to fully port.

* Check Laravel auth for the legacy calls.
Display Laravel errors in the dashboard.
legacy auth checks are mostly extraneous now.
2018-09-30 21:23:00 -05:00
TheGreatDoc c30d494505 Fixed edit dashboard permissions + moved to toastr (#9236)
* Fixed edit dashboard permissions + moved to toastr

* Moved $_POST to $vars
2018-09-20 12:21:38 -05:00
Neil Lathwood 86d862fb25 Added support for allowing alerts to un-ack (#9136)
* Add support for allowing alerts to un-ack

* Updated db_schema.yaml

* Update and rename 263.sql to 265.sql

* Fix up ui a bit.

* Renamed sql file
2018-09-19 23:38:01 +01:00
Tony Murray 32a7c50189 Use Laravel authentication (#8702)
* Use Laravel for authentication
Support legacy auth methods
Always create DB entry for users (segregate by auth method)

Port api auth to Laravel

restrict poller errors to devices the user has access to

Run checks on every page load.  But set a 5 minute (configurable) timer.
Only run some checks if the user is an admin

Move toastr down a few pixels so it isn't as annoying.

Fix menu not loaded on laravel pages when twofactor is enabled for the system, but disabled for the user.
Add two missing menu entries in the laravel menu

Rewrite 2FA code
Simplify some and verify code before applying

Get http-auth working
Handle legacy $_SESSION differently.  Allows Auth::once(), etc to work.

* Fix tests and mysqli extension check

* remove duplicate Toastr messages

* Fix new items

* Rename 266.sql to 267.sql
2018-09-11 07:51:35 -05:00
Neil Lathwood 1eee6e8195 alert: Added ability to make notes for acking alerts + record who did so (#8433)
* alert: Added ability to make notes for acking alerts + record who did so

* Updated schema

* moved sql file

* Updated from comments in PR

* warning changed to blue

* reset notes + keep notes on ack
2018-04-26 00:00:56 -05:00
Tony Murray 7250376104 refactor: Don't access $_SESSION directly for Auth (#8513)
* Don't access $_SESSION directly for Auth

* fix style

* add property annotations
2018-04-07 21:55:28 +01:00
Ryan Medlyn d6ae852617 Fixes query selector scope for bootgrid destroy (#7379) 2017-09-22 07:06:49 +01:00
Ryan Medlyn 6077d3a3db webui: Greatly reduces application memory leak for dashboard (#7215) 2017-09-01 17:27:01 +01:00
Slashdoom fbf157c053 webui: Load google maps js library only if globe map widget is used
webui: Load google maps js library only if globe map widget is used
2017-06-02 21:02:50 +01:00
Neil Lathwood acaa29c583 webui: Disabled settings button for Shared (read) dashboards if you are not the owner (#6596) 2017-05-05 16:22:01 -05:00
Daniel Preussker 2076e3655f Revert #6282 as it breaks graph widgets (#6361) 2017-04-05 16:14:21 +01:00
Tony Murray dd91484716 fix: Select the correct dashboard when there are no defaults. (#6339) 2017-04-04 17:55:18 +01:00
Neil Lathwood 1bbbaff58b refactor: Moved ifLabel -> cleanPort and updated the usage (#6288)
* refactor: Moved ifLabel -> cleanPort and updated the usage

* added list of tags allowed

* few updates as per comments from @murrant

* Added simple unit tests

* double display for javascript popover

* Remove ifNameDescr() function
Fix realtime port page

* remove accidental temp code

* Remove double display calls in ajax tables
2017-04-04 08:08:23 +01:00
Tony Murray 4b9f3f37d7 fix: move user preferences dashboard and twofactor out of users table (#6286)
* fix: move user preferences dashboard and twofactor out of users table
This allows them to work with any authentication method
Add set_user_pref() and get_user_pref() helper functions

* fix edit users for other users

* Fix updated_at default timestamp

* Update and rename 183.sql to 184.sql

* removed commented out debug
2017-04-01 22:18:00 +01:00
Jan-Philipp Litza 323df86d40 fix: Fixed height of widget boxes (#6282)
* Fix height of widget boxes

This pracitcally reverts #5644 and instead applies the correct fix by
calculating the dimensions of the widget box correctly.

* I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md.
2017-03-28 16:02:10 +01:00
Neil Lathwood 8b453889fc fix: Stop creating dashboards when user has a default that no longer exists #5610 (#5613) 2017-01-26 22:38:14 +00:00
Tony Murray a83e126b40 refactor: Remove inappropriate usages of truncate() (#5028)
Where truncate() is used as substr(), replace with substr()
2016-11-20 11:12:25 +00:00
Neil Lathwood 085e7537d8 fix: Merge pull request #4939 from laf/issue-4937
* fix: If all dashboards are deleted, create a default #4937

* Remove debug statement
2016-11-14 21:54:12 -06:00
crcro 80497f5295 fix: Ignore meraki bad_uptime #4691 2016-10-08 18:48:11 +01:00
crcro f06b0ffb66 fix: device with no uptime (#4625)
fix: Add checks for devices with no uptime over snmp #4587
2016-09-27 21:07:42 +01:00
Neil Lathwood 3a0487088c fix: Always validate the default dashboard_id to make sure it still exists
fix: Always validate the default dashboard_id to make sure it still exists
2016-08-30 22:03:23 +01:00
Guillaume Coeugnet d2db74c44e [Bugfix] Dashboards redirecting and widgets not adding (#4272)
bug: Fixes dashboards redirecting #4213 and adding new widgets #4255
2016-08-30 13:56:28 +01:00
Eldon Koyle 787c4f09f7 Config option for global default dashboard (#4080)
* Config option for global default dashboard

Add config option to set a global default dashbord.  This will be used
instead of the user's "Default" dashboard unless they have changed their
default dashboard in their user settings.

* Use a dropdown for the default_dashboard option

Update generate_dynamic_config_panel to allow assoc arrays with
`'value'` and `'description'` as keys and change to a select box.

* Fix PHP style issues lost during merge
2016-08-23 19:37:12 +01:00
Bennett Blodinger 2fd6a9f0fb Fix button jumping for dashboard tooltips (#4164)
http://getbootstrap.com/javascript/#callout-tooltip-groups
2016-08-22 19:09:22 +01:00
Tony Murray 8c639aa5a4 PSR2 Cleanup: /html edition
Travis tests for code conformance. Ignore warnings for now.
Fixed all errors, left most warnings.
2016-08-18 21:29:30 -05:00
Guillaume COEUGNET 8264f3dfb5 Remove extra dbInsert from dashborads creation 2016-07-01 11:13:10 +02:00
laf f2cd332b91 Updated old frontpage to use new services format 2016-06-20 23:00:40 +01:00
Tony Murray 18484db3fe Fix adding widgets (#3567) 2016-05-27 09:20:33 -05:00
Tony Murray 07455a6e0a Scrollable widgets
Remove several javascript:return false;
2016-05-26 09:44:41 -05:00
laf e0f14798fe Updated services box to be 2 for down 2016-05-03 22:15:29 +00:00
Tony Murray b98ba8c1a4 Remove some deprecated functions 2016-04-24 01:05:14 -05:00
Rosiak bf175ef8a0 Fix 2685
Print the dash owner’s username when using sticky dash.
2016-01-06 23:41:58 +01:00
Daniel Preussker a63ea78441 First Draft in Per-User default dashboards 2015-12-13 19:39:12 +00:00
Daniel Preussker 93f85af48b Merge pull request #2414 from laf/gridster
Gridster update - responsive support
2015-11-21 10:59:41 +00:00
laf b9e95b702d Updated userlevel >= 10 checks to use functions 2015-11-12 19:28:19 +00:00
laf 248c2004fc Updated to be responsive 2015-11-11 08:49:07 +00:00
Daniel Preussker 7ce765444a Dont show dashboard settings if /bare=yes/ 2015-10-29 17:00:56 +00:00
Mike Rostermund 6b31a15e79 Sort list of available dashboards. 2015-10-08 20:16:44 +02:00
f0o 0321c0f152 Added tooltips
Fixed Placeholder message
2015-10-02 07:21:37 +00:00
f0o ea00040fd0 By default lock all tiles
Only allow moving/resizing if in Edit mode
2015-10-02 05:06:48 +00:00
Arjit Chaudhary dca4f7ba85 Use bootstrap alert class for device down boxes 2015-09-28 00:33:50 +05:30
Daniel Preussker baa209ff05 Fixed width of dashboard-dropdown 2015-09-12 09:51:58 +01:00
Daniel Preussker 8859130949 Fix base_url with tailing slash 2015-09-11 21:17:49 +01:00
Daniel Preussker 9e668e9bd7 Updated dashboard menu's 2015-09-11 21:14:25 +01:00
Daniel Preussker f80b10bfa0 Added Dashboard sharing. 2015-09-11 19:20:10 +01:00
Daniel Preussker cc936c34f8 Re-arranged dashboard bar 2015-09-11 14:41:17 +01:00
Daniel Preussker ac6e56fa56 changed settings icon 2015-09-10 17:14:36 +01:00