Custom Module with Host Action - Is sorting and an icon possible?

We’ve created a custom module that creates a new action under the “Action” headline which is working fine.

Besides that new action link there are a couple of other links from modules and shared navigation links, that aren’t sorted by name.
Is there a way to sort the entries by name and add an icon that’ll help finding links more easily?

  • Icinga Web 2 Version 2.12.5
  • Used modules and their versions (System - About)
    businessprocess 2.5.2
    icingadb 1.2.2
    cube 1.3.3
    director 1.11.5
    fileshipper 1.2.0
    grafana 3.0.0
    incubator 0.23.0
    jirasdurl 0.0.1
    pdfexport 0.11.0
    reporting 1.0.5
    x509 1.3.2

I dont know about sorting, but you definitely can add icons.

Either on the Add Host Action button in the UI:

image

Or in a web module:

            new Link(
                [new Icon('globe'), $label],
                'map?showHost=' . rawurlencode($host->name)
            )

You can see here how it uses the globe icon in the code for the Host Action. I hope this gives you an idea.

1 Like

Thanks a lot for that hint @bberg !

I can now use an icon from the IPL.

Anybody else with hints for custom icons and/or sorting options?

AlexR

1 Like