You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by ilya musayev <il...@gmail.com> on 2015/03/05 23:44:38 UTC

Disable a UI button via global setting - how to implement?

I'm looking into a way of making ResetVM button disabled in some 
cloudstack environments. Ideally, i'd want it per zone, but its can be 
also Global Setting.

I don't want to disable the API ResetVM, just the UI button.

Would you know of a feature/button in cloudstack UI that follows a 
similar pattern and can be  used as a point of reference?

Thanks
ilya

Re: Disable a UI button via global setting - how to implement?

Posted by Rohit Yadav <ro...@shapeblue.com>.
Right now there is nothing that the framework provides to enable/disable
views. In case of SAML button, I call a getSPMetadata API which is only
available if the plugin was enabled from global settings, if the reply
is 200 (ok) then I show the button (sort of a hack).

On Friday 06 March 2015 09:57 PM, Daniel Vega Simões wrote:
> As Andrija pointed out, you can check out templates.js and see the if
> condition for displaying "public" checkbox or not.
>
> It is based on a global variable called g_userPublicTemplateEnabled, which
> is assigned in cloudStack.js.
>
> The command that pulls that kind of info is listCapabilitiesCmd. I believe
> it's the only command that is called before the user logs in to set some
> variables, such as cloudstack version, ability for users to create projects
> etc. It gets the info from global configs.
>
> In your case, you could implement a new attribute on that command and then
> update the UI with the same if condition as in the templates.js file.
>
>
>
> --
> Daniel Simões
> Time Evolução Infra - Globo.com
> E-mail: daniel.simoes@corp.globo.com
> Tel.: +55 21 2483-6977
>
> 2015-03-06 12:00 GMT-03:00 Andrija Panic <an...@gmail.com>:
>
>> If you disable global option for users to create Public templates, then
>> "public" checkbox is hidden on the New Template creation form..
>>
>> not a button - but...
>>
>> On 6 March 2015 at 14:50, Pierre-Luc Dion <pd...@cloudops.com> wrote:
>>
>>> I think Ilya want to implement the disable Reset VM button,   SAML button
>>> can be disable thru GlobalSettings:  saml2.enabled
>>>
>>>
>>>
>>>
>>>
>>> On Fri, Mar 6, 2015 at 8:39 AM, Nux! <nu...@li.nux.ro> wrote:
>>>
>>>> Pierre-Luc,
>>>>
>>>> Out of curiosity, which is the setting that disables "Reset VM"?
>>>>
>>>> Lucian
>>>>
>>>> --
>>>> Sent from the Delta quadrant using Borg technology!
>>>>
>>>> Nux!
>>>> www.nux.ro
>>>>
>>>> ----- Original Message -----
>>>>> From: "Pierre-Luc Dion" <pd...@cloudops.com>
>>>>> To: dev@cloudstack.apache.org
>>>>> Sent: Friday, 6 March, 2015 13:29:28
>>>>> Subject: Re: Disable a UI button via global setting - how to
>> implement?
>>>>
>>>>> You can refer to Rohit's SAML feature, their is a button on the logon
>>>> page
>>>>> in acs4.5, it can be disabled thru GlobalSettings.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Mar 5, 2015 at 5:44 PM, ilya musayev <
>>>> ilya.mailing.lists@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> I'm looking into a way of making ResetVM button disabled in some
>>>>>> cloudstack environments. Ideally, i'd want it per zone, but its can
>> be
>>>> also
>>>>>> Global Setting.
>>>>>>
>>>>>> I don't want to disable the API ResetVM, just the UI button.
>>>>>>
>>>>>> Would you know of a feature/button in cloudstack UI that follows a
>>>> similar
>>>>>> pattern and can be  used as a point of reference?
>>>>>>
>>>>>> Thanks
>>>>>> ilya
>>>>
>>>
>>
>>
>>
>> --
>>
>> Andrija Panić
>>
>

--
Regards,
Rohit Yadav
Software Architect, ShapeBlue
M. +91 8826230892 | rohit.yadav@shapeblue.com
Blog: bhaisaab.org | Twitter: @_bhaisaab
PS. If you see any footer below, I did not add it :)
Find out more about ShapeBlue and our range of CloudStack related services

IaaS Cloud Design & Build<http://shapeblue.com/iaas-cloud-design-and-build//>
CSForge – rapid IaaS deployment framework<http://shapeblue.com/csforge/>
CloudStack Consulting<http://shapeblue.com/cloudstack-consultancy/>
CloudStack Software Engineering<http://shapeblue.com/cloudstack-software-engineering/>
CloudStack Infrastructure Support<http://shapeblue.com/cloudstack-infrastructure-support/>
CloudStack Bootcamp Training Courses<http://shapeblue.com/cloudstack-training/>

