oVirt 4.2 WebUI Plugin API Docs?

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_3601647075_235210751 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit Are there any updated docs for the WebUI Plugins API? I have found the following which all appear to be old and no longer working? https://www.ovirt.org/documentation/admin-guide/appe-oVirt_User_Interface_Pl ugins/ https://www.ovirt.org/develop/release-management/features/ux/uiplugins/ http://resources.ovirt.org/old-site-files/UI_Plugins_at_oVirt_Workshop_Sunny vale_2013.pdf Thanks Zip --B_3601647075_235210751 Content-type: text/html; charset="US-ASCII" 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; color: rgb(0, 0, 0); font-size:= 14px; font-family: Calibri, sans-serif;"><div><div><div>Are there any updat= ed docs for the WebUI Plugins API?</div></div></div><div><br></div><div>I ha= ve found the following which all appear to be old and no longer working?</di= v><div><br></div><div><a href=3D"https://www.ovirt.org/documentation/admin-gui= de/appe-oVirt_User_Interface_Plugins">https://www.ovirt.org/documentation/ad= min-guide/appe-oVirt_User_Interface_Plugins</a>/</div><div><a href=3D"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=3D"http://resources.ovirt.org/old-site-files/UI_Plugins_at_oVirt_Worksho= p_Sunnyvale_2013.pdf">http://resources.ovirt.org/old-site-files/UI_Plugins_a= t_oVirt_Workshop_Sunnyvale_2013.pdf</a></div><div><br></div><div>Thanks = ;</div><div><br></div><div>Zip</div></body></html> --B_3601647075_235210751--

On Friday, February 16, 2018 6:31:10 PM EST Zip wrote:
Are there any updated docs for the WebUI Plugins API?
Unfortunately no, I haven't had a chance to create updated documentation. However the first two links are mostly still accurate as we haven't done any major changes to the API. Some things to note that are different from the API documentation in https:// www.ovirt.org/develop/release-management/features/ux/uiplugins/ for 4.2: - 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 utilize 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 convention so use subTabs. - mainTabActionButton location property no longer has any meaning and is ignored. That is it I think, we tried to make it so existing plugins would remain working even if some options no longer mean anything.
I have found the following which all appear to be old and no longer working?
https://www.ovirt.org/documentation/admin-guide/appe-oVirt_User_Interface_Pl ugins/ https://www.ovirt.org/develop/release-management/features/ux/uiplugins/ http://resources.ovirt.org/old-site-files/UI_Plugins_at_oVirt_Workshop_Sunny vale_2013.pdf
Thanks
Zip

