Commit Graph

546 Commits

Author SHA1 Message Date
PipoCanaja
dde970ddcf bug - Fix missing device_id in NAC tab view, round 2 (#15537)
* Revert "Fix missing device_id (#15534)"

This reverts commit f678f4c540.

* fix
2023-10-31 19:21:09 -05:00
PipoCanaja
f678f4c540 Fix missing device_id (#15534)
Missed a commit in #15329
2023-10-31 16:09:38 -05:00
Tony Murray
ef12cef6aa Respect web_mouseover setting in popup component (#15530)
* Respect web_mouseover setting in popup component
fixes #15496

* Apply fixes from StyleCI

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-10-31 10:12:17 -05:00
Tony Murray
6bc8a504bb Plugin update (breaking) (#15498)
* Plugin update (breaking)
A couple breaking changes regarding property types and method arguments.
Add a setting to allow plugin errors to be shown instead of automatically disabling the plugin.
All default hooks now use Dependency Injection to make it easy to get access to whatever you need (such as settings)
Add a ton of comments and examples in the PHP code.
Expand a bit on the documentation, it could still use more help
Fix a bug in the settings and page view where the included blade file was output before the page headers, etc

* Apply fixes from StyleCI

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-10-29 22:45:23 -05:00
Tony Murray
8e8fa8365e Fix missing Mac class namespace (#15447) 2023-10-12 17:09:41 -05:00
Tony Murray
d8c372bbf4 Refactor MAC utilities into a single class (#15379)
* Refactor MAC utils to a new utility class

* Apply fixes from StyleCI

* Inline functions
Add tests
Handle bridgeid format

* Apply fixes from StyleCI

* Dedicated code path for stp bridge parsing, and improve STP output a bit

* Correctly parse dot1dBaseBridgeAddress and don't store int in bool field

* trim any unexpected character from bridge addresses, add extra test data.

* better comment

* barsBridge can handle dot1dBaseBridgeAddress correctly now

* parseBridge, check for properly formatted mac first.

* update test data, empty data = empty mac

* Fix new usage after rebase

* import

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
2023-10-06 07:34:14 -05:00
Tony Murray
efb763d8c5 Vertically center device icons (#15361) 2023-09-29 00:07:23 +02:00
PipoCanaja
6ba103db68 Device NAC page to Laravel Blade (#15329) 2023-09-24 15:19:25 -05:00
Tony Murray
35406b4b32 Fix some issues with admin self settings (#15332)
Don't require old password when not settings password
Show old password field for user's own user
2023-09-18 14:35:12 -05:00
Tony Murray
41cffd3bfd Fix login page HTML (#15321)
got split incorrectly at some point
2023-09-14 09:27:32 -05:00
PipoCanaja
8eeb83928f Add global NAC page and refactor the per-device one (#15228)
* Adding a NAC global port page

* style

* filter_menu_entry

* typo

* ->when()

* device_id always returned

* use request

* laravel conversion, let see how it goes

* styleci

* ->with('device') to avoid 1 query per item processed

* and rewrote on @murrant advice

* any -> get

Suggested by @murrant

Co-authored-by: Tony Murray <murraytony@gmail.com>

* @push('scripts')

* style

* @endpush

---------

Co-authored-by: Tony Murray <murraytony@gmail.com>
2023-08-31 20:25:24 -05:00
Tony Murray
2cd207028a Implement RBAC (only built in roles) (#15212)
* Install bouncer

* Seeder and level migration

* Display and edit roles

* remove unused deluser page

* Update Radius and SSO to assign roles

* update AlertUtil direct level check to use roles instead

* rewrite ircbot auth handling

* Remove legacy auth getUserlist and getUserlevel methods, add getRoles
Set roles in LegacyUserProvider

* Small cleanups

* centralize role sync code
show roles on user preferences page

* VueSelect component WIP and a little docs

* WIP

* SelectControllers id and text fields.

* LibrenmsSelect component extracted from SettingSelectDynamic

* Handle multiple selections

* allow type coercion

* full width settings

* final style adjustments

* Final compiled assets update

* Style fixes

* Fix SSO tests

* Lint cleanups

* small style fix

* don't use json yet

* Update baseline for usptream package issues

* Change schema, not 100% sure it is correct
not sure why xor doesn't work
2023-08-28 00:13:40 -05:00
Whitey
2eed0722e7 Fixed CSS error causing generic image widgets not to do height correctly (#15220) 2023-08-12 18:55:47 +02:00
Tony Murray
4f5e31c88f Fix select2 search field focus (#15171)
Some jQuery version broke the focus search field on open, this should fix that.
2023-07-31 13:11:36 -05:00
Jellyfrog
153be4d583 Tests: Fix Dusk tests after 13626 (#15057) 2023-05-23 19:23:15 +02:00
Tony Murray
7390c0b0a0 Ondemand popup graphs (#15050)
* Only load popup graphs when popup is shown
Might cause a small delay, but pre-loading all the graphs was causing a lot of un-needed work. Slowing down page loading.

fixes #343

* remove extra div
2023-05-19 10:23:37 -05:00
Etienne Wan
9af97a0395 Add a global setting for Ctrl-F focus (improve #14947) (#15023)
* Add a global setting for Ctrl-F focus (improve #14947)

* Move this new global setting to user setting (improve #14947)

* Update preferences.blade.php

Cleaner wording, and Copy & Paste bled through.

* Fix indents and @endif position in menu.blade.php

---------

Co-authored-by: Justin Lentz <monkeybrains7@gmail.com>
2023-05-14 20:34:37 -05:00
eskyuu
ce0734ff5d Added support for user timezones and user browser timezone by default (incomplete) (#13626)
* Added support for user timezones and user browser timezone byt default

* Formatting fixes

* Use the timezone for alert log display

also added validation for the timezone because it's being used in SQL.

* Formatting fixes

* Added return type

* Formatting"

* Update the latency graphs to use the user timezone

* Simplify the web routes config

* Update phpstan to ignore type error

* Fixed up the phpstan config

* Reverse phpstan change

* Re-apply phpstan override

* Remove the option to unset the session timezone

* Formatting fix

* Update outge and event logs to use session timezone

* Fix route for the timezone control

* Made the timezone more dynamic

* Fix a logic error that was stopping the timezone from being set automatically on login

* Prevent getPref from being called twice

* again prevent getPref double call

* getPref double call

* Fixed typo made during merge

* Fixed merge error in phpstan-baseline.neon

* Change spaces to tabs in phpstan-baseline.neon

* Update error count

---------

Co-authored-by: Tony Murray <murraytony@gmail.com>
2023-05-09 10:24:48 -05:00
Tony Murray
5c25cece48 Convert the inventory page to Laravel (#15004)
* Convert the inventory page to Laravel
Fix several XSS issues (hopefully no new ones snuck in)
Small improvement to the SelectController to allow filtering by filterFields()

* style fixes

* Fix lint issues

* Fix part device filter
2023-04-28 07:51:41 -05:00
Jellyfrog
f271019f6c Add a validation for checking if the scheduler is running (#14987) 2023-04-24 10:04:50 +02:00
Santiago Z
e815bbb81d [About] Link to LinkedIn (#14991) 2023-04-21 21:14:33 -05:00
Jellyfrog
0a351b49fd Laravel 9.x Shift (#14504)
* Move `resources/lang` folder

* Shift registered middleware

* Remove `fruitcake/laravel-cors` dependency

* Streamline `$commands` property

* Upgrade to Flysystem 3.0

* Shift core files

* Convert `optional()` to nullsafe operator

* Remove unnecessary `$model` property

* Convert route options to fluent methods

Laravel 8 adopts the tuple syntax for controller actions. Since the old options array is incompatible with this syntax, Shift converted them to use modern, fluent methods.

* Convert deprecated `$dates` property to `$casts`

* Shift config files

* Default config files

In an effort to make upgrading the constantly changing config files
easier, Shift defaulted them and merged your true customizations -
where ENV variables may not be used.

* Bump Laravel dependencies

* Use `<env>` tags for configuration

`<env>` tags have a lower precedence than system environment variables making it easier to overwrite PHPUnit configuration values in additional environments, such a CI.

Review this blog post for more details on configuration precedence when testing Laravel: https://jasonmccreary.me/articles/laravel-testing-configuration-precedence/

* Fix error provider

* Match new symfony syntax

* Match upstream syntax

* Fix route syntax

* generate composer.lock

* Sync back configs

* routes

* composer

* Fix more flare

* fix cors

* sync lang

* Apply fixes from StyleCI (#14517)

Co-authored-by: StyleCI Bot <bot@styleci.io>

* bump larastan

* update packages

* wip

* Temporarily lower phpstan level

* Update phpstan.neon

* wip

* wip

* wip

* Apply fixes from StyleCI (#14592)

Co-authored-by: StyleCI Bot <bot@styleci.io>

* test

* Update CiHelper.php

* Update test.yml

* Update CiHelper.php

* Update CiHelper.php

* Apply fixes from StyleCI (#14616)

Co-authored-by: StyleCI Bot <bot@styleci.io>

* test?

* fix phpstan problems

* dont run snmpsim on github ci

* Fix whitespace

* More whitespace

* More whitespace ???

* I think the space broke it

* fix the reset of the whitespace

* hard code auth guard

---------

Co-authored-by: Shift <shift@laravelshift.com>
Co-authored-by: StyleCI Bot <bot@styleci.io>
Co-authored-by: Tony Murray <murraytony@gmail.com>
2023-04-17 06:51:35 -05:00
Arjen Zonneveld
72ed398835 Update commands.php (#14946)
Fix typo
2023-04-07 13:38:32 -05:00
Stef
74c627270a Set focus tp Global Search form if user presses Ctrl-F (#14947) 2023-04-07 13:05:39 -05:00
Arjen Zonneveld
6e502f7673 Update commands.php (#14937)
Fix typo
2023-04-06 18:21:14 -05:00
Tony Murray
d3f02e6bb7 SnmpQuery, respect snmp.max_oid (#14894)
Previously, the code would query all the oids it received. Now it will split it up into multiple queries if too many are sent.

Prevents some devices snmp service from crashing.
2023-03-13 10:17:34 -05:00
Zane C. Bowers-Hadley
cd82c72190 add graph_stat_percentile_disable config item to disable percentile lines/value printing (#14887)
* add the initial config items for graph_stat_percentile_disable

* update generic stats to use graph_stat_percentile_disable

* style fix
2023-03-09 17:24:32 +01:00
Hans Erasmus
c330f91e01 Fix empty output on validation test (#14822)
* Fix empty output on validation test

* tried to fix indentation issue

* tried to fix indentation issue again

* tried to fix stylci test error

* remove trailing spaces

* Applied styleci diff
2023-02-01 10:52:36 -06:00
Jason Cheng
6e42eaf1ae Update zh-TW.json (#14765) 2022-12-31 16:33:36 +01:00
Jason Cheng
04015d3a2d Create files with Traditional Chinese translation (#14764) 2022-12-31 00:39:04 +01:00
Tony Murray
8ea3f5cd06 Offer opt in to usage and error reporting during install (#13906)
and on the about page
2022-12-15 19:52:22 -06:00
Tony Murray
a6e1c11b0c Remove ungrouped devices panel (#14664)
The panel destroyed the page performance on larger installs.
Now has a link to the devices list with new group=none filter.
2022-11-22 15:52:29 -06:00
Tony Murray
7635ace4fa Split out lnms snmp convenience commands (#14603)
* Split out lnms snmp convenience commands

* Use SnmpQuery->valuesByIndex()

* Fix style
2022-11-19 22:10:25 -06:00
Tony Murray
78d6ed49ee Fix some icons (#14584)
fa-info icons, update to FA6 style
2022-11-04 23:13:36 -05:00
Santiago Z
24c36ffcf4 [About] Open Laravel and RRDtool link in new tab (#14568) 2022-11-03 15:31:39 +01:00
Santiago Z
f4860ac999 Open the contributor list link in a new tab (#14553) 2022-11-01 16:51:01 +01:00
mprins-RAM
ad2ef227da Userlist description fix (#14482)
* Fix for displaying user description when F2A isnt used

* Revert "Fix for displaying user description when F2A isnt used"
This reverts commit d9f170d7e6.

* Fix for displaying user description when F2A isnt used
2022-10-22 11:47:24 +02:00
Tony Murray
4b97abe225 Add --forgot-key to key:rotate command (#14495)
Destroys all encrypted data
2022-10-22 11:45:58 +02:00
Tony Murray
7dd3a224fa Block disabled user session auth (#14473)
Do not allow users that are disabled to be logged in via cookie.
Allow all auth methods to disable users
2022-10-17 12:39:15 -05:00
Tony Murray
3e3752eb72 Fix users xss (#14469)
Prevent bootgrid from unescaping already escaped strings.
2022-10-17 12:18:38 -05:00
Tony Murray
3cdbf35a86 Fix about date display (#14442) 2022-10-11 16:10:11 -05:00
electrocret
8c2da218f8 Update settings.php (#14443) 2022-10-11 22:26:04 +02:00
Jellyfrog
071173ffb9 Remove tabs from yaml (#14437)
* Remove tabs from yaml

* Remove tabs from random files
2022-10-10 18:13:10 +02:00
Kayck Matias
1f54fc786a Update ports_purge docs and definitions (#14402)
* Update ports_purge docs and definitions
* Translate
2022-09-30 18:48:39 +02:00
Tony Murray
ad8580d694 Cleanup and optimize the availability widget (#14329)
* Cleanup and optimize the availability widget
Default sort is display name
Sort applies to services too (services always last)
May need to refresh the page to get new css

* style

* We don't need request (lint fix)

* Wrong service field name
2022-09-09 18:22:58 +02:00
Marek Wobst
22f84ef3d8 Add additional sorting options for Availability Map (#14073)
* Fix IPv6 in service check host (#13939)

* Add hostName cleaning to Clean

* Apply RFC 5952 formatting to Clean::hostName output

* Use more liberal cleaning for hostnames

* Remove unwanted whitespace

* Apply Clean::hostName() to all relevant fields

* Fix docstring

* Use IP::isValid inline

* Update Clean.php

* Update services.inc.php

Co-authored-by: Tony Murray <murraytony@gmail.com>

* Add sorting support for additional columns + dual column

Additional columns are Display Name (display) and System Name (sysName)

Dual column means that first is sorted after status, then within
each status group another sort is done (every columns from single column
sorting is possible).

* Change code for styleCI

* Expand availability map sorting menu

Also change sysName to System Name – there is no real reason for
that short form.

* Add german translation for avail. map sorting/display options

* Adjust sorting behaviour in Availability Map

The dropdown now presents two options:

- Display Text: Sort by the selected value of the dropdown 'Display Text'
- Status: Sort by status, then by selected value of dropdown 'Display Text'

As the field 'display' (The display name) may contain template functions
etc., sorting is not done by SQL means; instead custom sorting is done
within the controller.

* Apply fix for styleCI

* Apply fix for styleCI, part 2

* Update availability-map.blade.php

* Update availability-map.blade.php

* Update availability-map.blade.php

* Update de.json

* Update AvailabilityMapController.php

* Update AvailabilityMapController.php

* Update availability-map.blade.php

* Update de.json

Co-authored-by: Sander Steffann <sander@steffann.nl>
Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-09-07 20:02:00 -05:00
PipoCanaja
53bfb24ef9 Migrate xDSL code to module, and add support for VDSL2 MIB (#14207)
* use component to discover if xDSL polling is needed

use component to discover if xDSL polling is needed

* Components OK, Polling in correct files, no DB for VDSL

* GUI

GUI_suite

* per port as well

* rename

* interface listing

* draytek_snmpsim

* fix arraymerge

fix names and max value

* schema

schema

style

* remove one dbFetchRows

remove 2x dbFetchCell

style

style

remove Legacy dbFetchRow

tests

tests

eloquent

more eloquent

more eloquent

one more gone

* fix properties access

eloquent_insert_update

style

tests

tests

tests

tests

* tests

tests

tests

* adslLineCoding

* Models

* fix not nullable cols in DB from code

default values

typo

rename

typo

schema

fix

fix

vdsl fix now

typo

typo

fix size

fix size

* Power values for VDSL

Power values for VDSL

Power values for VDSL

DB

* cleanup

* Rrd::checkRrdExists

* always enable DSL discovery

style

* xdsl module

* cleanup and move to Module

cleanup and move to Module

cleanup and move to Module

cleanup and move to Module

* Fix display

* fix polling and tenth

* remove legacy poller

* Style and Cosmetics

Cosmetics

Cleanup

* Translations

Translations

* exists

exists

* add test support for xdsl

* remove last component call

unused

* translations

* remove non standard onclick event on xdsl line

* Update Discovery Support.md

Update Poller Support.md

toner_gone

* Notification for removal of lnms config:set enable_ports_adsl true

* enable on devices with potential DSL interfaces

* tests are working now

fix teldat tests

* os_schema

* teldat

* move to new module structure

* move to new module structure

* wrong dump function

* wrong dump function

* laravel_through_key hidden

* Update notifications.rss

* Update notifications.rss

Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-09-07 19:29:17 -05:00
Tony Murray
302a989d4e Email Transport: embed graphs by default (#14270)
* Email embed graphs

* Allow attachment for non-html
Add setting to webui
Correct $auth setting

* Cleanups, throw RrdGraphException instead of returning an error image.
Generate the error image later, giving more control.
Reduce code duplication a little

* Style and lint fixes
Change to flags

* Add baseline for lint errors I don't know how to resolve

* oopsie, changed the code after generating the baseline

* Tiny cleanups.  Make set DeviceCache primary, it is free.

* Docs.

* email_html note

* Allow control of graph embed at the email transport level to override the global config.

* Allow control of graph embed at the email transport level to override the global config.

* Add INLINE_BASE64 to make it easier to create inline image tags
2022-09-05 20:41:55 -05:00
Tony Murray
14799ecdd3 cisco-sla module was renamed to slas (#14288)
Cleanup references to it.
2022-09-05 09:25:36 +02:00
Tony Murray
a95b1c408c move #14222 code so it doesn't run on every page (#14279) 2022-09-03 09:48:35 -05:00