Advertisement
Guest User

oVirt

a guest
Jan 20th, 2013
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <!-- including jquery -->
  5. <script src="http://code.jquery.com/jquery-latest.js"></script>
  6. <script>
  7.  
  8. var api = parent.pluginApi('icinga');
  9. var conf = api.configObject();
  10.  
  11. // Register an event handler, for the UI Plugin init
  12. api.register({
  13.     UiInit: function() {
  14.         // Dashboard Main Tab
  15.         api.addMainTab(conf.icingaDashboardLabel, 'icinga', 'https://monitoring.ovido.at/icinga-web');
  16.  
  17.     // Host Sub Tab
  18.     api.addSubTab('Host', conf.icingaDetailsLabel, 'hosts-monitoring', conf.url + '?subtab=hosts');
  19.  
  20.     // VirtualMachine Sub Tab
  21.     api.addSubTab('VirtualMachine', conf.icingaDetailsLabel, 'vms-monitoring', conf.url + '?subtab=vms');
  22.     },
  23.     // When the VM selection is changed, we need the new VM name
  24.     HostSelectionChange: function() {
  25.         var hostName = arguments[0].name;
  26.         alert(hostName);
  27.     // Reload Host Sub Tab
  28.     api.setTabContentUrl('hosts-monitoring', conf.url + '?subtab=hosts&name=' + encodeURIComponent(hostName));
  29.     },
  30.     VirtualMachineSelectionChange: function() {
  31.     var vmName = arguments[0].name;
  32.         alert(vmName);
  33.     // Reload VM Sub Tab
  34.     api.setTabContentUrl('vms-monitoring', conf.url + '?subtab=vms&name=' + encodeURIComponent(vmName));
  35.     }
  36. });
  37.  
  38. // Calling api.ready - the plugin is now ready to be initialized
  39. api.ready();
  40.  
  41. </script>
  42. </head>
  43. <body>
  44. </body>
  45. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement