Skip to content

Allow specifying "global-overview" as default map#54

Open
mj84 wants to merge 1 commit into
Icinga:mainfrom
mj84:global-overview
Open

Allow specifying "global-overview" as default map#54
mj84 wants to merge 1 commit into
Icinga:mainfrom
mj84:global-overview

Conversation

@mj84

@mj84 mj84 commented Aug 22, 2023

Copy link
Copy Markdown
Contributor

I implemented a quick way to allow the use of "global-overview" as the default map.
While mod=Overview does not respect header_menu=0 it is still nice to have a simple way to include the NagVis default overview.

Allow specifying default-map = global-overview
@cla-bot cla-bot Bot added the cla/signed label Aug 22, 2023
@yhabteab

Copy link
Copy Markdown
Member

Hi, thanks for contributing! Though, I'm not quite sure yet what this is supposed to fix. There's already an option, as far as I can see, that lets you define your own default map.

I implemented a quick way to allow the use of "global-overview" as the default map.

Where does the hard-coded global-overview map name come from?

@mj84

mj84 commented Oct 31, 2023

Copy link
Copy Markdown
Contributor Author

Hi there,
sorry it took me a while to come back to you.
Currently, it is not possible to use NagVis' own overview (which is called via URL parameters mod=Overview) when using this module.
Since we are running quite a lot of NagVis maps, which also change semi-frequently, it is not feasible to manually create a map which links to other maps and use that "map" as an overview.
There is a comment in the source code at

// TODO: I'd prefer to have mod=Overview as a default, that would also

which states, that mod=Overview is currently not being used in this module because it doesn't respect the header_menu=0 parameter.
My PR restores this functionality by explicitly setting the default map to "global-overview" and the overview menu of NagVis returns:

image

@mj84

mj84 commented Sep 11, 2024

Copy link
Copy Markdown
Contributor Author

Hi,
any thoughts about this?
For us, the native NagVis overview is really useful, I bet others would benefit from this as well.

That being said, I guess the "proper" solution would be a native overview implementation within this module, but this exceeds my abilities in Icingaweb2 module development by far :)

So this could be used as a temporary solution to provide an overview of accessible maps until a better one is available.

Best regards

$url = $baseurl . '/frontend/nagvis-js/index.php';
$url .= '?mod=Map&act=view&show=' . urlencode($map);

if($map == 'global-overview') {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change still relevant to you? If so, I suggest to rewrite the code block from line 71 to 79 as follows:

$baseurl = $this->Config()->get('global', 'baseurl', '/nagvis');
$url = $baseurl . '/frontend/nagvis-js/index.php';

if ($map === 'global-overview') {
    $url .= '?mod=Overview';
} else {
    $url .= '?mod=Map&act=view&show=' . urlencode($map);
}

Could you please also add a section to the FAQ or another suitable Markdown file documenting the use of the NagVis global overview?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants