[luci] 回复:Re: how to control the property of buttons in a map?

Seamus Tuohy s2e at opentechinstitute.org
Fri Mar 7 16:07:06 CET 2014


Just one quick clarification on this. The "affects" list is actually a
list of other sections in the ucitrack that should be called. This means
that "list affects dhcp" will actually run the "option init" in the
"config dhcp" section, not the "/etc/init.d/dhcp" init script.

If you want to really understand this look at the following files:

apply_xhr.htm #The javascript caller that starts the apply function
servicectl.lua #The controller for apply/reload  functions
(action_restart() is the function in question for apply)
uci.lua #The Cursor.apply() and Cursor._affected() functions will show
you how init scripts are chosen to be run by servicectl
ucitrack # already covered
luci-reload #The init script that actually runs the various init scripts
functions.sh #The uci script helper, its just useful for understanding
luci-reload

s2e

On 03/06/2014 05:15 AM, Le Tran Dat wrote:
> you can check the /etc/config/ucitrack to know which application will
> be executed.
> 
> for example:
> config network
>         option init network #init file will be restarted /ect/init.d/network
>         list affects dhcp #other applications: /etc/init.d/dhcp
>         list affects radvd #other applications: /etc/init.d/radvd
> 
> so you can open the script and find file file called the wifi up
> 
> but I guess the /etc/init.d/network will call the wifi up.
> 
> in some cases, an application might put network into its affects list.
> Then whenever you press save&apply on that application, after
> restarting itself, it will call network to be restarted.
> 
> 
> 
> On Thu, Mar 6, 2014 at 4:14 PM, 子文 <u8j9 at 163.com> wrote:
>> b
>> Hello
>>       I found luci will call wifi up command after pressing save & apply
>> button, So I want to find where the luci  call the wifi up
>>
>>
>>
>>
>>
>> At 2014-03-06 10:12:45,"Le Tran Dat" <trandatnh at gmail.com> wrote:
>>> hi u8j9,
>>>
>>>> How can I find what the save button do after pressing it?
>>> http://luci.subsignal.org/trac/wiki/Documentation/LuCI-0.10#Hooks
>>>
>>> On Thu, Mar 6, 2014 at 8:59 AM, u8j9 <u8j9 at 163.com> wrote:
>>>> How can I find what the save button do after pressing it?
>>>> Sent from Huawei Mobile
>>>>
>>>> Seamus Tuohy <s2e at opentechinstitute.org>编写:
>>>>
>>>>> Hello 刘岚,
>>>>>
>>>>> The buttons can be controlled through the "flow" property of a map. This
>>>>> value is not set in the model, but in the controller entry for that page.
>>>>>
>>>>> The options are:
>>>>> { skip, autoapply, hidesavebtn, hideresetbtn, hideapplybtn }
>>>>>
>>>>> skip: If true ADD the skip button.
>>>>> autoapply: if true (and hideapplybtn not true) HIDE submit button.
>>>>> hideapplybtn: if true (and autoapply not true) HIDE submit button.
>>>>> hidesavebtn: If true HIDE the save button
>>>>> hideresetbtn: if true HIDE the reset button.
>>>>>
>>>>>
>>>>> These options are set as bool values in a table. This table is passed as
>>>>> the second value of the cbi call.
>>>>>
>>>>> entry({"admin", "my_page"}, cbi("admin/my_page", {skip=true,
>>>>> autoapply=false}), translate("My Page"), 15)
>>>>>
>>>>>
>>>>> Hope that lets you do what you need to do.
>>>>>
>>>>> s2e
>>>>>
>>>>> On 03/05/2014 07:04 AM, 刘岚 wrote:
>>>>>> Dear all I want to change some property of buttons in a map(not a
>>>>>> simpleform).For example, I want to show the button "save & apply" and
>>>>>> hide the other two or only show one of them in a page.How can I do
>>>>>> this?thanks!
>>>>>>
>>>>>>
>>>>>>
>>>>>> _______________________________________________ luci mailing list
>>>>>> luci at lists.subsignal.org
>>>>>> https://lists.subsignal.org/mailman/listinfo/luci
>>>>>>
>>>>> _______________________________________________
>>>>> luci mailing list
>>>>> luci at lists.subsignal.org
>>>>> https://lists.subsignal.org/mailman/listinfo/luci
>>>> _______________________________________________
>>>> luci mailing list
>>>> luci at lists.subsignal.org
>>>> https://lists.subsignal.org/mailman/listinfo/luci
>>> _______________________________________________
>>> luci mailing list
>>> luci at lists.subsignal.org
>>> https://lists.subsignal.org/mailman/listinfo/luci
>>
>>
>>
>>
>> _______________________________________________
>> luci mailing list
>> luci at lists.subsignal.org
>> https://lists.subsignal.org/mailman/listinfo/luci
>>
> _______________________________________________
> luci mailing list
> luci at lists.subsignal.org
> https://lists.subsignal.org/mailman/listinfo/luci
> 


More information about the luci mailing list