Ad Widget

Collapse

Map URL target

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dabbelju
    Junior Member
    • Sep 2019
    • 5

    #1

    Map URL target

    Hi,

    is it in Zabbix 4 somehow possible to open a URL which is added to map (either via the map properties or the map element) in a new tab or window and if yes how?

    I did search the web but found only possibilities to do it in Zabbix 2.x or 3.x. Of course it would be fantastic to have an option where to open the link in the mentioned places. It would not really help to have all URLs open in a new window or tab because tehere are for sure URLs which navigate "inside" Zabbix.

    I am looking forward to your feedback.

    thanks and best regards
    Dabbelju

  • dabbelju
    Junior Member
    • Sep 2019
    • 5

    #2
    Move hopefully in the right place...

    Comment

    • dabbelju
      Junior Member
      • Sep 2019
      • 5

      #3
      Hi splitek,

      of course you are right. My Admins could also use a right click and something like "open in new tab" or "open in new window". I am asking this question to make it more easy for people.

      Would just be "nice".

      Thanks
      Dabbelju

      Comment

      • Guntis
        Junior Member
        • Mar 2019
        • 18

        #4
        Hi, I have created a patch based on the 2.x/3.x code I also found. This has been Tested on Zabbix 5.2, hopefully will work on 4.x as well

        HTML Code:
        diff --git a/usr/share/zabbix/js/menupopup.js.original b/usr/share/zabbix/js/menupopup.js
        index af31a0b..5c20a28 100644
        --- a/usr/share/zabbix/js/menupopup.js.original
        +++ b/usr/share/zabbix/js/menupopup.js
        @@ -250,6 +250,16 @@ function getMenuPopupHost(options, trigger_elmnt) {
        label: t('URLs'),
        items: options.urls
        });
        +
        + for (var key in options.urls) {
        + options.urls[key].clickCallback = function(url) {
        + return function(e) {
        + window.open(url, '_blank');
        + cancelEvent(e);
        + jQuery(this).closest('.menu-popup').hide();
        + };
        + }(options.urls[key].url);
        + }
        }
        
        // scripts
        Zabbix 5.2 patch to open Map URLs in blank page. GitHub Gist: instantly share code, notes, and snippets.
        Last edited by Guntis; 30-10-2020, 12:33.

        Comment

        Working...