openwrt ---Luci
--[[
luci 封裝好的html控制元件類可以在以下檔案檢視:./host/usr/lib/lua/luci/cbi.lua
Diagnostics 頁面相關檔案: controller/admin/network.lua, view/admin_network/diagnostics.htm
HTM 頁面的變數和lua互動, html中: name="ping", this.form.ping, lua中: diag_ping
<input style="width: 50%" type="text" value="openwrt.org" name="ping" />
<input type="button" value="<%:Ping%>" class="cbi-button cbi-button-apply" onclick="update_status(this.form.ping,this.form.proto)" />
page = entry({"admin", "network", "diag_ping"}, call("diag_ping"), nil)
#只修改 name="pingxu", this.form.pingxu, 頁面也執行, 出現如下錯誤:
No page is registered at '/admin/network/diag_pingxu/openwrt.org'.
If this url belongs to an extension, make sure it is properly installed.
If the extension was recently installed, try removing the /tmp/luci-indexcache file.
--- 再修改 diag_pingxu 則OK, page = entry({"admin", "network", "diag_pingxu"}, call("diag_ping"), nil)
在已有的lua檔案中修改, 網頁上可以直接看到介面; 增加或刪除lua檔案, 則必須重啟路由器才可以看到介面
#lua中增加頁面: view/xutest/web-cgi.htm, 字尾名必須為htm, 不能為html.
page.target = template("xutest/web-cgi")
/usr/lib/lua/luci/template.lua:81: Failed to load template 'xutest/web-cgi'.
Error while parsing template '/usr/lib/lua/luci/view/xutest/web-cgi.htm'.
#htm 中直接跳轉
<a href="http://www.w3school.com.cn/index.html">W3School web
#/www/xutest/web-cgi.html, uhttp預設的跟目錄和luci中的目錄不同. 192.168.1.1 換成localhost 則錯誤
<a href="http://192.168.1.1/xutest/web-cgi.html">web-cgi
#index.html中 直接執行luci命令
<a style="color: white; text-decoration: none" href="/cgi-bin/luci">LuCI - Lua Configuration Interface
]]--
page = node("admin", "network", "diagnostics")
-- 直接連結到 view 相應目錄下面的 htm 頁面
page.target = template("admin_network/diagnostics")
page.title = _("Diagnostics")
page.order = 60
1. luci線上API: http://luci.subsignal.org/api/luci/
2. luci實現框架: http://www.cnblogs.com/zmkeil/archive/2013/05/14/3078774.html
BusyBox v1.19.4 (2013-09-27 00:16:27 EDT) built-in shell (ash)
Enter 'help' for a list of built-in commands.
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
BARRIER BREAKER (Attitude Adjustment 12.09.1-qiushui007 test)
-----------------------------------------------------
* 1/2 oz Galliano Pour all ingredients into
* 4 oz cold Coffee an irish coffee mug filled
* 1 1/2 oz Dark Rum with crushed ice. Stir.
* 2 tsp. Creme de Cacao
-----------------------------------------------------
Filesystem Size Used Available Use% Mounted on
rootfs 5.3M 272.0K 5.0M 5% /
/dev/root 1.8M 1.8M 0 100% /rom
tmpfs 30.2M 88.0K 30.1M 0% /tmp
tmpfs 512.0K 0 512.0K 0% /dev
root 30.2M 48.0K 30.1M 0% /tmp/root
overlayfs:/tmp/root 30.2M 48.0K 30.1M 0% /tmp/root
/dev/mtdblock3 5.3M 272.0K 5.0M 5% /overlay
overlayfs:/overlay 5.3M 272.0K 5.0M 5% /
Downloading http://192.168.2.224/packages-ar71xx-AA/Packages.gz.
Updated list of available packages in /var/opkg-lists/snapshots.
[email protected]:/xutest# opkg install luci
Installing luci (0.11.1-1) to root...
Downloading http://192.168.2.224/packages-ar71xx-AA/luci_0.11.1-1_ar71xx.ipk.
Installing uhttpd (2012-10-30-e57bf6d8bfa465a50eea2c30269acdfe751a46fd) to root...
Downloading http://192.168.2.224/packages-ar71xx-AA/uhttpd_2012-10-30-e57bf6d8bfa465a50eea2c30269acdfe751a46fd_ar71xx.ipk.
Installing luci-mod-admin-full (0.11.1-1) to root...
Downloading http://192.168.2.224/packages-ar71xx-AA/luci-mod-admin-full_0.11.1-1_ar71xx.ipk.
Installing luci-mod-admin-core (0.11.1-1) to root...
Downloading http://192.168.2.224/packages-ar71xx-AA/luci-mod-admin-core_0.11.1-1_ar71xx.ipk.
Installing luci-lib-web (0.11.1-1) to root...
Downloading http://192.168.2.224/packages-ar71xx-AA/luci-lib-web_0.11.1-1_ar71xx.ipk.
Installing luci-lib-core (0.11.1-1) to root...
Downloading http://192.168.2.224/packages-ar71xx-AA/luci-lib-core_0.11.1-1_ar71xx.ipk.
Installing lua (5.1.4-8) to root...
Downloading http://192.168.2.224/packages-ar71xx-AA/lua_5.1.4-8_ar71xx.ipk.
Installing liblua (5.1.4-8) to root...
Downloading http://192.168.2.224/packages-ar71xx-AA/liblua_5.1.4-8_ar71xx.ipk.
Installing libuci-lua (2013-01-04.1-1) to root...
Downloading http://192.168.2.224/packages-ar71xx-AA/libuci-lua_2013-01-04.1-1_ar71xx.ipk.
Installing libubus-lua (2013-01-13-bf566871bd6a633e4504c60c6fc55b2a97305a50) to root...
Downloading http://192.168.2.224/packages-ar71xx-AA/libubus-lua_2013-01-13-bf566871bd6a633e4504c60c6fc55b2a97305a50_ar71xx.ipk.
Installing luci-lib-sys (0.11.1-1) to root...
Downloading http://192.168.2.224/packages-ar71xx-AA/luci-lib-sys_0.11.1-1_ar71xx.ipk.
Installing luci-lib-nixio (0.11.1-1) to root...
Downloading http://192.168.2.224/packages-ar71xx-AA/luci-lib-nixio_0.11.1-1_ar71xx.ipk.
Installing luci-sgi-cgi (0.11.1-1) to root...
Downloading http://192.168.2.224/packages-ar71xx-AA/luci-sgi-cgi_0.11.1-1_ar71xx.ipk.
Installing luci-proto-core (0.11.1-1) to root...
Downloading http://192.168.2.224/packages-ar71xx-AA/luci-proto-core_0.11.1-1_ar71xx.ipk.
Installing luci-i18n-english (0.11.1-1) to root...
Downloading http://192.168.2.224/packages-ar71xx-AA/luci-i18n-english_0.11.1-1_ar71xx.ipk.
Installing luci-lib-ipkg (0.11.1-1) to root...
Downloading http://192.168.2.224/packages-ar71xx-AA/luci-lib-ipkg_0.11.1-1_ar71xx.ipk.
Installing luci-theme-openwrt (0.11.1-1) to root...
Downloading http://192.168.2.224/packages-ar71xx-AA/luci-theme-openwrt_0.11.1-1_ar71xx.ipk.
Installing luci-theme-base (0.11.1-1) to root...
Downloading http://192.168.2.224/packages-ar71xx-AA/luci-theme-base_0.11.1-1_ar71xx.ipk.
Installing luci-app-firewall (0.11.1-1) to root...
Downloading http://192.168.2.224/packages-ar71xx-AA/luci-app-firewall_0.11.1-1_ar71xx.ipk.
Installing luci-proto-ppp (0.11.1-1) to root...
Downloading http://192.168.2.224/packages-ar71xx-AA/luci-proto-ppp_0.11.1-1_ar71xx.ipk.
Installing libiwinfo-lua (36) to root...
Downloading http://192.168.2.224/packages-ar71xx-AA/libiwinfo-lua_36_ar71xx.ipk.
Installing libiwinfo (36) to root...
Downloading http://192.168.2.224/packages-ar71xx-AA/libiwinfo_36_ar71xx.ipk.
Configuring luci-lib-sys.
Configuring liblua.
Configuring libuci-lua.
Configuring lua.
Configuring libubus-lua.
Configuring luci-lib-core.
Configuring luci-lib-nixio.
Configuring luci-sgi-cgi.
Configuring luci-lib-web.
Configuring luci-proto-core.
Configuring luci-i18n-english.
Configuring luci-mod-admin-core.
Configuring libiwinfo.
Configuring libiwinfo-lua.
Configuring luci-theme-base.
Configuring luci-theme-openwrt.
Configuring luci-app-firewall.
Configuring luci-lib-ipkg.
Configuring luci-proto-ppp.
Configuring luci-mod-admin-full.
Configuring uhttpd.
Configuring luci.
Collected errors:
* resolve_conffiles: Existing conffile /etc/config/luci is different from the conffile in the new package. The new conffile will be placed at /etc/config/luci-opkg.
[email protected]:/xutest# df -h
Filesystem Size Used Available Use% Mounted on
rootfs 5.3M 944.0K 4.4M 17% /
/dev/root 1.8M 1.8M 0 100% /rom
tmpfs 30.2M 388.0K 29.8M 1% /tmp
tmpfs 512.0K 0 512.0K 0% /dev
root 30.2M 48.0K 30.1M 0% /tmp/root
overlayfs:/tmp/root 30.2M 48.0K 30.1M 0% /tmp/root
/dev/mtdblock3 5.3M 944.0K 4.4M 17% /overlay
overlayfs:/overlay 5.3M 944.0K 4.4M 17% /
相關推薦
openwrt luci中文漢化
版權宣告:本文為博主原創文章,未經博主允許不得轉載。 https://blog.csdn.net/u011007991/article/details/70230916 前言 OpenWRT 的多語言支援此處只介紹中英文支援,首先OpenWRT的多語言支援其實就是
openwrt luci web解析
路由器:newifi mini 硬體資訊:mt7620a +mt7612e+128M DDR+16M flash 韌體: Pandorabox luci theme:lafite 主介面: winSCP登入 securieCRT 串列埠登
openwrt ---Luci
luci 參考資料 http://luci.subsignal.org/trac/wiki/Documentation http://wiki.openwrt.org/doc/techref/preinit_mount?#first.boot http://www.
Openwrt Luci介面開發
Openwrt已經提供了一個很強大的web管理介面Luci,可以方便的管理路由器。我們在開發智慧路由器時,一般就需要在OpenWrt的WEB介面增加內容。 1.Luci簡介 LuCI是OpenWrt上的Web管理介面,LuCI採用了MVC三層架構,使用Lua指令碼開發,所以
openwrt luci
一、如何修改LUCI原始碼如何修改該LuCI的原始碼,你首先需要了解一下LuCI基本知識,包括它的模組怎麼寫的,用的是lua語言等,LuCI實現啟動應用程式等指令碼命令,然後知道怎麼將luci編譯進韌體中去:輸入./scripts/feeds/ install luci。這樣子你就會發現feeds資料夾下面有
openwrt luci管理的Web介面例項
第一部分:template的方式實現網頁顯示hello world,如圖顯示:第一步:/usr/lib/lua/luci/controller/admin/system.lua中註冊選項:entry({
Openwrt系統中luci學習
1.Luci採用的是MCV框架,即是model,controller,view.在燒錄了編譯了luci的openwrt系統中,可以找到lua/luci陌路下的MCV三個目錄.其中model是抽象層,可以通過cbi開發基於框架下的介面;controller是控制層;而view則是介面層用來存放htm檔
openWRT學習之LUCI之一helloworld示例
備註1:本文 講述的是原生的openWRT環境下的LUCI 備註2:本文參考了諸多資料,感謝網友分享,參考資料: 文章開篇:新增一個選項,該選項處理結果:顯示hello world字串的網頁 注:我們先將頁面添加出來,然後我將分析如何為什麼這麼新增的。 目的:在s
openWRT學習之LUCI之二訪問controller下lua檔案的函式
備註:請關注之前的兩篇文章在做下面的工作 entry({"admin", "system", "heyg3"}, call("heyg3"), _("heyg3"), 5).dependent=false 同時在system.lua檔案中新增函式: --adde by h
OpenWrt新增LuCI的模組
【一、LuCI配置介面開發的框架】 LuCI是OpenWrt上的Web管理介面,LuCI採用了MVC三層架構,同時其使用Lua指令碼開發,所以開發LuCI的配置介面不需要編輯任何的Html程式碼,除非想自己單獨去建立網頁(View層),否則我們基本上只需要修改Model
Openwrt配置小記
穩定版 ann server mod ssh連接 dport port 固定ip lan 手中有臺Netgear WNR2000v3,一直想嘗試Openwrt,於是刷機。官方最新固件的穩定版本為15.05.1,該版本自帶luci,BUT,不能保存配置,上網查了很久,得出結論
OPENWRT中SSH免密鑰登陸(具體步驟)
文件 登陸 如果 roo article 能夠 -m zed track 通過使用ssh-keygen生成公鑰,在兩臺機器之間互相建立新人通道極客。 如果本地機器是client,遠程機器為server。 1、使用ssh-keygen生成rsa k
netgear 網件R6250路由 從OpenWrt或者DD-WRT系統恢復到默認系統 適合小白
openwrt恢復原廠固件 原文在這個連接,適合R6250。我順便把步驟詳細化,免得下次有小白遇到這個問題,耽誤太多的時間。 http://www.right.com.cn/forum/thread-155203-1-1.html 1.下載相關的固件 Version 1.0.0.62全名:R6250-V1.0
[無線路由] “免費”斐訊K2路由器刷OpenWRT(實戰MWAN多寬帶網速疊加)
blank balance -s 標準 理財 生效 數字 lin left (阿財首發於什麽值得買)斐訊K2可以算是一個非常另類的跨界數碼產品,其產品完全的醉翁之意不在酒。最多值99元的 MT7260硬件架構和用料,售價399元,金額激活K碼後自動轉入合作理財P2P平臺,等
初玩OpenWRT之編譯TP-Link WR841N V8固件
lan targe 分享 .com log 編輯 nwr 技術 blog 占坑,待編輯,先放一張圖 初玩OpenWRT之編譯TP-Link WR841N V8固件
集群 Ricci&&luci Fence機制
ha一 Ricci&&luciServer1和server4做同樣的操作, (1)配置yum 源[HighAvailability]name=HighAvailabilitybaseurl=http://172.25.21.250/rhel6.5/HighAvailabilitygpgchec
我的openwrt開發相關文章
strac wid ng- tail 大小端 能夠 light fig csdn openwrt學習筆記: 在openwrt的學習過程中,走了非常多的彎路。一直以來有個期盼。希望能夠出個簡易教程,希望openwrt的同仁們能夠更加高速的入手。 、
智能小車十五《安裝openwrt虛擬機》
sata 發現 虛擬硬盤 幫助 ads 硬盤 麥克風 generic 路由 小車要實現智能,單靠它上面的arduino uno單片機,計算能力實在不能滿足要求。比如要放個攝像頭或放點音樂,它基本不能實現。我先讓它長上"眼鏡",給他裝個攝像頭。 我找了下實現方案,發現現在已經
openwrt 添加 802.1x客戶端njit
git 執行 修改 fault 位置 all http 配置文件 com 1、修改feed的配置文件 feeds.conf.default 添加下面兩句: src-svn njit https://github.com/liuqun/openwrt-c
Openwrt 路由器上 安裝 svn server
ont span conf 功能 tel nbsp 介紹 all svnadmin Openwrt 上也可以搭建 svn 服務了,這樣就不用開著 ubuntu 了,省電。 在後臺打開 ssh 服務,或者使用 telnet 服務,使用 putty 登錄路由器。 如下圖所示,這