OPNsense Forum

English Forums => Development and Code Review => Topic started by: DerMozart on September 14, 2021, 11:30:17 AM

Title: DHCP client list widget for Dashboard
Post by: DerMozart on September 14, 2021, 11:30:17 AM
Hi my name is Johannes and I am new to the forum (just registered, this is my first post).
I found this archived post:
https://forum.opnsense.org/index.php?topic=7815.0
but no solution to the problem of having a list of the current dhcp clients in the network.

So I copied some stuff from some scripts and created a widget for the dashboard, you can find it here:
https://github.com/jbaconsult/opnsense_stuff/blob/main/dhcp_leases.widget.php

Looking forward to your comments and suggestions. Maybe there is already a widget for this and I just didn't know, then please ignore this.

Cheers
Johannes
Title: Re: DHCP client list widget for Dashboard
Post by: WimNL on January 10, 2024, 02:18:56 PM
Hello Mozart,

Great widget, so thanks for your work :)
Title: Re: DHCP client list widget for Dashboard
Post by: Leem on May 26, 2024, 07:34:00 PM
Hello Johannes,

Can you explain how I can add this widget to Opnsense?
Title: Re: DHCP client list widget for Dashboard
Post by: Patrick M. Hausen on May 26, 2024, 07:44:34 PM
It's explained in the README file at the top of the project:

https://github.com/jbaconsult/opnsense_stuff/tree/main

Just download the two files and copy them to the named locations on your OPNsense.

E.g. as root:
fetch -o /usr/local/www/widgets/widgets/dhcp_leases.widget.php https://raw.githubusercontent.com/jbaconsult/opnsense_stuff/main/dhcp_leases.widget.php
fetch -o /usr/local/www/widgets/include/dhcp_leases.inc https://raw.githubusercontent.com/jbaconsult/opnsense_stuff/main/dhcp_leases.inc


HTH,
Patrick
Title: Re: DHCP client list widget for Dashboard
Post by: franco on July 10, 2024, 08:30:27 AM
Please note the old dashboard and its widgets will no longer be part of (or work) with the upcoming 24.7.

And yes yes the ones that are there will be converted to new widgets. Just not this one as it's not in the code.


Cheers,
Franco
Title: Re: DHCP client list widget for Dashboard
Post by: woggle on September 14, 2024, 09:48:45 PM
I was able to make an updated widget. If I figure out how to share it, I will. I'm not very familiar with github anymore.
Title: Re: DHCP client list widget for Dashboard
Post by: woggle on September 15, 2024, 04:32:58 AM
Quote from: franco on July 10, 2024, 08:30:27 AM
Please note the old dashboard and its widgets will no longer be part of (or work) with the upcoming 24.7.

And yes yes the ones that are there will be converted to new widgets. Just not this one as it's not in the code.


Cheers,
Franco

I have created a pull request for the widget I made... maybe now it will be in the code. https://github.com/opnsense/core/pull/7865
Title: Re: DHCP client list widget for Dashboard
Post by: DerMozart on March 10, 2025, 04:05:35 PM
The widget is now fully compatible with the new dashboard system.
Title: Re: DHCP client list widget for Dashboard
Post by: Patrick M. Hausen on March 10, 2025, 04:20:44 PM
@franco How about making this part of OPNsense?
Title: Re: DHCP client list widget for Dashboard
Post by: franco on March 13, 2025, 07:30:51 PM
Last response by Stephan and without discussion no progress.  Showing all the leases may not be of much help, a condensed lease statistic and maybe "last 5 leases" makes a lot more sense to me for the same arguments already shared in the PR.


Cheers,
Franco