Commit Graph

528 Commits

Author SHA1 Message Date
Tim de Boer
d333d2f29e Fixed typo in globe widget 2019-01-07 16:56:47 +01:00
Tony Murray
ae29d43af0 Sort device select by hostname (#9607)
Plus small format fix for horizontal device summary widget.

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.
2019-01-05 15:31:12 +00:00
Tony Murray
2a765bfed7
Widget fixes 4 (#9583)
* Globe: fix issue with more than one widget

* Widgets/JS: prevent race conditions by storing all callbacks waiting for the same script.  After the script is loaded run all callbacks.

* Fix broken Mapquest maps
2018-12-21 09:00:53 -06:00
Tony Murray
7093b362bb
Allow multiple worldmap widgets (#9565)
Use unique id for each map
2018-12-19 07:48:47 -06:00
Tony Murray
5d20686d34
More Widget fixes (#9559)
* limit worldmap to active devices, use scope in availability map

* Linkable totals and better option description for disabled/ignored.

* fix disabled / ignore enabled display

* better? links

* style improvements.  Not important enough to bump version

* fix top interfaces query
2018-12-17 16:45:17 -06:00
Tony Murray
220bc2040c
Fix error in error page (#9560) 2018-12-17 11:51:29 -06:00
Tony Murray
41b1dc67ed Correctly handle the uniform tiles setting (inverted) 2018-12-17 09:12:05 -06:00
Tony Murray
0b724c3fbe Better handling of log file failures (#9539)
Fix issues when APP_LOG is empty, unwritable , or pointed at a directory.
APP_LOG takes precedence over $config['log_file'] now.

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:26:20 +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
Neil Lathwood
dd695dde53 Fixed openstreetmap support in device not using custom tiles (#9536)
* Fixed openstreetmap support in device not using custom tiles

* Updated blade template for locations

* Removed console.log()
2018-12-16 08:56:29 -06:00
Tony Murray
59e5c0f560
Manual location coordinate editing (#9526)
* Manual location coordinate editing

* reload bootgrid table on success
2018-12-11 09:37:11 -06:00
Tony Murray
00cd32f725 Device management fall back to http if https isn't available.
Adds a slight delay on management clicking, may be blocked by popup blocker...
2018-12-05 13:52:07 -06:00
Tony Murray
909f2c534d
Change locations default sort order (#9502) 2018-11-30 15:16:57 -06:00
Tony Murray
095a4a024a
Add bing layer to leaflet (#9497)
Also, polyfill for IE used by both bing and google maps
2018-11-30 14:36:52 -06:00
Tony Murray
957ecc2441
Locations UI and editing (#9480)
* Better handling of errors
Mapquest seems to return the center of the US on error.......

* Editable locations WIP

* Change to bootgrid ajax table WIP

* Graphs working, using handlebars
update js libs
add current location button

* remove sql query, change icon

* Add the map to the device view, only when gps is expanded.
Allow edit on device page, share js code

* fix chevron rotation, improve click area

* extra warning

* fix overview layout (remove containers)

* fix style

* fix html divs, change collapse ui a bit
move css, update css/js versions

* start zoomed out on new locations

* don't double load scripts, zoom to 17

* fix php-md errors, remove unused use statement

* improve non-admin experience

* Move locations page to Laravel
More functions in Url and Html util classes
reduce code duplication

* translation buttons too

* fix whitespace

* move formatters to the frontend

* small changes

* disable traffic for locations with no devices

* change down 0 to green from gray

* missing "

* Fix paginate all

* working fix for paginate all

* allow sort by counts

* fix down sort

* a little safety

* Don't call the function twice

* btn-xs
2018-11-29 19:23:40 -06: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
f439eb4f1d Disable page refresh on health sensors pages, autorefresh most tables (#9386)
* Disable page refresh on health sensors pages
Refresh all bootgrid tables every 5 minutes

* Update legacy_index.php

* Update librenmsv1.blade.php
2018-11-08 22:29:20 +00:00
Tony Murray
0ec8f18459 Graph of overall poller performance (#9381)
* Graph definitions

* Stacked.

* Add display

* remove old poll-log, add redirect

* Handle undefined data in graphs

* Standard pollers

* Change doc to send to the global poller module page.

* remove test code :)

* Link parent menu
2018-10-26 21:04:30 +01:00
Tony Murray
607a567090
Don't check file permissions on every request, handle failures (#9264)
* Don't check file permissions on every request, handle failures
Improve error page visually

* only print minimal mkdir

* invert file_exists check, whoops

* docblock

* revert accidental changes

* rename variable

* Change database errors to use the new layout

* Add support url to the default layout

* Replaced \n for && in fix for user perms

* fix web output
2018-10-18 21:08:46 -05:00
Tony Murray
421bcb030d
Force root url if set by user (#9266)
* Force root url if set by user
If user sets APP_URL, force the root url to that.  Empty strings result in default behavior.
Fix some of the urls in the laravel templates.

* Docs update

* Add base_url
2018-10-02 07:56:13 -05:00
Tony Murray
21ca8bf0b0 Update syslog display and backend (#9228)
* Update syslog display backend
select boxes now dynamically load instead of loading all on pageload
select and table ajax backends completely redone with Laravel (just syslog for now)
duplicate url creation to Url utility class for now (uses Device model instead of array)
build short hostname functionality into Device->displayName() helper

* Fix whitespace

* Some tidying up. Split out displayName() and shortDisplayName()

* Enable auto-sizing.
Fix small error in Url

* Eager load device
Use bootstrap theme for select2
2018-09-20 21:33:03 +01:00
Tony Murray
93d909c877
Fix extra large login images (#9183) 2018-09-11 19:21:29 -05: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
Tony Murray
a2e33efba8 Use PDO for MySQL queries (#8935)
Gut dbFacile
mres() now does nothing... could have some vulnerable queries, but most are ok

TODO
- [x] IRC client broke
- [x] Install broke

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`
2018-08-17 21:29:20 +01:00
Paul Heinrichs
7f16e586a7 Update base template (#8973) 2018-08-02 08:27:29 +01:00
Paul Heinrichs
da58c91dd9 Add docs for using a base template (#8939)
* Add docs for using a base template

* Updated readme
2018-07-31 19:16:45 -05:00
Tony Murray
4c8ec59098 Custom error page (#8911)
Generic error page, just a dump of the current page with additional information.

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`
2018-07-17 21:15:11 +01:00
Tony Murray
1ad7f3138b
Add Laravel to LibreNMS (#8318)
* Add Laravel to LibreNMS.

* Try to set permissions during initial install and first composer update to Laravel.

* Fix composer.lock
Fix missing db config keys

* Start building v1 layout
Port ajax_setresolution, inject csrf into jquery ajax calls
Layout works, building menu
Partially done.

* Fix device group list
remove stupid count relationships

* Print messages for common boot errors.
Don't log to laravel.log file.
Log to error_log until booted, then librenms.log

* Fix up some issues with Config loading
Start of custom directives

* Custom blade directives: config, notconfig, admin

* Preflight checks
Only load config files once.

* Update the composer.lock for php 5.6

* Menu through routing

* Start of alert menu

* Better alert scopes

* reduce cruft in models

* Alerting menu more or less working :D

* Fix style

* Improved preflight

* Fix chicken-eggs!

* Remove examples

* Better alert_rule status queries
Debugbar

* fix app.env check

* User Menu

* Settings bar (dropped refresh)
Search JS

* Toastr messages

* Rename preflight

* Use hasAccess(User) on most models.
Add port counts

* Missed a Preflight -> Checks rename

* Fix some formatting

* Boot Eloquent outside of Laravel
Use Eloquent for Config and Plugins so we don't have to connect with dbFacile inside Laravel.
Move locate_binary() into Config class

* Config WIP

* Try to fix a lot of config loading issues.

* Improve menu for non-admins removing unneeded menus
url() for all in menu

* Only use eloquent if it exists

* Include APP_URL in initial .env settings

* Implement Legacy User Provider

* Helper class for using Eloquent outside of Laravel.
Allows access to DB style queries too and checking the connection status.

* Fix up tests

* Fix device groups query

* Checking Travis

* copy config.test.php earlier

* dbFacile check config before connecting
Don't use exception to check if eloquent is connected, it gets grabbed by the exception handler.
Ignore missing config.php error.

* Fix config load with database is not migrated yet.

* Remove Config::load() from early boot.

* Use laravel config settings to init db (this prefers .env settings)
Fix bgp vars not set in menu
add _ide_helper.php to .gitignore

* Restrict dependencies to versions that support php 5.6

* Update ConfigTest

* Fix a couple of installation issues

* Add unique NODE_ID to .env

* Correct handling of title image

* Fix database config not loading. Thanks @laf

* Don't prepend /

* add class_exists checks for development service providers

* Fix config value casting

* Don't use functions that may not exist

* Update dbFacile.php

* d_echo may not be defined when Config used called.

* Add SELinux configuration steps
More detailed permissions check.
Check all and give complete corrective commands in one step.

* Ignore node_modules directory

* Re-add accidetal removal
2018-05-09 08:05:17 -05:00