This email and any attachments to it may be confidential and are intended solely for the use of the individual to whom it is addressed. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Shape Blue Ltd or related companies. If you are not the intended recipient of this email, you must neither take any action based upon its contents, nor copy or show it to anyone. Please contact the sender if you believe you have received this email in error. Shape Blue Ltd is a company incorporated in England & Wales. ShapeBlue Services India LLP is a company incorporated in India and is operated under license from Shape Blue Ltd. Shape Blue Brasil Consultoria Ltda is a company incorporated in Brasil and is operated under license from Shape Blue Ltd. ShapeBlue SA Pty Ltd is a company registered by The Republic of South Africa and is traded under license from Shape Blue Ltd. ShapeBlue is a registered trademark.

Re: Disable a UI button via global setting - how to implement?

Posted by Daniel Vega Simões <da...@corp.globo.com>.
As Andrija pointed out, you can check out templates.js and see the if
condition for displaying "public" checkbox or not.

It is based on a global variable called g_userPublicTemplateEnabled, which
is assigned in cloudStack.js.

The command that pulls that kind of info is listCapabilitiesCmd. I believe
it's the only command that is called before the user logs in to set some
variables, such as cloudstack version, ability for users to create projects
etc. It gets the info from global configs.

In your case, you could implement a new attribute on that command and then
update the UI with the same if condition as in the templates.js file.



--
Daniel Simões
Time Evolução Infra - Globo.com
E-mail: daniel.simoes@corp.globo.com
Tel.: +55 21 2483-6977

2015-03-06 12:00 GMT-03:00 Andrija Panic <an...@gmail.com>:

> If you disable global option for users to create Public templates, then
> "public" checkbox is hidden on the New Template creation form..
>
> not a button - but...
>
> On 6 March 2015 at 14:50, Pierre-Luc Dion <pd...@cloudops.com> wrote:
>
> > I think Ilya want to implement the disable Reset VM button,   SAML button
> > can be disable thru GlobalSettings:  saml2.enabled
> >
> >
> >
> >
> >
> > On Fri, Mar 6, 2015 at 8:39 AM, Nux! <nu...@li.nux.ro> wrote:
> >
> > > Pierre-Luc,
> > >
> > > Out of curiosity, which is the setting that disables "Reset VM"?
> > >
> > > Lucian
> > >
> > > --
> > > Sent from the Delta quadrant using Borg technology!
> > >
> > > Nux!
> > > www.nux.ro
> > >
> > > ----- Original Message -----
> > > > From: "Pierre-Luc Dion" <pd...@cloudops.com>
> > > > To: dev@cloudstack.apache.org
> > > > Sent: Friday, 6 March, 2015 13:29:28
> > > > Subject: Re: Disable a UI button via global setting - how to
> implement?
> > >
> > > > You can refer to Rohit's SAML feature, their is a button on the logon
> > > page
> > > > in acs4.5, it can be disabled thru GlobalSettings.
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > On Thu, Mar 5, 2015 at 5:44 PM, ilya musayev <
> > > ilya.mailing.lists@gmail.com>
> > > > wrote:
> > > >
> > > >> I'm looking into a way of making ResetVM button disabled in some
> > > >> cloudstack environments. Ideally, i'd want it per zone, but its can
> be
> > > also
> > > >> Global Setting.
> > > >>
> > > >> I don't want to disable the API ResetVM, just the UI button.
> > > >>
> > > >> Would you know of a feature/button in cloudstack UI that follows a
> > > similar
> > > >> pattern and can be  used as a point of reference?
> > > >>
> > > >> Thanks
> > > >> ilya
> > >
> >
>
>
>
> --
>
> Andrija Panić
>

Re: Disable a UI button via global setting - how to implement?

Posted by Andrija Panic <an...@gmail.com>.
If you disable global option for users to create Public templates, then
"public" checkbox is hidden on the New Template creation form..

not a button - but...

On 6 March 2015 at 14:50, Pierre-Luc Dion <pd...@cloudops.com> wrote:

