diff --git a/luci-app-accesscontrol/Makefile b/luci-app-accesscontrol/Makefile
index 4edf4f6c..d6bdcb55 100644
--- a/luci-app-accesscontrol/Makefile
+++ b/luci-app-accesscontrol/Makefile
@@ -9,9 +9,10 @@ include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI Access Control Configuration
LUCI_DEPENDS:=
LUCI_PKGARCH:=all
+
PKG_NAME:=luci-app-accesscontrol
PKG_VERSION:=1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
include $(TOPDIR)/feeds/luci/luci.mk
diff --git a/luci-app-accesscontrol/luasrc/controller/mia.lua b/luci-app-accesscontrol/luasrc/controller/mia.lua
index f92d11a7..60aa95db 100644
--- a/luci-app-accesscontrol/luasrc/controller/mia.lua
+++ b/luci-app-accesscontrol/luasrc/controller/mia.lua
@@ -5,10 +5,7 @@ function index()
return
end
- local page = entry({"admin", "services", "mia"}, cbi("mia"), _("Internet Access Schedule Control"), 30)
- page.dependent = true
- page.acl_depends = { "luci-app-accesscontrol" }
-
+ entry({"admin", "services", "mia"}, cbi("mia"), _("Internet Access Schedule Control"), 30).dependent = true
entry({"admin", "services", "mia", "status"}, call("act_status")).leaf = true
end
diff --git a/luci-app-accesscontrol/luasrc/model/cbi/mia.lua b/luci-app-accesscontrol/luasrc/model/cbi/mia.lua
index 1d801b8b..0d49867e 100644
--- a/luci-app-accesscontrol/luasrc/model/cbi/mia.lua
+++ b/luci-app-accesscontrol/luasrc/model/cbi/mia.lua
@@ -1,5 +1,7 @@
+a = Map("mia")
+a.title = translate("Internet Access Schedule Control")
+a.description = translate("Access Schedule Control Settins")
-a = Map("mia", translate("Internet Access Schedule Control"), translate("Access Schedule Control Settins"))
a:section(SimpleSection).template = "mia/mia_status"
t = a:section(TypedSection, "basic")
@@ -9,8 +11,8 @@ e = t:option(Flag, "enable", translate("Enabled"))
e.rmempty = false
e = t:option(Flag, "strict", translate("Strict Mode"))
-e.rmempty = false
e.description = translate("Strict Mode will degrade CPU performance, but it can achieve better results")
+e.rmempty = false
t = a:section(TypedSection, "macbind", translate("Client Rules"))
t.template = "cbi/tblsection"
@@ -28,12 +30,12 @@ e:value(t,"%s (%s)"%{t,a})
end)
e = t:option(Value, "timeon", translate("Start time"))
-e.default = "00:00"
e.optional = false
+e.default = "00:00"
e = t:option(Value, "timeoff", translate("End time"))
-e.default = "23:59"
e.optional = false
+e.default = "23:59"
e = t:option(Flag, "z1", translate("Mon"))
e.rmempty = true
diff --git a/luci-app-accesscontrol/po/zh-cn b/luci-app-accesscontrol/po/zh-cn
deleted file mode 120000
index 8d69574d..00000000
--- a/luci-app-accesscontrol/po/zh-cn
+++ /dev/null
@@ -1 +0,0 @@
-zh_Hans
\ No newline at end of file
diff --git a/luci-app-accesscontrol/po/zh_Hans/mia.po b/luci-app-accesscontrol/po/zh-cn/mia.po
similarity index 96%
rename from luci-app-accesscontrol/po/zh_Hans/mia.po
rename to luci-app-accesscontrol/po/zh-cn/mia.po
index 8848c130..8f7c16aa 100644
--- a/luci-app-accesscontrol/po/zh_Hans/mia.po
+++ b/luci-app-accesscontrol/po/zh-cn/mia.po
@@ -28,9 +28,6 @@ msgstr "开始时间"
msgid "End time"
msgstr "结束时间"
-msgid "Enabled"
-msgstr "启用"
-
msgid "Mon"
msgstr "一"
diff --git a/luci-app-accesscontrol/po/zh_Hans b/luci-app-accesscontrol/po/zh_Hans
new file mode 120000
index 00000000..41451e4a
--- /dev/null
+++ b/luci-app-accesscontrol/po/zh_Hans
@@ -0,0 +1 @@
+zh-cn
\ No newline at end of file
diff --git a/luci-app-accesscontrol/root/etc/mia.include b/luci-app-accesscontrol/root/etc/mia.include
index 4d7859f3..359bbd6f 100755
--- a/luci-app-accesscontrol/root/etc/mia.include
+++ b/luci-app-accesscontrol/root/etc/mia.include
@@ -1 +1 @@
-/etc/init.d/mia restart
\ No newline at end of file
+/etc/init.d/mia restart
diff --git a/luci-app-accesscontrol/root/etc/uci-defaults/mia b/luci-app-accesscontrol/root/etc/uci-defaults/luci-mia
similarity index 99%
rename from luci-app-accesscontrol/root/etc/uci-defaults/mia
rename to luci-app-accesscontrol/root/etc/uci-defaults/luci-mia
index f7ad30b8..6737992c 100644
--- a/luci-app-accesscontrol/root/etc/uci-defaults/mia
+++ b/luci-app-accesscontrol/root/etc/uci-defaults/luci-mia
@@ -13,6 +13,7 @@ uci -q batch <<-EOF >/dev/null
add ucitrack mia
set ucitrack.@mia[-1].init=mia
commit ucitrack
+
delete firewall.mia
set firewall.mia=include
set firewall.mia.type=script
diff --git a/luci-app-alist/Makefile b/luci-app-alist/Makefile
deleted file mode 100644
index e3be692e..00000000
--- a/luci-app-alist/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-# SPDX-License-Identifier: Apache-2.0
-#
-# Copyright (C) 2023 ImmortalWrt.org
-
-include $(TOPDIR)/rules.mk
-
-LUCI_TITLE:=LuCI app for AList
-LUCI_DEPENDS:=+alist
-LUCI_PKGARCH:=all
-
-include $(TOPDIR)/feeds/luci/luci.mk
-
-# call BuildPackage - OpenWrt buildroot signature
diff --git a/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js b/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js
deleted file mode 100644
index 818d6e00..00000000
--- a/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js
+++ /dev/null
@@ -1,151 +0,0 @@
-// SPDX-License-Identifier: Apache-2.0
-
-'use strict';
-'require form';
-'require poll';
-'require rpc';
-'require uci';
-'require validation';
-'require view';
-
-var callServiceList = rpc.declare({
- object: 'service',
- method: 'list',
- params: ['name'],
- expect: { '': {} }
-});
-
-function getServiceStatus() {
- return L.resolveDefault(callServiceList('alist'), {}).then(function (res) {
- var isRunning = false;
- try {
- isRunning = res['alist']['instances']['instance1']['running'];
- } catch (e) { }
- return isRunning;
- });
-}
-
-function renderStatus(isRunning, port) {
- var spanTemp = '%s %s';
- var renderHTML;
- if (isRunning) {
- var button = String.format(' %s',
- window.location.hostname, port, _('Open Web Interface'));
- renderHTML = spanTemp.format('green', _('AList'), _('RUNNING')) + button;
- } else {
- renderHTML = spanTemp.format('red', _('AList'), _('NOT RUNNING'));
- }
-
- return renderHTML;
-}
-
-var stubValidator = {
- factory: validation,
- apply: function(type, value, args) {
- if (value != null)
- this.value = value;
-
- return validation.types[type].apply(this, args);
- },
- assert: function(condition) {
- return !!condition;
- }
-};
-
-return view.extend({
- load: function() {
- return Promise.all([
- uci.load('alist')
- ]);
- },
-
- render: function(data) {
- var m, s, o;
- var webport = uci.get(data[0], 'config', 'listen_http_port') || '5244';
-
- m = new form.Map('alist', _('AList'),
- _('A file list/WebDAV program that supports multiple storages, powered by Gin and Solidjs.
' +
- 'Default login username is admin and password is password.'));
-
- s = m.section(form.TypedSection);
- s.anonymous = true;
- s.render = function () {
- poll.add(function () {
- return L.resolveDefault(getServiceStatus()).then(function (res) {
- var view = document.getElementById('service_status');
- view.innerHTML = renderStatus(res, webport);
- });
- });
-
- return E('div', { class: 'cbi-section', id: 'status_bar' }, [
- E('p', { id: 'service_status' }, _('Collecting data...'))
- ]);
- }
-
- s = m.section(form.NamedSection, 'config', 'alist');
-
- o = s.option(form.Flag, 'enabled', _('Enable'));
- o.default = o.disabled;
- o.rmempty = false;
-
- o = s.option(form.Value, 'listen_addr', _('Listen address'));
- o.default = '0.0.0.0';
- o.rmempty = false;
- o.validate = function(section_id, value) {
- if (!value)
- return _('Expecting: %s').format(_('non-empty value'));
-
- var m4 = value.match(/^([^\[\]:]+)$/),
- m6 = value.match(/^\[(.+)\]$/ );
-
- if ((!m4 && !m6) || !stubValidator.apply('ipaddr', m4 ? m4[1] : m6[1]))
- return _('Expecting: %s').format(_('valid IP address'));
-
- return true;
- }
-
- o = s.option(form.Value, 'listen_http_port', _('Listen port'));
- o.datatype = 'port';
- o.default = '5244';
- o.rmempty = false;
-
- o = s.option(form.Value, 'site_login_expire', _('Login expiration time'),
- _('User login expiration time (in hours).'));
- o.datatype = 'uinteger';
- o.default = '48';
- o.rmempty = false;
-
- o = s.option(form.Value, 'site_max_connections', _('Max connections'),
- _('The maximum number of concurrent connections at the same time (0 = unlimited).'));
- o.datatype = 'uinteger';
- o.default = '0';
- o.rmempty = false;
-
- o = s.option(form.Flag, 'site_tls_insecure', _('Allow insecure connection'),
- _('Allow connection even if the remote TLS certificate is invalid (not recommended).'));
- o.default = o.disabled;
-
- o = s.option(form.Flag, 'log_enable', _('Enable logging'));
- o.default = o.enabled;
-
- o = s.option(form.Value, 'log_max_size', _('Max log size'),
- _('The maximum size in megabytes of the log file before it gets rotated.'));
- o.datatype = 'uinteger';
- o.default = '5';
- o.depends('log_enable', '1');
-
- o = s.option(form.Value, 'log_max_backups', _('Max log backups'),
- _('The maximum number of old log files to retain.'));
- o.datatype = 'uinteger';
- o.default = '1';
- o.depends('log_enable', '1');
-
- o = s.option(form.Value, 'log_max_age', _('Max log age'),
- _('The maximum days of the log file to retain.'));
- o.datatype = 'uinteger';
- o.default = '15';
- o.depends('log_enable', '1');
-
- return m.render();
- }
-});
diff --git a/luci-app-alist/htdocs/luci-static/resources/view/alist/log.js b/luci-app-alist/htdocs/luci-static/resources/view/alist/log.js
deleted file mode 100644
index f300abef..00000000
--- a/luci-app-alist/htdocs/luci-static/resources/view/alist/log.js
+++ /dev/null
@@ -1,75 +0,0 @@
-// SPDX-License-Identifier: Apache-2.0
-
-'use strict';
-'require dom';
-'require fs';
-'require poll';
-'require uci';
-'require view';
-
-return view.extend({
- render: function() {
- /* Thanks to luci-app-aria2 */
- var css = ' \
- #log_textarea { \
- padding: 10px; \
- text-align: left; \
- } \
- #log_textarea pre { \
- padding: .5rem; \
- word-break: break-all; \
- margin: 0; \
- } \
- .description { \
- background-color: #33ccff; \
- }';
-
- var log_textarea = E('div', { 'id': 'log_textarea' },
- E('img', {
- 'src': L.resource(['icons/loading.gif']),
- 'alt': _('Loading...'),
- 'style': 'vertical-align:middle'
- }, _('Collecting data...'))
- );
-
- poll.add(L.bind(function() {
- return fs.read_direct('/var/run/alist/log/alist.log', 'text')
- .then(function(res) {
- var log = E('pre', { 'wrap': 'pre' }, [
- res.trim() || _('Log is empty.')
- ]);
-
- dom.content(log_textarea, log);
- }).catch(function(err) {
- var log;
-
- if (err.toString().includes('NotFoundError'))
- log = E('pre', { 'wrap': 'pre' }, [
- _('Log file does not exist.')
- ]);
- else
- log = E('pre', { 'wrap': 'pre' }, [
- _('Unknown error: %s').format(err)
- ]);
-
- dom.content(log_textarea, log);
- });
- }));
-
- return E([
- E('style', [ css ]),
- E('div', {'class': 'cbi-map'}, [
- E('div', {'class': 'cbi-section'}, [
- log_textarea,
- E('div', {'style': 'text-align:right'},
- E('small', {}, _('Refresh every %s seconds.').format(L.env.pollinterval))
- )
- ])
- ])
- ]);
- },
-
- handleSaveApply: null,
- handleSave: null,
- handleReset: null
-});
diff --git a/luci-app-alist/po/templates/alist.pot b/luci-app-alist/po/templates/alist.pot
deleted file mode 100644
index ea258b0b..00000000
--- a/luci-app-alist/po/templates/alist.pot
+++ /dev/null
@@ -1,146 +0,0 @@
-msgid ""
-msgstr "Content-Type: text/plain; charset=UTF-8"
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:67
-msgid ""
-"A file list/WebDAV program that supports multiple storages, powered by Gin "
-"and Solidjs.
Default login username is admin and password "
-"is password."
-msgstr ""
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:34
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:36
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:66
-#: applications/luci-app-alist/root/usr/share/luci/menu.d/luci-app-alist.json:3
-msgid "AList"
-msgstr ""
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:125
-msgid ""
-"Allow connection even if the remote TLS certificate is invalid (not "
-"recommended)."
-msgstr ""
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:124
-msgid "Allow insecure connection"
-msgstr ""
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:81
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/log.js:32
-msgid "Collecting data..."
-msgstr ""
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:87
-msgid "Enable"
-msgstr ""
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:128
-msgid "Enable logging"
-msgstr ""
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:96
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:102
-msgid "Expecting: %s"
-msgstr ""
-
-#: applications/luci-app-alist/root/usr/share/rpcd/acl.d/luci-app-alist.json:3
-msgid "Grant access to AList configuration"
-msgstr ""
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:91
-msgid "Listen address"
-msgstr ""
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:107
-msgid "Listen port"
-msgstr ""
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/log.js:30
-msgid "Loading..."
-msgstr ""
-
-#: applications/luci-app-alist/root/usr/share/luci/menu.d/luci-app-alist.json:22
-msgid "Log"
-msgstr ""
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/log.js:48
-msgid "Log file does not exist."
-msgstr ""
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/log.js:39
-msgid "Log is empty."
-msgstr ""
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:112
-msgid "Login expiration time"
-msgstr ""
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:118
-msgid "Max connections"
-msgstr ""
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:143
-msgid "Max log age"
-msgstr ""
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:137
-msgid "Max log backups"
-msgstr ""
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:131
-msgid "Max log size"
-msgstr ""
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:36
-msgid "NOT RUNNING"
-msgstr ""
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:33
-msgid "Open Web Interface"
-msgstr ""
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:34
-msgid "RUNNING"
-msgstr ""
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/log.js:65
-msgid "Refresh every %s seconds."
-msgstr ""
-
-#: applications/luci-app-alist/root/usr/share/luci/menu.d/luci-app-alist.json:14
-msgid "Settings"
-msgstr ""
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:144
-msgid "The maximum days of the log file to retain."
-msgstr ""
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:119
-msgid ""
-"The maximum number of concurrent connections at the same time (0 = "
-"unlimited)."
-msgstr ""
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:138
-msgid "The maximum number of old log files to retain."
-msgstr ""
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:132
-msgid "The maximum size in megabytes of the log file before it gets rotated."
-msgstr ""
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/log.js:52
-msgid "Unknown error: %s"
-msgstr ""
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:113
-msgid "User login expiration time (in hours)."
-msgstr ""
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:96
-msgid "non-empty value"
-msgstr ""
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:102
-msgid "valid IP address"
-msgstr ""
diff --git a/luci-app-alist/po/zh-cn b/luci-app-alist/po/zh-cn
deleted file mode 120000
index 8d69574d..00000000
--- a/luci-app-alist/po/zh-cn
+++ /dev/null
@@ -1 +0,0 @@
-zh_Hans
\ No newline at end of file
diff --git a/luci-app-alist/po/zh_Hans/alist.po b/luci-app-alist/po/zh_Hans/alist.po
deleted file mode 100644
index 1ece1133..00000000
--- a/luci-app-alist/po/zh_Hans/alist.po
+++ /dev/null
@@ -1,155 +0,0 @@
-msgid ""
-msgstr ""
-"Content-Type: text/plain; charset=UTF-8\n"
-"Project-Id-Version: PACKAGE VERSION\n"
-"Last-Translator: Automatically generated\n"
-"Language-Team: none\n"
-"Language: zh-Hans\n"
-"MIME-Version: 1.0\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:67
-msgid ""
-"A file list/WebDAV program that supports multiple storages, powered by Gin "
-"and Solidjs.
Default login username is admin and password "
-"is password."
-msgstr ""
-"一个支持多存储的 文件列表/WebDAV 程序,使用 Gin 和 Solidjs。
默认登录用"
-"户名 admin 密码 password。"
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:34
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:36
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:66
-#: applications/luci-app-alist/root/usr/share/luci/menu.d/luci-app-alist.json:3
-msgid "AList"
-msgstr "AList"
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:125
-msgid ""
-"Allow connection even if the remote TLS certificate is invalid (not "
-"recommended)."
-msgstr "即使远程 TLS 证书无效,也允许连接(不推荐)。"
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:124
-msgid "Allow insecure connection"
-msgstr "允许不安全连接"
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:81
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/log.js:32
-msgid "Collecting data..."
-msgstr "收集数据中..."
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:87
-msgid "Enable"
-msgstr "启用"
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:128
-msgid "Enable logging"
-msgstr "启用日志"
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:96
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:102
-msgid "Expecting: %s"
-msgstr "请输入:%s"
-
-#: applications/luci-app-alist/root/usr/share/rpcd/acl.d/luci-app-alist.json:3
-msgid "Grant access to AList configuration"
-msgstr "授予访问 AList 配置的权限"
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:91
-msgid "Listen address"
-msgstr "监听地址"
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:107
-msgid "Listen port"
-msgstr "监听端口"
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/log.js:30
-msgid "Loading..."
-msgstr "加载中..."
-
-#: applications/luci-app-alist/root/usr/share/luci/menu.d/luci-app-alist.json:22
-msgid "Log"
-msgstr "日志"
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/log.js:48
-msgid "Log file does not exist."
-msgstr "日志文件不存在。"
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/log.js:39
-msgid "Log is empty."
-msgstr "日志为空。"
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:112
-msgid "Login expiration time"
-msgstr "登录过期时间"
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:118
-msgid "Max connections"
-msgstr "最大连接数"
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:143
-msgid "Max log age"
-msgstr "日志最长保留时间"
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:137
-msgid "Max log backups"
-msgstr "日志最大备份数"
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:131
-msgid "Max log size"
-msgstr "日志最大大小"
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:36
-msgid "NOT RUNNING"
-msgstr "未运行"
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:33
-msgid "Open Web Interface"
-msgstr "打开 Web 界面"
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:34
-msgid "RUNNING"
-msgstr "运行中"
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/log.js:65
-msgid "Refresh every %s seconds."
-msgstr "每 %s 秒刷新。"
-
-#: applications/luci-app-alist/root/usr/share/luci/menu.d/luci-app-alist.json:14
-msgid "Settings"
-msgstr "设置"
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:144
-msgid "The maximum days of the log file to retain."
-msgstr "日志文件的最长保存天数。"
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:119
-msgid ""
-"The maximum number of concurrent connections at the same time (0 = "
-"unlimited)."
-msgstr "允许的最大并发连接数(0 = 不限制)。"
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:138
-msgid "The maximum number of old log files to retain."
-msgstr "要保留的最大旧日志文件数量。"
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:132
-msgid "The maximum size in megabytes of the log file before it gets rotated."
-msgstr "轮换前的最大日志大小(单位:MB)。"
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/log.js:52
-msgid "Unknown error: %s"
-msgstr "未知错误:%s"
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:113
-msgid "User login expiration time (in hours)."
-msgstr "用户登录过期时间(单位:小时)。"
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:96
-msgid "non-empty value"
-msgstr "非空值"
-
-#: applications/luci-app-alist/htdocs/luci-static/resources/view/alist/config.js:102
-msgid "valid IP address"
-msgstr "有效 IP 地址"
diff --git a/luci-app-alist/root/usr/share/luci/menu.d/luci-app-alist.json b/luci-app-alist/root/usr/share/luci/menu.d/luci-app-alist.json
deleted file mode 100644
index ca8bcca3..00000000
--- a/luci-app-alist/root/usr/share/luci/menu.d/luci-app-alist.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "admin/services/alist": {
- "title": "AList",
- "order": 10,
- "action": {
- "type": "firstchild"
- },
- "depends": {
- "acl": [ "luci-app-alist" ],
- "uci": { "alist": true }
- }
- },
- "admin/services/alist/config": {
- "title": "Settings",
- "order": 10,
- "action": {
- "type": "view",
- "path": "alist/config"
- }
- },
- "admin/services/alist/log": {
- "title": "Log",
- "order": 20,
- "action": {
- "type": "view",
- "path": "alist/log"
- }
- }
-}
diff --git a/luci-app-alist/root/usr/share/rpcd/acl.d/luci-app-alist.json b/luci-app-alist/root/usr/share/rpcd/acl.d/luci-app-alist.json
deleted file mode 100644
index 1dd31ef7..00000000
--- a/luci-app-alist/root/usr/share/rpcd/acl.d/luci-app-alist.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "luci-app-alist": {
- "description": "Grant access to AList configuration",
- "read": {
- "file": {
- "/var/run/alist/log/alist.log": [ "read" ]
- },
- "ubus": {
- "service": [ "list" ]
- },
- "uci": [ "alist" ]
- },
- "write": {
- "uci": [ "alist" ]
- }
- }
-}
diff --git a/luci-app-cifs/Makefile b/luci-app-cifs/Makefile
deleted file mode 100644
index 91fc36f7..00000000
--- a/luci-app-cifs/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-## Copyright (C) 2018 By-Ameng Openwrt.org
-#
-## This is free software, licensed under the Apache License, Version 2.0 .
-#
-#
-
-include $(TOPDIR)/rules.mk
-
-LUCI_TITLE:=luci-app-cifs
-LUCI_DEPENDS:=+kmod-fs-cifs +kmod-nls-utf8 +kmod-nls-base +kmod-crypto-hmac +kmod-crypto-md5 +kmod-crypto-misc +cifsmount
-LUCI_PKGARCH:=all
-PKG_VERSION:=1.0
-PKG_RELEASE:=1
-
-include $(TOPDIR)/feeds/luci/luci.mk
-
-# call BuildPackage - OpenWrt buildroot signature
diff --git a/luci-app-cifs/luasrc/controller/cifs.lua b/luci-app-cifs/luasrc/controller/cifs.lua
deleted file mode 100644
index 0afe51cf..00000000
--- a/luci-app-cifs/luasrc/controller/cifs.lua
+++ /dev/null
@@ -1,24 +0,0 @@
--- Copyright 2015
--- Matthew
--- Licensed to the public under the Apache License 2.0.
-
-module("luci.controller.cifs", package.seeall)
-
-function index()
- if not nixio.fs.access("/etc/config/cifs") then
- return
- end
-
- local page = entry({"admin", "services", "cifs"}, cbi("cifs"), _("Mounting NAT drives"))
- page.dependent = true
- page.acl_depends = { "luci-app-cifs" }
-
- entry({"admin", "services", "cifs", "status"}, call("act_status")).leaf = true
-end
-
-function act_status()
- local e = {}
- e.running = luci.sys.call("pidof cifsd > /dev/null") == 0
- luci.http.prepare_content("application/json")
- luci.http.write_json(e)
-end
diff --git a/luci-app-cifs/luasrc/model/cbi/cifs.lua b/luci-app-cifs/luasrc/model/cbi/cifs.lua
deleted file mode 100644
index e598d6ef..00000000
--- a/luci-app-cifs/luasrc/model/cbi/cifs.lua
+++ /dev/null
@@ -1,97 +0,0 @@
--- Copyright 2015
--- Matthew
--- Licensed to the public under the Apache License 2.0.
-
-local fs = require "nixio.fs"
-
-m = Map("cifs", translate("Mounting NAT drives"))
-m.description = translate("Allows you mounting Nat drives")
-
-m:section(SimpleSection).template = "cifs/cifs_status"
-
-s = m:section(TypedSection, "cifs", "Cifs")
-s.anonymous = true
-
-s:tab("general", translate("General Settings"))
-
-switch = s:taboption("general", Flag, "enabled", translate("Enable"))
-switch.rmempty = false
-
-workgroup = s:taboption("general", Value, "workgroup", translate("Workgroup"))
-workgroup.default = "WORKGROUP"
-
-mountarea = s:taboption("general", Value, "mountarea", translate("Mount Area"))
-mountarea.description = translate("All the Mounted NAT Drives will be centralized into this folder.")
-mountarea.default = "/tmp/mnt"
-mountarea.rmempty = false
-
-delay = s:taboption("general", Value, "delay", translate("Delay"))
-delay.description = translate("Delay command runing for wait till your drivers online.\n Only work in start mode(/etc/init.d/cifs start) ")
-delay:value("0")
-delay:value("3")
-delay:value("5")
-delay:value("7")
-delay:value("10")
-delay.default = "5"
-
-iocharset = s:taboption("general", Value, "iocharset", translate("Iocharset"))
-iocharset.description = translate("Character Encoding")
-iocharset.default = "utf8"
-
-s = m:section(TypedSection, "natshare", translate("NAT Drivers"))
-s.anonymous = true
-s.addremove = true
-s.template = "cbi/tblsection"
-
-server = s:option(Value, "server", translate("Server"))
-server.description = translate("Server Name/IP")
-server.size = 6
-server.rmempty = false
-
-name = s:option(Value, "name", translate("Name"))
-name.description = translate("Mouting Folder Name")
-name.size = 6
-name.rmempty = false
-
-sec = s:option(Value, "sec", translate("Choose Safety Mode"))
-sec:value("none")
-sec:value("krb5")
-sec:value("krb5i")
-sec:value("ntlm")
-sec:value("ntlmi")
-sec:value("ntlmv2")
-sec:value("ntlmv2i")
-sec.rmempty = true
-sec.size = 7
-
-agm = s:option(Value, "agm", translate("Arguments"))
-agm:value("rm", translate"rm: Read Only")
-agm:value("rw", translate"rw: Read and Write")
-agm:value("noperm")
-agm:value("noacl")
-agm:value("sfu")
-agm:value("dirctio")
-agm:value("file_mode=0755,dir_mode=0n755")
-agm:value("nounix", translate"nounix: Disable Unix Extensions")
-agm.rmempty = true
-agm.size = 8
-
-guest = s:option(Flag, "guest", translate("Using Guest"))
-guest.rmempty = false
-guest.enabled = "1"
-guest.disabled = "0"
-
-users = s:option(Value, "users", translate("Users"))
-users.size = 3
-users.rmempty = true
-
-pwd = s:option(Value, "pwd", translate("password"))
-pwd.rmempty = true
-pwd.size = 3
-
-local apply = luci.http.formvalue("cbi.apply")
-if apply then
- io.popen("/etc/init.d/cifs restart")
-end
-
-return m
diff --git a/luci-app-cifs/luasrc/view/cifs_status.htm b/luci-app-cifs/luasrc/view/cifs_status.htm
deleted file mode 100644
index 3abb4dd2..00000000
--- a/luci-app-cifs/luasrc/view/cifs_status.htm
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
diff --git a/luci-app-cifs/po/zh-cn b/luci-app-cifs/po/zh-cn
deleted file mode 120000
index 8d69574d..00000000
--- a/luci-app-cifs/po/zh-cn
+++ /dev/null
@@ -1 +0,0 @@
-zh_Hans
\ No newline at end of file
diff --git a/luci-app-cifs/po/zh_Hans/cifs.po b/luci-app-cifs/po/zh_Hans/cifs.po
deleted file mode 100644
index 796563ad..00000000
--- a/luci-app-cifs/po/zh_Hans/cifs.po
+++ /dev/null
@@ -1,41 +0,0 @@
-msgid ""
-msgstr "Content-Type: text/plain; charset=UTF-8\n"
-
-msgid "Mounting NAT drives"
-msgstr "挂载网络驱动器"
-
-msgid "Allows you mounting Nat drives"
-msgstr "允许挂载网络驱动器"
-
-msgid "Mount Area"
-msgstr "挂载目录"
-
-msgid "All the Mounted NAT Drives will be centralized into this folder."
-msgstr "所有安装的网络驱动器都将集中到这个文件夹中。"
-
-msgid "Delay"
-msgstr "延迟"
-
-msgid "Delay command runing for wait till your drivers online.\n Only work in start mode(/etc/init.d/cifs start) "
-msgstr "延迟命令运行,等待驱动程序联机。\n仅在启动模式下工作(/etc/init.d/cifs start)"
-
-msgid "Iocharset"
-msgstr "编码"
-
-msgid "Character Encoding"
-msgstr "字符编码"
-
-msgid "NAT Drivers"
-msgstr "网络硬盘"
-
-msgid "Server Name/IP"
-msgstr "服务器名称/ip地址"
-
-msgid "Mouting Folder Name"
-msgstr "共享目录/名称"
-
-msgid "Choose Safety Mode"
-msgstr "安全模式"
-
-msgid "Arguments"
-msgstr "共享权限"
diff --git a/luci-app-cifs/root/etc/config/cifs b/luci-app-cifs/root/etc/config/cifs
deleted file mode 100644
index 87038a4f..00000000
--- a/luci-app-cifs/root/etc/config/cifs
+++ /dev/null
@@ -1,7 +0,0 @@
-
-config cifs
- option enabled '0'
- option workgroup 'WORKGROUP'
- option iocharset 'utf8'
- option delay '5'
- option mountarea '/tmp/mnt'
diff --git a/luci-app-cifs/root/etc/init.d/cifs b/luci-app-cifs/root/etc/init.d/cifs
deleted file mode 100755
index 2d6d5618..00000000
--- a/luci-app-cifs/root/etc/init.d/cifs
+++ /dev/null
@@ -1,184 +0,0 @@
-#!/bin/sh /etc/rc.common
-
-START=99
-
-ENABLED=0
-MOUNTAREA=0
-WORKGROUPD=0
-IOCHARSET=0
-DELAY=0
-GUEST=""
-USERS=""
-SEC=""
-AGM=""
-
-cifs_header() {
- local enabled
- local workgroup
- local mountarea
- local delay
- local iocharset
-
- config_get enabled $1 enabled
- config_get mountarea $1 mountarea
- config_get workgroup $1 workgroup
- config_get delay $1 delay
- config_get iocharset $1 iocharset
-
- ENABLED=$enabled
- MOUNTAREA=$mountarea
- WORKGROUPD=$workgroup
- IOCHARSET=$iocharset
-
- if [ $delay != 0 ]
- then
- DELAY=$delay
- fi
-}
-
-mount_natshare() {
- local server
- local name
- local guest
- local users
- local pwd
- local sec
- local agm
-
- local _mount_path
- local _agm
-
- config_get server $1 server
- config_get name $1 name
- config_get guest $1 guest
- config_get users $1 users
- config_get pwd $1 pwd
- config_get sec $1 sec
- config_get agm $1 agm
-
- if [ $guest == 1 ]
- then
- GUEST="guest,"
- USERS=""
- else if [ $guest == 0 ]
- then {
- if [ $users ]
- then
- USERS="username=$users,password=$pwd,"
- GUEST=""
- else
- USERS=""
- GUEST="guest,"
- fi
- }
- fi
- fi
-
- if [ $sec ]
- then
- SEC=",sec=$sec"
- else
- SEC=""
- fi
-
- if [ $agm ]
- then
- AGM=",$agm"
- else
- AGM=""
- fi
-
- natpath="//${server}/$name"
-
- append _mount_path "$MOUNTAREA/$name"
- append _agm "-o ${USERS}${GUEST},dom=$WORKGROUPD,iocharset=$IOCHARSET,$SEC,$AGM,vers=1.0"
-
- sleep 1
- mkdir -p $_mount_path
- mount -t cifs $natpath $_mount_path $_agm
-}
-
-umount_natshare() {
- local server
- local name
- local _mount_path
-
- config_get server $1 server
- config_get name $1 name
-
- append _mount_path "$MOUNTAREA/$name"
-
- sleep 1
- umount -d -l $_mount_path
- rm -r -f $_mount_path
-}
-
-change_natshare() {
- sleep 1
-}
-
-start() {
- config_load cifs
- config_foreach cifs_header cifs
-
- echo "Checking..."
-
- if [ $ENABLED == 1 ]
- then {
- echo "Cifs Mount is Enabled."
- echo "Starting..."
- if [ $DELAY != 0 ]
- then
- sleep $DELAY
- echo "DELAY Operation ${DELAY}s"
- else
- echo "Not DELAY ${DELAY}s"
- fi
-
- config_foreach mount_natshare natshare
-
- echo "Cifs Mount succeed."
- }
- else
- echo "Cifs Mount is Disabled.Please enter The Web Cotrol Center to enable it."
- fi
-}
-
-stop() {
- echo "Umounting..."
-
- config_load cifs
- config_foreach cifs_header cifs
- config_foreach umount_natshare natshare
-
- echo "Cifs Umount succeed."
-
-}
-
-restart() {
- echo 'Umounting... '
-
- config_load cifs
- config_foreach cifs_header cifs
-
- config_foreach umount_natshare natshare
-
- echo "Cifs Umount succeed."
-
- echo ''
- echo 'Checking... '
-
- if [ $ENABLED == 1 ]
- then {
- echo 'Cifs Mmount is Enabled. '
- echo 'Starting... '
-
- config_foreach mount_natshare natshare
-
- echo "Cifs Mount succeed."
- }
- else
- /etc/init.d/cifs disable
- echo "Cifs Mount is Disabled.Please enter The Web Cotrol Center to enable it."
- fi
-}
diff --git a/luci-app-cifs/root/etc/uci-defaults/luci-cifs b/luci-app-cifs/root/etc/uci-defaults/luci-cifs
deleted file mode 100644
index 59a5cd6b..00000000
--- a/luci-app-cifs/root/etc/uci-defaults/luci-cifs
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-[ ! -f "/usr/share/ucitrack/luci-app-cifs.json" ] && {
- cat > /usr/share/ucitrack/luci-app-cifs.json << EEOF
-{
- "config": "cifs",
- "init": "cifs"
-}
-EEOF
-}
-
-uci -q batch <<-EOF >/dev/null
- delete ucitrack.@cifs[-1]
- add ucitrack cifs
- set ucitrack.@cifs[-1].init=cifs
- commit ucitrack
-EOF
-
-/etc/init.d/cifs stop >/dev/null 2>&1
-/etc/init.d/cifs disable >/dev/null 2>&1
-
-rm -f /tmp/luci-indexcache
-exit 0
diff --git a/luci-app-cifs/root/usr/share/rpcd/acl.d/luci-app-cifs.json b/luci-app-cifs/root/usr/share/rpcd/acl.d/luci-app-cifs.json
deleted file mode 100644
index b0646081..00000000
--- a/luci-app-cifs/root/usr/share/rpcd/acl.d/luci-app-cifs.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "luci-app-cifs": {
- "description": "Grant UCI access for luci-app-cifs",
- "read": {
- "uci": [ "cifs" ]
- },
- "write": {
- "uci": [ "cifs" ]
- }
- }
-}
diff --git a/luci-app-cifs/root/usr/share/ucitrack/luci-app-cifs.json b/luci-app-cifs/root/usr/share/ucitrack/luci-app-cifs.json
deleted file mode 100644
index ca5c972a..00000000
--- a/luci-app-cifs/root/usr/share/ucitrack/luci-app-cifs.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "config": "cifs",
- "init": "cifs"
-}
diff --git a/luci-app-fileassistant/Makefile b/luci-app-fileassistant/Makefile
index ad383666..caa9385e 100644
--- a/luci-app-fileassistant/Makefile
+++ b/luci-app-fileassistant/Makefile
@@ -6,9 +6,9 @@ include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support for Fileassistant
LUCI_PKGARCH:=all
-PKG_VERSION:=1.0
-PKG_RELEASE:=1
+PKG_VERSION:=1.0-5
+PKG_RELEASE:=2
include $(TOPDIR)/feeds/luci/luci.mk
-# call BuildPackage - OpenWrt buildroot signature
+# call BuildPackage - OpenWrt buildroot signature
\ No newline at end of file
diff --git a/luci-app-fileassistant/htdocs/luci-static/resources/fileassistant/fb.js b/luci-app-fileassistant/htdocs/luci-static/resources/fileassistant/fb.js
index 2e3addef..616919d2 100644
--- a/luci-app-fileassistant/htdocs/luci-static/resources/fileassistant/fb.js
+++ b/luci-app-fileassistant/htdocs/luci-static/resources/fileassistant/fb.js
@@ -91,6 +91,40 @@ String.prototype.replaceAll = function(search, replacement) {
}
}
+ function chmodPath(filename, isdir) {
+ var newmod = prompt('请输入新的权限位(支持八进制权限位或者a+x格式):', isdir === "1" ? "0755" : "0644");
+ if (newmod) {
+ iwxhr.get('/cgi-bin/luci/admin/nas/fileassistant/chmod',
+ {
+ filepath: concatPath(currentPath, filename),
+ newmod: newmod
+ },
+ function (x, res) {
+ if (res.ec === 0) {
+ refresh_list(res.data, currentPath);
+ }
+ }
+ );
+ }
+ }
+
+ function chownPath(filename) {
+ var newown = prompt('请输入新的用户名(支持用户名或用户名:群组格式):', "root");
+ if (newown) {
+ iwxhr.get('/cgi-bin/luci/admin/nas/fileassistant/chown',
+ {
+ filepath: concatPath(currentPath, filename),
+ newown: newown
+ },
+ function (x, res) {
+ if (res.ec === 0) {
+ refresh_list(res.data, currentPath);
+ }
+ }
+ );
+ }
+ }
+
function openpath(filename, dirname) {
dirname = dirname || currentPath;
window.open('/cgi-bin/luci/admin/nas/fileassistant/open?path='
@@ -130,6 +164,13 @@ String.prototype.replaceAll = function(search, replacement) {
else if (targetElem.className.indexOf('cbi-button-edit') > -1) {
renamePath(targetElem.parentNode.parentNode.dataset['filename']);
}
+ else if (targetElem.className.indexOf('cbi-button-chmod') > -1) {
+ infoElem = targetElem.parentNode.parentNode;
+ chmodPath(infoElem.dataset['filename'] , infoElem.dataset['isdir']);
+ }
+ else if (targetElem.className.indexOf('cbi-button-chown') > -1) {
+ chownPath(targetElem.parentNode.parentNode.dataset['filename']);
+ }
else if (targetElem = getFileElem(targetElem)) {
if (targetElem.className.indexOf('parent-icon') > -1) {
update_list(currentPath.replace(/\/[^/]+($|\/$)/, ''));
@@ -156,7 +197,14 @@ String.prototype.replaceAll = function(search, replacement) {
}
}
function refresh_list(filenames, path) {
- var listHtml = '';
+ var listHtml = ''
+ +'| 文件 | '
+ +'所有者 | '
+ +'修改时间 | '
+ +'大小 | '
+ +'权限 | '
+ +'操作 | '
+ +'
';
if (path !== '/') {
listHtml += '| .. |
';
}
@@ -196,7 +244,9 @@ String.prototype.replaceAll = function(search, replacement) {
+ ''+o.perms+' | '
+ '\
\
- '
+ \
+ \
+ '
+ install_btn
+ ' | '
+ '';
@@ -270,6 +320,26 @@ String.prototype.replaceAll = function(search, replacement) {
}
};
+ document.getElementById('mkdir-toggle').onclick = function() {
+ var dirname = null;
+ if (dirname = prompt("请输入文件夹名称:")) {
+ var formData = new FormData();
+ formData.append('path', currentPath);
+ formData.append('dirname', dirname);
+ var xhr = new XMLHttpRequest();
+ xhr.open("POST", "/cgi-bin/luci/admin/nas/fileassistant/mkdir", true);
+ xhr.onload = function() {
+ if (xhr.status == 200) {
+ var res = JSON.parse(xhr.responseText);
+ refresh_list(res.data, currentPath);
+ }
+ else {
+ alert('创建失败,请稍后再试...');
+ }
+ };
+ xhr.send(formData);
+ }
+ };
document.addEventListener('DOMContentLoaded', function(evt) {
var initPath = '/';
if (/path=([/\w]+)/.test(location.search)) {
diff --git a/luci-app-fileassistant/luasrc/controller/fileassistant.lua b/luci-app-fileassistant/luasrc/controller/fileassistant.lua
index 7b880136..4c4bcb59 100644
--- a/luci-app-fileassistant/luasrc/controller/fileassistant.lua
+++ b/luci-app-fileassistant/luasrc/controller/fileassistant.lua
@@ -6,7 +6,6 @@ function index()
page = entry({"admin", "system", "fileassistant"}, template("fileassistant"), _("文件管理"), 50)
page.i18n = "base"
page.dependent = true
- page.acl_depends = { "luci-app-fileassistant" }
page = entry({"admin", "nas", "fileassistant", "list"}, call("fileassistant_list"), nil)
page.leaf = true
@@ -26,6 +25,14 @@ function index()
page = entry({"admin", "nas", "fileassistant", "install"}, call("fileassistant_install"), nil)
page.leaf = true
+ page = entry({"admin", "nas", "fileassistant", "mkdir"}, call("fileassistant_mkdir"), nil)
+ page.leaf = true
+
+ page = entry({"admin", "nas", "fileassistant", "chmod"}, call("fileassistant_chmod"), nil)
+ page.leaf = true
+
+ page = entry({"admin", "nas", "fileassistant", "chown"}, call("fileassistant_chown"), nil)
+ page.leaf = true
end
function list_response(path, success)
@@ -109,15 +116,18 @@ function installIPK(filepath)
end
function fileassistant_upload()
- local filecontent = luci.http.formvalue("upload-file")
- local filename = luci.http.formvalue("upload-filename")
- local uploaddir = luci.http.formvalue("upload-dir")
- local filepath = uploaddir..filename
-
local fp
+ -- MUST setfilehandler before formvalue,
+ -- beacuse formvalue will parse form and write body to /tmp if filehandler not present
luci.http.setfilehandler(
function(meta, chunk, eof)
if not fp and meta and meta.name == "upload-file" then
+ local filename = luci.http.formvalue("upload-filename")
+ local uploaddir = luci.http.formvalue("upload-dir")
+ if not uploaddir or not filename then
+ error("uploaddir or filename is nil")
+ end
+ local filepath = uploaddir..filename
fp = io.open(filepath, "w")
end
if fp and chunk then
@@ -129,7 +139,28 @@ function fileassistant_upload()
end
)
- list_response(uploaddir, true)
+ list_response(luci.http.formvalue("upload-dir"), true)
+end
+
+function fileassistant_mkdir()
+ local path = luci.http.formvalue("path")
+ local dirname = luci.http.formvalue("dirname")
+ local success = os.execute('sh -c \'cd "'..path..'" && mkdir -p "'..dirname..'"\'')
+ list_response(path, success)
+end
+
+function fileassistant_chmod()
+ local path = luci.http.formvalue("filepath")
+ local newmod = luci.http.formvalue("newmod")
+ local success = os.execute('chmod '..newmod..' "'..path..'"')
+ list_response(nixio.fs.dirname(path), success)
+end
+
+function fileassistant_chown()
+ local path = luci.http.formvalue("filepath")
+ local newown = luci.http.formvalue("newown")
+ local success = os.execute('chown '..newown..' "'..path..'"')
+ list_response(nixio.fs.dirname(path), success)
end
function scandir(directory)
diff --git a/luci-app-fileassistant/luasrc/view/fileassistant.htm b/luci-app-fileassistant/luasrc/view/fileassistant.htm
index 15f069b9..3d760b40 100644
--- a/luci-app-fileassistant/luasrc/view/fileassistant.htm
+++ b/luci-app-fileassistant/luasrc/view/fileassistant.htm
@@ -1,12 +1,13 @@
<%+header%>
-
+
文件助手