
26 Feb
2018
26 Feb
'18
2:50 p.m.
> This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --B_3602479845_8414555 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable Thanks Alexander, This works: api.addMainTab('oVirtTab', 'ovirt-tab', =E2=80=98http://www.something.com', {priority: 5}); Can you advise how to get the api.addSubTab to work? api.addSubTab('ovirt-tab', 'Test 123', 'test-123', '#=E2=80=99); I tried the above and many other combinations, no errors, just doesnt work. Maybe I am wrong on what it does? I am looking to add a submenu =E2=80=93 same as the current 4.2.1 UI shows Networ= k and then(Vnic Profiles) (Networks) as submenus. Thanks Zip >=20 >=20 > On Sunday, February 25, 2018 1:11:08 AM EST Zip wrote: >> Hi Alexander, >> =20 >> If I try the following: >> =20 >> <!DOCTYPE html> >> <html> >> <head> >> <script> >> var api =3D parent.pluginApi('HelloWorld'); >> api.register({ >> UiInit: function () { >> api.addMainTab('FooTab','xtab123','http://foo.com/'); >> } >> }); >> api.ready(); >> </script> >> </head> >> <body></body> >> </html> >> =20 >> I get the error in my browser console: >> =20 >> Sun Feb 25 00:03:56 GMT-600 2018 >> org.ovirt.engine.ui.webadmin.plugin.PluginManager SEVERE: Exception cau= ght >> while invoking event handler function [UiInit] for plugin [HelloWorld]: >> Error: java.lang.IndexOutOfBoundsException webadmin:1:13517 >> <https://ovirtmgmt.intricatenetworks.com/ovirt-engine/webadmin/?locale=3D= en_US >> #dashboard-main> >> =20 >> Sun Feb 25 00:03:56 GMT-600 2018 >> org.ovirt.engine.ui.webadmin.plugin.PluginManager WARNING: Plugin >> [HelloWorld] removed from service due to failure >> =20 >> =20 >> However if I remove the line: >> =20 >> api.addMainTab('FooTab','xtab123','http://foo.com/=C5=92); >> =20 >> And replace it with something simple like: >> =20 >> alert(=C5=92Test 123=C2=B9); >> =20 >> There are no errors and the alert fires as it should. >> =20 >> =20 >> Any ideas of what I might be missing? >> =20 >> I am running oVirt 4.2.1 on CentOS =C2=AD Hosted Engine setup with 1 host f= or >> testing. >> =20 >> Thanks >> =20 >> Zip >> =20 >=20 > Well you found a bug, I will be posting a patch soon. To bypass the probl= em > add the following: >=20 > api.addMainTab('FooTab','xtab123','http://foo.com/, {priority: N}); >=20 > Where N is a number between 0 and 5 >=20 > This will determine where the new menu item will show up in the menu, 0 b= eing > at the top below the dashboard, and 5 being right above Events. Normally = it is > supposed to simply add to the end, however due to the bug it won't. >=20 >>> > From: Alexander Wels <awels@redhat.com> >>> > Date: Monday, February 19, 2018 at 7:54 AM >>> > To: "users@ovirt.org" <users@ovirt.org> >>> > Cc: Preston <plord@inetx.ca> >>> > Subject: Re: [ovirt-users] oVirt 4.2 WebUI Plugin API Docs? >>> >=20 >>> > On Friday, February 16, 2018 6:31:10 PM EST Zip wrote: >>>> >> Are there any updated docs for the WebUI Plugins API? >>> >=20 >>> > Unfortunately no, I haven't had a chance to create updated documenta= tion. >>> > However the first two links are mostly still accurate as we haven't = done >>> > any major changes to the API. >>> >=20 >>> > Some things to note that are different from the API documentation in >>> > https:// www.ovirt.org/develop/release-management/features/ux/uiplug= ins/ >>> > for 4.2: >>> >=20 >>> > - alignRight no longer has any effect, as the UI in 4.2 no longer >>> respects >>> > it. - none of the systemTreeNode selection code does anything (since >>> > there is no more system tree) >>> > - As noted in the documentation itself the RestApiSessionAcquired is= no >>> > longer available as we have a proper SSO mechanism that you can util= ize >>> > at this point. >>> > - Main Tabs are now called Main Views (but the api still calls them = main >>> > tabs, so use the apis described). And sub tabs are now called detail >>> > tabs, but the same thing the API hasn't changed the naming conventio= n so >>> > use subTabs. - mainTabActionButton location property no longer has a= ny >>> > meaning and is ignored. >>> >=20 >>> > That is it I think, we tried to make it so existing plugins would re= main >>> > working even if some options no longer mean anything. >>> >=20 >>>> >> I have found the following which all appear to be old and no long= er >>>> >> working? >>>> >> =20 >>>> >> =20 >>>> https://www.ovirt.org/documentation/admin-guide/appe-oVirt_User_Interf= ac >>>> >> e_Pl ugins/ >>>> >> =20 >>>> https://www.ovirt.org/develop/release-management/features/ux/uiplugins= / >>>> >> =20 >>>> http://resources.ovirt.org/old-site-files/UI_Plugins_at_oVirt_Workshop= _S >>>> >> unny vale_2013.pdf >>>> >> =20 >>>> >> Thanks >>>> >> =20 >>>> >> Zip >=20 >=20 >=20 --B_3602479845_8414555 Content-type: text/html; charset="UTF-8" Content-transfer-encoding: quoted-printable <html><head></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s= pace; -webkit-line-break: after-white-space;"><div><div style=3D"color: rgb(0,= 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">Thanks Alexander= ,</div><div style=3D"color: rgb(0, 0, 0); font-family: Calibri, sans-serif; fo= nt-size: 14px;"><br></div><div style=3D"color: rgb(0, 0, 0); font-family: Cali= bri, sans-serif; font-size: 14px;">This works:</div><div style=3D"color: rgb(0= , 0, 0); font-family: Calibri, sans-serif; font-size: 14px;"><br></div><div>= <font face=3D"Calibri,sans-serif">api.addMainTab('oVirtTab', 'ovirt-tab', = ;‘http://www.something.com', {priority: 5});</font></div><div><font fa= ce=3D"Calibri,sans-serif"><br></font></div><div><font face=3D"Calibri,sans-serif= ">Can you advise how to get the </font><span style=3D"font-family: Calibr= i, sans-serif;">api.addSubTab to work?</span></div><div><font face=3D"Calibri,= sans-serif"><br></font></div><div><font face=3D"Calibri,sans-serif">api.addSub= Tab('ovirt-tab', 'Test 123', 'test-123', '#’);</font></div><div><font = face=3D"Calibri,sans-serif"><br></font></div><div><font face=3D"Calibri,sans-ser= if">I tried the above and many other combinations, no errors, just doesnt wo= rk. Maybe I am wrong on what it does?</font></div><div><font face=3D"Calibri,s= ans-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=3D"Calibri,sans-serif"><br></font></div><blockq= uote style=3D"color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size= : 14px; margin: 0px 0px 0px 40px; border: none; padding: 0px;"><div><br></di= v><div><span class=3D"Apple-style-span" style=3D"font-size: 12px; font-family: V= erdana, Helvetica, Arial;"><br></span></div></blockquote></div><span id=3D"OLK= _SRC_BODY_SECTION" style=3D"color: rgb(0, 0, 0); font-family: Calibri, sans-se= rif; font-size: 14px;"><div><div><blockquote style=3D"margin:0 0 0 40px; borde= r:none; padding:0px;"><div>On Sunday, February 25, 2018 1:11:08 AM EST Zip w= rote:</div><blockquote id=3D"MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style=3D"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> &n= bsp; var api =3D parent.pluginApi('HelloWorld');</div><div>&= nbsp; api.register({</div><div>&nb= sp; UiInit= : function () {</div><div> &n= bsp; api.addMainTab('FooTab','xtab= 123','<a href=3D"http://foo.com/'">http://foo.com/'</a>);</div><div> &nbs= p; }</div><div>&= nbsp; });</div><div> &n= bsp; 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: Excepti= on caught</div><div> while invoking event handler function [UiInit] for plug= in [HelloWorld]:</div><div> Error: java.lang.IndexOutOfBoundsException webad= min:1:13517</div><div> <<a href=3D"https://ovirtmgmt.intricatenetworks.com/= ovirt-engine/webadmin/?locale=3Den_US">https://ovirtmgmt.intricatenetworks.com= /ovirt-engine/webadmin/?locale=3Den_US</a></div><div> #dashboard-main></div= ><div> </div><div> Sun Feb 25 00:03:56 GMT-600 2018</div><div> org.ovirt.eng= ine.ui.webadmin.plugin.PluginManager WARNING: Plugin</div><div> [HelloWorld]= removed from service due to failure</div><div> </div><div> </div><div> Howe= ver if I remove the line:</div><div> </div><div> api.addMainTab('= FooTab','xtab123','<a href=3D"http://foo.com/Œ">http://foo.com/Œ</a>= );</div><div> </div><div> And replace it with something simple like:</div><d= iv> </div><div> alert(ŒTest 123=C2=B9);</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 o= Virt 4.2.1 on CentOS =C2=AD Hosted Engine setup with 1 host for</div><div> testi= ng.</div><div> </div><div> Thanks</div><div> </div><div> Zip</div><div> </di= v></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=3D"http://foo.com/">h= ttp://foo.com/</a>, {priority: N});</div><div><br></div><div>Where N is a nu= mber 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>sup= posed to simply add to the end, however due to the bug it won't.</div><div><= br></div><blockquote id=3D"MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style=3D"BORDER-L= EFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;"><div> > From:&nbs= p; Alexander Wels <<a href=3D"mailto:awels@redhat.com">awels@redhat.co= m</a>></div><div> > Date: Monday, February 19, 2018 at 7:54= AM</div><div> > To: "<a href=3D"mailto:users@ovirt.org">users@o= virt.org</a>" <<a href=3D"mailto:users@ovirt.org">users@ovirt.org</a>></= div><div> > Cc: Preston <<a href=3D"mailto:plord@inetx.ca">pl= ord@inetx.ca</a>></div><div> > Subject: Re: [ovirt-users] o= Virt 4.2 WebUI Plugin API Docs?</div><div> > </div><div> > On Friday, = February 16, 2018 6:31:10 PM EST Zip wrote:</div><div> >> A= re there any updated docs for the WebUI Plugins API?</div><div> > </div><= div> > Unfortunately no, I haven't had a chance to create updated documen= tation.</div><div> > However the first two links are mostly still accurat= e 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-mana= gement/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 longe= r respects</div><div> > it. - none of the systemTreeNode selection code d= oes anything (since</div><div> > there is no more system tree)</div><div>= > - As noted in the documentation itself the RestApiSessionAcquired is n= o</div><div> > longer available as we have a proper SSO mechanism that yo= u 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> > ta= bs, 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 woul= d remain</div><div> > working even if some options no longer mean anythin= g.</div><div> > </div><div> >> I have found the followin= g which all appear to be old and no longer</div><div> >> wo= rking?</div><div> >> </div><div> >> <a hre= f=3D"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=3D"https://www.ovirt.org/develop/release-management/features/ux/uiplug= ins/">https://www.ovirt.org/develop/release-management/features/ux/uiplugins= /</a></div><div> >> <a href=3D"http://resources.ovirt.org/old= -site-files/UI_Plugins_at_oVirt_Workshop_S">http://resources.ovirt.org/old-s= ite-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></blockqu= ote></div></div></span></body></html> --B_3602479845_8414555--