docs: various updates
[project/luci.git] / docs / jsapi / uci.js.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <title>Source: uci.js</title>
6
7
8 <script src="scripts/prettify/prettify.js"></script>
9 <script src="scripts/prettify/lang-css.js"></script>
10 <script src="scripts/jquery.min.js"></script>
11 <!--[if lt IE 9]>
12 <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
13 <![endif]-->
14 <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
15 <link type="text/css" rel="stylesheet" href="styles/bootstrap.min.css">
16 <link type="text/css" rel="stylesheet" href="styles/jaguar.css">
17
18
19 <script>
20 var config = {"monospaceLinks":true,"cleverLinks":true,"default":{"outputSourceFiles":true}};
21 </script>
22
23
24
25 </head>
26 <body>
27 <div id="wrap" class="clearfix">
28
29 <div class="navigation">
30 <h3 class="applicationName"><a href="index.html"></a></h3>
31
32 <div class="search">
33 <input id="search" type="text" class="form-control input-sm" placeholder="Search Documentations">
34 </div>
35 <ul class="list">
36
37 <li class="item" data-name="LuCI">
38 <span class="title">
39 <a href="LuCI.html">LuCI</a>
40
41 </span>
42 <ul class="members itemMembers">
43
44 <span class="subtitle">Members</span>
45
46 <li data-name="LuCI#env"><a href="LuCI.html#env">env</a></li>
47
48 </ul>
49 <ul class="typedefs itemMembers">
50
51 <span class="subtitle">Typedefs</span>
52
53 <li data-name="LuCI.requestCallbackFn"><a href="LuCI.html#.requestCallbackFn">requestCallbackFn</a></li>
54
55 </ul>
56 <ul class="typedefs itemMembers">
57
58 </ul>
59 <ul class="methods itemMembers">
60
61 <span class="subtitle">Methods</span>
62
63 <li data-name="LuCI#bind"><a href="LuCI.html#bind">bind</a></li>
64
65 <li data-name="LuCI#error"><a href="LuCI.html#error">error</a></li>
66
67 <li data-name="LuCI#get"><a href="LuCI.html#get">get</a></li>
68
69 <li data-name="LuCI#halt"><a href="LuCI.html#halt">halt</a></li>
70
71 <li data-name="LuCI#hasSystemFeature"><a href="LuCI.html#hasSystemFeature">hasSystemFeature</a></li>
72
73 <li data-name="LuCI#isObject"><a href="LuCI.html#isObject">isObject</a></li>
74
75 <li data-name="LuCI#location"><a href="LuCI.html#location">location</a></li>
76
77 <li data-name="LuCI#path"><a href="LuCI.html#path">path</a></li>
78
79 <li data-name="LuCI#poll"><a href="LuCI.html#poll">poll</a></li>
80
81 <li data-name="LuCI#post"><a href="LuCI.html#post">post</a></li>
82
83 <li data-name="LuCI#raise"><a href="LuCI.html#raise">raise</a></li>
84
85 <li data-name="LuCI#require"><a href="LuCI.html#require">require</a></li>
86
87 <li data-name="LuCI#resolveDefault"><a href="LuCI.html#resolveDefault">resolveDefault</a></li>
88
89 <li data-name="LuCI#resource"><a href="LuCI.html#resource">resource</a></li>
90
91 <li data-name="LuCI#run"><a href="LuCI.html#run">run</a></li>
92
93 <li data-name="LuCI#sortedKeys"><a href="LuCI.html#sortedKeys">sortedKeys</a></li>
94
95 <li data-name="LuCI#stop"><a href="LuCI.html#stop">stop</a></li>
96
97 <li data-name="LuCI#toArray"><a href="LuCI.html#toArray">toArray</a></li>
98
99 <li data-name="LuCI#url"><a href="LuCI.html#url">url</a></li>
100
101 </ul>
102 <ul class="events itemMembers">
103
104 </ul>
105 </li>
106
107 <li class="item" data-name="LuCI.Class">
108 <span class="title">
109 <a href="LuCI.Class.html">LuCI.Class</a>
110
111 </span>
112 <ul class="members itemMembers">
113
114 </ul>
115 <ul class="typedefs itemMembers">
116
117 </ul>
118 <ul class="typedefs itemMembers">
119
120 </ul>
121 <ul class="methods itemMembers">
122
123 <span class="subtitle">Methods</span>
124
125 <li data-name="LuCI.Class.extend"><a href="LuCI.Class.html#.extend">extend</a></li>
126
127 <li data-name="LuCI.Class.instantiate"><a href="LuCI.Class.html#.instantiate">instantiate</a></li>
128
129 <li data-name="LuCI.Class.isSubclass"><a href="LuCI.Class.html#.isSubclass">isSubclass</a></li>
130
131 <li data-name="LuCI.Class.singleton"><a href="LuCI.Class.html#.singleton">singleton</a></li>
132
133 <li data-name="LuCI.Class#super"><a href="LuCI.Class.html#super">super</a></li>
134
135 <li data-name="LuCI.Class#varargs"><a href="LuCI.Class.html#varargs">varargs</a></li>
136
137 </ul>
138 <ul class="events itemMembers">
139
140 </ul>
141 </li>
142
143 <li class="item" data-name="LuCI.dom">
144 <span class="title">
145 <a href="LuCI.dom.html">LuCI.dom</a>
146
147 </span>
148 <ul class="members itemMembers">
149
150 </ul>
151 <ul class="typedefs itemMembers">
152
153 <span class="subtitle">Typedefs</span>
154
155 <li data-name="LuCI.dom~ignoreCallbackFn"><a href="LuCI.dom.html#~ignoreCallbackFn">ignoreCallbackFn</a></li>
156
157 </ul>
158 <ul class="typedefs itemMembers">
159
160 </ul>
161 <ul class="methods itemMembers">
162
163 <span class="subtitle">Methods</span>
164
165 <li data-name="LuCI.dom#append"><a href="LuCI.dom.html#append">append</a></li>
166
167 <li data-name="LuCI.dom#attr"><a href="LuCI.dom.html#attr">attr</a></li>
168
169 <li data-name="LuCI.dom#bindClassInstance"><a href="LuCI.dom.html#bindClassInstance">bindClassInstance</a></li>
170
171 <li data-name="LuCI.dom#callClassMethod"><a href="LuCI.dom.html#callClassMethod">callClassMethod</a></li>
172
173 <li data-name="LuCI.dom#content"><a href="LuCI.dom.html#content">content</a></li>
174
175 <li data-name="LuCI.dom#create"><a href="LuCI.dom.html#create">create</a></li>
176
177 <li data-name="LuCI.dom#data"><a href="LuCI.dom.html#data">data</a></li>
178
179 <li data-name="LuCI.dom#elem"><a href="LuCI.dom.html#elem">elem</a></li>
180
181 <li data-name="LuCI.dom#findClassInstance"><a href="LuCI.dom.html#findClassInstance">findClassInstance</a></li>
182
183 <li data-name="LuCI.dom#isEmpty"><a href="LuCI.dom.html#isEmpty">isEmpty</a></li>
184
185 <li data-name="LuCI.dom#matches"><a href="LuCI.dom.html#matches">matches</a></li>
186
187 <li data-name="LuCI.dom#parent"><a href="LuCI.dom.html#parent">parent</a></li>
188
189 <li data-name="LuCI.dom#parse"><a href="LuCI.dom.html#parse">parse</a></li>
190
191 </ul>
192 <ul class="events itemMembers">
193
194 </ul>
195 </li>
196
197 <li class="item" data-name="LuCI.fs">
198 <span class="title">
199 <a href="LuCI.fs.html">LuCI.fs</a>
200
201 </span>
202 <ul class="members itemMembers">
203
204 </ul>
205 <ul class="typedefs itemMembers">
206
207 <span class="subtitle">Typedefs</span>
208
209 <li data-name="LuCI.fs.FileExecResult"><a href="LuCI.fs.html#.FileExecResult">FileExecResult</a></li>
210
211 <li data-name="LuCI.fs.FileStatEntry"><a href="LuCI.fs.html#.FileStatEntry">FileStatEntry</a></li>
212
213 </ul>
214 <ul class="typedefs itemMembers">
215
216 </ul>
217 <ul class="methods itemMembers">
218
219 <span class="subtitle">Methods</span>
220
221 <li data-name="LuCI.fs#exec"><a href="LuCI.fs.html#exec">exec</a></li>
222
223 <li data-name="LuCI.fs#lines"><a href="LuCI.fs.html#lines">lines</a></li>
224
225 <li data-name="LuCI.fs#list"><a href="LuCI.fs.html#list">list</a></li>
226
227 <li data-name="LuCI.fs#read"><a href="LuCI.fs.html#read">read</a></li>
228
229 <li data-name="LuCI.fs#remove"><a href="LuCI.fs.html#remove">remove</a></li>
230
231 <li data-name="LuCI.fs#stat"><a href="LuCI.fs.html#stat">stat</a></li>
232
233 <li data-name="LuCI.fs#trimmed"><a href="LuCI.fs.html#trimmed">trimmed</a></li>
234
235 <li data-name="LuCI.fs#write"><a href="LuCI.fs.html#write">write</a></li>
236
237 </ul>
238 <ul class="events itemMembers">
239
240 </ul>
241 </li>
242
243 <li class="item" data-name="LuCI.Headers">
244 <span class="title">
245 <a href="LuCI.Headers.html">LuCI.Headers</a>
246
247 </span>
248 <ul class="members itemMembers">
249
250 </ul>
251 <ul class="typedefs itemMembers">
252
253 </ul>
254 <ul class="typedefs itemMembers">
255
256 </ul>
257 <ul class="methods itemMembers">
258
259 <span class="subtitle">Methods</span>
260
261 <li data-name="LuCI.Headers#get"><a href="LuCI.Headers.html#get">get</a></li>
262
263 <li data-name="LuCI.Headers#has"><a href="LuCI.Headers.html#has">has</a></li>
264
265 </ul>
266 <ul class="events itemMembers">
267
268 </ul>
269 </li>
270
271 <li class="item" data-name="LuCI.Network">
272 <span class="title">
273 <a href="LuCI.Network.html">LuCI.Network</a>
274
275 </span>
276 <ul class="members itemMembers">
277
278 </ul>
279 <ul class="typedefs itemMembers">
280
281 <span class="subtitle">Typedefs</span>
282
283 <li data-name="LuCI.Network.SwitchTopology"><a href="LuCI.Network.html#.SwitchTopology">SwitchTopology</a></li>
284
285 <li data-name="LuCI.Network.WifiEncryption"><a href="LuCI.Network.html#.WifiEncryption">WifiEncryption</a></li>
286
287 <li data-name="LuCI.Network.WifiPeerEntry"><a href="LuCI.Network.html#.WifiPeerEntry">WifiPeerEntry</a></li>
288
289 <li data-name="LuCI.Network.WifiRateEntry"><a href="LuCI.Network.html#.WifiRateEntry">WifiRateEntry</a></li>
290
291 <li data-name="LuCI.Network.WifiScanResult"><a href="LuCI.Network.html#.WifiScanResult">WifiScanResult</a></li>
292
293 </ul>
294 <ul class="typedefs itemMembers">
295
296 </ul>
297 <ul class="methods itemMembers">
298
299 <span class="subtitle">Methods</span>
300
301 <li data-name="LuCI.Network#addNetwork"><a href="LuCI.Network.html#addNetwork">addNetwork</a></li>
302
303 <li data-name="LuCI.Network#addWifiNetwork"><a href="LuCI.Network.html#addWifiNetwork">addWifiNetwork</a></li>
304
305 <li data-name="LuCI.Network#deleteNetwork"><a href="LuCI.Network.html#deleteNetwork">deleteNetwork</a></li>
306
307 <li data-name="LuCI.Network#deleteWifiNetwork"><a href="LuCI.Network.html#deleteWifiNetwork">deleteWifiNetwork</a></li>
308
309 <li data-name="LuCI.Network#flushCache"><a href="LuCI.Network.html#flushCache">flushCache</a></li>
310
311 <li data-name="LuCI.Network#formatWifiEncryption"><a href="LuCI.Network.html#formatWifiEncryption">formatWifiEncryption</a></li>
312
313 <li data-name="LuCI.Network#getDevice"><a href="LuCI.Network.html#getDevice">getDevice</a></li>
314
315 <li data-name="LuCI.Network#getDevices"><a href="LuCI.Network.html#getDevices">getDevices</a></li>
316
317 <li data-name="LuCI.Network#getDSLModemType"><a href="LuCI.Network.html#getDSLModemType">getDSLModemType</a></li>
318
319 <li data-name="LuCI.Network#getHostHints"><a href="LuCI.Network.html#getHostHints">getHostHints</a></li>
320
321 <li data-name="LuCI.Network#getIfnameOf"><a href="LuCI.Network.html#getIfnameOf">getIfnameOf</a></li>
322
323 <li data-name="LuCI.Network#getNetwork"><a href="LuCI.Network.html#getNetwork">getNetwork</a></li>
324
325 <li data-name="LuCI.Network#getNetworks"><a href="LuCI.Network.html#getNetworks">getNetworks</a></li>
326
327 <li data-name="LuCI.Network#getProtocol"><a href="LuCI.Network.html#getProtocol">getProtocol</a></li>
328
329 <li data-name="LuCI.Network#getProtocols"><a href="LuCI.Network.html#getProtocols">getProtocols</a></li>
330
331 <li data-name="LuCI.Network#getSwitchTopologies"><a href="LuCI.Network.html#getSwitchTopologies">getSwitchTopologies</a></li>
332
333 <li data-name="LuCI.Network#getWAN6Networks"><a href="LuCI.Network.html#getWAN6Networks">getWAN6Networks</a></li>
334
335 <li data-name="LuCI.Network#getWANNetworks"><a href="LuCI.Network.html#getWANNetworks">getWANNetworks</a></li>
336
337 <li data-name="LuCI.Network#getWifiDevice"><a href="LuCI.Network.html#getWifiDevice">getWifiDevice</a></li>
338
339 <li data-name="LuCI.Network#getWifiDevices"><a href="LuCI.Network.html#getWifiDevices">getWifiDevices</a></li>
340
341 <li data-name="LuCI.Network#getWifiNetwork"><a href="LuCI.Network.html#getWifiNetwork">getWifiNetwork</a></li>
342
343 <li data-name="LuCI.Network#getWifiNetworks"><a href="LuCI.Network.html#getWifiNetworks">getWifiNetworks</a></li>
344
345 <li data-name="LuCI.Network#isIgnoredDevice"><a href="LuCI.Network.html#isIgnoredDevice">isIgnoredDevice</a></li>
346
347 <li data-name="LuCI.Network#maskToPrefix"><a href="LuCI.Network.html#maskToPrefix">maskToPrefix</a></li>
348
349 <li data-name="LuCI.Network#prefixToMask"><a href="LuCI.Network.html#prefixToMask">prefixToMask</a></li>
350
351 <li data-name="LuCI.Network#registerErrorCode"><a href="LuCI.Network.html#registerErrorCode">registerErrorCode</a></li>
352
353 <li data-name="LuCI.Network#registerPatternVirtual"><a href="LuCI.Network.html#registerPatternVirtual">registerPatternVirtual</a></li>
354
355 <li data-name="LuCI.Network#registerProtocol"><a href="LuCI.Network.html#registerProtocol">registerProtocol</a></li>
356
357 <li data-name="LuCI.Network#renameNetwork"><a href="LuCI.Network.html#renameNetwork">renameNetwork</a></li>
358
359 </ul>
360 <ul class="events itemMembers">
361
362 </ul>
363 </li>
364
365 <li class="item" data-name="LuCI.Network.Device">
366 <span class="title">
367 <a href="LuCI.Network.Device.html">LuCI.Network.Device</a>
368
369 </span>
370 <ul class="members itemMembers">
371
372 </ul>
373 <ul class="typedefs itemMembers">
374
375 </ul>
376 <ul class="typedefs itemMembers">
377
378 </ul>
379 <ul class="methods itemMembers">
380
381 <span class="subtitle">Methods</span>
382
383 <li data-name="LuCI.Network.Device#getBridgeID"><a href="LuCI.Network.Device.html#getBridgeID">getBridgeID</a></li>
384
385 <li data-name="LuCI.Network.Device#getBridgeSTP"><a href="LuCI.Network.Device.html#getBridgeSTP">getBridgeSTP</a></li>
386
387 <li data-name="LuCI.Network.Device#getI18n"><a href="LuCI.Network.Device.html#getI18n">getI18n</a></li>
388
389 <li data-name="LuCI.Network.Device#getIP6Addrs"><a href="LuCI.Network.Device.html#getIP6Addrs">getIP6Addrs</a></li>
390
391 <li data-name="LuCI.Network.Device#getIPAddrs"><a href="LuCI.Network.Device.html#getIPAddrs">getIPAddrs</a></li>
392
393 <li data-name="LuCI.Network.Device#getMAC"><a href="LuCI.Network.Device.html#getMAC">getMAC</a></li>
394
395 <li data-name="LuCI.Network.Device#getMTU"><a href="LuCI.Network.Device.html#getMTU">getMTU</a></li>
396
397 <li data-name="LuCI.Network.Device#getName"><a href="LuCI.Network.Device.html#getName">getName</a></li>
398
399 <li data-name="LuCI.Network.Device#getNetwork"><a href="LuCI.Network.Device.html#getNetwork">getNetwork</a></li>
400
401 <li data-name="LuCI.Network.Device#getNetworks"><a href="LuCI.Network.Device.html#getNetworks">getNetworks</a></li>
402
403 <li data-name="LuCI.Network.Device#getPorts"><a href="LuCI.Network.Device.html#getPorts">getPorts</a></li>
404
405 <li data-name="LuCI.Network.Device#getRXBytes"><a href="LuCI.Network.Device.html#getRXBytes">getRXBytes</a></li>
406
407 <li data-name="LuCI.Network.Device#getRXPackets"><a href="LuCI.Network.Device.html#getRXPackets">getRXPackets</a></li>
408
409 <li data-name="LuCI.Network.Device#getShortName"><a href="LuCI.Network.Device.html#getShortName">getShortName</a></li>
410
411 <li data-name="LuCI.Network.Device#getTXBytes"><a href="LuCI.Network.Device.html#getTXBytes">getTXBytes</a></li>
412
413 <li data-name="LuCI.Network.Device#getTXPackets"><a href="LuCI.Network.Device.html#getTXPackets">getTXPackets</a></li>
414
415 <li data-name="LuCI.Network.Device#getType"><a href="LuCI.Network.Device.html#getType">getType</a></li>
416
417 <li data-name="LuCI.Network.Device#getTypeI18n"><a href="LuCI.Network.Device.html#getTypeI18n">getTypeI18n</a></li>
418
419 <li data-name="LuCI.Network.Device#getWifiNetwork"><a href="LuCI.Network.Device.html#getWifiNetwork">getWifiNetwork</a></li>
420
421 <li data-name="LuCI.Network.Device#isBridge"><a href="LuCI.Network.Device.html#isBridge">isBridge</a></li>
422
423 <li data-name="LuCI.Network.Device#isBridgePort"><a href="LuCI.Network.Device.html#isBridgePort">isBridgePort</a></li>
424
425 <li data-name="LuCI.Network.Device#isUp"><a href="LuCI.Network.Device.html#isUp">isUp</a></li>
426
427 </ul>
428 <ul class="events itemMembers">
429
430 </ul>
431 </li>
432
433 <li class="item" data-name="LuCI.Network.Hosts">
434 <span class="title">
435 <a href="LuCI.Network.Hosts.html">LuCI.Network.Hosts</a>
436
437 </span>
438 <ul class="members itemMembers">
439
440 </ul>
441 <ul class="typedefs itemMembers">
442
443 </ul>
444 <ul class="typedefs itemMembers">
445
446 </ul>
447 <ul class="methods itemMembers">
448
449 <span class="subtitle">Methods</span>
450
451 <li data-name="LuCI.Network.Hosts#getHostnameByIP6Addr"><a href="LuCI.Network.Hosts.html#getHostnameByIP6Addr">getHostnameByIP6Addr</a></li>
452
453 <li data-name="LuCI.Network.Hosts#getHostnameByIPAddr"><a href="LuCI.Network.Hosts.html#getHostnameByIPAddr">getHostnameByIPAddr</a></li>
454
455 <li data-name="LuCI.Network.Hosts#getHostnameByMACAddr"><a href="LuCI.Network.Hosts.html#getHostnameByMACAddr">getHostnameByMACAddr</a></li>
456
457 <li data-name="LuCI.Network.Hosts#getIP6AddrByMACAddr"><a href="LuCI.Network.Hosts.html#getIP6AddrByMACAddr">getIP6AddrByMACAddr</a></li>
458
459 <li data-name="LuCI.Network.Hosts#getIPAddrByMACAddr"><a href="LuCI.Network.Hosts.html#getIPAddrByMACAddr">getIPAddrByMACAddr</a></li>
460
461 <li data-name="LuCI.Network.Hosts#getMACAddrByIP6Addr"><a href="LuCI.Network.Hosts.html#getMACAddrByIP6Addr">getMACAddrByIP6Addr</a></li>
462
463 <li data-name="LuCI.Network.Hosts#getMACAddrByIPAddr"><a href="LuCI.Network.Hosts.html#getMACAddrByIPAddr">getMACAddrByIPAddr</a></li>
464
465 <li data-name="LuCI.Network.Hosts#getMACHints"><a href="LuCI.Network.Hosts.html#getMACHints">getMACHints</a></li>
466
467 </ul>
468 <ul class="events itemMembers">
469
470 </ul>
471 </li>
472
473 <li class="item" data-name="LuCI.Network.Protocol">
474 <span class="title">
475 <a href="LuCI.Network.Protocol.html">LuCI.Network.Protocol</a>
476
477 </span>
478 <ul class="members itemMembers">
479
480 </ul>
481 <ul class="typedefs itemMembers">
482
483 </ul>
484 <ul class="typedefs itemMembers">
485
486 </ul>
487 <ul class="methods itemMembers">
488
489 <span class="subtitle">Methods</span>
490
491 <li data-name="LuCI.Network.Protocol#addDevice"><a href="LuCI.Network.Protocol.html#addDevice">addDevice</a></li>
492
493 <li data-name="LuCI.Network.Protocol#containsDevice"><a href="LuCI.Network.Protocol.html#containsDevice">containsDevice</a></li>
494
495 <li data-name="LuCI.Network.Protocol#deleteDevice"><a href="LuCI.Network.Protocol.html#deleteDevice">deleteDevice</a></li>
496
497 <li data-name="LuCI.Network.Protocol#get"><a href="LuCI.Network.Protocol.html#get">get</a></li>
498
499 <li data-name="LuCI.Network.Protocol#getDevice"><a href="LuCI.Network.Protocol.html#getDevice">getDevice</a></li>
500
501 <li data-name="LuCI.Network.Protocol#getDevices"><a href="LuCI.Network.Protocol.html#getDevices">getDevices</a></li>
502
503 <li data-name="LuCI.Network.Protocol#getDNS6Addrs"><a href="LuCI.Network.Protocol.html#getDNS6Addrs">getDNS6Addrs</a></li>
504
505 <li data-name="LuCI.Network.Protocol#getDNSAddrs"><a href="LuCI.Network.Protocol.html#getDNSAddrs">getDNSAddrs</a></li>
506
507 <li data-name="LuCI.Network.Protocol#getErrors"><a href="LuCI.Network.Protocol.html#getErrors">getErrors</a></li>
508
509 <li data-name="LuCI.Network.Protocol#getExpiry"><a href="LuCI.Network.Protocol.html#getExpiry">getExpiry</a></li>
510
511 <li data-name="LuCI.Network.Protocol#getGateway6Addr"><a href="LuCI.Network.Protocol.html#getGateway6Addr">getGateway6Addr</a></li>
512
513 <li data-name="LuCI.Network.Protocol#getGatewayAddr"><a href="LuCI.Network.Protocol.html#getGatewayAddr">getGatewayAddr</a></li>
514
515 <li data-name="LuCI.Network.Protocol#getI18n"><a href="LuCI.Network.Protocol.html#getI18n">getI18n</a></li>
516
517 <li data-name="LuCI.Network.Protocol#getIfname"><a href="LuCI.Network.Protocol.html#getIfname">getIfname</a></li>
518
519 <li data-name="LuCI.Network.Protocol#getIP6Addr"><a href="LuCI.Network.Protocol.html#getIP6Addr">getIP6Addr</a></li>
520
521 <li data-name="LuCI.Network.Protocol#getIP6Addrs"><a href="LuCI.Network.Protocol.html#getIP6Addrs">getIP6Addrs</a></li>
522
523 <li data-name="LuCI.Network.Protocol#getIP6Prefix"><a href="LuCI.Network.Protocol.html#getIP6Prefix">getIP6Prefix</a></li>
524
525 <li data-name="LuCI.Network.Protocol#getIPAddr"><a href="LuCI.Network.Protocol.html#getIPAddr">getIPAddr</a></li>
526
527 <li data-name="LuCI.Network.Protocol#getIPAddrs"><a href="LuCI.Network.Protocol.html#getIPAddrs">getIPAddrs</a></li>
528
529 <li data-name="LuCI.Network.Protocol#getL2Device"><a href="LuCI.Network.Protocol.html#getL2Device">getL2Device</a></li>
530
531 <li data-name="LuCI.Network.Protocol#getL3Device"><a href="LuCI.Network.Protocol.html#getL3Device">getL3Device</a></li>
532
533 <li data-name="LuCI.Network.Protocol#getMetric"><a href="LuCI.Network.Protocol.html#getMetric">getMetric</a></li>
534
535 <li data-name="LuCI.Network.Protocol#getName"><a href="LuCI.Network.Protocol.html#getName">getName</a></li>
536
537 <li data-name="LuCI.Network.Protocol#getNetmask"><a href="LuCI.Network.Protocol.html#getNetmask">getNetmask</a></li>
538
539 <li data-name="LuCI.Network.Protocol#getOpkgPackage"><a href="LuCI.Network.Protocol.html#getOpkgPackage">getOpkgPackage</a></li>
540
541 <li data-name="LuCI.Network.Protocol#getProtocol"><a href="LuCI.Network.Protocol.html#getProtocol">getProtocol</a></li>
542
543 <li data-name="LuCI.Network.Protocol#getType"><a href="LuCI.Network.Protocol.html#getType">getType</a></li>
544
545 <li data-name="LuCI.Network.Protocol#getUptime"><a href="LuCI.Network.Protocol.html#getUptime">getUptime</a></li>
546
547 <li data-name="LuCI.Network.Protocol#getZoneName"><a href="LuCI.Network.Protocol.html#getZoneName">getZoneName</a></li>
548
549 <li data-name="LuCI.Network.Protocol#isAlias"><a href="LuCI.Network.Protocol.html#isAlias">isAlias</a></li>
550
551 <li data-name="LuCI.Network.Protocol#isBridge"><a href="LuCI.Network.Protocol.html#isBridge">isBridge</a></li>
552
553 <li data-name="LuCI.Network.Protocol#isDynamic"><a href="LuCI.Network.Protocol.html#isDynamic">isDynamic</a></li>
554
555 <li data-name="LuCI.Network.Protocol#isEmpty"><a href="LuCI.Network.Protocol.html#isEmpty">isEmpty</a></li>
556
557 <li data-name="LuCI.Network.Protocol#isFloating"><a href="LuCI.Network.Protocol.html#isFloating">isFloating</a></li>
558
559 <li data-name="LuCI.Network.Protocol#isInstalled"><a href="LuCI.Network.Protocol.html#isInstalled">isInstalled</a></li>
560
561 <li data-name="LuCI.Network.Protocol#isUp"><a href="LuCI.Network.Protocol.html#isUp">isUp</a></li>
562
563 <li data-name="LuCI.Network.Protocol#isVirtual"><a href="LuCI.Network.Protocol.html#isVirtual">isVirtual</a></li>
564
565 <li data-name="LuCI.Network.Protocol#set"><a href="LuCI.Network.Protocol.html#set">set</a></li>
566
567 </ul>
568 <ul class="events itemMembers">
569
570 </ul>
571 </li>
572
573 <li class="item" data-name="LuCI.Network.WifiDevice">
574 <span class="title">
575 <a href="LuCI.Network.WifiDevice.html">LuCI.Network.WifiDevice</a>
576
577 </span>
578 <ul class="members itemMembers">
579
580 </ul>
581 <ul class="typedefs itemMembers">
582
583 </ul>
584 <ul class="typedefs itemMembers">
585
586 </ul>
587 <ul class="methods itemMembers">
588
589 <span class="subtitle">Methods</span>
590
591 <li data-name="LuCI.Network.WifiDevice#addWifiNetwork"><a href="LuCI.Network.WifiDevice.html#addWifiNetwork">addWifiNetwork</a></li>
592
593 <li data-name="LuCI.Network.WifiDevice#deleteWifiNetwork"><a href="LuCI.Network.WifiDevice.html#deleteWifiNetwork">deleteWifiNetwork</a></li>
594
595 <li data-name="LuCI.Network.WifiDevice#get"><a href="LuCI.Network.WifiDevice.html#get">get</a></li>
596
597 <li data-name="LuCI.Network.WifiDevice#getHTModes"><a href="LuCI.Network.WifiDevice.html#getHTModes">getHTModes</a></li>
598
599 <li data-name="LuCI.Network.WifiDevice#getHWModes"><a href="LuCI.Network.WifiDevice.html#getHWModes">getHWModes</a></li>
600
601 <li data-name="LuCI.Network.WifiDevice#getI18n"><a href="LuCI.Network.WifiDevice.html#getI18n">getI18n</a></li>
602
603 <li data-name="LuCI.Network.WifiDevice#getName"><a href="LuCI.Network.WifiDevice.html#getName">getName</a></li>
604
605 <li data-name="LuCI.Network.WifiDevice#getScanList"><a href="LuCI.Network.WifiDevice.html#getScanList">getScanList</a></li>
606
607 <li data-name="LuCI.Network.WifiDevice#getWifiNetwork"><a href="LuCI.Network.WifiDevice.html#getWifiNetwork">getWifiNetwork</a></li>
608
609 <li data-name="LuCI.Network.WifiDevice#getWifiNetworks"><a href="LuCI.Network.WifiDevice.html#getWifiNetworks">getWifiNetworks</a></li>
610
611 <li data-name="LuCI.Network.WifiDevice#isDisabled"><a href="LuCI.Network.WifiDevice.html#isDisabled">isDisabled</a></li>
612
613 <li data-name="LuCI.Network.WifiDevice#isUp"><a href="LuCI.Network.WifiDevice.html#isUp">isUp</a></li>
614
615 <li data-name="LuCI.Network.WifiDevice#set"><a href="LuCI.Network.WifiDevice.html#set">set</a></li>
616
617 </ul>
618 <ul class="events itemMembers">
619
620 </ul>
621 </li>
622
623 <li class="item" data-name="LuCI.Network.WifiNetwork">
624 <span class="title">
625 <a href="LuCI.Network.WifiNetwork.html">LuCI.Network.WifiNetwork</a>
626
627 </span>
628 <ul class="members itemMembers">
629
630 </ul>
631 <ul class="typedefs itemMembers">
632
633 </ul>
634 <ul class="typedefs itemMembers">
635
636 </ul>
637 <ul class="methods itemMembers">
638
639 <span class="subtitle">Methods</span>
640
641 <li data-name="LuCI.Network.WifiNetwork#disconnectClient"><a href="LuCI.Network.WifiNetwork.html#disconnectClient">disconnectClient</a></li>
642
643 <li data-name="LuCI.Network.WifiNetwork#get"><a href="LuCI.Network.WifiNetwork.html#get">get</a></li>
644
645 <li data-name="LuCI.Network.WifiNetwork#getActiveBSSID"><a href="LuCI.Network.WifiNetwork.html#getActiveBSSID">getActiveBSSID</a></li>
646
647 <li data-name="LuCI.Network.WifiNetwork#getActiveEncryption"><a href="LuCI.Network.WifiNetwork.html#getActiveEncryption">getActiveEncryption</a></li>
648
649 <li data-name="LuCI.Network.WifiNetwork#getActiveMode"><a href="LuCI.Network.WifiNetwork.html#getActiveMode">getActiveMode</a></li>
650
651 <li data-name="LuCI.Network.WifiNetwork#getActiveModeI18n"><a href="LuCI.Network.WifiNetwork.html#getActiveModeI18n">getActiveModeI18n</a></li>
652
653 <li data-name="LuCI.Network.WifiNetwork#getActiveSSID"><a href="LuCI.Network.WifiNetwork.html#getActiveSSID">getActiveSSID</a></li>
654
655 <li data-name="LuCI.Network.WifiNetwork#getAssocList"><a href="LuCI.Network.WifiNetwork.html#getAssocList">getAssocList</a></li>
656
657 <li data-name="LuCI.Network.WifiNetwork#getBitRate"><a href="LuCI.Network.WifiNetwork.html#getBitRate">getBitRate</a></li>
658
659 <li data-name="LuCI.Network.WifiNetwork#getBSSID"><a href="LuCI.Network.WifiNetwork.html#getBSSID">getBSSID</a></li>
660
661 <li data-name="LuCI.Network.WifiNetwork#getChannel"><a href="LuCI.Network.WifiNetwork.html#getChannel">getChannel</a></li>
662
663 <li data-name="LuCI.Network.WifiNetwork#getCountryCode"><a href="LuCI.Network.WifiNetwork.html#getCountryCode">getCountryCode</a></li>
664
665 <li data-name="LuCI.Network.WifiNetwork#getDevice"><a href="LuCI.Network.WifiNetwork.html#getDevice">getDevice</a></li>
666
667 <li data-name="LuCI.Network.WifiNetwork#getFrequency"><a href="LuCI.Network.WifiNetwork.html#getFrequency">getFrequency</a></li>
668
669 <li data-name="LuCI.Network.WifiNetwork#getI18n"><a href="LuCI.Network.WifiNetwork.html#getI18n">getI18n</a></li>
670
671 <li data-name="LuCI.Network.WifiNetwork#getID"><a href="LuCI.Network.WifiNetwork.html#getID">getID</a></li>
672
673 <li data-name="LuCI.Network.WifiNetwork#getIfname"><a href="LuCI.Network.WifiNetwork.html#getIfname">getIfname</a></li>
674
675 <li data-name="LuCI.Network.WifiNetwork#getMeshID"><a href="LuCI.Network.WifiNetwork.html#getMeshID">getMeshID</a></li>
676
677 <li data-name="LuCI.Network.WifiNetwork#getMode"><a href="LuCI.Network.WifiNetwork.html#getMode">getMode</a></li>
678
679 <li data-name="LuCI.Network.WifiNetwork#getName"><a href="LuCI.Network.WifiNetwork.html#getName">getName</a></li>
680
681 <li data-name="LuCI.Network.WifiNetwork#getNetwork"><a href="LuCI.Network.WifiNetwork.html#getNetwork">getNetwork</a></li>
682
683 <li data-name="LuCI.Network.WifiNetwork#getNetworkNames"><a href="LuCI.Network.WifiNetwork.html#getNetworkNames">getNetworkNames</a></li>
684
685 <li data-name="LuCI.Network.WifiNetwork#getNetworks"><a href="LuCI.Network.WifiNetwork.html#getNetworks">getNetworks</a></li>
686
687 <li data-name="LuCI.Network.WifiNetwork#getNoise"><a href="LuCI.Network.WifiNetwork.html#getNoise">getNoise</a></li>
688
689 <li data-name="LuCI.Network.WifiNetwork#getShortName"><a href="LuCI.Network.WifiNetwork.html#getShortName">getShortName</a></li>
690
691 <li data-name="LuCI.Network.WifiNetwork#getSignal"><a href="LuCI.Network.WifiNetwork.html#getSignal">getSignal</a></li>
692
693 <li data-name="LuCI.Network.WifiNetwork#getSignalLevel"><a href="LuCI.Network.WifiNetwork.html#getSignalLevel">getSignalLevel</a></li>
694
695 <li data-name="LuCI.Network.WifiNetwork#getSignalPercent"><a href="LuCI.Network.WifiNetwork.html#getSignalPercent">getSignalPercent</a></li>
696
697 <li data-name="LuCI.Network.WifiNetwork#getSSID"><a href="LuCI.Network.WifiNetwork.html#getSSID">getSSID</a></li>
698
699 <li data-name="LuCI.Network.WifiNetwork#getTXPower"><a href="LuCI.Network.WifiNetwork.html#getTXPower">getTXPower</a></li>
700
701 <li data-name="LuCI.Network.WifiNetwork#getTXPowerOffset"><a href="LuCI.Network.WifiNetwork.html#getTXPowerOffset">getTXPowerOffset</a></li>
702
703 <li data-name="LuCI.Network.WifiNetwork#getWifiDevice"><a href="LuCI.Network.WifiNetwork.html#getWifiDevice">getWifiDevice</a></li>
704
705 <li data-name="LuCI.Network.WifiNetwork#getWifiDeviceName"><a href="LuCI.Network.WifiNetwork.html#getWifiDeviceName">getWifiDeviceName</a></li>
706
707 <li data-name="LuCI.Network.WifiNetwork#isClientDisconnectSupported"><a href="LuCI.Network.WifiNetwork.html#isClientDisconnectSupported">isClientDisconnectSupported</a></li>
708
709 <li data-name="LuCI.Network.WifiNetwork#isDisabled"><a href="LuCI.Network.WifiNetwork.html#isDisabled">isDisabled</a></li>
710
711 <li data-name="LuCI.Network.WifiNetwork#isUp"><a href="LuCI.Network.WifiNetwork.html#isUp">isUp</a></li>
712
713 <li data-name="LuCI.Network.WifiNetwork#set"><a href="LuCI.Network.WifiNetwork.html#set">set</a></li>
714
715 </ul>
716 <ul class="events itemMembers">
717
718 </ul>
719 </li>
720
721 <li class="item" data-name="LuCI.Poll">
722 <span class="title">
723 <a href="LuCI.Poll.html">LuCI.Poll</a>
724
725 </span>
726 <ul class="members itemMembers">
727
728 </ul>
729 <ul class="typedefs itemMembers">
730
731 </ul>
732 <ul class="typedefs itemMembers">
733
734 </ul>
735 <ul class="methods itemMembers">
736
737 <span class="subtitle">Methods</span>
738
739 <li data-name="LuCI.Poll#active"><a href="LuCI.Poll.html#active">active</a></li>
740
741 <li data-name="LuCI.Poll#add"><a href="LuCI.Poll.html#add">add</a></li>
742
743 <li data-name="LuCI.Poll#remove"><a href="LuCI.Poll.html#remove">remove</a></li>
744
745 <li data-name="LuCI.Poll#start"><a href="LuCI.Poll.html#start">start</a></li>
746
747 <li data-name="LuCI.Poll#stop"><a href="LuCI.Poll.html#stop">stop</a></li>
748
749 </ul>
750 <ul class="events itemMembers">
751
752 </ul>
753 </li>
754
755 <li class="item" data-name="LuCI.Request">
756 <span class="title">
757 <a href="LuCI.Request.html">LuCI.Request</a>
758
759 </span>
760 <ul class="members itemMembers">
761
762 </ul>
763 <ul class="typedefs itemMembers">
764
765 <span class="subtitle">Typedefs</span>
766
767 <li data-name="LuCI.Request.interceptorFn"><a href="LuCI.Request.html#.interceptorFn">interceptorFn</a></li>
768
769 <li data-name="LuCI.Request.RequestOptions"><a href="LuCI.Request.html#.RequestOptions">RequestOptions</a></li>
770
771 </ul>
772 <ul class="typedefs itemMembers">
773
774 </ul>
775 <ul class="methods itemMembers">
776
777 <span class="subtitle">Methods</span>
778
779 <li data-name="LuCI.Request#addInterceptor"><a href="LuCI.Request.html#addInterceptor">addInterceptor</a></li>
780
781 <li data-name="LuCI.Request#expandURL"><a href="LuCI.Request.html#expandURL">expandURL</a></li>
782
783 <li data-name="LuCI.Request#get"><a href="LuCI.Request.html#get">get</a></li>
784
785 <li data-name="LuCI.Request#post"><a href="LuCI.Request.html#post">post</a></li>
786
787 <li data-name="LuCI.Request#removeInterceptor"><a href="LuCI.Request.html#removeInterceptor">removeInterceptor</a></li>
788
789 <li data-name="LuCI.Request#request"><a href="LuCI.Request.html#request">request</a></li>
790
791 </ul>
792 <ul class="events itemMembers">
793
794 </ul>
795 </li>
796
797 <li class="item" data-name="LuCI.Request.poll">
798 <span class="title">
799 <a href="LuCI.Request.poll.html">LuCI.Request.poll</a>
800
801 </span>
802 <ul class="members itemMembers">
803
804 </ul>
805 <ul class="typedefs itemMembers">
806
807 <span class="subtitle">Typedefs</span>
808
809 <li data-name="LuCI.Request.poll~callbackFn"><a href="LuCI.Request.poll.html#~callbackFn">callbackFn</a></li>
810
811 </ul>
812 <ul class="typedefs itemMembers">
813
814 </ul>
815 <ul class="methods itemMembers">
816
817 <span class="subtitle">Methods</span>
818
819 <li data-name="LuCI.Request.poll#active"><a href="LuCI.Request.poll.html#active">active</a></li>
820
821 <li data-name="LuCI.Request.poll#add"><a href="LuCI.Request.poll.html#add">add</a></li>
822
823 <li data-name="LuCI.Request.poll#remove"><a href="LuCI.Request.poll.html#remove">remove</a></li>
824
825 <li data-name="LuCI.Request.poll#start"><a href="LuCI.Request.poll.html#start">start</a></li>
826
827 <li data-name="LuCI.Request.poll#stop"><a href="LuCI.Request.poll.html#stop">stop</a></li>
828
829 </ul>
830 <ul class="events itemMembers">
831
832 </ul>
833 </li>
834
835 <li class="item" data-name="LuCI.Response">
836 <span class="title">
837 <a href="LuCI.Response.html">LuCI.Response</a>
838
839 </span>
840 <ul class="members itemMembers">
841
842 <span class="subtitle">Members</span>
843
844 <li data-name="LuCI.Response#duration"><a href="LuCI.Response.html#duration">duration</a></li>
845
846 <li data-name="LuCI.Response#headers"><a href="LuCI.Response.html#headers">headers</a></li>
847
848 <li data-name="LuCI.Response#ok"><a href="LuCI.Response.html#ok">ok</a></li>
849
850 <li data-name="LuCI.Response#status"><a href="LuCI.Response.html#status">status</a></li>
851
852 <li data-name="LuCI.Response#statusText"><a href="LuCI.Response.html#statusText">statusText</a></li>
853
854 <li data-name="LuCI.Response#url"><a href="LuCI.Response.html#url">url</a></li>
855
856 </ul>
857 <ul class="typedefs itemMembers">
858
859 </ul>
860 <ul class="typedefs itemMembers">
861
862 </ul>
863 <ul class="methods itemMembers">
864
865 <span class="subtitle">Methods</span>
866
867 <li data-name="LuCI.Response#clone"><a href="LuCI.Response.html#clone">clone</a></li>
868
869 <li data-name="LuCI.Response#json"><a href="LuCI.Response.html#json">json</a></li>
870
871 <li data-name="LuCI.Response#text"><a href="LuCI.Response.html#text">text</a></li>
872
873 </ul>
874 <ul class="events itemMembers">
875
876 </ul>
877 </li>
878
879 <li class="item" data-name="LuCI.rpc">
880 <span class="title">
881 <a href="LuCI.rpc.html">LuCI.rpc</a>
882
883 </span>
884 <ul class="members itemMembers">
885
886 </ul>
887 <ul class="typedefs itemMembers">
888
889 <span class="subtitle">Typedefs</span>
890
891 <li data-name="LuCI.rpc.DeclareOptions"><a href="LuCI.rpc.html#.DeclareOptions">DeclareOptions</a></li>
892
893 <li data-name="LuCI.rpc~filterFn"><a href="LuCI.rpc.html#~filterFn">filterFn</a></li>
894
895 <li data-name="LuCI.rpc~interceptorFn"><a href="LuCI.rpc.html#~interceptorFn">interceptorFn</a></li>
896
897 <li data-name="LuCI.rpc~invokeFn"><a href="LuCI.rpc.html#~invokeFn">invokeFn</a></li>
898
899 </ul>
900 <ul class="typedefs itemMembers">
901
902 </ul>
903 <ul class="methods itemMembers">
904
905 <span class="subtitle">Methods</span>
906
907 <li data-name="LuCI.rpc#addInterceptor"><a href="LuCI.rpc.html#addInterceptor">addInterceptor</a></li>
908
909 <li data-name="LuCI.rpc#declare"><a href="LuCI.rpc.html#declare">declare</a></li>
910
911 <li data-name="LuCI.rpc#getBaseURL"><a href="LuCI.rpc.html#getBaseURL">getBaseURL</a></li>
912
913 <li data-name="LuCI.rpc#getSessionID"><a href="LuCI.rpc.html#getSessionID">getSessionID</a></li>
914
915 <li data-name="LuCI.rpc#getStatusText"><a href="LuCI.rpc.html#getStatusText">getStatusText</a></li>
916
917 <li data-name="LuCI.rpc#list"><a href="LuCI.rpc.html#list">list</a></li>
918
919 <li data-name="LuCI.rpc#removeInterceptor"><a href="LuCI.rpc.html#removeInterceptor">removeInterceptor</a></li>
920
921 <li data-name="LuCI.rpc#setBaseURL"><a href="LuCI.rpc.html#setBaseURL">setBaseURL</a></li>
922
923 <li data-name="LuCI.rpc#setSessionID"><a href="LuCI.rpc.html#setSessionID">setSessionID</a></li>
924
925 </ul>
926 <ul class="events itemMembers">
927
928 </ul>
929 </li>
930
931 <li class="item" data-name="LuCI.uci">
932 <span class="title">
933 <a href="LuCI.uci.html">LuCI.uci</a>
934
935 </span>
936 <ul class="members itemMembers">
937
938 </ul>
939 <ul class="typedefs itemMembers">
940
941 <span class="subtitle">Typedefs</span>
942
943 <li data-name="LuCI.uci.ChangeRecord"><a href="LuCI.uci.html#.ChangeRecord">ChangeRecord</a></li>
944
945 <li data-name="LuCI.uci.SectionObject"><a href="LuCI.uci.html#.SectionObject">SectionObject</a></li>
946
947 <li data-name="LuCI.uci~sectionsFn"><a href="LuCI.uci.html#~sectionsFn">sectionsFn</a></li>
948
949 </ul>
950 <ul class="typedefs itemMembers">
951
952 </ul>
953 <ul class="methods itemMembers">
954
955 <span class="subtitle">Methods</span>
956
957 <li data-name="LuCI.uci#add"><a href="LuCI.uci.html#add">add</a></li>
958
959 <li data-name="LuCI.uci#apply"><a href="LuCI.uci.html#apply">apply</a></li>
960
961 <li data-name="LuCI.uci#changes"><a href="LuCI.uci.html#changes">changes</a></li>
962
963 <li data-name="LuCI.uci#createSID"><a href="LuCI.uci.html#createSID">createSID</a></li>
964
965 <li data-name="LuCI.uci#get"><a href="LuCI.uci.html#get">get</a></li>
966
967 <li data-name="LuCI.uci#get_first"><a href="LuCI.uci.html#get_first">get_first</a></li>
968
969 <li data-name="LuCI.uci#load"><a href="LuCI.uci.html#load">load</a></li>
970
971 <li data-name="LuCI.uci#move"><a href="LuCI.uci.html#move">move</a></li>
972
973 <li data-name="LuCI.uci#remove"><a href="LuCI.uci.html#remove">remove</a></li>
974
975 <li data-name="LuCI.uci#resolveSID"><a href="LuCI.uci.html#resolveSID">resolveSID</a></li>
976
977 <li data-name="LuCI.uci#save"><a href="LuCI.uci.html#save">save</a></li>
978
979 <li data-name="LuCI.uci#sections"><a href="LuCI.uci.html#sections">sections</a></li>
980
981 <li data-name="LuCI.uci#set"><a href="LuCI.uci.html#set">set</a></li>
982
983 <li data-name="LuCI.uci#set_first"><a href="LuCI.uci.html#set_first">set_first</a></li>
984
985 <li data-name="LuCI.uci#unload"><a href="LuCI.uci.html#unload">unload</a></li>
986
987 <li data-name="LuCI.uci#unset"><a href="LuCI.uci.html#unset">unset</a></li>
988
989 <li data-name="LuCI.uci#unset_first"><a href="LuCI.uci.html#unset_first">unset_first</a></li>
990
991 </ul>
992 <ul class="events itemMembers">
993
994 </ul>
995 </li>
996
997 <li class="item" data-name="LuCI.view">
998 <span class="title">
999 <a href="LuCI.view.html">LuCI.view</a>
1000
1001 </span>
1002 <ul class="members itemMembers">
1003
1004 </ul>
1005 <ul class="typedefs itemMembers">
1006
1007 </ul>
1008 <ul class="typedefs itemMembers">
1009
1010 </ul>
1011 <ul class="methods itemMembers">
1012
1013 <span class="subtitle">Methods</span>
1014
1015 <li data-name="LuCI.view#addFooter"><a href="LuCI.view.html#addFooter">addFooter</a></li>
1016
1017 <li data-name="LuCI.view#handleReset"><a href="LuCI.view.html#handleReset">handleReset</a></li>
1018
1019 <li data-name="LuCI.view#handleSave"><a href="LuCI.view.html#handleSave">handleSave</a></li>
1020
1021 <li data-name="LuCI.view#handleSaveApply"><a href="LuCI.view.html#handleSaveApply">handleSaveApply</a></li>
1022
1023 <li data-name="LuCI.view#load"><a href="LuCI.view.html#load">load</a></li>
1024
1025 <li data-name="LuCI.view#render"><a href="LuCI.view.html#render">render</a></li>
1026
1027 </ul>
1028 <ul class="events itemMembers">
1029
1030 </ul>
1031 </li>
1032
1033 <li class="item" data-name="LuCI.XHR">
1034 <span class="title">
1035 <a href="LuCI.XHR.html">LuCI.XHR</a>
1036
1037 </span>
1038 <ul class="members itemMembers">
1039
1040 </ul>
1041 <ul class="typedefs itemMembers">
1042
1043 </ul>
1044 <ul class="typedefs itemMembers">
1045
1046 </ul>
1047 <ul class="methods itemMembers">
1048
1049 <span class="subtitle">Methods</span>
1050
1051 <li data-name="LuCI.XHR#abort"><a href="LuCI.XHR.html#abort">abort</a></li>
1052
1053 <li data-name="LuCI.XHR#busy"><a href="LuCI.XHR.html#busy">busy</a></li>
1054
1055 <li data-name="LuCI.XHR#cancel"><a href="LuCI.XHR.html#cancel">cancel</a></li>
1056
1057 <li data-name="LuCI.XHR#get"><a href="LuCI.XHR.html#get">get</a></li>
1058
1059 <li data-name="LuCI.XHR#post"><a href="LuCI.XHR.html#post">post</a></li>
1060
1061 <li data-name="LuCI.XHR#send_form"><a href="LuCI.XHR.html#send_form">send_form</a></li>
1062
1063 </ul>
1064 <ul class="events itemMembers">
1065
1066 </ul>
1067 </li>
1068
1069 </ul>
1070 </div>
1071 <div class="main">
1072 <h1 class="page-title" data-filename="uci.js.html">Source: uci.js</h1>
1073
1074
1075
1076
1077 <section>
1078 <article>
1079 <pre id="source-code" class="prettyprint source "><code>'use strict';
1080 'require rpc';
1081
1082 /**
1083 * @class uci
1084 * @memberof LuCI
1085 * @hideconstructor
1086 * @classdesc
1087 *
1088 * The `LuCI.uci` class utilizes {@link LuCI.rpc} to declare low level
1089 * remote UCI `ubus` procedures and implements a local caching and data
1090 * manipulation layer on top to allow for synchroneous operations on
1091 * UCI configuration data.
1092 */
1093 return L.Class.extend(/** @lends LuCI.uci.prototype */ {
1094 __init__: function() {
1095 this.state = {
1096 newidx: 0,
1097 values: { },
1098 creates: { },
1099 changes: { },
1100 deletes: { },
1101 reorder: { }
1102 };
1103
1104 this.loaded = {};
1105 },
1106
1107 callLoad: rpc.declare({
1108 object: 'uci',
1109 method: 'get',
1110 params: [ 'config' ],
1111 expect: { values: { } }
1112 }),
1113
1114
1115 callOrder: rpc.declare({
1116 object: 'uci',
1117 method: 'order',
1118 params: [ 'config', 'sections' ]
1119 }),
1120
1121 callAdd: rpc.declare({
1122 object: 'uci',
1123 method: 'add',
1124 params: [ 'config', 'type', 'name', 'values' ],
1125 expect: { section: '' }
1126 }),
1127
1128 callSet: rpc.declare({
1129 object: 'uci',
1130 method: 'set',
1131 params: [ 'config', 'section', 'values' ]
1132 }),
1133
1134 callDelete: rpc.declare({
1135 object: 'uci',
1136 method: 'delete',
1137 params: [ 'config', 'section', 'options' ]
1138 }),
1139
1140 callApply: rpc.declare({
1141 object: 'uci',
1142 method: 'apply',
1143 params: [ 'timeout', 'rollback' ]
1144 }),
1145
1146 callConfirm: rpc.declare({
1147 object: 'uci',
1148 method: 'confirm'
1149 }),
1150
1151
1152 /**
1153 * Generates a new, unique section ID for the given configuration.
1154 *
1155 * Note that the generated ID is temporary, it will get replaced by an
1156 * identifier in the form `cfgXXXXXX` once the configuration is saved
1157 * by the remote `ubus` UCI api.
1158 *
1159 * @param {string} config
1160 * The configuration to generate the new section ID for.
1161 *
1162 * @returns {string}
1163 * A newly generated, unique section ID in the form `newXXXXXX`
1164 * where `X` denotes a hexadecimal digit.
1165 */
1166 createSID: function(conf) {
1167 var v = this.state.values,
1168 n = this.state.creates,
1169 sid;
1170
1171 do {
1172 sid = "new%06x".format(Math.random() * 0xFFFFFF);
1173 } while ((n[conf] &amp;&amp; n[conf][sid]) || (v[conf] &amp;&amp; v[conf][sid]));
1174
1175 return sid;
1176 },
1177
1178 /**
1179 * Resolves a given section ID in extended notation to the internal
1180 * section ID value.
1181 *
1182 * @param {string} config
1183 * The configuration to resolve the section ID for.
1184 *
1185 * @param {string} sid
1186 * The section ID to resolve. If the ID is in the form `@typename[#]`,
1187 * it will get resolved to an internal anonymous ID in the forms
1188 * `cfgXXXXXX`/`newXXXXXX` or to the name of a section in case it points
1189 * to a named section. When the given ID is not in extended notation,
1190 * it will be returned as-is.
1191 *
1192 * @returns {string|null}
1193 * Returns the resolved section ID or the original given ID if it was
1194 * not in extended notation. Returns `null` when an extended ID could
1195 * not be resolved to existing section ID.
1196 */
1197 resolveSID: function(conf, sid) {
1198 if (typeof(sid) != 'string')
1199 return sid;
1200
1201 var m = /^@([a-zA-Z0-9_-]+)\[(-?[0-9]+)\]$/.exec(sid);
1202
1203 if (m) {
1204 var type = m[1],
1205 pos = +m[2],
1206 sections = this.sections(conf, type),
1207 section = sections[pos >= 0 ? pos : sections.length + pos];
1208
1209 return section ? section['.name'] : null;
1210 }
1211
1212 return sid;
1213 },
1214
1215 /* private */
1216 reorderSections: function() {
1217 var v = this.state.values,
1218 n = this.state.creates,
1219 r = this.state.reorder,
1220 tasks = [];
1221
1222 if (Object.keys(r).length === 0)
1223 return Promise.resolve();
1224
1225 /*
1226 gather all created and existing sections, sort them according
1227 to their index value and issue an uci order call
1228 */
1229 for (var c in r) {
1230 var o = [ ];
1231
1232 if (n[c])
1233 for (var s in n[c])
1234 o.push(n[c][s]);
1235
1236 for (var s in v[c])
1237 o.push(v[c][s]);
1238
1239 if (o.length > 0) {
1240 o.sort(function(a, b) {
1241 return (a['.index'] - b['.index']);
1242 });
1243
1244 var sids = [ ];
1245
1246 for (var i = 0; i &lt; o.length; i++)
1247 sids.push(o[i]['.name']);
1248
1249 tasks.push(this.callOrder(c, sids));
1250 }
1251 }
1252
1253 this.state.reorder = { };
1254 return Promise.all(tasks);
1255 },
1256
1257 /* private */
1258 loadPackage: function(packageName) {
1259 if (this.loaded[packageName] == null)
1260 return (this.loaded[packageName] = this.callLoad(packageName));
1261
1262 return Promise.resolve(this.loaded[packageName]);
1263 },
1264
1265 /**
1266 * Loads the given UCI configurations from the remote `ubus` api.
1267 *
1268 * Loaded configurations are cached and only loaded once. Subsequent
1269 * load operations of the same configurations will return the cached
1270 * data.
1271 *
1272 * To force reloading a configuration, it has to be unloaded with
1273 * {@link LuCI.uci#unload uci.unload()} first.
1274 *
1275 * @param {string|string[]} config
1276 * The name of the configuration or an array of configuration
1277 * names to load.
1278 *
1279 * @returns {Promise&lt;string[]>}
1280 * Returns a promise resolving to the names of the configurations
1281 * that have been successfully loaded.
1282 */
1283 load: function(packages) {
1284 var self = this,
1285 pkgs = [ ],
1286 tasks = [];
1287
1288 if (!Array.isArray(packages))
1289 packages = [ packages ];
1290
1291 for (var i = 0; i &lt; packages.length; i++)
1292 if (!self.state.values[packages[i]]) {
1293 pkgs.push(packages[i]);
1294 tasks.push(self.loadPackage(packages[i]));
1295 }
1296
1297 return Promise.all(tasks).then(function(responses) {
1298 for (var i = 0; i &lt; responses.length; i++)
1299 self.state.values[pkgs[i]] = responses[i];
1300
1301 if (responses.length)
1302 document.dispatchEvent(new CustomEvent('uci-loaded'));
1303
1304 return pkgs;
1305 });
1306 },
1307
1308 /**
1309 * Unloads the given UCI configurations from the local cache.
1310 *
1311 * @param {string|string[]} config
1312 * The name of the configuration or an array of configuration
1313 * names to unload.
1314 */
1315 unload: function(packages) {
1316 if (!Array.isArray(packages))
1317 packages = [ packages ];
1318
1319 for (var i = 0; i &lt; packages.length; i++) {
1320 delete this.state.values[packages[i]];
1321 delete this.state.creates[packages[i]];
1322 delete this.state.changes[packages[i]];
1323 delete this.state.deletes[packages[i]];
1324
1325 delete this.loaded[packages[i]];
1326 }
1327 },
1328
1329 /**
1330 * Adds a new section of the given type to the given configuration,
1331 * optionally named according to the given name.
1332 *
1333 * @param {string} config
1334 * The name of the configuration to add the section to.
1335 *
1336 * @param {string} type
1337 * The type of the section to add.
1338 *
1339 * @param {string} [name]
1340 * The name of the section to add. If the name is omitted, an anonymous
1341 * section will be added instead.
1342 *
1343 * @returns {string}
1344 * Returns the section ID of the newly added section which is equivalent
1345 * to the given name for non-anonymous sections.
1346 */
1347 add: function(conf, type, name) {
1348 var n = this.state.creates,
1349 sid = name || this.createSID(conf);
1350
1351 if (!n[conf])
1352 n[conf] = { };
1353
1354 n[conf][sid] = {
1355 '.type': type,
1356 '.name': sid,
1357 '.create': name,
1358 '.anonymous': !name,
1359 '.index': 1000 + this.state.newidx++
1360 };
1361
1362 return sid;
1363 },
1364
1365 /**
1366 * Removes the section with the given ID from the given configuration.
1367 *
1368 * @param {string} config
1369 * The name of the configuration to remove the section from.
1370 *
1371 * @param {string} sid
1372 * The ID of the section to remove.
1373 */
1374 remove: function(conf, sid) {
1375 var n = this.state.creates,
1376 c = this.state.changes,
1377 d = this.state.deletes;
1378
1379 /* requested deletion of a just created section */
1380 if (n[conf] &amp;&amp; n[conf][sid]) {
1381 delete n[conf][sid];
1382 }
1383 else {
1384 if (c[conf])
1385 delete c[conf][sid];
1386
1387 if (!d[conf])
1388 d[conf] = { };
1389
1390 d[conf][sid] = true;
1391 }
1392 },
1393
1394 /**
1395 * A section object represents the options and their corresponding values
1396 * enclosed within a configuration section, as well as some additional
1397 * meta data such as sort indexes and internal ID.
1398 *
1399 * Any internal metadata fields are prefixed with a dot which is isn't
1400 * an allowed character for normal option names.
1401 *
1402 * @typedef {Object&lt;string, boolean|number|string|string[]>} SectionObject
1403 * @memberof LuCI.uci
1404 *
1405 * @property {boolean} .anonymous
1406 * The `.anonymous` property specifies whether the configuration is
1407 * anonymous (`true`) or named (`false`).
1408 *
1409 * @property {number} .index
1410 * The `.index` property specifes the sort order of the section.
1411 *
1412 * @property {string} .name
1413 * The `.name` property holds the name of the section object. It may be
1414 * either an anonymous ID in the form `cfgXXXXXX` or `newXXXXXX` with `X`
1415 * being a hexadecimal digit or a string holding the name of the section.
1416 *
1417 * @property {string} .type
1418 * The `.type` property contains the type of the corresponding uci
1419 * section.
1420 *
1421 * @property {string|string[]} *
1422 * A section object may contain an arbitrary number of further properties
1423 * representing the uci option enclosed in the section.
1424 *
1425 * All option property names will be in the form `[A-Za-z0-9_]+` and
1426 * either contain a string value or an array of strings, in case the
1427 * underlying option is an UCI list.
1428 */
1429
1430 /**
1431 * The sections callback is invoked for each section found within
1432 * the given configuration and receives the section object and its
1433 * associated name as arguments.
1434 *
1435 * @callback LuCI.uci~sectionsFn
1436 *
1437 * @param {LuCI.uci.SectionObject} section
1438 * The section object.
1439 *
1440 * @param {string} sid
1441 * The name or ID of the section.
1442 */
1443
1444 /**
1445 * Enumerates the sections of the given configuration, optionally
1446 * filtered by type.
1447 *
1448 * @param {string} config
1449 * The name of the configuration to enumerate the sections for.
1450 *
1451 * @param {string} [type]
1452 * Enumerate only sections of the given type. If omitted, enumerate
1453 * all sections.
1454 *
1455 * @param {LuCI.uci~sectionsFn} [cb]
1456 * An optional callback to invoke for each enumerated section.
1457 *
1458 * @returns {Array&lt;LuCI.uci.SectionObject>}
1459 * Returns a sorted array of the section objects within the given
1460 * configuration, filtered by type of a type has been specified.
1461 */
1462 sections: function(conf, type, cb) {
1463 var sa = [ ],
1464 v = this.state.values[conf],
1465 n = this.state.creates[conf],
1466 c = this.state.changes[conf],
1467 d = this.state.deletes[conf];
1468
1469 if (!v)
1470 return sa;
1471
1472 for (var s in v)
1473 if (!d || d[s] !== true)
1474 if (!type || v[s]['.type'] == type)
1475 sa.push(Object.assign({ }, v[s], c ? c[s] : undefined));
1476
1477 if (n)
1478 for (var s in n)
1479 if (!type || n[s]['.type'] == type)
1480 sa.push(Object.assign({ }, n[s]));
1481
1482 sa.sort(function(a, b) {
1483 return a['.index'] - b['.index'];
1484 });
1485
1486 for (var i = 0; i &lt; sa.length; i++)
1487 sa[i]['.index'] = i;
1488
1489 if (typeof(cb) == 'function')
1490 for (var i = 0; i &lt; sa.length; i++)
1491 cb.call(this, sa[i], sa[i]['.name']);
1492
1493 return sa;
1494 },
1495
1496 /**
1497 * Gets the value of the given option within the specified section
1498 * of the given configuration or the entire section object if the
1499 * option name is omitted.
1500 *
1501 * @param {string} config
1502 * The name of the configuration to read the value from.
1503 *
1504 * @param {string} sid
1505 * The name or ID of the section to read.
1506 *
1507 * @param {string} [option]
1508 * The option name to read the value from. If the option name is
1509 * omitted or `null`, the entire section is returned instead.
1510 *
1511 * @returns {null|string|string[]|LuCI.uci.SectionObject}
1512 * - Returns a string containing the option value in case of a
1513 * plain UCI option.
1514 * - Returns an array of strings containing the option values in
1515 * case of `option` pointing to an UCI list.
1516 * - Returns a {@link LuCI.uci.SectionObject section object} if
1517 * the `option` argument has been omitted or is `null`.
1518 * - Returns `null` if the config, section or option has not been
1519 * found or if the corresponding configuration is not loaded.
1520 */
1521 get: function(conf, sid, opt) {
1522 var v = this.state.values,
1523 n = this.state.creates,
1524 c = this.state.changes,
1525 d = this.state.deletes;
1526
1527 sid = this.resolveSID(conf, sid);
1528
1529 if (sid == null)
1530 return null;
1531
1532 /* requested option in a just created section */
1533 if (n[conf] &amp;&amp; n[conf][sid]) {
1534 if (!n[conf])
1535 return undefined;
1536
1537 if (opt == null)
1538 return n[conf][sid];
1539
1540 return n[conf][sid][opt];
1541 }
1542
1543 /* requested an option value */
1544 if (opt != null) {
1545 /* check whether option was deleted */
1546 if (d[conf] &amp;&amp; d[conf][sid]) {
1547 if (d[conf][sid] === true)
1548 return undefined;
1549
1550 for (var i = 0; i &lt; d[conf][sid].length; i++)
1551 if (d[conf][sid][i] == opt)
1552 return undefined;
1553 }
1554
1555 /* check whether option was changed */
1556 if (c[conf] &amp;&amp; c[conf][sid] &amp;&amp; c[conf][sid][opt] != null)
1557 return c[conf][sid][opt];
1558
1559 /* return base value */
1560 if (v[conf] &amp;&amp; v[conf][sid])
1561 return v[conf][sid][opt];
1562
1563 return undefined;
1564 }
1565
1566 /* requested an entire section */
1567 if (v[conf])
1568 return v[conf][sid];
1569
1570 return undefined;
1571 },
1572
1573 /**
1574 * Sets the value of the given option within the specified section
1575 * of the given configuration.
1576 *
1577 * If either config, section or option is null, or if `option` begins
1578 * with a dot, the function will do nothing.
1579 *
1580 * @param {string} config
1581 * The name of the configuration to set the option value in.
1582 *
1583 * @param {string} sid
1584 * The name or ID of the section to set the option value in.
1585 *
1586 * @param {string} option
1587 * The option name to set the value for.
1588 *
1589 * @param {null|string|string[]} value
1590 * The option value to set. If the value is `null` or an empty string,
1591 * the option will be removed, otherwise it will be set or overwritten
1592 * with the given value.
1593 */
1594 set: function(conf, sid, opt, val) {
1595 var v = this.state.values,
1596 n = this.state.creates,
1597 c = this.state.changes,
1598 d = this.state.deletes;
1599
1600 sid = this.resolveSID(conf, sid);
1601
1602 if (sid == null || opt == null || opt.charAt(0) == '.')
1603 return;
1604
1605 if (n[conf] &amp;&amp; n[conf][sid]) {
1606 if (val != null)
1607 n[conf][sid][opt] = val;
1608 else
1609 delete n[conf][sid][opt];
1610 }
1611 else if (val != null &amp;&amp; val !== '') {
1612 /* do not set within deleted section */
1613 if (d[conf] &amp;&amp; d[conf][sid] === true)
1614 return;
1615
1616 /* only set in existing sections */
1617 if (!v[conf] || !v[conf][sid])
1618 return;
1619
1620 if (!c[conf])
1621 c[conf] = {};
1622
1623 if (!c[conf][sid])
1624 c[conf][sid] = {};
1625
1626 /* undelete option */
1627 if (d[conf] &amp;&amp; d[conf][sid])
1628 d[conf][sid] = d[conf][sid].filter(function(o) { return o !== opt });
1629
1630 c[conf][sid][opt] = val;
1631 }
1632 else {
1633 /* only delete in existing sections */
1634 if (!(v[conf] &amp;&amp; v[conf][sid] &amp;&amp; v[conf][sid].hasOwnProperty(opt)) &amp;&amp;
1635 !(c[conf] &amp;&amp; c[conf][sid] &amp;&amp; c[conf][sid].hasOwnProperty(opt)))
1636 return;
1637
1638 if (!d[conf])
1639 d[conf] = { };
1640
1641 if (!d[conf][sid])
1642 d[conf][sid] = [ ];
1643
1644 if (d[conf][sid] !== true)
1645 d[conf][sid].push(opt);
1646 }
1647 },
1648
1649 /**
1650 * Remove the given option within the specified section of the given
1651 * configuration.
1652 *
1653 * This function is a convenience wrapper around
1654 * `uci.set(config, section, option, null)`.
1655 *
1656 * @param {string} config
1657 * The name of the configuration to remove the option from.
1658 *
1659 * @param {string} sid
1660 * The name or ID of the section to remove the option from.
1661 *
1662 * @param {string} option
1663 * The name of the option to remove.
1664 */
1665 unset: function(conf, sid, opt) {
1666 return this.set(conf, sid, opt, null);
1667 },
1668
1669 /**
1670 * Gets the value of the given option or the entire section object of
1671 * the first found section of the specified type or the first found
1672 * section of the entire configuration if no type is specfied.
1673 *
1674 * @param {string} config
1675 * The name of the configuration to read the value from.
1676 *
1677 * @param {string} [type]
1678 * The type of the first section to find. If it is `null`, the first
1679 * section of the entire config is read, otherwise the first section
1680 * matching the given type.
1681 *
1682 * @param {string} [option]
1683 * The option name to read the value from. If the option name is
1684 * omitted or `null`, the entire section is returned instead.
1685 *
1686 * @returns {null|string|string[]|LuCI.uci.SectionObject}
1687 * - Returns a string containing the option value in case of a
1688 * plain UCI option.
1689 * - Returns an array of strings containing the option values in
1690 * case of `option` pointing to an UCI list.
1691 * - Returns a {@link LuCI.uci.SectionObject section object} if
1692 * the `option` argument has been omitted or is `null`.
1693 * - Returns `null` if the config, section or option has not been
1694 * found or if the corresponding configuration is not loaded.
1695 */
1696 get_first: function(conf, type, opt) {
1697 var sid = null;
1698
1699 this.sections(conf, type, function(s) {
1700 if (sid == null)
1701 sid = s['.name'];
1702 });
1703
1704 return this.get(conf, sid, opt);
1705 },
1706
1707 /**
1708 * Sets the value of the given option within the first found section
1709 * of the given configuration matching the specified type or within
1710 * the first section of the entire config when no type has is specified.
1711 *
1712 * If either config, type or option is null, or if `option` begins
1713 * with a dot, the function will do nothing.
1714 *
1715 * @param {string} config
1716 * The name of the configuration to set the option value in.
1717 *
1718 * @param {string} [type]
1719 * The type of the first section to find. If it is `null`, the first
1720 * section of the entire config is written to, otherwise the first
1721 * section matching the given type is used.
1722 *
1723 * @param {string} option
1724 * The option name to set the value for.
1725 *
1726 * @param {null|string|string[]} value
1727 * The option value to set. If the value is `null` or an empty string,
1728 * the option will be removed, otherwise it will be set or overwritten
1729 * with the given value.
1730 */
1731 set_first: function(conf, type, opt, val) {
1732 var sid = null;
1733
1734 this.sections(conf, type, function(s) {
1735 if (sid == null)
1736 sid = s['.name'];
1737 });
1738
1739 return this.set(conf, sid, opt, val);
1740 },
1741
1742 /**
1743 * Removes the given option within the first found section of the given
1744 * configuration matching the specified type or within the first section
1745 * of the entire config when no type has is specified.
1746 *
1747 * This function is a convenience wrapper around
1748 * `uci.set_first(config, type, option, null)`.
1749 *
1750 * @param {string} config
1751 * The name of the configuration to set the option value in.
1752 *
1753 * @param {string} [type]
1754 * The type of the first section to find. If it is `null`, the first
1755 * section of the entire config is written to, otherwise the first
1756 * section matching the given type is used.
1757 *
1758 * @param {string} option
1759 * The option name to set the value for.
1760 */
1761 unset_first: function(conf, type, opt) {
1762 return this.set_first(conf, type, opt, null);
1763 },
1764
1765 /**
1766 * Move the first specified section within the given configuration
1767 * before or after the second specified section.
1768 *
1769 * @param {string} config
1770 * The configuration to move the section within.
1771 *
1772 * @param {string} sid1
1773 * The ID of the section to move within the configuration.
1774 *
1775 * @param {string} [sid2]
1776 * The ID of the target section for the move operation. If the
1777 * `after` argument is `false` or not specified, the section named by
1778 * `sid1` will be moved before this target section, if the `after`
1779 * argument is `true`, the `sid1` section will be moved after this
1780 * section.
1781 *
1782 * When the `sid2` argument is `null`, the section specified by `sid1`
1783 * is moved to the end of the configuration.
1784 *
1785 * @param {boolean} [after=false]
1786 * When `true`, the section `sid1` is moved after the section `sid2`,
1787 * when `false`, the section `sid1` is moved before `sid2`.
1788 *
1789 * If `sid2` is null, then this parameter has no effect and the section
1790 * `sid1` is moved to the end of the configuration instead.
1791 *
1792 * @returns {boolean}
1793 * Returns `true` when the section was successfully moved, or `false`
1794 * when either the section specified by `sid1` or by `sid2` is not found.
1795 */
1796 move: function(conf, sid1, sid2, after) {
1797 var sa = this.sections(conf),
1798 s1 = null, s2 = null;
1799
1800 sid1 = this.resolveSID(conf, sid1);
1801 sid2 = this.resolveSID(conf, sid2);
1802
1803 for (var i = 0; i &lt; sa.length; i++) {
1804 if (sa[i]['.name'] != sid1)
1805 continue;
1806
1807 s1 = sa[i];
1808 sa.splice(i, 1);
1809 break;
1810 }
1811
1812 if (s1 == null)
1813 return false;
1814
1815 if (sid2 == null) {
1816 sa.push(s1);
1817 }
1818 else {
1819 for (var i = 0; i &lt; sa.length; i++) {
1820 if (sa[i]['.name'] != sid2)
1821 continue;
1822
1823 s2 = sa[i];
1824 sa.splice(i + !!after, 0, s1);
1825 break;
1826 }
1827
1828 if (s2 == null)
1829 return false;
1830 }
1831
1832 for (var i = 0; i &lt; sa.length; i++)
1833 this.get(conf, sa[i]['.name'])['.index'] = i;
1834
1835 this.state.reorder[conf] = true;
1836
1837 return true;
1838 },
1839
1840 /**
1841 * Submits all local configuration changes to the remove `ubus` api,
1842 * adds, removes and reorders remote sections as needed and reloads
1843 * all loaded configurations to resynchronize the local state with
1844 * the remote configuration values.
1845 *
1846 * @returns {string[]}
1847 * Returns a promise resolving to an array of configuration names which
1848 * have been reloaded by the save operation.
1849 */
1850 save: function() {
1851 var v = this.state.values,
1852 n = this.state.creates,
1853 c = this.state.changes,
1854 d = this.state.deletes,
1855 r = this.state.reorder,
1856 self = this,
1857 snew = [ ],
1858 pkgs = { },
1859 tasks = [];
1860
1861 if (n)
1862 for (var conf in n) {
1863 for (var sid in n[conf]) {
1864 var r = {
1865 config: conf,
1866 values: { }
1867 };
1868
1869 for (var k in n[conf][sid]) {
1870 if (k == '.type')
1871 r.type = n[conf][sid][k];
1872 else if (k == '.create')
1873 r.name = n[conf][sid][k];
1874 else if (k.charAt(0) != '.')
1875 r.values[k] = n[conf][sid][k];
1876 }
1877
1878 snew.push(n[conf][sid]);
1879 tasks.push(self.callAdd(r.config, r.type, r.name, r.values));
1880 }
1881
1882 pkgs[conf] = true;
1883 }
1884
1885 if (c)
1886 for (var conf in c) {
1887 for (var sid in c[conf])
1888 tasks.push(self.callSet(conf, sid, c[conf][sid]));
1889
1890 pkgs[conf] = true;
1891 }
1892
1893 if (d)
1894 for (var conf in d) {
1895 for (var sid in d[conf]) {
1896 var o = d[conf][sid];
1897 tasks.push(self.callDelete(conf, sid, (o === true) ? null : o));
1898 }
1899
1900 pkgs[conf] = true;
1901 }
1902
1903 if (r)
1904 for (var conf in r)
1905 pkgs[conf] = true;
1906
1907 return Promise.all(tasks).then(function(responses) {
1908 /*
1909 array "snew" holds references to the created uci sections,
1910 use it to assign the returned names of the new sections
1911 */
1912 for (var i = 0; i &lt; snew.length; i++)
1913 snew[i]['.name'] = responses[i];
1914
1915 return self.reorderSections();
1916 }).then(function() {
1917 pkgs = Object.keys(pkgs);
1918
1919 self.unload(pkgs);
1920
1921 return self.load(pkgs);
1922 });
1923 },
1924
1925 /**
1926 * Instructs the remote `ubus` UCI api to commit all saved changes with
1927 * rollback protection and attempts to confirm the pending commit
1928 * operation to cancel the rollback timer.
1929 *
1930 * @param {number} [timeout=10]
1931 * Override the confirmation timeout after which a rollback is triggered.
1932 *
1933 * @returns {Promise&lt;number>}
1934 * Returns a promise resolving/rejecting with the `ubus` RPC status code.
1935 */
1936 apply: function(timeout) {
1937 var self = this,
1938 date = new Date();
1939
1940 if (typeof(timeout) != 'number' || timeout &lt; 1)
1941 timeout = 10;
1942
1943 return self.callApply(timeout, true).then(function(rv) {
1944 if (rv != 0)
1945 return Promise.reject(rv);
1946
1947 var try_deadline = date.getTime() + 1000 * timeout;
1948 var try_confirm = function() {
1949 return self.callConfirm().then(function(rv) {
1950 if (rv != 0) {
1951 if (date.getTime() &lt; try_deadline)
1952 window.setTimeout(try_confirm, 250);
1953 else
1954 return Promise.reject(rv);
1955 }
1956
1957 return rv;
1958 });
1959 };
1960
1961 window.setTimeout(try_confirm, 1000);
1962 });
1963 },
1964
1965 /**
1966 * An UCI change record is a plain array containing the change operation
1967 * name as first element, the affected section ID as second argument
1968 * and an optional third and fourth argument whose meanings depend on
1969 * the operation.
1970 *
1971 * @typedef {string[]} ChangeRecord
1972 * @memberof LuCI.uci
1973 *
1974 * @property {string} 0
1975 * The operation name - may be one of `add`, `set`, `remove`, `order`,
1976 * `list-add`, `list-del` or `rename`.
1977 *
1978 * @property {string} 1
1979 * The section ID targeted by the operation.
1980 *
1981 * @property {string} 2
1982 * The meaning of the third element depends on the operation.
1983 * - For `add` it is type of the section that has been added
1984 * - For `set` it either is the option name if a fourth element exists,
1985 * or the type of a named section which has been added when the change
1986 * entry only contains three elements.
1987 * - For `remove` it contains the name of the option that has been
1988 * removed.
1989 * - For `order` it specifies the new sort index of the section.
1990 * - For `list-add` it contains the name of the list option a new value
1991 * has been added to.
1992 * - For `list-del` it contains the name of the list option a value has
1993 * been removed from.
1994 * - For `rename` it contains the name of the option that has been
1995 * renamed if a fourth element exists, else it contains the new name
1996 * a section has been renamed to if the change entry only contains
1997 * three elements.
1998 *
1999 * @property {string} 4
2000 * The meaning of the fourth element depends on the operation.
2001 * - For `set` it is the value an option has been set to.
2002 * - For `list-add` it is the new value that has been added to a
2003 * list option.
2004 * - For `rename` it is the new name of an option that has been
2005 * renamed.
2006 */
2007
2008 /**
2009 * Fetches uncommitted UCI changes from the remote `ubus` RPC api.
2010 *
2011 * @method
2012 * @returns {Promise&lt;Object&lt;string, Array&lt;LuCI.uci.ChangeRecord>>>}
2013 * Returns a promise resolving to an object containing the configuration
2014 * names as keys and arrays of related change records as values.
2015 */
2016 changes: rpc.declare({
2017 object: 'uci',
2018 method: 'changes',
2019 expect: { changes: { } }
2020 })
2021 });
2022 </code></pre>
2023 </article>
2024 </section>
2025
2026
2027
2028
2029
2030
2031
2032
2033 <footer>
2034 Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Thu Nov 07 2019 12:36:05 GMT+0100 (Central European Standard Time)
2035 </footer>
2036 </div>
2037 </div>
2038 <script>prettyPrint();</script>
2039 <script src="scripts/jaguar.js"></script>
2040 </body>
2041 </html>