summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-example
diff options
context:
space:
mode:
Diffstat (limited to 'applications/luci-app-example')
-rw-r--r--applications/luci-app-example/Makefile11
-rw-r--r--applications/luci-app-example/README.md25
-rw-r--r--applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js36
-rw-r--r--applications/luci-app-example/htdocs/luci-static/resources/view/example/htmlview.js30
-rw-r--r--applications/luci-app-example/po/de/example.po78
-rw-r--r--applications/luci-app-example/po/en/example.po62
-rw-r--r--applications/luci-app-example/po/es/example.po75
-rw-r--r--applications/luci-app-example/po/fr/example.po71
-rw-r--r--applications/luci-app-example/po/nb-NO/example.po65
-rw-r--r--applications/luci-app-example/po/templates/example.pot62
-rw-r--r--applications/luci-app-example/po/zh-Hans/example.po74
-rw-r--r--applications/luci-app-example/root/etc/uci-defaults/80_example8
-rw-r--r--applications/luci-app-example/root/usr/share/luci/menu.d/luci-app-example.json30
-rw-r--r--applications/luci-app-example/root/usr/share/rpcd/acl.d/luci-app-example.json25
14 files changed, 652 insertions, 0 deletions
diff --git a/applications/luci-app-example/Makefile b/applications/luci-app-example/Makefile
new file mode 100644
index 0000000000..70834ad909
--- /dev/null
+++ b/applications/luci-app-example/Makefile
@@ -0,0 +1,11 @@
+# See /LICENSE for more information.
+# This is free software, licensed under the GNU General Public License v2.
+
+include $(TOPDIR)/rules.mk
+
+LUCI_TITLE:=LuCI example app for js based luci
+LUCI_DEPENDS:=+luci-base
+
+include ../../luci.mk
+
+# call BuildPackage - OpenWrt buildroot signature
diff --git a/applications/luci-app-example/README.md b/applications/luci-app-example/README.md
new file mode 100644
index 0000000000..23a3a3a179
--- /dev/null
+++ b/applications/luci-app-example/README.md
@@ -0,0 +1,25 @@
+# Example app for js based Luci
+
+This app is meant to be a kind of template, example or starting point for developing new luci apps.
+
+It provides two pages in the admin backend:
+* [htmlview.js](./htdocs/luci-static/resources/view/example/htmlview.js) is based on a view with a form and makes use of internal models.
+* [form.js](./htdocs/luci-static/resources/view/example/form.js) uses the `E()` method to create more flexible pages.
+
+The view based page is used to modify the example configuration.
+
+The html view page just shows the configured values.
+
+The configuration is stored in `/etc/config/example`.
+The file must exist and created on device boot by UCI defaults script in `/root/etc/uci-defaults/80_example`.
+More details about the UCI defaults https://openwrt.org/docs/guide-developer/uci-defaults
+
+To install the luci-app-example to your OpenWrt instance use:
+```
+scp -r root/* root@192.168.1.1:/
+scp -r htdocs/* root@192.168.1.1:/www/
+# execute the UCI defaults script to create the /etc/config/example
+ssh root@192.168.1.1 "sh /etc/uci-defaults/80_example"
+```
+
+Then you need to re-login to LUCI and you'll see a new Example item in main menu.
diff --git a/applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js b/applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js
new file mode 100644
index 0000000000..75fa3c3079
--- /dev/null
+++ b/applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js
@@ -0,0 +1,36 @@
+'use strict';
+'require view';
+'require form';
+
+return view.extend({
+ render: function() {
+ var m, s, o;
+
+ m = new form.Map('example', _('Example Form'),
+ _('Example Form Configuration.'));
+
+ s = m.section(form.TypedSection, 'first', _('first section'));
+ s.anonymous = true;
+
+ s.option(form.Value, 'first_option', _('First Option'),
+ _('Input for the first option'));
+
+ s = m.section(form.TypedSection, 'second', _('second section'));
+ s.anonymous = true;
+
+ o = s.option(form.Flag, 'flag', _('Flag Option'),
+ _('A boolean option'));
+ o.default = '1';
+ o.rmempty = false;
+
+ o = s.option(form.ListValue, 'select', _('Select Option'),
+ _('A select option'));
+ o.placeholder = 'placeholder';
+ o.value('key1', 'value1');
+ o.value('key2', 'value2');
+ o.rmempty = false;
+ o.editable = true;
+
+ return m.render();
+ },
+});
diff --git a/applications/luci-app-example/htdocs/luci-static/resources/view/example/htmlview.js b/applications/luci-app-example/htdocs/luci-static/resources/view/example/htmlview.js
new file mode 100644
index 0000000000..feae899a17
--- /dev/null
+++ b/applications/luci-app-example/htdocs/luci-static/resources/view/example/htmlview.js
@@ -0,0 +1,30 @@
+'use strict';
+'require uci';
+'require view';
+
+return view.extend({
+ handleSaveApply: null,
+ handleSave: null,
+ handleReset: null,
+ load: function() {
+ return Promise.all([
+ uci.load('example')
+ ]);
+ },
+ render: function(data) {
+ var body = E([
+ E('h2', _('Example HTML Page'))
+ ]);
+ var sections = uci.sections('example');
+ var listContainer = E('div');
+ var list = E('ul');
+ list.appendChild(E('li', { 'class': 'css-class' }, ['First Option in first section: ', E('em', {}, [sections[0].first_option])]));
+ list.appendChild(E('li', { 'class': 'css-class' }, ['Flag in second section: ', E('em', {}, [sections[1].flag])]));
+ list.appendChild(E('li', { 'class': 'css-class' }, ['Select in second section: ', E('em', {}, [sections[1].select])]));
+ listContainer.appendChild(list);
+ body.appendChild(listContainer);
+ console.log(sections);
+ return body;
+ }
+ });
+
diff --git a/applications/luci-app-example/po/de/example.po b/applications/luci-app-example/po/de/example.po
new file mode 100644
index 0000000000..e7cb820f7f
--- /dev/null
+++ b/applications/luci-app-example/po/de/example.po
@@ -0,0 +1,78 @@
+#
+# Translators:
+# Andi Bräu <freifunk@andi95.de>, 2021
+#
+msgid ""
+msgstr ""
+"PO-Revision-Date: 2022-10-22 18:07+0000\n"
+"Last-Translator: ssantos <ssantos@web.de>\n"
+"Language-Team: German <https://hosted.weblate.org/projects/openwrt/"
+"luciapplicationsexample/de/>\n"
+"Language: de\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Weblate 4.14.2-dev\n"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:22
+msgid "A boolean option"
+msgstr "Eine boolsche Option"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:27
+msgid "A select option"
+msgstr "Eine Auswahloption"
+
+#: applications/luci-app-example/root/usr/share/luci/menu.d/luci-app-example.json:3
+msgid "Example"
+msgstr "Beispiel"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:9
+msgid "Example Form"
+msgstr "Beispielformular"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:10
+msgid "Example Form Configuration."
+msgstr "Beispielformularkonfiguration."
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/htmlview.js:16
+msgid "Example HTML Page"
+msgstr "Beispiel-HTML-Seite"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:15
+msgid "First Option"
+msgstr "Erste Option"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:21
+msgid "Flag Option"
+msgstr "Kennzeichenoption"
+
+#: applications/luci-app-example/root/usr/share/luci/menu.d/luci-app-example.json:14
+msgid "Form View"
+msgstr "Formularansicht"
+
+#: applications/luci-app-example/root/usr/share/rpcd/acl.d/luci-app-example.json:3
+msgid "Grant UCI access to LuCI app example"
+msgstr "Zugang zur LuCI-Anwendung example gewähren"
+
+#: applications/luci-app-example/root/usr/share/luci/menu.d/luci-app-example.json:23
+msgid "HTML Page"
+msgstr "HTML Seite"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:16
+msgid "Input for the first option"
+msgstr "Eingabe für die erste Option"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:26
+msgid "Select Option"
+msgstr "Auswahloption"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:12
+msgid "first section"
+msgstr "Erste Sektion"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:18
+msgid "second section"
+msgstr "Zweite Sektion"
+
+#~ msgid "Grant UCI access to LuCI app ecample"
+#~ msgstr "UCI-Zugriff für LuCI Beispielanwendung gewähren"
diff --git a/applications/luci-app-example/po/en/example.po b/applications/luci-app-example/po/en/example.po
new file mode 100644
index 0000000000..36fb31752e
--- /dev/null
+++ b/applications/luci-app-example/po/en/example.po
@@ -0,0 +1,62 @@
+msgid ""
+msgstr "Content-Type: text/plain; charset=UTF-8\n"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:22
+msgid "A boolean option"
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:27
+msgid "A select option"
+msgstr ""
+
+#: applications/luci-app-example/root/usr/share/luci/menu.d/luci-app-example.json:3
+msgid "Example"
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:9
+msgid "Example Form"
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:10
+msgid "Example Form Configuration."
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/htmlview.js:16
+msgid "Example HTML Page"
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:15
+msgid "First Option"
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:21
+msgid "Flag Option"
+msgstr ""
+
+#: applications/luci-app-example/root/usr/share/luci/menu.d/luci-app-example.json:14
+msgid "Form View"
+msgstr ""
+
+#: applications/luci-app-example/root/usr/share/rpcd/acl.d/luci-app-example.json:3
+msgid "Grant UCI access to LuCI app example"
+msgstr ""
+
+#: applications/luci-app-example/root/usr/share/luci/menu.d/luci-app-example.json:23
+msgid "HTML Page"
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:16
+msgid "Input for the first option"
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:26
+msgid "Select Option"
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:12
+msgid "first section"
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:18
+msgid "second section"
+msgstr ""
diff --git a/applications/luci-app-example/po/es/example.po b/applications/luci-app-example/po/es/example.po
new file mode 100644
index 0000000000..f5c951356d
--- /dev/null
+++ b/applications/luci-app-example/po/es/example.po
@@ -0,0 +1,75 @@
+msgid ""
+msgstr ""
+"PO-Revision-Date: 2022-10-26 20:02+0000\n"
+"Last-Translator: Franco Castillo <castillofrancodamian@gmail.com>\n"
+"Language-Team: Spanish <https://hosted.weblate.org/projects/openwrt/"
+"luciapplicationsexample/es/>\n"
+"Language: es\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Weblate 4.14.2-dev\n"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:22
+msgid "A boolean option"
+msgstr "Una opción booleana"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:27
+msgid "A select option"
+msgstr "Una opción de selección"
+
+#: applications/luci-app-example/root/usr/share/luci/menu.d/luci-app-example.json:3
+msgid "Example"
+msgstr "Ejemplo"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:9
+msgid "Example Form"
+msgstr "Formulario de ejemplo"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:10
+msgid "Example Form Configuration."
+msgstr "Ejemplo de configuración de formulario."
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/htmlview.js:16
+msgid "Example HTML Page"
+msgstr "Ejemplo de página HTML"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:15
+msgid "First Option"
+msgstr "Primera opción"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:21
+#, fuzzy
+msgid "Flag Option"
+msgstr "Opción de indicador"
+
+#: applications/luci-app-example/root/usr/share/luci/menu.d/luci-app-example.json:14
+msgid "Form View"
+msgstr "Vista de formulario"
+
+#: applications/luci-app-example/root/usr/share/rpcd/acl.d/luci-app-example.json:3
+msgid "Grant UCI access to LuCI app example"
+msgstr "Conceder acceso UCI a LuCI app example"
+
+#: applications/luci-app-example/root/usr/share/luci/menu.d/luci-app-example.json:23
+msgid "HTML Page"
+msgstr "Página HTML"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:16
+msgid "Input for the first option"
+msgstr "Entrada para la primera opción"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:26
+msgid "Select Option"
+msgstr "Seleccionar opción"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:12
+msgid "first section"
+msgstr "primera sección"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:18
+msgid "second section"
+msgstr "segunda sección"
+
+#~ msgid "Grant UCI access to LuCI app ecample"
+#~ msgstr "Otorgar acceso UCI a la app Ejemplo de LuCI"
diff --git a/applications/luci-app-example/po/fr/example.po b/applications/luci-app-example/po/fr/example.po
new file mode 100644
index 0000000000..d1c8e5668a
--- /dev/null
+++ b/applications/luci-app-example/po/fr/example.po
@@ -0,0 +1,71 @@
+msgid ""
+msgstr ""
+"PO-Revision-Date: 2022-02-04 18:56+0000\n"
+"Last-Translator: ButterflyOfFire <ButterflyOfFire@protonmail.com>\n"
+"Language-Team: French <https://hosted.weblate.org/projects/openwrt/"
+"luciapplicationsexample/fr/>\n"
+"Language: fr\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n > 1;\n"
+"X-Generator: Weblate 4.11-dev\n"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:22
+msgid "A boolean option"
+msgstr "Option booléenne"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:27
+msgid "A select option"
+msgstr ""
+
+#: applications/luci-app-example/root/usr/share/luci/menu.d/luci-app-example.json:3
+msgid "Example"
+msgstr "Exemple"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:9
+msgid "Example Form"
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:10
+msgid "Example Form Configuration."
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/htmlview.js:16
+msgid "Example HTML Page"
+msgstr "Exemple de page HTML"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:15
+msgid "First Option"
+msgstr "Première option"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:21
+msgid "Flag Option"
+msgstr ""
+
+#: applications/luci-app-example/root/usr/share/luci/menu.d/luci-app-example.json:14
+msgid "Form View"
+msgstr ""
+
+#: applications/luci-app-example/root/usr/share/rpcd/acl.d/luci-app-example.json:3
+msgid "Grant UCI access to LuCI app example"
+msgstr ""
+
+#: applications/luci-app-example/root/usr/share/luci/menu.d/luci-app-example.json:23
+msgid "HTML Page"
+msgstr "Page HTML"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:16
+msgid "Input for the first option"
+msgstr "Entrée pour la première option"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:26
+msgid "Select Option"
+msgstr "Option de sélection"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:12
+msgid "first section"
+msgstr "Première section"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:18
+msgid "second section"
+msgstr "Deuxième section"
diff --git a/applications/luci-app-example/po/nb-NO/example.po b/applications/luci-app-example/po/nb-NO/example.po
new file mode 100644
index 0000000000..181af06ad2
--- /dev/null
+++ b/applications/luci-app-example/po/nb-NO/example.po
@@ -0,0 +1,65 @@
+msgid ""
+msgstr ""
+"Language: nb_NO\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:22
+msgid "A boolean option"
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:27
+msgid "A select option"
+msgstr ""
+
+#: applications/luci-app-example/root/usr/share/luci/menu.d/luci-app-example.json:3
+msgid "Example"
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:9
+msgid "Example Form"
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:10
+msgid "Example Form Configuration."
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/htmlview.js:16
+msgid "Example HTML Page"
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:15
+msgid "First Option"
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:21
+msgid "Flag Option"
+msgstr ""
+
+#: applications/luci-app-example/root/usr/share/luci/menu.d/luci-app-example.json:14
+msgid "Form View"
+msgstr ""
+
+#: applications/luci-app-example/root/usr/share/rpcd/acl.d/luci-app-example.json:3
+msgid "Grant UCI access to LuCI app example"
+msgstr ""
+
+#: applications/luci-app-example/root/usr/share/luci/menu.d/luci-app-example.json:23
+msgid "HTML Page"
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:16
+msgid "Input for the first option"
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:26
+msgid "Select Option"
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:12
+msgid "first section"
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:18
+msgid "second section"
+msgstr ""
diff --git a/applications/luci-app-example/po/templates/example.pot b/applications/luci-app-example/po/templates/example.pot
new file mode 100644
index 0000000000..264f4f35e4
--- /dev/null
+++ b/applications/luci-app-example/po/templates/example.pot
@@ -0,0 +1,62 @@
+msgid ""
+msgstr "Content-Type: text/plain; charset=UTF-8"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:22
+msgid "A boolean option"
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:27
+msgid "A select option"
+msgstr ""
+
+#: applications/luci-app-example/root/usr/share/luci/menu.d/luci-app-example.json:3
+msgid "Example"
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:9
+msgid "Example Form"
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:10
+msgid "Example Form Configuration."
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/htmlview.js:16
+msgid "Example HTML Page"
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:15
+msgid "First Option"
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:21
+msgid "Flag Option"
+msgstr ""
+
+#: applications/luci-app-example/root/usr/share/luci/menu.d/luci-app-example.json:14
+msgid "Form View"
+msgstr ""
+
+#: applications/luci-app-example/root/usr/share/rpcd/acl.d/luci-app-example.json:3
+msgid "Grant UCI access to LuCI app example"
+msgstr ""
+
+#: applications/luci-app-example/root/usr/share/luci/menu.d/luci-app-example.json:23
+msgid "HTML Page"
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:16
+msgid "Input for the first option"
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:26
+msgid "Select Option"
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:12
+msgid "first section"
+msgstr ""
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:18
+msgid "second section"
+msgstr ""
diff --git a/applications/luci-app-example/po/zh-Hans/example.po b/applications/luci-app-example/po/zh-Hans/example.po
new file mode 100644
index 0000000000..9388eb746d
--- /dev/null
+++ b/applications/luci-app-example/po/zh-Hans/example.po
@@ -0,0 +1,74 @@
+msgid ""
+msgstr ""
+"PO-Revision-Date: 2022-10-18 04:10+0000\n"
+"Last-Translator: Eric <hamburger1024@mailbox.org>\n"
+"Language-Team: Chinese (Simplified) <https://hosted.weblate.org/projects/"
+"openwrt/luciapplicationsexample/zh_Hans/>\n"
+"Language: zh-Hans\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+"X-Generator: Weblate 4.15-dev\n"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:22
+msgid "A boolean option"
+msgstr "布尔选项"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:27
+msgid "A select option"
+msgstr "选择选项"
+
+#: applications/luci-app-example/root/usr/share/luci/menu.d/luci-app-example.json:3
+msgid "Example"
+msgstr "示例"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:9
+msgid "Example Form"
+msgstr "示例表单"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:10
+msgid "Example Form Configuration."
+msgstr "示例表单配置。"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/htmlview.js:16
+msgid "Example HTML Page"
+msgstr "示例 HTML 页面"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:15
+msgid "First Option"
+msgstr "第一个选项"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:21
+msgid "Flag Option"
+msgstr "标记选项"
+
+#: applications/luci-app-example/root/usr/share/luci/menu.d/luci-app-example.json:14
+msgid "Form View"
+msgstr "表单视图"
+
+#: applications/luci-app-example/root/usr/share/rpcd/acl.d/luci-app-example.json:3
+msgid "Grant UCI access to LuCI app example"
+msgstr "授权 LuCI 应用样例访问 UCI"
+
+#: applications/luci-app-example/root/usr/share/luci/menu.d/luci-app-example.json:23
+msgid "HTML Page"
+msgstr "HTML 页面"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:16
+msgid "Input for the first option"
+msgstr "第一个选项的输入"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:26
+msgid "Select Option"
+msgstr "选择选项"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:12
+msgid "first section"
+msgstr "第一部分"
+
+#: applications/luci-app-example/htdocs/luci-static/resources/view/example/form.js:18
+msgid "second section"
+msgstr "第二部分"
+
+#~ msgid "Grant UCI access to LuCI app ecample"
+#~ msgstr "授予 LuCI app example UCI 访问权限"
diff --git a/applications/luci-app-example/root/etc/uci-defaults/80_example b/applications/luci-app-example/root/etc/uci-defaults/80_example
new file mode 100644
index 0000000000..529e6b0bd4
--- /dev/null
+++ b/applications/luci-app-example/root/etc/uci-defaults/80_example
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+touch /etc/config/example
+uci set example.first=first
+uci set example.second=second
+uci commit
+
+return 0
diff --git a/applications/luci-app-example/root/usr/share/luci/menu.d/luci-app-example.json b/applications/luci-app-example/root/usr/share/luci/menu.d/luci-app-example.json
new file mode 100644
index 0000000000..7b4772328a
--- /dev/null
+++ b/applications/luci-app-example/root/usr/share/luci/menu.d/luci-app-example.json
@@ -0,0 +1,30 @@
+{
+ "admin/example/": {
+ "title": "Example",
+ "order": 60,
+ "action": {
+ "type": "firstchild"
+ },
+ "depends": {
+ "acl": [ "luci-app-example" ]
+ }
+ },
+
+ "admin/example/form": {
+ "title": "Form View",
+ "order": 1,
+ "action": {
+ "type": "view",
+ "path": "example/form"
+ }
+ },
+
+ "admin/example/html": {
+ "title": "HTML Page",
+ "order": 2,
+ "action": {
+ "type": "view",
+ "path": "example/htmlview"
+ }
+ }
+}
diff --git a/applications/luci-app-example/root/usr/share/rpcd/acl.d/luci-app-example.json b/applications/luci-app-example/root/usr/share/rpcd/acl.d/luci-app-example.json
new file mode 100644
index 0000000000..136f9aed55
--- /dev/null
+++ b/applications/luci-app-example/root/usr/share/rpcd/acl.d/luci-app-example.json
@@ -0,0 +1,25 @@
+{
+ "luci-app-example": {
+ "description": "Grant UCI access to LuCI app example",
+ "read": {
+ "ubus": {
+ "uci": [
+ "get"
+ ]
+ },
+ "uci": [
+ "example"
+ ]
+ },
+ "write": {
+ "ubus": {
+ "uci": [
+ "set", "commit"
+ ]
+ },
+ "uci": [
+ "example"
+ ]
+ }
+ }
+}