How to hide the action button on the web, confd

hi, in the web UI, there is a action button. Once clicked, it will trigger some actions. However, in the UI, we would like to display or hide the button from the users, depending on the configuration/operating status. How do I do that?

our yang model:

container enodebMgr
{
    leaf runningMode
    {
        type enodebRunningMode;
        default Manual;
    }


    leaf isEnodebActive
    {
        config false;
        tailf:info "enodeb process is active";
        type boolean;
        default false;
    }

    tailf:action start 
    {
        tailf:actionpoint enodeb-start-point;
        input 
        {
        }
        output 
        {
            leaf response 
            {
                type string;
            }
        }
    }   
    
} 

for example, if runningMode is manual, we want to display action. If it is auto, we want to hide/disable action. thank you

Hi,
You can for example use a YANG “when” statement, the tailf:hidden yang extension, or a ConfD NACM rule depending on your use case.

hi cohult,

thank you for your reply. I tried the “when” statement. however, when cannot be used inside the action. I have to put the action inside a container first, and use the “when” on the container. However, this is not what I want as it will force the user to click on the container, then can see the action button.

As for the NACM rule, I do not know enough about it. please point me to more detail about that.

For my user case, I want the same behavior for all users/groups. The “start” button will appear when the system mode is in manual, and disappear/disabled once the user click on the “start” button (meaning started already, cannot be clicked again) or if the user change the system mode to auto mode.

thank you

From what I understand, you likely want to use a tailf:hidden statement on your “tailf:action start” node. A tailf:set-hook can be used to hide and unhide the action. See UG for details on hidden and set-hook statements.
Then of course, your javascript code for your button can check the values you want to determine if the button should be displayed/disabled.

thank you… will check