Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <!-- including jquery -->
- <script src="http://code.jquery.com/jquery-latest.js"></script>
- <script>
- var api = parent.pluginApi('icinga');
- var conf = api.configObject();
- // Register an event handler, for the UI Plugin init
- api.register({
- UiInit: function() {
- // Dashboard Main Tab
- api.addMainTab(conf.icingaDashboardLabel, 'icinga', 'https://monitoring.ovido.at/icinga-web');
- // Host Sub Tab
- api.addSubTab('Host', conf.icingaDetailsLabel, 'hosts-monitoring', conf.url + '?subtab=hosts');
- // VirtualMachine Sub Tab
- api.addSubTab('VirtualMachine', conf.icingaDetailsLabel, 'vms-monitoring', conf.url + '?subtab=vms');
- },
- // When the VM selection is changed, we need the new VM name
- HostSelectionChange: function() {
- var hostName = arguments[0].name;
- alert(hostName);
- // Reload Host Sub Tab
- api.setTabContentUrl('hosts-monitoring', conf.url + '?subtab=hosts&name=' + encodeURIComponent(hostName));
- },
- VirtualMachineSelectionChange: function() {
- var vmName = arguments[0].name;
- alert(vmName);
- // Reload VM Sub Tab
- api.setTabContentUrl('vms-monitoring', conf.url + '?subtab=vms&name=' + encodeURIComponent(vmName));
- }
- });
- // Calling api.ready - the plugin is now ready to be initialized
- api.ready();
- </script>
- </head>
- <body>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement