summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-rosy-file-server/luasrc/model/cbi/rosy-file-server/rosyfs.lua
diff options
context:
space:
mode:
authorRosy Song <rosysong@rosinson.com>2018-12-28 10:47:02 +0800
committerRosy Song <rosysong@rosinson.com>2019-01-02 16:31:59 +0800
commitf6a0e3852f4aee2dbe595e5ce05c5217d42dccb8 (patch)
tree84ba3a39bc62540ec699b7e5bb6dc974e018c6fc /applications/luci-app-rosy-file-server/luasrc/model/cbi/rosy-file-server/rosyfs.lua
parent1893892581707fcd83e684a7a03dd6b5d3c2c3a2 (diff)
luci-app-rosy-file-server: add new application
Signed-off-by: Rosy Song <rosysong@rosinson.com>
Diffstat (limited to 'applications/luci-app-rosy-file-server/luasrc/model/cbi/rosy-file-server/rosyfs.lua')
-rw-r--r--applications/luci-app-rosy-file-server/luasrc/model/cbi/rosy-file-server/rosyfs.lua26
1 files changed, 26 insertions, 0 deletions
diff --git a/applications/luci-app-rosy-file-server/luasrc/model/cbi/rosy-file-server/rosyfs.lua b/applications/luci-app-rosy-file-server/luasrc/model/cbi/rosy-file-server/rosyfs.lua
new file mode 100644
index 0000000000..51efa9e814
--- /dev/null
+++ b/applications/luci-app-rosy-file-server/luasrc/model/cbi/rosy-file-server/rosyfs.lua
@@ -0,0 +1,26 @@
+-- Copyright 2019 Rosy Song <rosysong@rosinson.com>
+-- Licensed to the public under the Apache License 2.0.
+
+local uci = require("luci.model.uci").cursor()
+local dis = uci:get("rosyfs", "default", "disabled")
+local tgt = uci:get("rosyfs", "default", "target")
+local tlt = uci:get("rosyfs", "default", "title")
+
+m = Map("rosyfs", translate("Rosy File Server Settings"))
+
+s = m:section(TypedSection, "rosyfs", nil)
+s.addremove = false
+s.anonymous = true
+
+e = s:option(Flag, "disabled", translate("Disable"), translate("Disable Rosy File Server"))
+e.default = dis or e.disabled
+e.rmempty = false
+
+a = s:option(Value, "target", translate("Target"), translate("Specify path to be mapped"))
+a.default = tgt or "/www"
+a.datatype = "directory"
+
+t = s:option(Value, "title", translate("Title"), translate("Title to be shown"))
+t.default = tlt or "Rosy File Server"
+
+return m