You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by Thibaut Marmin <tm...@cyres.fr> on 2013/10/10 16:11:03 UTC

Reinitialize ambari-web application

Hi everyone,

I'm trying to to implement a way to manage multiple clusters from single ambari web interface. I never worked with ember framework so I try to understant gradually.

I'm able to modify template (to add clusterName field to the login form), implement modifications in controllers, routes etc. In this first implementation, if you want to switch to another cluster, you have to sign out and log in again with another cluster name.

Everything works except one thing. I still have a problem with Ember datastore which is not fully reloaded for each login step. It makes that when I login with another cluster name, previous service name and hosts (inter alia) still displayed.

When user logs out, I could remove each items related to the current cluster stored in App.store, but I don't know if it is the best way. -> App.store.findAll(App.[MODEL]).forEach(function(item){item.deleteRecord()})

I'll suggest a patch for issue 1518 if I found an appropriate solution.

Thanks.

Thibaut Marmin


RE: Reinitialize ambari-web application

Posted by Thibaut Marmin <tm...@cyres.fr>.
Thanks for your answer.

In this quickly realized patch, I added a cluster name field to the login form. So a new clusterName attribute is stored in App.db (as the login name). The clusterController has a new method isSync used to check if current cluster is the same as expected one.

Currently I failed to reload full cluster (I should clean the Model) so I added a hack which reloads window on logout (window.location.reload(true)).

Sorry if my code is not perfect, I'm new on the project..

Thibaut

-----Message d'origine-----
De : Yusaku Sako [mailto:yusaku@hortonworks.com] 
Envoyé : samedi 12 octobre 2013 04:47
À : ambari-dev@incubator.apache.org
Objet : Re: Reinitialize ambari-web application

Hi Thibaut,

Can you attach your patch, even if it's work-in-progress, to AMBARI-1518?
That makes it easier to suggest solutions.

Yusaku

On Thu, Oct 10, 2013 at 7:11 AM, Thibaut Marmin <tm...@cyres.fr> wrote:
> Hi everyone,
>
> I'm trying to to implement a way to manage multiple clusters from single ambari web interface. I never worked with ember framework so I try to understant gradually.
>
> I'm able to modify template (to add clusterName field to the login form), implement modifications in controllers, routes etc. In this first implementation, if you want to switch to another cluster, you have to sign out and log in again with another cluster name.
>
> Everything works except one thing. I still have a problem with Ember datastore which is not fully reloaded for each login step. It makes that when I login with another cluster name, previous service name and hosts (inter alia) still displayed.
>
> When user logs out, I could remove each items related to the current 
> cluster stored in App.store, but I don't know if it is the best way. 
> -> 
> App.store.findAll(App.[MODEL]).forEach(function(item){item.deleteRecor
> d()})
>
> I'll suggest a patch for issue 1518 if I found an appropriate solution.
>
> Thanks.
>
> Thibaut Marmin
>

--
CONFIDENTIALITY NOTICE
NOTICE: This message is intended for the use of the individual or entity to which it is addressed and may contain information that is confidential, privileged and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are hereby notified that any printing, copying, dissemination, distribution, disclosure or forwarding of this communication is strictly prohibited. If you have received this communication in error, please contact the sender immediately and delete it from your system. Thank You.

Re: Reinitialize ambari-web application

Posted by Yusaku Sako <yu...@hortonworks.com>.
Hi Thibaut,

Can you attach your patch, even if it's work-in-progress, to AMBARI-1518?
That makes it easier to suggest solutions.

Yusaku

On Thu, Oct 10, 2013 at 7:11 AM, Thibaut Marmin <tm...@cyres.fr> wrote:
> Hi everyone,
>
> I'm trying to to implement a way to manage multiple clusters from single ambari web interface. I never worked with ember framework so I try to understant gradually.
>
> I'm able to modify template (to add clusterName field to the login form), implement modifications in controllers, routes etc. In this first implementation, if you want to switch to another cluster, you have to sign out and log in again with another cluster name.
>
> Everything works except one thing. I still have a problem with Ember datastore which is not fully reloaded for each login step. It makes that when I login with another cluster name, previous service name and hosts (inter alia) still displayed.
>
> When user logs out, I could remove each items related to the current cluster stored in App.store, but I don't know if it is the best way. -> App.store.findAll(App.[MODEL]).forEach(function(item){item.deleteRecord()})
>
> I'll suggest a patch for issue 1518 if I found an appropriate solution.
>
> Thanks.
>
> Thibaut Marmin
>

-- 
CONFIDENTIALITY NOTICE
NOTICE: This message is intended for the use of the individual or entity to 
which it is addressed and may contain information that is confidential, 
privileged and exempt from disclosure under applicable law. If the reader 
of this message is not the intended recipient, you are hereby notified that 
any printing, copying, dissemination, distribution, disclosure or 
forwarding of this communication is strictly prohibited. If you have 
received this communication in error, please contact the sender immediately 
and delete it from your system. Thank You.