diff --git a/applications/luci-app-clouddrive2/Makefile b/applications/luci-app-clouddrive2/Makefile new file mode 100644 index 00000000..6531bdac --- /dev/null +++ b/applications/luci-app-clouddrive2/Makefile @@ -0,0 +1,20 @@ + +# Copyright (C) 2016 Openwrt.org +# +# This is free software, licensed under the Apache License, Version 2.0 . +# + + +include $(TOPDIR)/rules.mk + +LUCI_TITLE:=LuCI support for CloudDrive2 +LUCI_DEPENDS:=+clouddrive2 +LUCI_PKGARCH:=all + +PKG_NAME:=luci-app-clouddrive2 +PKG_VERSION:=1 +PKG_RELEASE:=7 + +include ../../luci.mk + +# call BuildPackage - OpenWrt buildroot signature diff --git a/applications/luci-app-clouddrive2/luasrc/controller/clouddrive2.lua b/applications/luci-app-clouddrive2/luasrc/controller/clouddrive2.lua new file mode 100644 index 00000000..0a1a4af4 --- /dev/null +++ b/applications/luci-app-clouddrive2/luasrc/controller/clouddrive2.lua @@ -0,0 +1,17 @@ +module("luci.controller.clouddrive2", package.seeall) + +function index() + if not nixio.fs.access("/etc/config/clouddrive2") then + return + end + entry({"admin", "nas"}, firstchild(), _("NAS"), 45).dependent = false + entry({"admin","nas","clouddrive2"},cbi("clouddrive2"),_("CloudDrive2"), 10).acl_depends = { "luci-app-clouddrive2" } + entry({"admin", "nas", "clouddrive2", "status"}, call("act_status")).leaf = true +end + +function act_status() + local e={} + e.running=luci.sys.call("pgrep clouddrive >/dev/null")==0 + luci.http.prepare_content("application/json") + luci.http.write_json(e) +end diff --git a/applications/luci-app-clouddrive2/luasrc/model/cbi/clouddrive2.lua b/applications/luci-app-clouddrive2/luasrc/model/cbi/clouddrive2.lua new file mode 100644 index 00000000..48e45328 --- /dev/null +++ b/applications/luci-app-clouddrive2/luasrc/model/cbi/clouddrive2.lua @@ -0,0 +1,21 @@ +local m, s, o + +m = Map("clouddrive2", translate("CloudDrive2"), translate("Configure and manage CloudDrive2")) + +m:section(SimpleSection).template="clouddrive2/status" + +s = m:section(TypedSection, "clouddrive2", translate("Settings")) +s.anonymous = true +s.addremove = false + +o = s:option(Flag, "enabled", translate("Enable")) +o.rmempty = false + +o = s:option(Value, "port", translate("Port")) +o.datatype = "port" +o.default = "19798" +-- +-- o = s:option(Value, "mount_point", translate("Mount Point")) +-- o.default = "/mnt/clouddrive" + +return m diff --git a/applications/luci-app-clouddrive2/luasrc/view/clouddrive2/status.htm b/applications/luci-app-clouddrive2/luasrc/view/clouddrive2/status.htm new file mode 100644 index 00000000..40f441a7 --- /dev/null +++ b/applications/luci-app-clouddrive2/luasrc/view/clouddrive2/status.htm @@ -0,0 +1,27 @@ + + +
+

+ <%:Collecting data...%> +

+
\ No newline at end of file diff --git a/applications/luci-app-clouddrive2/po/zh-cn b/applications/luci-app-clouddrive2/po/zh-cn new file mode 120000 index 00000000..8d69574d --- /dev/null +++ b/applications/luci-app-clouddrive2/po/zh-cn @@ -0,0 +1 @@ +zh_Hans \ No newline at end of file diff --git a/applications/luci-app-clouddrive2/po/zh_Hans/clouddrive2.po b/applications/luci-app-clouddrive2/po/zh_Hans/clouddrive2.po new file mode 100644 index 00000000..420906a0 --- /dev/null +++ b/applications/luci-app-clouddrive2/po/zh_Hans/clouddrive2.po @@ -0,0 +1,32 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8\n" + +msgid "Configure and manage CloudDrive2" +msgstr "配置和管理CloudDrive2" + +msgid "Settings" +msgstr "设置" + +msgid "Enable" +msgstr "启用" + +msgid "Port" +msgstr "端口" + +msgid "Mount Point" +msgstr "挂载点" + +msgid "CloudDrive2 Status" +msgstr "CloudDrive2状态" + +msgid "Running Status" +msgstr "运行状态" + +msgid "Collecting data..." +msgstr "正在收集数据..." + +msgid "CloudDrive2 is running" +msgstr "CloudDrive2 正在运行" + +msgid "CloudDrive2 is not running" +msgstr "CloudDrive2 未运行" diff --git a/applications/luci-app-clouddrive2/root/etc/uci-defaults/luci-clouddrive2 b/applications/luci-app-clouddrive2/root/etc/uci-defaults/luci-clouddrive2 new file mode 100644 index 00000000..0fa7c776 --- /dev/null +++ b/applications/luci-app-clouddrive2/root/etc/uci-defaults/luci-clouddrive2 @@ -0,0 +1,16 @@ +#!/bin/sh + +uci -q batch <<-EOF >/dev/null + delete ucitrack.@clouddrive2[-1] + add ucitrack clouddrive2 + set ucitrack.@clouddrive2[-1].init=clouddrive2 + commit ucitrack +EOF + +mkdir -p /lib/upgrade/keep.d +cat > "/lib/upgrade/keep.d/luci-clouddrive2" <<-EOF +/Waytech/CloudDrive2/ +EOF + +rm -f /tmp/luci-indexcache +exit 0 diff --git a/applications/luci-app-clouddrive2/root/usr/share/rpcd/acl.d/luci-app-clouddrive2.json b/applications/luci-app-clouddrive2/root/usr/share/rpcd/acl.d/luci-app-clouddrive2.json new file mode 100644 index 00000000..6097a29d --- /dev/null +++ b/applications/luci-app-clouddrive2/root/usr/share/rpcd/acl.d/luci-app-clouddrive2.json @@ -0,0 +1,11 @@ +{ + "luci-app-clouddrive2": { + "description": "Grant UCI access for luci-app-clouddrive2", + "read": { + "uci": [ "clouddrive2" ] + }, + "write": { + "uci": [ "clouddrive2" ] + } + } +} \ No newline at end of file