Commit graph

353 commits

Author SHA1 Message Date
Jo-Philipp Wich
3553d308f6 [PATCH] Naive fix for bug #208
For SimpleSection, use the section name (always "1") instead of the
section type in the CBI-like string used to identify the upload.  This
allows upload fields to be placed in SimpleSections.  The fix changes a
minimal number of lines, but does introduce some unnecessary confusion,
it may or may not be better than a more thorough/invasive fix.

Set the enctype for the form element in the simpleform view to be
multipart/form-data because the default
application/x-www-form-urlencoded does not support input files.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2011-12-20 17:52:10 +00:00
Jo-Philipp Wich
8358175f25 libs/web: show input/forward hints in zonelist widget only if bnoth allowany and allowlocal are enabled 2011-12-20 17:51:44 +00:00
Jo-Philipp Wich
b89300eb67 libs/web: prevent break between action buttons in tblsection template 2011-12-20 03:57:40 +00:00
Jo-Philipp Wich
48838ea0f7 libs/web: fix placeholder attribute for DynList 2011-12-20 03:00:17 +00:00
Jo-Philipp Wich
161218a576 libs/web: fix undesired autofocus of DynamicList widget 2011-12-20 02:56:03 +00:00
Jo-Philipp Wich
6ae669da06 libs/web: improve ip6addr datype validation, accept both CIDR and IP/Mask notation 2011-12-20 02:44:32 +00:00
Jo-Philipp Wich
24c4cce3ae libs/web: add "any" option to firewall_zonelist widget 2011-12-19 20:09:20 +00:00
Jo-Philipp Wich
21a0fcc4c1 libs/web: rework DynamicList widget to support dynamic lists composed of comboboxes 2011-12-19 18:55:59 +00:00
Jo-Philipp Wich
375a476d27 libs/web: rework hostname match to not allow arbritary sequences of numbers and dots 2011-12-16 06:05:51 +00:00
Jo-Philipp Wich
3a0905f21c libs/web: add list(...) datatype for space separated lists of arbritary datatypes 2011-12-16 05:52:24 +00:00
Jo-Philipp Wich
757e9c2f1c libs/web: add missing parts of previous commit 2011-12-16 01:18:34 +00:00
Jo-Philipp Wich
cdcfb5502b libs/web: implement "network" cbi datatype 2011-12-16 01:18:15 +00:00
Jo-Philipp Wich
c5811d52d0 libs/web: allow one-character hostnames 2011-12-14 15:01:54 +00:00
Jo-Philipp Wich
099e97532c libs/web: add assert() statements for unresolvable function case 2011-11-30 12:50:32 +00:00
Jo-Philipp Wich
96f494f4ba libs/web: dispatcher: fix access to template properties in attr() and ifattr() helpers (#10317) 2011-10-30 15:00:54 +00:00
Jo-Philipp Wich
334756a472 libs/web: fix possible dispatcher crash 2011-10-26 03:04:41 +00:00
Jo-Philipp Wich
e12b8dbc1f libs/web: move ifattr() and attr() helpers into dispatcher scope to make them avilable to all templates, remove duplicate exports in cbi tempalte scope 2011-10-26 02:17:45 +00:00
Jo-Philipp Wich
5f7d2719b2 libs/web: dispatcher add node_childs() and node_visible() helper functions for templates 2011-10-26 00:24:17 +00:00
Jo-Philipp Wich
6021cf3bdf libs/web: dispatcher: implement a "firstchild()" target which simply redirects to the first child of a node, useful for menus that are empty by default and may gain arbritary childs 2011-10-25 22:48:43 +00:00
Jo-Philipp Wich
8cd46b595a libs/web: cbi: support description attribute in nullsection instances 2011-10-23 04:21:14 +00:00
Jo-Philipp Wich
a24d340ca4 libs/web: fix package name in error suggestion 2011-10-21 17:22:48 +00:00
Jo-Philipp Wich
cd46e1611e libs/web: handle .redirect property for SimpleForm widgets 2011-10-11 01:20:36 +00:00
Jo-Philipp Wich
2337ee9206 libs/web: add network_netlist widget option to filter virtual networks 2011-10-10 18:10:12 +00:00
Jo-Philipp Wich
63608d2636 libs/web: sent origin section id encoded in cbi.cts. requests 2011-10-09 20:14:25 +00:00
Jo-Philipp Wich
4fb5f1aca6 libs/web: pass origin section id to :create() callback, needed when multiple, filtered TypedSection instances of the same type are used within a single Map 2011-10-09 20:07:02 +00:00
Jo-Philipp Wich
0d4ec2bbba libs/web: add error message printing to nullsection template, fixes server side validation in SimpleForm instances 2011-10-09 18:43:11 +00:00
Jo-Philipp Wich
43df504278 libs/web: assign extra css class to typed or named sections with tabs 2011-09-30 14:14:04 +00:00
Jo-Philipp Wich
ea6f5379dc libs/web: network widget fixes 2011-09-25 11:59:21 +00:00
Jo-Philipp Wich
bf49f78599 libs/web: align interface related widgets to changed network model api 2011-09-24 03:49:17 +00:00
Jo-Philipp Wich
7925014561 libs/web: add missing class attributes 2011-09-22 18:21:38 +00:00
Jo-Philipp Wich
737daee3e1 libs/web: cbi: dynamically update css class of last field after dependency update 2011-09-22 17:05:14 +00:00
Jo-Philipp Wich
688eb421cc libs/web: cbi: assign dedicated css class to last child 2011-09-22 16:34:52 +00:00
Jo-Philipp Wich
96dd29753c libs/web: cbi: provide a "last_child" property to allow for more layout control in form rendering 2011-09-22 16:33:28 +00:00
Jo-Philipp Wich
362c84480a libs/web: add another missing class attribute 2011-09-22 13:43:39 +00:00
Jo-Philipp Wich
b360dbc6dc modules/admin-full, modules/freifunk, modules/niu, libs/web, applications/luci-upnp: tune input class attributes 2011-09-22 13:25:48 +00:00
Jo-Philipp Wich
59e95ddcad modules/admin-full, libs/web: various interface handling fixes in network settings 2011-09-22 01:40:26 +00:00
Jo-Philipp Wich
537c929d63 libs/web: track submit state in network_ifacelist widget, fixes deselecting all member ifaces in checkbox mode 2011-09-14 09:28:16 +00:00
Jo-Philipp Wich
794094caa2 libs/web: add "neg()" cbi datatype to negate arbritary types, e.g. "neg(hostname)" would allow "!example.com" 2011-09-04 12:07:43 +00:00
Jo-Philipp Wich
37df666e0a libs/web: fix some missing escapes in iface and netlist widgets 2011-09-01 16:07:02 +00:00
Jo-Philipp Wich
a8ac3b344f libs/web: add _() function to dispatcher, used for marking translatable menu entries 2011-08-12 13:11:29 +00:00
Jo-Philipp Wich
986c4b5bc1 libs/web: eliminate another uneeded require in dispatcher 2011-08-12 12:34:13 +00:00
Jo-Philipp Wich
c1d69d0146 libs/web: optimize access to translate() api by directly reusing the luci.i18n instance loaded in dispatcher - this saves one extra function call, one extra require and one extra table lookup for _each_ translation string 2011-08-12 11:13:39 +00:00
Jo-Philipp Wich
0cb0742818 [PATCH] Allow smarter node creation based on visibility during createtree
As I've brought up on the mailing list thread "High latency caused by full tree creation", there is a large amount of delay per LuCI request which is spent building the node tree in createtree(). Most nodes created aren't 
needed for the view presented to the user and only serve to consume memory and CPU time during a page load.

My idea is to provide an easy mechanism for index()ers to determine which needs to be created and what isn't. Due to the constraints of the standard LuCI web interface, this optimization needs to establish a few rules:

 * The page requested must have its node created
 * All parents of the page being requested must be created, so the children inherit the track
 * All the top-level nodes "Status", "System", "Services", "Network" (and others added by extensions) must be created in order to have their top-level tabs in the UI
 * All peers of second-level nodes need to be created as well for the same reason, to display their links on the subindexes 
                
To make this easy to implement in each controller, the attached patch adds an "inreq" field to each created node to indicate if it lies on the request path. To satisfy the "top level node" requirement, we always 
add the top level node, then check its inreq property if the top-level node is not "in request", then the controller can exit index() early.
2011-08-12 11:05:59 +00:00
Jo-Philipp Wich
b3861e0ec7 [PATCH] Wasted memory use storing path copies in node tree
When creating the node tree, every node stores a copy of its full path table. e.g. for node("admin.network.wireless"), node.path = { "admin", "network", "wireless" }

This value is not used anywhere, and likely may be from before the addition of the treecache lookup table? In any instance, I've searched high and low and see nothing ever referencing any node's path via the path member. It 
eats a good chunk of memory though and as such I believe it should be removed.

I've tested every page in the admin-full module after removing it and all seem to function properly.
2011-08-12 11:04:42 +00:00
Jo-Philipp Wich
2e618aaf29 libs/web: more verbose faults 2011-07-21 01:04:53 +00:00
Jo-Philipp Wich
d970d7bd27 libs/web: make dispatcher faults more verbose 2011-07-20 23:57:32 +00:00
Jo-Philipp Wich
253eafb577 libs/web: fix index cache rebuild triggering (#275) 2011-07-18 14:50:39 +00:00
Jo-Philipp Wich
354aeb44f6 libs/web: add new datatypes min(...), max(...) and neg_network_ip4addr 2011-06-17 10:52:49 +00:00
Jo-Philipp Wich
6e6bac2a4a libs/web: remove license comments from cbi templates, saves around 50% of their size 2011-05-04 12:56:06 +00:00
Jo-Philipp Wich
b95ec6c93a libs/web: fix another invalid entity 2011-05-03 03:31:30 +00:00