> 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_3602362279_2373602 Content-type: text/plain; charset="ISO-8859-1" Content-transfer-encoding: quoted-printable Hi Alexander, If I try the following: <!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> I get the error in my browser console: Sun Feb 25 00:03:56 GMT-600 2018 org.ovirt.engine.ui.webadmin.plugin.PluginManager SEVERE: Exception caught while invoking event handler function [UiInit] for plugin [HelloWorld]: Error: java.lang.IndexOutOfBoundsException webadmin:1:13517 <https://ovirtmgmt.intricatenetworks.com/ovirt-engine/webadmin/?locale=3Den_U= S #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 However if I remove the line: api.addMainTab('FooTab','xtab123','http://foo.com/=8C); And replace it with something simple like: alert(=8CTest 123=B9); There are no errors and the alert fires as it should. Any ideas of what I might be missing? I am running oVirt 4.2.1 on CentOS =AD Hosted Engine setup with 1 host for testing. Thanks Zip >=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 >=20 > Unfortunately no, I haven't had a chance to create updated documentation. > 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 http= s:// > www.ovirt.org/develop/release-management/features/ux/uiplugins/ for 4.2: >=20 > - alignRight no longer has any effect, as the UI in 4.2 no longer respect= s 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 l= onger > available as we have a proper SSO mechanism that you can utilize 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 convention so use subTabs. > - mainTabActionButton location property no longer has any meaning and is > ignored. >=20 > That is it I think, we tried to make it so existing plugins would remain > working even if some options no longer mean anything. >=20 >> I have found the following which all appear to be old and no longer wor= king? >> =20 >> https://www.ovirt.org/documentation/admin-guide/appe-oVirt_User_Interfa= ce_Pl >> ugins/ >> https://www.ovirt.org/develop/release-management/features/ux/uiplugins/ >> http://resources.ovirt.org/old-site-files/UI_Plugins_at_oVirt_Workshop_= Sunny >> vale_2013.pdf >> =20 >> Thanks >> =20 >> Zip >=20 >=20 >=20 --B_3602362279_2373602 Content-type: text/html; charset="ISO-8859-1" Content-transfer-encoding: quoted-printable <html><head><meta http-equiv=3D"content-type" content=3D"text/html; charset=3Dutf= -8"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; -we= bkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; fo= nt-family: Calibri, sans-serif;"><div><div><div>Hi Alexander,</div><div><br>= </div><div>If I try the following:</div></div></div><div><br></div><div><div= ><!DOCTYPE html></div><div><html></div><div><head></div><d= iv> <script></div><div> var ap= i =3D parent.pluginApi('HelloWorld');</div><div> ap= i.register({</div><div> UiInit: fun= ction () {</div><div> = api.addMainTab('FooTab','xtab123','http://foo.com/');</div><div> &nbs= p; }</div><div> });</= div><div> api.ready();</div><div> &l= t;/script></div><div></head></div><div><body></body></d= iv><div></html></div></div><div><br></div><div>I get the error in my b= rowser console: </div><div><br></div><div><div class=3D"cm-s-mozilla mes= sage console-api error error" aria-live=3D"polite"><a class=3D"theme-twisty"></a= ><span class=3D"message-body-wrapper"><span class=3D"message-flex-body"><span cl= ass=3D"message-body devtools-monospace"><span class=3D"objectBox objectBox-strin= g">Sun Feb 25 00:03:56 GMT-600 2018 org.ovirt.engine.ui.webadmin.plugin.Plug= inManager SEVERE: Exception caught while invoking event handler function [UiInit] for= plugin [HelloWorld]: Error: java.lang.IndexOutOfBoundsException</span></spa= n> <span class=3D"message-location devtools-monospace"><span data-url=3D"https:/= /ovirtmgmt.intricatenetworks.com/ovirt-engine/webadmin/" class=3D"frame-link" = data-line=3D"1" data-column=3D"13517"><span class=3D"frame-link-source-inner" titl= e=3D"View source in Debugger ? https://ovirtmgmt.intricatenetworks.com/ovirt-e= ngine/webadmin/:1:13517"><a href=3D"https://ovirtmgmt.intricatenetworks.com/ov= irt-engine/webadmin/?locale=3Den_US#dashboard-main" class=3D"frame-link-source" = draggable=3D"false"><span class=3D"frame-link-filename">webadmin</span><span cla= ss=3D"frame-link-line">:1:13517</span></a></span></span></span></span> </span></div><div class=3D"cm-s-mozilla message console-api error error" aria= -live=3D"polite"><span class=3D"message-body-wrapper"><span class=3D"message-flex-= body"><span class=3D"message-location devtools-monospace"><span data-url=3D"http= s://ovirtmgmt.intricatenetworks.com/ovirt-engine/webadmin/" class=3D"frame-lin= k" data-line=3D"1" data-column=3D"13517"><br></span></span></span></span></div><= div class=3D"cm-s-mozilla message console-api warn warn" aria-live=3D"polite"><s= pan data-indent=3D"0" class=3D"indent" style=3D"width: 0px;"></span><span class=3D"i= con" title=3D"Warning" aria-live=3D"off"></span><span class=3D"message-body-wrappe= r">Sun Feb 25 00:03:56 GMT-600 2018 org.ovirt.engine.ui.webadmin.plugin.Plug= inManager WARNING: Plugin [HelloWorld] removed from service due to failure</span></di= v></div><div class=3D"cm-s-mozilla message console-api warn warn" aria-live=3D"p= olite"><span class=3D"message-body-wrapper"><br></span></div><div class=3D"cm-s-= mozilla message console-api warn warn" aria-live=3D"polite"><span class=3D"messa= ge-body-wrapper"><br></span></div><div class=3D"cm-s-mozilla message console-a= pi warn warn" aria-live=3D"polite"><span class=3D"message-body-wrapper">However = if I remove the line:</span></div><div class=3D"cm-s-mozilla message console-a= pi warn warn" aria-live=3D"polite"><span class=3D"message-body-wrapper"><br></sp= an></div><div class=3D"cm-s-mozilla message console-api warn warn" aria-live=3D"= polite"><span class=3D"message-body-wrapper"> api.addMainTab('FooTab','xt= ab123','<a href=3D"http://foo.com">http://foo.com</a>/‘);</span></div><d= iv class=3D"cm-s-mozilla message console-api warn warn" aria-live=3D"polite"><sp= an class=3D"message-body-wrapper"><br></span></div><div class=3D"cm-s-mozilla me= ssage console-api warn warn" aria-live=3D"polite"><span class=3D"message-body-wr= apper">And replace it with something simple like:</span></div><div class=3D"cm= -s-mozilla message console-api warn warn" aria-live=3D"polite"><span class=3D"me= ssage-body-wrapper"><br></span></div><div class=3D"cm-s-mozilla message consol= e-api warn warn" aria-live=3D"polite">alert(‘Test 123’);</div><div= class=3D"cm-s-mozilla message console-api warn warn" aria-live=3D"polite"><br><= /div><div class=3D"cm-s-mozilla message console-api warn warn" aria-live=3D"poli= te">There are no errors and the alert fires as it should.</div><div class=3D"c= m-s-mozilla message console-api warn warn" aria-live=3D"polite"><br></div><div= class=3D"cm-s-mozilla message console-api warn warn" aria-live=3D"polite"><br><= /div><div class=3D"cm-s-mozilla message console-api warn warn" aria-live=3D"poli= te">Any ideas of what I might be missing?</div><div class=3D"cm-s-mozilla mess= age console-api warn warn" aria-live=3D"polite"><br></div><div class=3D"cm-s-moz= illa message console-api warn warn" aria-live=3D"polite">I am running oVirt 4.= 2.1 on CentOS – Hosted Engine setup with 1 host for testing.</div><div= class=3D"cm-s-mozilla message console-api warn warn" aria-live=3D"polite"><br><= /div><div class=3D"cm-s-mozilla message console-api warn warn" aria-live=3D"poli= te">Thanks</div><div class=3D"cm-s-mozilla message console-api warn warn" aria= -live=3D"polite"><br></div><div class=3D"cm-s-mozilla message console-api warn w= arn" aria-live=3D"polite">Zip</div><div><br></div><blockquote style=3D"margin:0 = 0 0 40px; border:none; padding:0px;"><div><br></div></blockquote><span id=3D"O= LK_SRC_BODY_SECTION"><blockquote style=3D"margin:0 0 0 40px; border:none; padd= ing:0px;"><div style=3D"font-family:Calibri; font-size:11pt; text-align:left; = color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-B= OTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt s= olid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><span style=3D"font-weight:= bold">From: </span> Alexander Wels <<a href=3D"mailto:awels@redhat.com">awe= ls@redhat.com</a>><br><span style=3D"font-weight:bold">Date: </span> Monday= , February 19, 2018 at 7:54 AM<br><span style=3D"font-weight:bold">To: </span>= "<a href=3D"mailto:users@ovirt.org">users@ovirt.org</a>" <<a href=3D"mailto:= users@ovirt.org">users@ovirt.org</a>><br><span style=3D"font-weight:bold">C= c: </span> Preston <<a href=3D"mailto:plord@inetx.ca">plord@inetx.ca</a>>= ;<br><span style=3D"font-weight:bold">Subject: </span> Re: [ovirt-users] oVirt= 4.2 WebUI Plugin API Docs?<br></div><div><br></div></blockquote><div><div><= blockquote style=3D"margin:0 0 0 40px; border:none; padding:0px;"><div>On Frid= ay, February 16, 2018 6:31:10 PM EST Zip wrote:</div><blockquote id=3D"MAC_OUT= LOOK_ATTRIBUTION_BLOCKQUOTE" style=3D"BORDER-LEFT: #b5c4df 5 solid; PADDING:0 = 0 0 5; MARGIN:0 0 0 5;"><div> Are there any updated docs for the WebUI Plugi= ns API?</div><div> </div></blockquote><div><br></div><div>Unfortunately no, = I haven't had a chance to create updated documentation. </div><div>However t= he first two links are mostly still accurate as we haven't done any </div><d= iv>major changes to the API.</div><div><br></div><div>Some things to note th= at are different from the API documentation in https://</div><div>www.ovirt.= org/develop/release-management/features/ux/uiplugins/ for 4.2:</div><div><br= ></div><div>- alignRight no longer has any effect, as the UI in 4.2 no longe= r respects it.</div><div>- none of the systemTreeNode selection code does an= ything (since there is no </div><div>more system tree)</div><div>- As noted = in the documentation itself the RestApiSessionAcquired is no longer </div><d= iv>available as we have a proper SSO mechanism that you can utilize at this = </div><div>point.</div><div>- Main Tabs are now called Main Views (but the a= pi still calls them main tabs, </div><div>so use the apis described). And su= b tabs are now called detail tabs, but the </div><div>same thing the API has= n't changed the naming convention so use subTabs.</div><div>- mainTabActionB= utton location property no longer has any meaning and is </div><div>ignored.= </div><div><br></div><div>That is it I think, we tried to make it so existin= g plugins would remain </div><div>working even if some options no longer mea= n anything.</div><div><br></div><blockquote id=3D"MAC_OUTLOOK_ATTRIBUTION_BLOC= KQUOTE" style=3D"BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5= ;"><div> I have found the following which all appear to be old and no longer= working?</div><div> </div><div> <a href=3D"https://www.ovirt.org/documentatio= n/admin-guide/appe-oVirt_User_Interface_Pl">https://www.ovirt.org/documentat= ion/admin-guide/appe-oVirt_User_Interface_Pl</a></div><div> ugins/</div><div= > <a href=3D"https://www.ovirt.org/develop/release-management/features/ux/uipl= ugins/">https://www.ovirt.org/develop/release-management/features/ux/uiplugi= ns/</a></div><div> <a href=3D"http://resources.ovirt.org/old-site-files/UI_Plu= gins_at_oVirt_Workshop_Sunny">http://resources.ovirt.org/old-site-files/UI_P= lugins_at_oVirt_Workshop_Sunny</a></div><div> vale_2013.pdf</div><div> </div= ><div> Thanks</div><div> </div><div> Zip</div></blockquote><div><br></div><d= iv><br></div><div><br></div></blockquote></div></div></span></body></html> --B_3602362279_2373602--