> I think Ilya want to implement the disable Reset VM button,   SAML button
> can be disable thru GlobalSettings:  saml2.enabled
>
>
>
>
>
> On Fri, Mar 6, 2015 at 8:39 AM, Nux! <nu...@li.nux.ro> wrote:
>
> > Pierre-Luc,
> >
> > Out of curiosity, which is the setting that disables "Reset VM"?
> >
> > Lucian
> >
> > --
> > Sent from the Delta quadrant using Borg technology!
> >
> > Nux!
> > www.nux.ro
> >
> > ----- Original Message -----
> > > From: "Pierre-Luc Dion" <pd...@cloudops.com>
> > > To: dev@cloudstack.apache.org
> > > Sent: Friday, 6 March, 2015 13:29:28
> > > Subject: Re: Disable a UI button via global setting - how to implement?
> >
> > > You can refer to Rohit's SAML feature, their is a button on the logon
> > page
> > > in acs4.5, it can be disabled thru GlobalSettings.
> > >
> > >
> > >
> > >
> > >
> > > On Thu, Mar 5, 2015 at 5:44 PM, ilya musayev <
> > ilya.mailing.lists@gmail.com>
> > > wrote:
> > >
> > >> I'm looking into a way of making ResetVM button disabled in some
> > >> cloudstack environments. Ideally, i'd want it per zone, but its can be
> > also
> > >> Global Setting.
> > >>
> > >> I don't want to disable the API ResetVM, just the UI button.
> > >>
> > >> Would you know of a feature/button in cloudstack UI that follows a
> > similar
> > >> pattern and can be  used as a point of reference?
> > >>
> > >> Thanks
> > >> ilya
> >
>



-- 

Andrija Panić

Re: Disable a UI button via global setting - how to implement?

Posted by Pierre-Luc Dion <pd...@cloudops.com>.
I think Ilya want to implement the disable Reset VM button,   SAML button
can be disable thru GlobalSettings:  saml2.enabled





On Fri, Mar 6, 2015 at 8:39 AM, Nux! <nu...@li.nux.ro> wrote:

> Pierre-Luc,
>
> Out of curiosity, which is the setting that disables "Reset VM"?
>
> Lucian
>
> --
> Sent from the Delta quadrant using Borg technology!
>
> Nux!
> www.nux.ro
>
> ----- Original Message -----
> > From: "Pierre-Luc Dion" <pd...@cloudops.com>
> > To: dev@cloudstack.apache.org
> > Sent: Friday, 6 March, 2015 13:29:28
> > Subject: Re: Disable a UI button via global setting - how to implement?
>
> > You can refer to Rohit's SAML feature, their is a button on the logon
> page
> > in acs4.5, it can be disabled thru GlobalSettings.
> >
> >
> >
> >
> >
> > On Thu, Mar 5, 2015 at 5:44 PM, ilya musayev <
> ilya.mailing.lists@gmail.com>
> > wrote:
> >
> >> I'm looking into a way of making ResetVM button disabled in some
> >> cloudstack environments. Ideally, i'd want it per zone, but its can be
> also
> >> Global Setting.
> >>
> >> I don't want to disable the API ResetVM, just the UI button.
> >>
> >> Would you know of a feature/button in cloudstack UI that follows a
> similar
> >> pattern and can be  used as a point of reference?
> >>
> >> Thanks
> >> ilya
>

Re: Disable a UI button via global setting - how to implement?

Posted by Nux! <nu...@li.nux.ro>.
Pierre-Luc,

Out of curiosity, which is the setting that disables "Reset VM"?

Lucian

--
Sent from the Delta quadrant using Borg technology!

Nux!
www.nux.ro

----- Original Message -----
> From: "Pierre-Luc Dion" <pd...@cloudops.com>
> To: dev@cloudstack.apache.org
> Sent: Friday, 6 March, 2015 13:29:28
> Subject: Re: Disable a UI button via global setting - how to implement?

> You can refer to Rohit's SAML feature, their is a button on the logon page
> in acs4.5, it can be disabled thru GlobalSettings.
> 
> 
> 
> 
> 
> On Thu, Mar 5, 2015 at 5:44 PM, ilya musayev <il...@gmail.com>
> wrote:
> 
>> I'm looking into a way of making ResetVM button disabled in some
>> cloudstack environments. Ideally, i'd want it per zone, but its can be also
>> Global Setting.
>>
>> I don't want to disable the API ResetVM, just the UI button.
>>
>> Would you know of a feature/button in cloudstack UI that follows a similar
>> pattern and can be  used as a point of reference?
>>
>> Thanks
>> ilya

Re: Disable a UI button via global setting - how to implement?

Posted by Pierre-Luc Dion <pd...@cloudops.com>.
You can refer to Rohit's SAML feature, their is a button on the logon page
in acs4.5, it can be disabled thru GlobalSettings.





On Thu, Mar 5, 2015 at 5:44 PM, ilya musayev <il...@gmail.com>
wrote:

> I'm looking into a way of making ResetVM button disabled in some
> cloudstack environments. Ideally, i'd want it per zone, but its can be also
> Global Setting.
>
> I don't want to disable the API ResetVM, just the UI button.
>
> Would you know of a feature/button in cloudstack UI that follows a similar
> pattern and can be  used as a point of reference?
>
> Thanks
> ilya
>