<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">Thanks Alexander,</div><div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;"><br></div><div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">This works:</div><div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;"><br></div><div><font face="Calibri,sans-serif">api.addMainTab('oVirtTab', 'ovirt-tab', ‘http://www.something.com', {priority: 5});</font></div><div><font face="Calibri,sans-serif"><br></font></div><div><font face="Calibri,sans-serif">Can you advise how to get the </font><span style="font-family: Calibri, sans-serif;">api.addSubTab to work?</span></div><div><font face="Calibri,sans-serif"><br></font></div><div><font face="Calibri,sans-serif">api.addSubTab('ovirt-tab', 'Test 123', 'test-123', '#’);</font></div><div><font face="Calibri,sans-serif"><br></font></div><div><font face="Calibri,sans-serif">I tried the above and many other combinations, no errors, just doesnt work. Maybe I am wrong on what it does?</font></div><div><font face="Calibri,sans-serif"><br></font></div><div>I am looking to add a submenu – same as the current 4.2.1 UI shows Network and then(Vnic Profiles) (Networks) as submenus.</div><div><br></div><div>Thanks</div><div><br></div><div>Zip</div><div><br></div><div><font face="Calibri,sans-serif"><br></font></div><blockquote style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px; margin: 0px 0px 0px 40px; border: none; padding: 0px;"><div><br></div><div><span class="Apple-style-span" style="font-size: 12px; font-family: Verdana, Helvetica, Arial;"><br></span></div></blockquote></div><span id="OLK_SRC_BODY_SECTION" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;"><div><div><blockquote style="margin:0 0 0 40px; border:none; padding:0px;"><div>On Sunday, February 25, 2018 1:11:08 AM EST Zip wrote:</div><blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;"><div> Hi Alexander,</div><div> </div><div> If I try the following:</div><div> </div><div> <!DOCTYPE html></div><div> <html></div><div> <head></div><div> <script></div><div> var api = parent.pluginApi('HelloWorld');</div><div> api.register({</div><div> UiInit: function () {</div><div> api.addMainTab('FooTab','xtab123','<a href="http://foo.com/'">http://foo.com/'</a>);</div><div> }</div><div> });</div><div> api.ready();</div><div> </script></div><div> </head></div><div> <body></body></div><div> </html></div><div> </div><div> I get the error in my browser console:</div><div> </div><div> Sun Feb 25 00:03:56 GMT-600 2018</div><div> org.ovirt.engine.ui.webadmin.plugin.PluginManager SEVERE: Exception caught</div><div> while invoking event handler function [UiInit] for plugin [HelloWorld]:</div><div> Error: java.lang.IndexOutOfBoundsException webadmin:1:13517</div><div> <<a href="https://ovirtmgmt.intricatenetworks.com/ovirt-engine/webadmin/?locale=en_US">https://ovirtmgmt.intricatenetworks.com/ovirt-engine/webadmin/?locale=en_US</a></div><div> #dashboard-main></div><div> </div><div> Sun Feb 25 00:03:56 GMT-600 2018</div><div> org.ovirt.engine.ui.webadmin.plugin.PluginManager WARNING: Plugin</div><div> [HelloWorld] removed from service due to failure</div><div> </div><div> </div><div> However if I remove the line:</div><div> </div><div> api.addMainTab('FooTab','xtab123','<a href="http://foo.com/Œ">http://foo.com/Œ</a>);</div><div> </div><div> And replace it with something simple like:</div><div> </div><div> alert(ŒTest 123¹);</div><div> </div><div> There are no errors and the alert fires as it should.</div><div> </div><div> </div><div> Any ideas of what I might be missing?</div><div> </div><div> I am running oVirt 4.2.1 on CentOS Hosted Engine setup with 1 host for</div><div> testing.</div><div> </div><div> Thanks</div><div> </div><div> Zip</div><div> </div></blockquote><div><br></div><div>Well you found a bug, I will be posting a patch soon. To bypass the problem </div><div>add the following:</div><div><br></div><div>api.addMainTab('FooTab','xtab123','<a href="http://foo.com/">http://foo.com/</a>, {priority: N});</div><div><br></div><div>Where N is a number between 0 and 5</div><div><br></div><div>This will determine where the new menu item will show up in the menu, 0 being </div><div>at the top below the dashboard, and 5 being right above Events. Normally it is </div><div>supposed to simply add to the end, however due to the bug it won't.</div><div><br></div><blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;"><div> > From: Alexander Wels <<a href="mailto:awels@redhat.com">awels@redhat.com</a>></div><div> > Date: Monday, February 19, 2018 at 7:54 AM</div><div> > To: "<a href="mailto:users@ovirt.org">users@ovirt.org</a>" <<a href="mailto:users@ovirt.org">users@ovirt.org</a>></div><div> > Cc: Preston <<a href="mailto:plord@inetx.ca">plord@inetx.ca</a>></div><div> > Subject: Re: [ovirt-users] oVirt 4.2 WebUI Plugin API Docs?</div><div> > </div><div> > On Friday, February 16, 2018 6:31:10 PM EST Zip wrote:</div><div> >> Are there any updated docs for the WebUI Plugins API?</div><div> > </div><div> > Unfortunately no, I haven't had a chance to create updated documentation.</div><div> > However the first two links are mostly still accurate as we haven't done</div><div> > any major changes to the API.</div><div> > </div><div> > Some things to note that are different from the API documentation in</div><div> > https:// www.ovirt.org/develop/release-management/features/ux/uiplugins/</div><div> > for 4.2:</div><div> > </div><div> > - alignRight no longer has any effect, as the UI in 4.2 no longer respects</div><div> > it. - none of the systemTreeNode selection code does anything (since</div><div> > there is no more system tree)</div><div> > - As noted in the documentation itself the RestApiSessionAcquired is no</div><div> > longer available as we have a proper SSO mechanism that you can utilize</div><div> > at this point.</div><div> > - Main Tabs are now called Main Views (but the api still calls them main</div><div> > tabs, so use the apis described). And sub tabs are now called detail</div><div> > tabs, but the same thing the API hasn't changed the naming convention so</div><div> > use subTabs. - mainTabActionButton location property no longer has any</div><div> > meaning and is ignored.</div><div> > </div><div> > That is it I think, we tried to make it so existing plugins would remain</div><div> > working even if some options no longer mean anything.</div><div> > </div><div> >> I have found the following which all appear to be old and no longer</div><div> >> working?</div><div> >> </div><div> >> <a href="https://www.ovirt.org/documentation/admin-guide/appe-oVirt_User_Interfac">https://www.ovirt.org/documentation/admin-guide/appe-oVirt_User_Interfac</a></div><div> >> e_Pl ugins/</div><div> >> <a href="https://www.ovirt.org/develop/release-management/features/ux/uiplugins/">https://www.ovirt.org/develop/release-management/features/ux/uiplugins/</a></div><div> >> <a href="http://resources.ovirt.org/old-site-files/UI_Plugins_at_oVirt_Workshop_S">http://resources.ovirt.org/old-site-files/UI_Plugins_at_oVirt_Workshop_S</a></div><div> >> unny vale_2013.pdf</div><div> >> </div><div> >> Thanks</div><div> >> </div><div> >> Zip</div></blockquote><div><br></div><div><br></div><div><br></div></blockquote></div></div></span></body></html>