OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • Tutorials and FAQs »
  • [solved] Custom link on menu
« previous next »
  • Print
Pages: [1]

Author Topic: [solved] Custom link on menu  (Read 5059 times)

marcri

  • Jr. Member
  • **
  • Posts: 60
  • Karma: 5
    • View Profile
    • https://www.risse-it.services/
[solved] Custom link on menu
« on: June 05, 2019, 08:31:12 pm »
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
« Last Edit: June 08, 2019, 05:33:18 pm by marcri »
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 17703
  • Karma: 1616
    • View Profile
Re: Custom link on menu
« Reply #1 on: June 05, 2019, 09:39:33 pm »
Hi Marc,

Look no further ;)

https://docs.opnsense.org/development/examples/helloworld.html#plugin-to-the-menu-system


Cheers,
Franco
Logged

marcri

  • Jr. Member
  • **
  • Posts: 60
  • Karma: 5
    • View Profile
    • https://www.risse-it.services/
Re: Custom link on menu
« Reply #2 on: June 06, 2019, 09:46:06 pm »
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 :-/
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 17703
  • Karma: 1616
    • View Profile
Re: Custom link on menu
« Reply #3 on: June 06, 2019, 10:25:59 pm »
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
Logged

marcri

  • Jr. Member
  • **
  • Posts: 60
  • Karma: 5
    • View Profile
    • https://www.risse-it.services/
Re: Custom link on menu
« Reply #4 on: June 08, 2019, 10:19:42 am »
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
« Last Edit: June 08, 2019, 10:43:27 am by marcri »
Logged

marcri

  • Jr. Member
  • **
  • Posts: 60
  • Karma: 5
    • View Profile
    • https://www.risse-it.services/
Re: Custom link on menu
« Reply #5 on: June 08, 2019, 10:32:41 am »
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
Code: [Select]
<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



« Last Edit: June 10, 2019, 07:41:43 am by marcri »
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • Tutorials and FAQs »
  • [solved] Custom link on menu
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2