summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-example
diff options
context:
space:
mode:
authorSergey Ponomarev <stokito@gmail.com>2022-10-13 14:27:15 +0300
committerSergey Ponomarev <stokito@gmail.com>2022-10-13 14:27:15 +0300
commit7b073526a659842d942a3a0e4717ddba3ee6eadb (patch)
tree07dd4d873bc746653d97b91c39d0ef52b2d970cd /applications/luci-app-example
parentb0b9a34f8b75f9c2c91cb6a4badcc4e8e4122821 (diff)
luci-app-example: improve description
Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
Diffstat (limited to 'applications/luci-app-example')
-rw-r--r--applications/luci-app-example/README.md16
-rw-r--r--applications/luci-app-example/root/usr/share/rpcd/acl.d/luci-app-example.json2
2 files changed, 16 insertions, 2 deletions
diff --git a/applications/luci-app-example/README.md b/applications/luci-app-example/README.md
index 379bb7e032..23a3a3a179 100644
--- a/applications/luci-app-example/README.md
+++ b/applications/luci-app-example/README.md
@@ -2,10 +2,24 @@
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. One is based on a view with a form and makes use of internal models. The other one uses the `E()`-method to create more flexibel pages.
+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/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
index 998cb4b0e1..136f9aed55 100644
--- 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
@@ -1,6 +1,6 @@
{
"luci-app-example": {
- "description": "Grant UCI access to LuCI app ecample",
+ "description": "Grant UCI access to LuCI app example",
"read": {
"ubus": {
"uci": [