From 620068ecb040f721d4de03dadcda68f784674059 Mon Sep 17 00:00:00 2001 From: Sukru Senli Date: Tue, 14 Apr 2015 10:32:30 +0200 Subject: [PATCH] BB: carry luci2 from feeds to local package dir --- luci2/luci2-p910nd/Makefile | 36 + .../usr/share/rpcd/acl.d/services.p910nd.json | 15 + .../share/rpcd/menu.d/services.p910nd.json | 11 + .../www/luci2/template/services.p910nd.htm | 1 + .../files/www/luci2/view/services.p910nd.js | 61 + luci2/luci2/Makefile | 62 + luci2/luci2/htdocs/luci2.html | 59 + luci2/luci2/htdocs/luci2/bootstrap.js | 1488 +++ luci2/luci2/htdocs/luci2/cbi.js | 3329 ++++++ luci2/luci2/htdocs/luci2/css/bootstrap.css | 5061 +++++++++ luci2/luci2/htdocs/luci2/css/luci2.css | 268 + luci2/luci2/htdocs/luci2/firewall.js | 50 + luci2/luci2/htdocs/luci2/html5.js | 8 + luci2/luci2/htdocs/luci2/icons/bridge.png | Bin 0 -> 838 bytes .../htdocs/luci2/icons/bridge_disabled.png | Bin 0 -> 517 bytes luci2/luci2/htdocs/luci2/icons/cbi/add.gif | Bin 0 -> 378 bytes luci2/luci2/htdocs/luci2/icons/cbi/apply.gif | Bin 0 -> 268 bytes luci2/luci2/htdocs/luci2/icons/cbi/arrow.gif | Bin 0 -> 135 bytes luci2/luci2/htdocs/luci2/icons/cbi/down.gif | Bin 0 -> 131 bytes .../luci2/htdocs/luci2/icons/cbi/download.gif | Bin 0 -> 189 bytes luci2/luci2/htdocs/luci2/icons/cbi/edit.gif | Bin 0 -> 280 bytes .../luci2/htdocs/luci2/icons/cbi/fieldadd.gif | Bin 0 -> 379 bytes luci2/luci2/htdocs/luci2/icons/cbi/file.gif | Bin 0 -> 371 bytes luci2/luci2/htdocs/luci2/icons/cbi/find.gif | Bin 0 -> 273 bytes luci2/luci2/htdocs/luci2/icons/cbi/folder.gif | Bin 0 -> 698 bytes luci2/luci2/htdocs/luci2/icons/cbi/help.gif | Bin 0 -> 266 bytes luci2/luci2/htdocs/luci2/icons/cbi/key.gif | Bin 0 -> 230 bytes luci2/luci2/htdocs/luci2/icons/cbi/link.gif | Bin 0 -> 279 bytes luci2/luci2/htdocs/luci2/icons/cbi/reload.gif | Bin 0 -> 248 bytes luci2/luci2/htdocs/luci2/icons/cbi/remove.gif | Bin 0 -> 385 bytes luci2/luci2/htdocs/luci2/icons/cbi/reset.gif | Bin 0 -> 258 bytes luci2/luci2/htdocs/luci2/icons/cbi/save.gif | Bin 0 -> 263 bytes luci2/luci2/htdocs/luci2/icons/cbi/up.gif | Bin 0 -> 130 bytes luci2/luci2/htdocs/luci2/icons/cbi/user.gif | Bin 0 -> 246 bytes luci2/luci2/htdocs/luci2/icons/encryption.png | Bin 0 -> 1224 bytes .../luci2/icons/encryption_disabled.png | Bin 0 -> 1197 bytes luci2/luci2/htdocs/luci2/icons/ethernet.png | Bin 0 -> 814 bytes .../htdocs/luci2/icons/ethernet_disabled.png | Bin 0 -> 508 bytes luci2/luci2/htdocs/luci2/icons/loading.gif | Bin 0 -> 1787 bytes luci2/luci2/htdocs/luci2/icons/port_down.png | Bin 0 -> 982 bytes luci2/luci2/htdocs/luci2/icons/port_up.png | Bin 0 -> 1401 bytes luci2/luci2/htdocs/luci2/icons/progress.gif | Bin 0 -> 1738 bytes .../luci2/htdocs/luci2/icons/signal-0-25.png | Bin 0 -> 495 bytes luci2/luci2/htdocs/luci2/icons/signal-0.png | Bin 0 -> 478 bytes .../luci2/htdocs/luci2/icons/signal-25-50.png | Bin 0 -> 501 bytes .../luci2/htdocs/luci2/icons/signal-50-75.png | Bin 0 -> 500 bytes .../htdocs/luci2/icons/signal-75-100.png | Bin 0 -> 485 bytes .../luci2/htdocs/luci2/icons/signal-none.png | Bin 0 -> 681 bytes luci2/luci2/htdocs/luci2/icons/switch.png | Bin 0 -> 794 bytes .../htdocs/luci2/icons/switch_disabled.png | Bin 0 -> 505 bytes luci2/luci2/htdocs/luci2/icons/tunnel.png | Bin 0 -> 533 bytes .../htdocs/luci2/icons/tunnel_disabled.png | Bin 0 -> 546 bytes luci2/luci2/htdocs/luci2/icons/vlan.png | Bin 0 -> 794 bytes .../htdocs/luci2/icons/vlan_disabled.png | Bin 0 -> 505 bytes luci2/luci2/htdocs/luci2/icons/wifi.png | Bin 0 -> 1037 bytes luci2/luci2/htdocs/luci2/icons/wifi_big.png | Bin 0 -> 2865 bytes .../htdocs/luci2/icons/wifi_big_disabled.png | Bin 0 -> 2853 bytes .../htdocs/luci2/icons/wifi_disabled.png | Bin 0 -> 980 bytes luci2/luci2/htdocs/luci2/jquery-1.9.1.js | 9597 +++++++++++++++++ luci2/luci2/htdocs/luci2/jquery.peity.js | 261 + luci2/luci2/htdocs/luci2/luci2.js | 705 ++ luci2/luci2/htdocs/luci2/network.js | 1447 +++ luci2/luci2/htdocs/luci2/proto/6in4.js | 90 + luci2/luci2/htdocs/luci2/proto/6rd.js | 63 + luci2/luci2/htdocs/luci2/proto/6to4.js | 35 + luci2/luci2/htdocs/luci2/proto/dhcp.js | 60 + luci2/luci2/htdocs/luci2/proto/dhcpv6.js | 59 + luci2/luci2/htdocs/luci2/proto/dslite.js | 46 + luci2/luci2/htdocs/luci2/proto/none.js | 6 + luci2/luci2/htdocs/luci2/proto/static.js | 113 + luci2/luci2/htdocs/luci2/respond.min.js | 6 + luci2/luci2/htdocs/luci2/rpc.js | 188 + luci2/luci2/htdocs/luci2/session.js | 78 + luci2/luci2/htdocs/luci2/system.js | 82 + .../luci2/template/network.diagnostics.htm | 20 + .../htdocs/luci2/template/network.hosts.htm | 1 + .../luci2/template/network.interfaces.htm | 1 + .../htdocs/luci2/template/network.routes.htm | 1 + .../htdocs/luci2/template/network.switch.htm | 1 + .../luci2/template/network.wireless.htm | 1 + .../htdocs/luci2/template/status.dmesg.htm | 1 + .../htdocs/luci2/template/status.overview.htm | 10 + .../luci2/template/status.processes.htm | 1 + .../htdocs/luci2/template/status.routes.htm | 3 + .../htdocs/luci2/template/status.syslog.htm | 1 + .../htdocs/luci2/template/system.admin.htm | 1 + .../htdocs/luci2/template/system.cron.htm | 6 + .../htdocs/luci2/template/system.leds.htm | 1 + .../htdocs/luci2/template/system.software.htm | 71 + .../htdocs/luci2/template/system.startup.htm | 21 + .../htdocs/luci2/template/system.system.htm | 1 + .../htdocs/luci2/template/system.upgrade.htm | 51 + .../htdocs/luci2/template/system.users.htm | 1 + luci2/luci2/htdocs/luci2/uci.js | 532 + luci2/luci2/htdocs/luci2/ui.js | 1580 +++ .../htdocs/luci2/view/network.diagnostics.js | 90 + .../luci2/htdocs/luci2/view/network.hosts.js | 29 + .../htdocs/luci2/view/network.interfaces.js | 361 + .../luci2/htdocs/luci2/view/network.routes.js | 110 + .../luci2/htdocs/luci2/view/network.switch.js | 338 + .../htdocs/luci2/view/network.wireless.js | 89 + luci2/luci2/htdocs/luci2/view/status.dmesg.js | 20 + .../htdocs/luci2/view/status.overview.js | 427 + .../htdocs/luci2/view/status.processes.js | 80 + .../luci2/htdocs/luci2/view/status.routes.js | 99 + .../luci2/htdocs/luci2/view/status.syslog.js | 20 + luci2/luci2/htdocs/luci2/view/system.admin.js | 373 + luci2/luci2/htdocs/luci2/view/system.cron.js | 33 + luci2/luci2/htdocs/luci2/view/system.leds.js | 121 + .../htdocs/luci2/view/system.software.js | 361 + .../luci2/htdocs/luci2/view/system.startup.js | 103 + .../luci2/htdocs/luci2/view/system.system.js | 212 + .../luci2/htdocs/luci2/view/system.upgrade.js | 290 + luci2/luci2/htdocs/luci2/view/system.users.js | 317 + luci2/luci2/htdocs/luci2/wireless.js | 181 + luci2/luci2/htdocs/luci2/zoneinfo.json | 1 + luci2/luci2/share/acl.d/luci2.json | 361 + luci2/luci2/share/menu.d/network.json | 44 + luci2/luci2/share/menu.d/status.json | 36 + luci2/luci2/share/menu.d/system.json | 56 + luci2/luci2/src/CMakeLists.txt | 6 + luci2/luci2/src/io/CMakeLists.txt | 19 + luci2/luci2/src/io/main.c | 644 ++ luci2/luci2/src/io/multipart_parser.c | 309 + luci2/luci2/src/io/multipart_parser.h | 48 + luci2/luci2/src/rpcd/CMakeLists.txt | 26 + luci2/luci2/src/rpcd/bwmon.c | 283 + luci2/luci2/src/rpcd/luci2.c | 2906 +++++ 128 files changed, 33984 insertions(+) create mode 100644 luci2/luci2-p910nd/Makefile create mode 100644 luci2/luci2-p910nd/files/usr/share/rpcd/acl.d/services.p910nd.json create mode 100644 luci2/luci2-p910nd/files/usr/share/rpcd/menu.d/services.p910nd.json create mode 100644 luci2/luci2-p910nd/files/www/luci2/template/services.p910nd.htm create mode 100644 luci2/luci2-p910nd/files/www/luci2/view/services.p910nd.js create mode 100644 luci2/luci2/Makefile create mode 100644 luci2/luci2/htdocs/luci2.html create mode 100644 luci2/luci2/htdocs/luci2/bootstrap.js create mode 100644 luci2/luci2/htdocs/luci2/cbi.js create mode 100644 luci2/luci2/htdocs/luci2/css/bootstrap.css create mode 100644 luci2/luci2/htdocs/luci2/css/luci2.css create mode 100644 luci2/luci2/htdocs/luci2/firewall.js create mode 100644 luci2/luci2/htdocs/luci2/html5.js create mode 100644 luci2/luci2/htdocs/luci2/icons/bridge.png create mode 100644 luci2/luci2/htdocs/luci2/icons/bridge_disabled.png create mode 100644 luci2/luci2/htdocs/luci2/icons/cbi/add.gif create mode 100644 luci2/luci2/htdocs/luci2/icons/cbi/apply.gif create mode 100644 luci2/luci2/htdocs/luci2/icons/cbi/arrow.gif create mode 100644 luci2/luci2/htdocs/luci2/icons/cbi/down.gif create mode 100644 luci2/luci2/htdocs/luci2/icons/cbi/download.gif create mode 100644 luci2/luci2/htdocs/luci2/icons/cbi/edit.gif create mode 100644 luci2/luci2/htdocs/luci2/icons/cbi/fieldadd.gif create mode 100644 luci2/luci2/htdocs/luci2/icons/cbi/file.gif create mode 100644 luci2/luci2/htdocs/luci2/icons/cbi/find.gif create mode 100644 luci2/luci2/htdocs/luci2/icons/cbi/folder.gif create mode 100644 luci2/luci2/htdocs/luci2/icons/cbi/help.gif create mode 100644 luci2/luci2/htdocs/luci2/icons/cbi/key.gif create mode 100644 luci2/luci2/htdocs/luci2/icons/cbi/link.gif create mode 100644 luci2/luci2/htdocs/luci2/icons/cbi/reload.gif create mode 100644 luci2/luci2/htdocs/luci2/icons/cbi/remove.gif create mode 100644 luci2/luci2/htdocs/luci2/icons/cbi/reset.gif create mode 100644 luci2/luci2/htdocs/luci2/icons/cbi/save.gif create mode 100644 luci2/luci2/htdocs/luci2/icons/cbi/up.gif create mode 100644 luci2/luci2/htdocs/luci2/icons/cbi/user.gif create mode 100644 luci2/luci2/htdocs/luci2/icons/encryption.png create mode 100644 luci2/luci2/htdocs/luci2/icons/encryption_disabled.png create mode 100644 luci2/luci2/htdocs/luci2/icons/ethernet.png create mode 100644 luci2/luci2/htdocs/luci2/icons/ethernet_disabled.png create mode 100644 luci2/luci2/htdocs/luci2/icons/loading.gif create mode 100644 luci2/luci2/htdocs/luci2/icons/port_down.png create mode 100644 luci2/luci2/htdocs/luci2/icons/port_up.png create mode 100644 luci2/luci2/htdocs/luci2/icons/progress.gif create mode 100644 luci2/luci2/htdocs/luci2/icons/signal-0-25.png create mode 100644 luci2/luci2/htdocs/luci2/icons/signal-0.png create mode 100644 luci2/luci2/htdocs/luci2/icons/signal-25-50.png create mode 100644 luci2/luci2/htdocs/luci2/icons/signal-50-75.png create mode 100644 luci2/luci2/htdocs/luci2/icons/signal-75-100.png create mode 100644 luci2/luci2/htdocs/luci2/icons/signal-none.png create mode 100644 luci2/luci2/htdocs/luci2/icons/switch.png create mode 100644 luci2/luci2/htdocs/luci2/icons/switch_disabled.png create mode 100644 luci2/luci2/htdocs/luci2/icons/tunnel.png create mode 100644 luci2/luci2/htdocs/luci2/icons/tunnel_disabled.png create mode 100644 luci2/luci2/htdocs/luci2/icons/vlan.png create mode 100644 luci2/luci2/htdocs/luci2/icons/vlan_disabled.png create mode 100644 luci2/luci2/htdocs/luci2/icons/wifi.png create mode 100644 luci2/luci2/htdocs/luci2/icons/wifi_big.png create mode 100644 luci2/luci2/htdocs/luci2/icons/wifi_big_disabled.png create mode 100644 luci2/luci2/htdocs/luci2/icons/wifi_disabled.png create mode 100644 luci2/luci2/htdocs/luci2/jquery-1.9.1.js create mode 100644 luci2/luci2/htdocs/luci2/jquery.peity.js create mode 100644 luci2/luci2/htdocs/luci2/luci2.js create mode 100644 luci2/luci2/htdocs/luci2/network.js create mode 100644 luci2/luci2/htdocs/luci2/proto/6in4.js create mode 100644 luci2/luci2/htdocs/luci2/proto/6rd.js create mode 100644 luci2/luci2/htdocs/luci2/proto/6to4.js create mode 100644 luci2/luci2/htdocs/luci2/proto/dhcp.js create mode 100644 luci2/luci2/htdocs/luci2/proto/dhcpv6.js create mode 100644 luci2/luci2/htdocs/luci2/proto/dslite.js create mode 100644 luci2/luci2/htdocs/luci2/proto/none.js create mode 100644 luci2/luci2/htdocs/luci2/proto/static.js create mode 100644 luci2/luci2/htdocs/luci2/respond.min.js create mode 100644 luci2/luci2/htdocs/luci2/rpc.js create mode 100644 luci2/luci2/htdocs/luci2/session.js create mode 100644 luci2/luci2/htdocs/luci2/system.js create mode 100644 luci2/luci2/htdocs/luci2/template/network.diagnostics.htm create mode 100644 luci2/luci2/htdocs/luci2/template/network.hosts.htm create mode 100644 luci2/luci2/htdocs/luci2/template/network.interfaces.htm create mode 100644 luci2/luci2/htdocs/luci2/template/network.routes.htm create mode 100644 luci2/luci2/htdocs/luci2/template/network.switch.htm create mode 100644 luci2/luci2/htdocs/luci2/template/network.wireless.htm create mode 100644 luci2/luci2/htdocs/luci2/template/status.dmesg.htm create mode 100644 luci2/luci2/htdocs/luci2/template/status.overview.htm create mode 100644 luci2/luci2/htdocs/luci2/template/status.processes.htm create mode 100644 luci2/luci2/htdocs/luci2/template/status.routes.htm create mode 100644 luci2/luci2/htdocs/luci2/template/status.syslog.htm create mode 100644 luci2/luci2/htdocs/luci2/template/system.admin.htm create mode 100644 luci2/luci2/htdocs/luci2/template/system.cron.htm create mode 100644 luci2/luci2/htdocs/luci2/template/system.leds.htm create mode 100644 luci2/luci2/htdocs/luci2/template/system.software.htm create mode 100644 luci2/luci2/htdocs/luci2/template/system.startup.htm create mode 100644 luci2/luci2/htdocs/luci2/template/system.system.htm create mode 100644 luci2/luci2/htdocs/luci2/template/system.upgrade.htm create mode 100644 luci2/luci2/htdocs/luci2/template/system.users.htm create mode 100644 luci2/luci2/htdocs/luci2/uci.js create mode 100644 luci2/luci2/htdocs/luci2/ui.js create mode 100644 luci2/luci2/htdocs/luci2/view/network.diagnostics.js create mode 100644 luci2/luci2/htdocs/luci2/view/network.hosts.js create mode 100644 luci2/luci2/htdocs/luci2/view/network.interfaces.js create mode 100644 luci2/luci2/htdocs/luci2/view/network.routes.js create mode 100644 luci2/luci2/htdocs/luci2/view/network.switch.js create mode 100644 luci2/luci2/htdocs/luci2/view/network.wireless.js create mode 100644 luci2/luci2/htdocs/luci2/view/status.dmesg.js create mode 100644 luci2/luci2/htdocs/luci2/view/status.overview.js create mode 100644 luci2/luci2/htdocs/luci2/view/status.processes.js create mode 100644 luci2/luci2/htdocs/luci2/view/status.routes.js create mode 100644 luci2/luci2/htdocs/luci2/view/status.syslog.js create mode 100644 luci2/luci2/htdocs/luci2/view/system.admin.js create mode 100644 luci2/luci2/htdocs/luci2/view/system.cron.js create mode 100644 luci2/luci2/htdocs/luci2/view/system.leds.js create mode 100644 luci2/luci2/htdocs/luci2/view/system.software.js create mode 100644 luci2/luci2/htdocs/luci2/view/system.startup.js create mode 100644 luci2/luci2/htdocs/luci2/view/system.system.js create mode 100644 luci2/luci2/htdocs/luci2/view/system.upgrade.js create mode 100644 luci2/luci2/htdocs/luci2/view/system.users.js create mode 100644 luci2/luci2/htdocs/luci2/wireless.js create mode 100644 luci2/luci2/htdocs/luci2/zoneinfo.json create mode 100644 luci2/luci2/share/acl.d/luci2.json create mode 100644 luci2/luci2/share/menu.d/network.json create mode 100644 luci2/luci2/share/menu.d/status.json create mode 100644 luci2/luci2/share/menu.d/system.json create mode 100644 luci2/luci2/src/CMakeLists.txt create mode 100644 luci2/luci2/src/io/CMakeLists.txt create mode 100644 luci2/luci2/src/io/main.c create mode 100644 luci2/luci2/src/io/multipart_parser.c create mode 100644 luci2/luci2/src/io/multipart_parser.h create mode 100644 luci2/luci2/src/rpcd/CMakeLists.txt create mode 100644 luci2/luci2/src/rpcd/bwmon.c create mode 100644 luci2/luci2/src/rpcd/luci2.c diff --git a/luci2/luci2-p910nd/Makefile b/luci2/luci2-p910nd/Makefile new file mode 100644 index 000000000..50aeadceb --- /dev/null +++ b/luci2/luci2-p910nd/Makefile @@ -0,0 +1,36 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=luci2-p910nd +PKG_RELEASE:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/luci2-p910nd + SECTION:=luci2 + CATEGORY:=LuCI2 + TITLE:=LuCI2 p910nd module + DEPENDS:=luci2 p910nd +endef + +define Package/luci2-p910nd/description + LuCI2 module for p910nd printer daemon management +endef + +define Build/Compile +endef + +define Package/luci2-p910nd/install + $(INSTALL_DIR) $(1)/usr/share/rpcd/menu.d + $(INSTALL_DATA) ./files/usr/share/rpcd/menu.d/services.p910nd.json $(1)/usr/share/rpcd/menu.d/ + + $(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d + $(INSTALL_DATA) ./files/usr/share/rpcd/acl.d/services.p910nd.json $(1)/usr/share/rpcd/acl.d/ + + $(INSTALL_DIR) $(1)/www/luci2/template + $(INSTALL_DATA) ./files/www/luci2/template/services.p910nd.htm $(1)/www/luci2/template + + $(INSTALL_DIR) $(1)/www/luci2/view + $(INSTALL_DATA) ./files/www/luci2/view/services.p910nd.js $(1)/www/luci2/view +endef + +$(eval $(call BuildPackage,luci2-p910nd)) diff --git a/luci2/luci2-p910nd/files/usr/share/rpcd/acl.d/services.p910nd.json b/luci2/luci2-p910nd/files/usr/share/rpcd/acl.d/services.p910nd.json new file mode 100644 index 000000000..dac817843 --- /dev/null +++ b/luci2/luci2-p910nd/files/usr/share/rpcd/acl.d/services.p910nd.json @@ -0,0 +1,15 @@ +{ + "p910nd": { + "description": "P910ND management", + "read": { + "uci": [ + "p910nd" + ] + }, + "write": { + "uci": [ + "p910nd" + ] + } + } +} \ No newline at end of file diff --git a/luci2/luci2-p910nd/files/usr/share/rpcd/menu.d/services.p910nd.json b/luci2/luci2-p910nd/files/usr/share/rpcd/menu.d/services.p910nd.json new file mode 100644 index 000000000..1522e198f --- /dev/null +++ b/luci2/luci2-p910nd/files/usr/share/rpcd/menu.d/services.p910nd.json @@ -0,0 +1,11 @@ +{ + "services": { + "title": "Services", + "index": 40 + }, + "services/p910nd": { + "title": "p910nd", + "acls": [ "p910nd" ], + "view": "services/p910nd" + } +} \ No newline at end of file diff --git a/luci2/luci2-p910nd/files/www/luci2/template/services.p910nd.htm b/luci2/luci2-p910nd/files/www/luci2/template/services.p910nd.htm new file mode 100644 index 000000000..ad19e7dab --- /dev/null +++ b/luci2/luci2-p910nd/files/www/luci2/template/services.p910nd.htm @@ -0,0 +1 @@ +
diff --git a/luci2/luci2-p910nd/files/www/luci2/view/services.p910nd.js b/luci2/luci2-p910nd/files/www/luci2/view/services.p910nd.js new file mode 100644 index 000000000..d024b24b5 --- /dev/null +++ b/luci2/luci2-p910nd/files/www/luci2/view/services.p910nd.js @@ -0,0 +1,61 @@ +L.ui.view.extend({ + PortValue: L.cbi.InputValue.extend({ + ucivalue: function(sid) + { + var v = this.callSuper('ucivalue', sid); + if (typeof v == 'undefined') + return ''; + + return 9100 + parseInt(v); + }, + + formvalue: function(sid) + { + var v = $('#' + this.id(sid)).val(); + + return parseInt(v) - 9100; + } + }), + + execute: function() { + var self = this; + + var m = new L.cbi.Map('p910nd', { + caption: L.tr('p910nd printer daemon') + }); + + var s = m.section(L.cbi.TypedSection, 'p910nd', { + caption: L.tr('Printers'), + addremove: true, + add_caption: L.tr('Add shared printer …'), + }); + + s.option(L.cbi.CheckboxValue, 'enabled', { + caption: L.tr('Enabled'), + initial: 0, + enabled: '1', + disabled: '0' + }); + + s.option(self.PortValue, 'port', { + caption: L.tr('Port'), + description: L.tr('Specifies the listening port'), + datatype: 'range(9100, 65535)' + }); + + s.option(L.cbi.InputValue, 'device', { + caption: L.tr('Device'), + description: L.tr('Printer device path in the filesystem') + }); + + s.option(L.cbi.CheckboxValue, 'bidirectional', { + caption: L.tr('Bidirectional'), + description: L.tr('Bidirectional copying'), + initial: 1, + enabled: '1', + disabled: '0' + }); + + return m.insertInto('#map'); + } +}); diff --git a/luci2/luci2/Makefile b/luci2/luci2/Makefile new file mode 100644 index 000000000..014077435 --- /dev/null +++ b/luci2/luci2/Makefile @@ -0,0 +1,62 @@ +# +# Copyright (C) 2013 Jo-Philipp Wich +# +# Licensed under the Apache License, Version 2.0. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=luci2 +PKG_VERSION:=$(shell git --git-dir=$(CURDIR)/../.git log -1 --pretty="%ci %h" | awk '{ print $$1 "-" $$4 }') +PKG_MAINTAINER:=Jo-Philipp Wich + +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:= + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Build/Prepare + $(INSTALL_DIR) $(PKG_BUILD_DIR) + $(CP) ./src/* $(PKG_BUILD_DIR)/ +endef + +define Package/luci2 + SECTION:=luci2 + CATEGORY:=LuCI2 + TITLE:=LuCI2 UI + DEPENDS:=+rpcd +rpcd-mod-iwinfo +uhttpd +uhttpd-mod-ubus +libubox +libubus +endef + +define Package/luci2/description + Provides the LuCI2 web interface with standard functionality. +endef + +define Package/luci2/install + $(INSTALL_DIR) $(1)/www + $(CP) ./htdocs/* $(1)/www/ + $(INSTALL_DIR) $(1)/usr/share/rpcd + $(CP) ./share/* $(1)/usr/share/rpcd/ + $(INSTALL_DIR) $(1)/usr/lib/rpcd + $(INSTALL_BIN) $(PKG_BUILD_DIR)/rpcd/luci2.so $(1)/usr/lib/rpcd/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/rpcd/bwmon.so $(1)/usr/lib/rpcd/ + $(INSTALL_DIR) $(1)/usr/libexec $(1)/www/cgi-bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/io/luci2-io $(1)/usr/libexec/ + $(LN) /usr/libexec/luci2-io $(1)/www/cgi-bin/luci-upload + $(LN) /usr/libexec/luci2-io $(1)/www/cgi-bin/luci-backup +endef + +define Package/luci2/postinst +#!/bin/sh + +if [ "$$(uci -q get uhttpd.main.ubus_prefix)" != "/ubus" ]; then + uci set uhttpd.main.ubus_prefix="/ubus" + uci commit uhttpd +fi + +exit 0 +endef + +$(eval $(call BuildPackage,luci2)) diff --git a/luci2/luci2/htdocs/luci2.html b/luci2/luci2/htdocs/luci2.html new file mode 100644 index 000000000..47c74c7b8 --- /dev/null +++ b/luci2/luci2/htdocs/luci2.html @@ -0,0 +1,59 @@ + + + + LuCI2 + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + diff --git a/luci2/luci2/htdocs/luci2/bootstrap.js b/luci2/luci2/htdocs/luci2/bootstrap.js new file mode 100644 index 000000000..847ab8197 --- /dev/null +++ b/luci2/luci2/htdocs/luci2/bootstrap.js @@ -0,0 +1,1488 @@ +/* ======================================================================== + * Bootstrap: alert.js v3.0.0 + * http://twbs.github.com/bootstrap/javascript.html#alerts + * ======================================================================== + * Copyright 2013 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ======================================================================== */ + + ++function ($) { "use strict"; + + // ALERT CLASS DEFINITION + // ====================== + + var dismiss = '[data-dismiss="alert"]' + var Alert = function (el) { + $(el).on('click', dismiss, this.close) + } + + Alert.prototype.close = function (e) { + var $this = $(this) + var selector = $this.attr('data-target') + + if (!selector) { + selector = $this.attr('href') + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 + } + + var $parent = $(selector) + + if (e) e.preventDefault() + + if (!$parent.length) { + $parent = $this.hasClass('alert') ? $this : $this.parent() + } + + $parent.trigger(e = $.Event('close.bs.alert')) + + if (e.isDefaultPrevented()) return + + $parent.removeClass('in') + + function removeElement() { + $parent.trigger('closed.bs.alert').remove() + } + + $.support.transition && $parent.hasClass('fade') ? + $parent + .one($.support.transition.end, removeElement) + .emulateTransitionEnd(150) : + removeElement() + } + + + // ALERT PLUGIN DEFINITION + // ======================= + + var old = $.fn.alert + + $.fn.alert = function (option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.alert') + + if (!data) $this.data('bs.alert', (data = new Alert(this))) + if (typeof option == 'string') data[option].call($this) + }) + } + + $.fn.alert.Constructor = Alert + + + // ALERT NO CONFLICT + // ================= + + $.fn.alert.noConflict = function () { + $.fn.alert = old + return this + } + + + // ALERT DATA-API + // ============== + + $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) + +}(window.jQuery); + +/* ======================================================================== + * Bootstrap: button.js v3.0.0 + * http://twbs.github.com/bootstrap/javascript.html#buttons + * ======================================================================== + * Copyright 2013 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ======================================================================== */ + + ++function ($) { "use strict"; + + // BUTTON PUBLIC CLASS DEFINITION + // ============================== + + var Button = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, Button.DEFAULTS, options) + } + + Button.DEFAULTS = { + loadingText: 'loading...' + } + + Button.prototype.setState = function (state) { + var d = 'disabled' + var $el = this.$element + var val = $el.is('input') ? 'val' : 'html' + var data = $el.data() + + state = state + 'Text' + + if (!data.resetText) $el.data('resetText', $el[val]()) + + $el[val](data[state] || this.options[state]) + + // push to event loop to allow forms to submit + setTimeout(function () { + state == 'loadingText' ? + $el.addClass(d).attr(d, d) : + $el.removeClass(d).removeAttr(d); + }, 0) + } + + Button.prototype.toggle = function () { + var $parent = this.$element.closest('[data-toggle="buttons"]') + + if ($parent.length) { + var $input = this.$element.find('input') + .prop('checked', !this.$element.hasClass('active')) + .trigger('change') + if ($input.prop('type') === 'radio') $parent.find('.active').removeClass('active') + } + + this.$element.toggleClass('active') + } + + + // BUTTON PLUGIN DEFINITION + // ======================== + + var old = $.fn.button + + $.fn.button = function (option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.button') + var options = typeof option == 'object' && option + + if (!data) $this.data('bs.button', (data = new Button(this, options))) + + if (option == 'toggle') data.toggle() + else if (option) data.setState(option) + }) + } + + $.fn.button.Constructor = Button + + + // BUTTON NO CONFLICT + // ================== + + $.fn.button.noConflict = function () { + $.fn.button = old + return this + } + + + // BUTTON DATA-API + // =============== + + $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) { + var $btn = $(e.target) + if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') + $btn.button('toggle') + e.preventDefault() + }) + +}(window.jQuery); + +/* ======================================================================== + * Bootstrap: dropdown.js v3.0.0 + * http://twbs.github.com/bootstrap/javascript.html#dropdowns + * ======================================================================== + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ======================================================================== */ + + ++function ($) { "use strict"; + + // DROPDOWN CLASS DEFINITION + // ========================= + + var backdrop = '.dropdown-backdrop' + var toggle = '[data-toggle=dropdown]' + var Dropdown = function (element) { + var $el = $(element).on('click.bs.dropdown', this.toggle) + } + + Dropdown.prototype.toggle = function (e) { + var $this = $(this) + + if ($this.is('.disabled, :disabled')) return + + var $parent = getParent($this) + var isActive = $parent.hasClass('open') + + clearMenus() + + if (!isActive) { + if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { + // if mobile we we use a backdrop because click events don't delegate + $('