On Sunday, February 25, 2018 1:11:08 AM EST Zip wrote:
Hi Alexander,
If I try the following:
<!DOCTYPE html> <html> <head> <script> var api = parent.pluginApi('HelloWorld'); api.register({ UiInit: function () { api.addMainTab('FooTab','xtab123','http://foo.com/'); } }); api.ready(); </script> </head> <body></body> </html>
I get the error in my browser console:
Sun Feb 25 00:03:56 GMT-600 2018 org.ovirt.engine.ui.webadmin.plugin.PluginManager SEVERE: Exception caught while invoking event handler function [UiInit] for plugin [HelloWorld]: Error: java.lang.IndexOutOfBoundsException webadmin:1:13517 <https://ovirtmgmt.intricatenetworks.com/ovirt-engine/webadmin/?locale=en_US #dashboard-main>
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
However if I remove the line:
api.addMainTab('FooTab','xtab123','http://foo.com/);
And replace it with something simple like:
alert(Test 123¹);
There are no errors and the alert fires as it should.
Any ideas of what I might be missing?
I am running oVirt 4.2.1 on CentOS Hosted Engine setup with 1 host for testing.
Thanks
Zip
Well you found a bug, I will be posting a patch soon. To bypass the problem add the following: api.addMainTab('FooTab','xtab123','http://foo.com/, {priority: N}); Where N is a number between 0 and 5 This will determine where the new menu item will show up in the menu, 0 being 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.
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?
On Friday, February 16, 2018 6:31:10 PM EST Zip wrote:
Are there any updated docs for the WebUI Plugins API?
Unfortunately no, I haven't had a chance to create updated documentation. However the first two links are mostly still accurate as we haven't done any major changes to the API.
Some things to note that are different from the API documentation in https:// www.ovirt.org/develop/release-management/features/ux/uiplugins/ for 4.2:
- 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 utilize 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 convention so use subTabs. - mainTabActionButton location property no longer has any meaning and is ignored.
That is it I think, we tried to make it so existing plugins would remain working even if some options no longer mean anything.
I have found the following which all appear to be old and no longer working?
https://www.ovirt.org/documentation/admin-guide/appe-oVirt_User_Interfac e_Pl ugins/ https://www.ovirt.org/develop/release-management/features/ux/uiplugins/ http://resources.ovirt.org/old-site-files/UI_Plugins_at_oVirt_Workshop_S unny vale_2013.pdf
Thanks
Zip

> 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--

On Monday, February 26, 2018 9:50:37 AM EST Zip wrote:
Thanks Alexander,
This works:
api.addMainTab('oVirtTab', 'ovirt-tab', ‘http://www.something.com', {priority: 5});
Can you advise how to get the api.addSubTab to work?
api.addSubTab('ovirt-tab', 'Test 123', 'test-123', '#’);
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 – same as the current 4.2.1 UI shows Network and then(Vnic Profiles) (Networks) as submenus.
Thanks
Zip
So api.addSubTab works on adding a 'detail' tab, aka when you click on lets say the VMs name, and go to the detail view, addSubTab will add another tab in there. What you want to do, is currently NOT possible. I have a TODO in my long list of items to add that capability to the UI plugin API. When the API was designed the secondary menus like Networks didn't exist, it was all main tabs or sub tabs. The primary and secondary menus are just a way to organize the main views instead of having a giant list of menu items. For now I would just put it in a primary menu until I get a chance to update the api to allow for you to add it to a secondary menu.
On Sunday, February 25, 2018 1:11:08 AM EST Zip wrote:
Hi Alexander,
If I try the following:
<!DOCTYPE html> <html> <head>
<script>
var api = parent.pluginApi('HelloWorld'); api.register({
UiInit: function () {
api.addMainTab('FooTab','xtab123','http://foo.com/');
}
}); api.ready();
</script>
</head> <body></body> </html>
I get the error in my browser console:
Sun Feb 25 00:03:56 GMT-600 2018 org.ovirt.engine.ui.webadmin.plugin.PluginManager SEVERE: Exception caught while invoking event handler function [UiInit] for plugin [HelloWorld]: Error: java.lang.IndexOutOfBoundsException webadmin:1:13517 <https://ovirtmgmt.intricatenetworks.com/ovirt-engine/webadmin/?locale=e n_US #dashboard-main>
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
However if I remove the line: api.addMainTab('FooTab','xtab123','http://foo.com/Œ);
And replace it with something simple like:
alert(ŒTest 123¹);
There are no errors and the alert fires as it should.
Any ideas of what I might be missing?
I am running oVirt 4.2.1 on CentOS Hosted Engine setup with 1 host for testing.
Thanks
Zip
Well you found a bug, I will be posting a patch soon. To bypass the problem add the following:
api.addMainTab('FooTab','xtab123','http://foo.com/, {priority: N});
Where N is a number between 0 and 5
This will determine where the new menu item will show up in the menu, 0 being 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.>
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?
On Friday, February 16, 2018 6:31:10 PM EST Zip wrote:
> Are there any updated docs for the WebUI Plugins API?
Unfortunately no, I haven't had a chance to create updated documentation. However the first two links are mostly still accurate as we haven't done any major changes to the API.
Some things to note that are different from the API documentation in https:// www.ovirt.org/develop/release-management/features/ux/uiplugins/ for 4.2:
- 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 utilize 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 convention so use subTabs. - mainTabActionButton location property no longer has any meaning and is ignored.
That is it I think, we tried to make it so existing plugins would remain working even if some options no longer mean anything.
> I have found the following which all appear to be old and no > longer > working?
https://www.ovirt.org/documentation/admin-guide/appe-oVirt_User_Interfa c
> e_Pl ugins/
https://www.ovirt.org/develop/release-management/features/ux/uiplugins/
http://resources.ovirt.org/old-site-files/UI_Plugins_at_oVirt_Workshop_ S
> unny vale_2013.pdf > > Thanks > > Zip
participants (2)
-
Alexander Wels
-
Zip