Commit Graph

533 Commits

Author SHA1 Message Date
Tony Murray
592ea1c263 Change port pagination default to 32 (#16131)
* Change port pagination default to 32
that way this includes all ports for most switches.
Most port counts are base 2, so change pagination options to match

* ignore upstream missing closure type

* Fix style again

* more
2024-06-17 09:09:33 -05:00
Tony Murray
097d4a3f94 Fix port neighbors unknown local port (#16128)
Fix issue when somehow the local port is unknown.  Likely this is faulty polling or snmp implementation.
2024-06-17 02:42:15 -05:00
Tony Murray
8c4caab81a Fix port pagination (#16127)
* Fix ports pagination

* Style fix
2024-06-17 02:28:36 -05:00
Tony Murray
a3d4a688a0 Fix submenu whitespace (#16123) 2024-06-16 23:54:14 -05:00
Tony Murray
075ba4c932 Ports UI update (#16115)
* WIP Device Ports porting to Laravel

* WIP port links

* Port Links WIP

* Port Links

* in_array -> isset

* Add request to DeviceTab data

* Add initial Pagination

* Missing select component

* Collapsed and expandable port neighbors
New expandable component

* Port sorting

* Fix port transfer

* Use menu entries to filter ports

* Add translatable strings

* style fixes and cleanup

* update css

* graph views and tidy controller
basic port link view

* cleanup

* port row blade to reuse in legacy port view

* Legacy tab url handling
work properly in subdirectory
remove includes from sub tab directory to prevent oddity

* fallback to detail list when the view doesn't exist

* Use named variable to simplify

* Fix issue from file that was a symlink

* Submenu handle sub items and query string urls

* extract pageLinks to improve readability

* fix typo

* Apply fixes from StyleCI

* phpstan was not happy using the relationship HasMany query

* Don't allow *bps etc to be on a second line

* Improve table on small screens

* Fix sort

---------

Co-authored-by: Tony Murray <murrant@users.noreply.github.com>
2024-06-16 11:29:06 -05:00
Tony Murray
7ac1b3303f ESRI ArcGIS geo map support (#16059) 2024-06-05 08:16:33 -05:00
Tony Murray
fa16c025ba Fix popup toast messages (Remove Flasher) (#16090)
* Remove flasher
Just use a bit of custom code to interface with toastr js
This is able to retain our custom theme and work properly

* Fix style issues

* Missed reference rename

* Remove test code :)

* Fix a missed rename

* Fix one more missed reference

* Fix typo
2024-06-05 08:07:42 -05:00
Tony Murray
05f29ae76c Edit Current Map menu entry (#16084) 2024-06-04 11:07:50 +02:00
Tony Murray
f0966f4d23 Widget hot refresh & worldmap cleanup (#16053)
* Iterate in javascript and separate processing

* Widget refresh/destroy events

* Remove old dom and unbind events

* fix whitespace

* Fix up bootgrid tables, they inserted a div before the first div breaking event propagation
switch to regular js function to scope variables instead of jquery

* Handle settings the same way as the normal widget

* Use standard init_map and add layer control

* May need L.Control.Locate now

* Set maxZoom for marker cluster

* Try setMaxZoom

* worldmap size 100 and resize on refresh/widget resize

* Add resize event (and throttle it a bit)

* Further worldmap cleanup

* Move most javascript to common js, will cause js errors until page is reloaded, but better in the long run
2024-05-22 21:23:39 -05:00
Tony Murray
7c4f04ab9d Manage Maps limit width (#16055) 2024-05-22 10:04:05 -05:00
Santiago Z
d4b7dbedab Align the buttons (Edit and Delete) to the right in Map Management (#16052) 2024-05-21 22:05:02 -05:00
eskyuu
9677f75480 Do not allow the legend nodes to trigger the node edit modal (#16026)
* Do not allow the legend nodes to trigger the node edit modal

* Added newline to trigger github tests
2024-05-14 08:37:39 -05:00
Tony Murray
0d246a6ffc Custom Maps: geo map and color backgrounds (#16020)
* Custom Maps: geo map and color background
tabs blade component
geo-map blade component and related script enhancements

* Update css/js

* style fixes

* update db_schema.yaml

* fix db_schema hand edit

* ignore phpstan being wrong

* Handle null

* another possible null spot

* Use standard file cache for custom map background images

* Create map->image as jpeg so we can compress it

* whitespace fix

* Fix background cancel button when other type is selected than the saved type

* Save and restore layer

* Map must exist before creating static image

* Don't show set as image button for Google and Bing.
Bing gives an odd error, but Google won't work.
2024-05-13 08:12:59 -05:00
Tony Murray
5b20886732 Map Management: Show Groups (#16005)
* Map Management: Show Groups

* reorganize group selector a bit

* Use uuid to prevent issues with unicode strings and other oddities

* Edit buttons should not be primary

* Reactivity for small screens
2024-05-03 18:30:03 -05:00
Tony Murray
1c5e96f8d4 Mobile menu full height (#16011)
Maybe more ease of use changes coming for mobile down the road, but this is a quick bandaid.
2024-05-03 18:18:50 -05:00
Tony Murray
fe2f8a6c81 Change custom map editor icon (#16004)
Edit icon makes more sense than map icon and makes it visually distinct from maps above it in menu.
2024-05-01 14:15:27 -05:00
Tony Murray
1dc62454fc Show custom maps in device overview (#15985)
* Show custom maps in device overview

* remove extra line return

* Sort by name
2024-04-26 15:10:24 -05:00
Tony Murray
43e6846cbc Custom Map: Show crosshairs when adding (#15978)
* Custom Map: Show crosshairs when adding
When adding a node or edge, give cursor feedback.
Updates js deps

* Missed package-lock.json
2024-04-25 15:36:16 -05:00
Tony Murray
f78edf4d11 New Map Menu (#15969)
* Map Menu
New top level Map menu.
Ability to group custom maps.
Ajax Select controller improvements

* Fix style
2024-04-25 15:32:33 -05:00
Tony Murray
ac98abbafb On-demand map menu items (#15971)
Only show map menu items if they have data:
 * Network
 * Device Dependencies
 * Device Group Dependencies
2024-04-25 09:19:21 -05:00
Tony Murray
d48d850c3e Custom Maps: Fix title update removing link (#15976) 2024-04-24 10:36:04 -05:00
Tony Murray
b0c03b29ac Custom Maps: make edit title clickable (#15965) 2024-04-23 09:57:19 +02:00
Tony Murray
19344f0584 Fix JS injection in Service Templates (#15954)
You can't put user data in any "onwhatever" attributes, there is no way to sanitize it there.
Use data attributes instead.
2024-04-18 21:45:30 -05:00
Tony Murray
49f8269262 Improved Latency graph (#15940)
* Improved Latency graph
Store loss+jitter info in rrd instead of database
New graph icmp_perf (legacy ping_perf still valid referencing part of the newer data)
Delete device_perf table

* Change loss to an area so it is more visible

* Style fixes

* Cleanups from phpstan & tests

* exit_code fix

* Remove alert usage of device_perf

* Don't use magic __get

* Add test for bulkPing
Add host to previous tests

* style fixes

* Fix issue fping error responses
2024-04-18 09:57:01 -05:00
Tony Murray
5828907b23 Fix graph selection when to/from missing from url (#15946)
* Fix graph selection when to/from missing from url
fixes #15840

* Update js cache value
2024-04-14 16:48:01 -05:00
eskyuu
22f5b687c4 Custommap label fixes (#15875)
* Fixes for the edge label:
 - Hide when editing the default settings
 - Copy the correct value into the textbox when editing

* Show the re-render button when a label is cleared
2024-03-04 12:33:16 +01:00
Zane C. Bowers-Hadley
56471e63d7 add dhcp-stats tests and update for v3 of the extend (#15378)
* update dhcp polling for version 3 of the extend

* add initial lease display for dhcp

* note where I copied it from

* document the new ISC DHCP stuff

* add in displaying pool and subnet info

* finalize the docs the new dhcpd stuff

* rework the dhcp page to display more information in a cleaner manner

* now display port and device info if known for a lease

* minor comment cleanup for the dhcp page

* add tests

* do not display the optionbar if the extend is not 3+

* update dhcp-stats doc for -w

* poke includes/html/functions.inc.php with php-cs-fixer

* poke includes/html/pages/device/apps/dhcp-stats.inc.php with php-cs-fixer

* derp... add the tests and not the snmprec twice

* strftime -> date

* fix naming of the linux dhcp-stats test data files

* minor tweaks to the rest results

* test fix

* more test cleanup

* minor test fix

* set the data value for v3

* minor test tweak

* add sortable_table blade template

* no longer need render_table

* formatting fix

* add regexp to make sure the mac is sane

* style fix

* formatting cleanup

* some more formatting fixes
2024-02-21 21:33:17 +01:00
Nicolas
b8095d6811 Don't escape leaflet tile url in location edit map (#15695)
* Don't escape leaflet tile url

* encode config as json and get config value in controller

* fixed array style
2024-02-21 12:09:04 -06:00
eskyuu
3d94c53438 Modify the date selector to use the session timezone (#15783)
* Modified the date selector to use the session timezone

* Set the timezone in the datetime picker and make sure it is always passed a moment date object, then altered the submit javascript function to use the existing moment object instead of creating its own

* Update the poll log to display in the correct timezone

* Fix the poll log to make the search work and be timezone aware

* Fix the displayed time on the device overview event log

* Style fixes
2024-02-21 11:45:12 -06:00
eskyuu
0d6fe96d03 Some bug fixes for the custom maps: (#15810)
- Make sure the default edge config works if it is still using the original config
 - Fix the map going blank when it is resized
 - Post map data as JSON to allow for saving with no edges
 - Allow the legend to be dragged by any node
2024-02-09 06:49:43 -06:00
eskyuu
cb09ae0d54 Additional custom map features (#15806)
* Added options on edges for a label and to show graphs as bps as well as percentages

I think that vis.js needs to be updated to allow both bps and percentages at the same time.

* Add database migration

* Try to avoid putting multiple mid points in the same position

* Added a URL parameter for screenshot mode, where node labels are blanked out
Also fixed up the node labels in the editor

* Added legend to the editor as well as database options for reversing arrows and adjusting the edge separation

All features have been implemented in the editor, but need to be implemented in the viewer

* Fix missing defaults on the edit map list page
Added arrow reverse code to the viewer
Added legend code to the viewer
Added code to the editor to correclty handle moving the legend

* Formatting fixes and DB schema update

* Remove view from database schema
2024-02-07 11:42:35 -06:00
eskyuu
cf99657c51 Add a missing endsection (#15792) 2024-02-02 09:49:09 -06:00
eskyuu
81bf68ba88 Make all image URLs absolute and fix path for viewer (#15788) 2024-01-31 22:09:44 -06:00
eskyuu
30953c386f Add functionality for custom maps (weathermaps) (#15633)
* Initial commit with editor.

* Added custom map models and database migrations.
Modified the controller and view to support saving the custom map settings to the database

* Added menu items and sorted out access permissions for maps and nodes

* Cleaned up some of the conditions in the javascript section of the blade

* Started work on the map data save

* Save of map nodes and edges is complete

* Got the map to load data on page load and added the delete functionality

* Fixed a typo and made link colour black if intertface is down

* Various usability fix-ups

* Show the save button on node and edge delete

* Fixed up access for users without global read

* Increase typeahead search size and standardised the way modals are triggered.

* Update data fetch to copy values into array so I can add more fields

* Convert blank array check to use count()

* Formatting changes

* More formatting fixes

* Formatting again

* DB schema update

* Revert previous commit

* Pass device id to pages

* Remove bad characters from javascript

* Re-add the - character in search results

* Update to avoid background colour being set to the current colour for offline devices

* Fixed a bug in speed detection when no suffix is given

* Fixed up the speed colour calculation and added comments

* Update default edge font size to 12

* Reduce arrow size

* Formatting fix

* Update the custom map controller to handle null interface speeds

* Alter JSON columns to be longtext instead

* Only refresh map data on successful save

* Update labels on default settings to make it clear that they are not saved

* Added timestamps to all custom map tables
Use HasFactory instead of static definitions for custom map tables
convert JSON DB fields to longtext and updated PHP to do the appropriate JSON decoding as a result

* Added missing vis.js images for the editor

* Split the custom map blade into different pages

* formatting fixes

* Initial commit with editor.

* Added custom map models and database migrations.
Modified the controller and view to support saving the custom map settings to the database

* Added menu items and sorted out access permissions for maps and nodes

* Cleaned up some of the conditions in the javascript section of the blade

* Started work on the map data save

* Save of map nodes and edges is complete

* Got the map to load data on page load and added the delete functionality

* Various usability fix-ups

* Show the save button on node and edge delete

* Fixed up access for users without global read

* Increase typeahead search size and standardised the way modals are triggered.

* Convert blank array check to use count()

* Formatting changes

* More formatting fixes

* Formatting again

* DB schema update

* Revert previous commit

* Pass device id to pages

* Remove bad characters from javascript

* Re-add the - character in search results

* Update to avoid background colour being set to the current colour for offline devices

* Reduce arrow size

* Only refresh map data on successful save

* Update labels on default settings to make it clear that they are not saved

* Added timestamps to all custom map tables
Use HasFactory instead of static definitions for custom map tables
convert JSON DB fields to longtext and updated PHP to do the appropriate JSON decoding as a result

* Added missing vis.js images for the editor

* Split the custom map blade into different pages

* Updated the custom maps to use the select2 searches for ports and devices

* Fix port search clearing with select2

* Update DB schema to add timestamps

* Add the ability to set a node alignment value where nodes will align to a grid

* Add a checkbox to re-center edge lines

* Schema update for node alignment

* Removed unused route

* Fixups after rebase

* Remove DevicePortSearchController

* Rebase fixups

* Remove unneeded controller

* Formatting fixes

* Update all network map documentation

* Fixed typo in doc

* Change background imgae database migration

* Update migration for custom map background to fix schema error

* Place a try/catch around the BLOB->MEDIUMBLOB migration

* Formatting fix

* Moved custom map background image location and added some SVG images to test as image options

* Updated the editor to use a static set of device images

* Update the image logic in the editor and added to the viewer

* DB Schema update

* Formatting

* remove svg height/width attributes

* Added some more icon options for arrows

* Added database migration to allow nodes to link to another custom map
Fixed an error in the image migration

* Added the ability to link a node to another custom map

* Formatting fixes

* DB Schema update

* Remove images-custom directory

* Explicitly cast map ID to int

* Made the image selection list dynamic based on the contents of the custom map icons directory

* Formatting fix

* Double-clicking on a link will take you to the link

* Remove whitespace

* Add translations
fix an xss and hopefully not add any new ones
refactor node image to use translations with fallback

* split modals out into separate files
return width/height to avoid js scope issues

* Formatting fixes

* refactor edit select page into a "manage" page
Still left:
validation/custom request
Controller refactor
ui tweaks

* MapSettingsRequest

* Refactor more routes, policy, controller
I think this is the last refactor. Everything is now organized in a standard way.
Missing a method to check if a user has access to a map

* Fix booleans and style

* Add versioning to the background image to prevent browser caching

* Fixed the background image update by splitting it into a separate modal
Changed the delete button on the map editor screen to return to the map list

* Formatting fix

* Added double-click actions in editor to edit nodes and edges

---------

Co-authored-by: Tony Murray <murraytony@gmail.com>
2024-01-31 08:56:59 -06:00
PipoCanaja
a7a6e67e87 NAC - Improve search in WebUI - Keep Historical data (#15629)
* search improvement for PortNac

* rename func

* style

* DB migration for timestamps

* style

* rules

* fix manually db_schema

* remove vlan only search for now

* add a bool column to ident historical nac entries

* add columns to the table

* queryByOui renamed everywhere

* age value instead of delete

* style

* style

* use Illuminate\Support\Facades\DB;

* tests fix

* module_tables.yaml

* dump model instead of tests/module_tables.yaml

* tests

* testVrp

* daily

* config

* display historical NAC entries in global view

* same for NAC device page

* nac tab on device/port view

* and display the tab link if necessary

* filter by port as well

* historical data in port tab

* formatters
2024-01-24 09:15:40 +01:00
Justin Lentz
ee114218d4 Add PollerGroup as an option for OxidizedMap (#15696)
* Update SettingOxidizedMaps.vue

* Update api_functions.inc.php

* Update app.js

* Update app.js

* Style

* Update mix-manifest.json
2024-01-15 22:55:20 +00:00
Wheel
f0bbab2419 Minor fix and tweak for graylog integration (#15455)
* Minor fix and tweak for graylog integration

* More flexible in other use cases

* fix again?
2023-11-01 22:35:44 -05:00
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