From pvital at linux.vnet.ibm.com Wed Jan 29 09:12:24 2014 Content-Type: multipart/mixed; boundary="===============4588120474692661048==" MIME-Version: 1.0 From: Paulo Ricardo Paz Vital To: kimchi-devel at ovirt.org Subject: Re: [Kimchi-devel] [PATCH] Make guests template handling more robust like host template handling Date: Wed, 29 Jan 2014 12:12:00 -0200 Message-ID: <1391004720.9421.5.camel@hornet.br.ibm.com> In-Reply-To: 1390967574-18803-1-git-send-email-rak@linux.vnet.ibm.com --===============4588120474692661048== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable -- = Reviewed-by: Paulo Vital On Tue, 2014-01-28 at 22:52 -0500, Adam King wrote: > Change guest tab loading from an ajax request to an inline element > processed by Cheetah at guests.html.tmpl load time. This will eliminate > the potential for error when fetching the guest template, as well as impr= ove > the performance of the flow. Also updated kimchi-ui.html to eliminate > potential race condition as I integrated the new guests load into the main > flow. > = > Signed-off-by: Adam King > --- > ui/js/src/kimchi.guest_main.js | 20 ++------------------ > ui/pages/kimchi-ui.html.tmpl | 28 +++++++++++++--------------- > ui/pages/tabs/guests.html.tmpl | 18 ++++++++++-------- > 3 files changed, 25 insertions(+), 41 deletions(-) > = > diff --git a/ui/js/src/kimchi.guest_main.js b/ui/js/src/kimchi.guest_main= .js > index 9c45cf5..8467f3f 100644 > --- a/ui/js/src/kimchi.guest_main.js > +++ b/ui/js/src/kimchi.guest_main.js > @@ -228,27 +228,11 @@ kimchi.guest_main =3D function() { > $("#vm-add").on("click", function(event) { > kimchi.window.open('guest-add.html'); > }); > - > - $.ajax({ > - headers : { > - Accept : "text/html" > - }, > - url : 'guest.html', > - type : 'GET', > - dataType : 'html', > - accepts : 'text/html', > - success : function(response) { > - kimchi.guestTemplate =3D response; > - kimchi.listVmsAuto() > - }, > - error : function() { > - console.error('Could not get guest.html'); > - }, > - }); > - > + kimchi.guestTemplate =3D $('#guest-tmpl').html(); > $('#guests-root-container').on('remove', function() { > kimchi.vmTimeout && clearTimeout(kimchi.vmTimeout); > }); > + kimchi.listVmsAuto() > }; > = > kimchi.editTemplate =3D function(guestTemplate, oldPopStat) { > diff --git a/ui/pages/kimchi-ui.html.tmpl b/ui/pages/kimchi-ui.html.tmpl > index 8e234e2..eebe886 100644 > --- a/ui/pages/kimchi-ui.html.tmpl > +++ b/ui/pages/kimchi-ui.html.tmpl > @@ -32,9 +32,14 @@ > Kimchi > > > - > - > - > + > + > + > + > + > + > + > + > = > > > > - > + >
>
>

3D"Project

> @@ -89,19 +94,12 @@ >
> > > - > - > - > - > = >
> -
Oops! It looks like I am running from a source tree and you forgot= to build! > -Please run the following command and reload this page: > -

python setup.py build

> -
> +

Oops! It looks like I am running from a source tree and you= forgot to build! > + Please run the following command from the kimchi directory and reloa= d this page:

> +

make

> +
>
> - > > > diff --git a/ui/pages/tabs/guests.html.tmpl b/ui/pages/tabs/guests.html.t= mpl > index d73eb39..e2ab173 100644 > --- a/ui/pages/tabs/guests.html.tmpl > +++ b/ui/pages/tabs/guests.html.tmpl > @@ -22,13 +22,14 @@ > = > #unicode UTF-8 > #import gettext > +#from Cheetah.Template import Template > #from kimchi.cachebust import href > #silent t =3D gettext.translation($lang.domain, $lang.localedir, languag= es=3D$lang.lang) > #silent _ =3D t.gettext > #silent _t =3D t.gettext > - > - > - > + > +#silent ht =3D Template > + >
>
>
> @@ -50,9 +51,10 @@ >
> $_("No guests found.") >
> + > + >
> - > - > - --===============4588120474692661048==--