Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Creating a new dashboard widget

    Scheduled Pinned Locked Moved Development
    17 Posts 6 Posters 1.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      hulleyrob @provels
      last edited by

      @provels interesting hadn’t considered it being an iframe thanks.

      provelsP 1 Reply Last reply Reply Quote 0
      • provelsP
        provels @hulleyrob
        last edited by

        @hulleyrob said in Creating a new dashboard widget:

        @provels interesting hadn’t considered it being an iframe thanks.

        Hey, I can barely spell www, so...

        Peder

        MAIN - pfSense+ 24.11-RELEASE - Adlink MXE-5401, i7, 16 GB RAM, 64 GB SSD. 500 GB HDD for SyslogNG
        BACKUP - pfSense+ 23.01-RELEASE - Hyper-V Virtual Machine, Gen 1, 2 v-CPUs, 3 GB RAM, 8GB VHDX (Dynamic)

        1 Reply Last reply Reply Quote 0
        • H
          hulleyrob
          last edited by

          Well it wasn't easy took way longer that it should have and I ended up trying so many ways only to come across unsolvable problems but ive finally managed to make a daily traffic total widget. Could have probably done the same in python in under 10 minutes.

          GertjanG V 2 Replies Last reply Reply Quote 1
          • GertjanG
            Gertjan @hulleyrob
            last edited by

            @hulleyrob said in Creating a new dashboard widget:

            .... same in python in under 10 minutes

            Because all the 'examples' (widgets already present) are written in PHP (and CSS, html, shell scripts, etc) doesn't mean you have to use PHP also.
            On the other hand : most needed pfSense GUI and system functions are written PHP .....
            Remember pfBlockerng :

            7871af69-7d42-4bb3-b969-0c1a3a24e01a-image.png

            So, Python is there. What's stopping you ?

            No "help me" PM's please. Use the forum, the community will thank you.
            Edit : and where are the logs ??

            1 Reply Last reply Reply Quote 0
            • V
              Viper_Rus @hulleyrob
              last edited by Viper_Rus

              @hulleyrob said in Creating a new dashboard widget:

              Well it wasn't easy took way longer that it should have and I ended up trying so many ways only to come across unsolvable problems but ive finally managed to make a daily traffic total widget. Could have probably done the same in python in under 10 minutes.

              Can you share your widget? Thank you in advance.

              H 1 Reply Last reply Reply Quote 0
              • H
                hulleyrob @Viper_Rus
                last edited by

                @Viper_Rus Hey its pretty much bespoke to my needs and still needs some work to stop the double refresh Ajax issue which came after another 5 hours today but I could share what ive got/help you mod it to your needs if your looking for something similar?

                V 1 Reply Last reply Reply Quote 0
                • V
                  Viper_Rus @hulleyrob
                  last edited by Viper_Rus

                  @hulleyrob

                  It would be great if you showed what you got ;) I want it for myself too :) ("daily traffic total widget")

                  H 1 Reply Last reply Reply Quote 0
                  • H
                    hulleyrob @Viper_Rus
                    last edited by

                    @Viper_Rus Ok Let me come up with something more generic for just the WAN interface and I will share the files and what I did.
                    I doubt I will have fixed the double refresh problem by then but it doesn't seem to cause major issues anyway.

                    H 1 Reply Last reply Reply Quote 0
                    • H
                      hulleyrob @hulleyrob
                      last edited by

                      @Viper_Rus sent you the file and instructions in a DM. If that cut down version and instructions works we can share it with anyone else wanting the same thing. I will continue to work on another version and maybe one day if I have time it I can do a PR to the main repo.

                      1 Reply Last reply Reply Quote 0
                      • S
                        Skoony
                        last edited by

                        @hulleyrob said in Creating a new dashboard widget:

                        Are there any tutorials for this or does someone know of a good starting point?

                        I want to create a widget that would show the current days totals from traffic totals stats page.

                        All the code should already be done in the php files but I have no idea how to go about running it to see what it already gets and what I need to do to filter out the data I want.

                        Seems like a simple thing but hopefully if I would use it other people would find it useful too.

                        Any help would be appreciated.

                        To begin building a widget that shows daily traffic totals from PHP files, you must first comprehend the PHP code that is currently in use and how the data is computed. For the widget, set up an HTML structure and apply CSS styling. Use JavaScript to asynchronously retrieve data from PHP so that the widget is updated dynamically. Verify locally that the PHP files are retrieving data properly. PHP should be modified if needed to support APIs. For a thorough overview, look for tutorials on HTML, CSS, JavaScript, and PHP. Install the widget on a server so that anyone can use it and maybe help others who are looking for a similar feature.

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post
                        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.