[solved] Custom link on menu

Started by marcri, June 05, 2019, 08:31:12 PM

Previous topic - Next topic
June 05, 2019, 08:31:12 PM Last Edit: June 08, 2019, 05:33:18 PM by marcri
Hi,

I want to add a simple link to the menu. I'm not a developer and all the tutorials i found were pretty hard for me to understand. In fact, I  want to add a link to the sarg-reports and maybe some quicklinks to the service logs.

Best
Marc


Thanks for your reply. It seems to be very complicated to add an entry to the menu. I need a second opnsence instance for development just to place one litte file? hmmm :-/

Well, in practice you only need to create a single file on your running OPNsense to add an entry (or overwrite another).

You can also edit an existing menu file, but that will be overwritten on the next update.


Cheers,
Franco

June 08, 2019, 10:19:42 AM #4 Last Edit: June 08, 2019, 10:43:27 AM by marcri
Okay, i managed to create a custom Link section onto the menu. :)
is it possible to trigger a rebuild of the menu after changing the menu.xml file?

SOLVED: /usr/local/etc/rc.configure_plugins

June 08, 2019, 10:32:41 AM #5 Last Edit: June 10, 2019, 07:41:43 AM by marcri
For everyone looking to add some custom links and don't want so become a developer:

Quick and DIRTY!!

mkdir  -p /usr/local/opnsense/mvc/app/models/OPNsense/Links/Menu

vi /usr/local/opnsense/mvc/app/models/OPNsense/Links/Menu/Menu.xml

<menu>
    <Lobby>
        <Links VisibleName="Links" cssClass="fa fa-tags fa-fw">
            <Sarg url="/squid-reports/" />
            <IDS-Alerts url="/ui/ids#alerts" />
            <FW-LiveLog url="/ui/diagnostics/firewall/log" />
            <Check_MK isExternal="Y" url="https://cmk.xxxxx" />
            <Kibana isExternal="Y" url="https://logs.xxxxx" />
        </Links>
    </Lobby>
</menu>


run /usr/local/etc/rc.configure_plugins to regenerate menu