Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ffbs/ffbs-gluon
  • parabol1337/ffbs-gluon
  • darkbit/ffbs-gluon
3 results
Show changes
Showing
with 1155 additions and 219 deletions
Views
=====
The template parser reads views from the ``view`` subdirectory of a
gluon-web application (``/lib/gluon/config-mode/view`` for the config mode,
``lib/gluon/status-page/view`` for the status page).
Writing own views should usually be avoided in favour of using :doc:`model`
with their predefined views.
Views are partial HTML pages, with additional template tags that allow
to embed Lua code and translation strings. The following tags are defined:
- ``<%`` ... ``%>`` evaluates the enclosed Lua expression.
- ``<%|`` ... ``%>`` evaluates the enclosed Lua expression and prints its value.
- ``<%=`` ... ``%>`` evaluates the enclosed Lua expression and prints its value
*without escaping HTML entities*. This is useful when the value contains HTML code.
- ``<%+`` ... ``%>`` includes another template.
- ``<%:`` ... ``%>`` translates the enclosed string using the loaded i18n catalog.
- ``<%_`` ... ``%>`` translates the enclosed string *without escaping HTML entities*
in the translation. This only makes sense when the i18n catalog contains HTML code.
- ``<%#`` ... ``%>`` is a comment.
All of these also come in the whitespace-stripping variants ``<%-`` and ``-%>`` that
remove all whitespace before or after the tag.
Complex combinations of HTML and Lua code are possible, for example:
.. code-block:: text
<div>
<% if foo then %>
Content
<% end %>
</div>
Variables and functions
-----------------------
Many call sites define additional variables (for example, model templates can
access the model as *self* and a unique element ID as *id*), but the following
variables and functions should always be available for the embedded Lua code:
- *renderer*: :ref:`web-controller-template-renderer`
- *http*: :ref:`web-controller-http`
- *request*: Table containing the path components of the current page
- *url* (*path*): returns the URL for the given path, which is passed as a table of path components.
- *attr* (*key*, *value*): Returns a string of the form ``key="value"``
(with a leading space character before the key).
*value* is converted to a string (tables are serialized as JSON) and HTML entities
are escaped. Returns an empty string when *value* is *nil* or *false*.
- *include* (*template*): Includes another template.
- *node* (*path*, ...): Returns the controller node for the given page (passed as
one argument per path component).
Use ``node(unpack(request))`` to get the node for the current page.
- *pcdata* (*str*): Escapes HTML entities in the passed string.
- *urlencode* (*str*): Escapes the passed string for use in an URL.
- *translate*, *_translate*, *translatef* and *i18n*: see :doc:`i18n`
......@@ -8,7 +8,7 @@ If you select this package, add a list of authorized keys to ``site.conf`` like
{
authorized_keys = { 'ssh-rsa AAA.... user1@host',
'ssh-rsa AAA.... user2@host },
'ssh-rsa AAA.... user2@host' },
hostname_prefix = ...
...
......
This diff is collapsed.
......@@ -14,10 +14,13 @@ Activating Config Mode
----------------------
Config Mode is automatically entered at the first boot. You can re-enter
Config Mode by pressing and holding the RESET/WPS button for about three
seconds. The device should reboot (all LEDs will turn of briefly) and
Config Mode by pressing and holding the RESET/WPS/DECT button for about three
seconds. The device should reboot (all LEDs will turn off briefly) and
Config Mode will be available.
If you have access to the console of the node, there is the
``gluon-enter-setup-mode`` command, which reboots a node into Config Mode.
Port Configuration
------------------
......
This diff is collapsed.
docs/features/fastd_mode.gif

28.1 KiB

Mesh on WAN
===========
It's possible to enable the mesh on the WAN port like this::
uci set network.mesh_wan.auto=1
uci commit
It may also be disabled again by running::
uci set network.mesh_wan.auto=0
uci commit
site.conf
---------
The optional option ``mesh_on_wan`` may be set to ``true`` (``false`` is the
default) to enable meshing on the WAN port without further configuration.
This diff is collapsed.
docs/features/multidomain_configmode.gif

57.1 KiB

This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
../site-example/i18n/
\ No newline at end of file
This diff is collapsed.
../site-example/modules
\ No newline at end of file