Thanks for the quick answer… but it’s not that simple. Seeing how the default stuff is done is not the same thing as installing a custom module in a way that can be distributed, etc.
With Grok instructions, I was able to create a custom module, get it loaded, but it would not show at all. That’s why this time I would like to try starting with something custom that somebody else did, even if very simple, as long as it is working. And then do my changes from there.
There is no ability to “hook in” to the dashboard unfortunately. You could try writing your own code and dumping it into /var/www/html/admin/modules/dashboard/sections. I wrote that little “notepad” panel a few years back and it was fairly straightforward. A very simple class that just pulls in a view and loads its info from the kv store. dashboard/sections/Notepad.class.php at release/17.0 · FreePBX/dashboard · GitHub
Thanks @miken32 ! I’m actually a fan of your Notepad widget!
Maybe I’ll start by cloning that widget and changing it. Maybe this weekend I’ll give it a try.
Do you know if there’s any “registry” for these dashboard widgets? Or is it enough to create new content in modules/dashboard/sections and it will get picked up?
Ok, so I’ve cloned the notepad dashboard widget, I edited the files to change all strings containing ‘Notepad’ to ‘PgrDashlet’, and now… I have an empty area:
So, it’s getting recognized, but something is still broken and I need to fix it. The problem is that I’ve spent a long time looking for any messages in any logs and I don’t see anything. I would expect a PHP error, do you know where these are logged to in FreePBX? Or do I need to activate the logs somewhere? Thanks for your help
They do their best to hide all the error messages, likely because there are so many warnings in their codebase lol. There are some Advanced Settings that can help. Depending on your setup they may end up in the web server log, PHP log, PHP FPM log, or FreePBX log.
Thanks - turning on debug log in Advanced Settings was enough to get me going. I got a message saying “failed to load the view” and it was enough to spot some case-sensitivity issues in the file names.
I am just starting, but my goal here is to provide an up-front list of links to menu options, with a paragraph for each to document it. This is to guide half-technical users (the guy at the company that is allowed to change settings in the UI) to the relevant menu options and what he can configure in each, instead of getting lost in over-crowded menus.
Thanks @penguinpbx I didn’t know about that (never noticed the options there to configure access to modules etc), and it does look useful! I will keep developing my dashboard widget, but I will surely also explore those options.