mirror of
https://github.com/kenzok8/openwrt-packages.git
synced 2025-01-09 03:58:26 +08:00
update 2023-06-10 02:01:17
This commit is contained in:
parent
16f0abaa06
commit
04fbda4f7e
@ -1,21 +1,12 @@
|
|||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
#
|
#
|
||||||
# Copyright (C) 2021 ImmortalWrt
|
# Copyright (C) 2023 ImmortalWrt.org
|
||||||
# <https://immortalwrt.org>
|
|
||||||
#
|
|
||||||
# This is free software, licensed under the GNU General Public License v3.
|
|
||||||
#
|
|
||||||
|
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
LUCI_TITLE:=LuCI Support for FileBrowser
|
LUCI_TITLE:=LuCI app for FileBrowser
|
||||||
LUCI_DEPENDS:=+filebrowser
|
|
||||||
LUCI_PKGARCH:=all
|
LUCI_PKGARCH:=all
|
||||||
|
LUCI_DEPENDS:=+filebrowser
|
||||||
PKG_NAME:=luci-app-filebrowser
|
|
||||||
PKG_VERSION:=snapshot
|
|
||||||
PKG_RELEASE:=118071b
|
|
||||||
|
|
||||||
PKG_LICENSE:=GPLv3
|
|
||||||
|
|
||||||
include $(TOPDIR)/feeds/luci/luci.mk
|
include $(TOPDIR)/feeds/luci/luci.mk
|
||||||
|
|
||||||
|
@ -0,0 +1,87 @@
|
|||||||
|
'use strict';
|
||||||
|
'require form';
|
||||||
|
'require poll';
|
||||||
|
'require rpc';
|
||||||
|
'require uci';
|
||||||
|
'require view';
|
||||||
|
|
||||||
|
var callServiceList = rpc.declare({
|
||||||
|
object: 'service',
|
||||||
|
method: 'list',
|
||||||
|
params: ['name'],
|
||||||
|
expect: { '': {} }
|
||||||
|
});
|
||||||
|
|
||||||
|
function getServiceStatus() {
|
||||||
|
return L.resolveDefault(callServiceList('filebrowser'), {}).then(function (res) {
|
||||||
|
var isRunning = false;
|
||||||
|
try {
|
||||||
|
isRunning = res['filebrowser']['instances']['instance1']['running'];
|
||||||
|
} catch (e) { }
|
||||||
|
return isRunning;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderStatus(isRunning, port) {
|
||||||
|
var spanTemp = '<span style="color:%s"><strong>%s %s</strong></span>';
|
||||||
|
var renderHTML;
|
||||||
|
if (isRunning) {
|
||||||
|
var button = String.format(' <a class="btn cbi-button" href="http://%s:%s" target="_blank" rel="noreferrer noopener">%s</a>',
|
||||||
|
window.location.hostname, port, _('Open Web Interface'));
|
||||||
|
renderHTML = spanTemp.format('green', _('FileBrowser'), _('RUNNING')) + button;
|
||||||
|
} else {
|
||||||
|
renderHTML = spanTemp.format('red', _('FileBrowser'), _('NOT RUNNING'));
|
||||||
|
}
|
||||||
|
|
||||||
|
return renderHTML;
|
||||||
|
}
|
||||||
|
|
||||||
|
return view.extend({
|
||||||
|
load: function() {
|
||||||
|
return uci.load('filebrowser');
|
||||||
|
},
|
||||||
|
|
||||||
|
render: function(data) {
|
||||||
|
var m, s, o;
|
||||||
|
var webport = (uci.get(data, 'config', 'listen_port') || '8989');
|
||||||
|
|
||||||
|
m = new form.Map('filebrowser', _('FileBrowser'),
|
||||||
|
_('FileBrowser provides a file managing interface within a specified directory and it can be used to upload, delete, preview, rename and edit your files..'));
|
||||||
|
|
||||||
|
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', 'filebrowser');
|
||||||
|
|
||||||
|
o = s.option(form.Flag, 'enabled', _('Enable'));
|
||||||
|
o.default = o.disabled;
|
||||||
|
o.rmempty = false;
|
||||||
|
|
||||||
|
o = s.option(form.Value, 'listen_port', _('Listen port'));
|
||||||
|
o.datatype = 'port';
|
||||||
|
o.default = '8989';
|
||||||
|
o.rmempty = false;
|
||||||
|
|
||||||
|
o = s.option(form.Value, 'root_path', _('Root directory'));
|
||||||
|
o.default = '/mnt';
|
||||||
|
o.rmempty = false;
|
||||||
|
|
||||||
|
o = s.option(form.Flag, 'disable_exec', _('Disable Command Runner feature'));
|
||||||
|
o.default = o.enabled;
|
||||||
|
o.rmempty = false;
|
||||||
|
|
||||||
|
return m.render();
|
||||||
|
}
|
||||||
|
});
|
@ -1,22 +0,0 @@
|
|||||||
module("luci.controller.filebrowser", package.seeall)
|
|
||||||
|
|
||||||
function index()
|
|
||||||
if not nixio.fs.access("/etc/config/filebrowser") then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
entry({"admin", "nas"}, firstchild(), _("NAS"), 45).dependent = false
|
|
||||||
|
|
||||||
local page = entry({"admin", "nas", "filebrowser"}, cbi("filebrowser"), _("文件管理器"), 100)
|
|
||||||
page.dependent = true
|
|
||||||
page.acl_depends = { "luci-app-filebrowser" }
|
|
||||||
|
|
||||||
entry({"admin", "nas", "filebrowser", "status"}, call("act_status")).leaf = true
|
|
||||||
end
|
|
||||||
|
|
||||||
function act_status()
|
|
||||||
local e = {}
|
|
||||||
e.running = luci.sys.call("pgrep filebrowser >/dev/null") == 0
|
|
||||||
luci.http.prepare_content("application/json")
|
|
||||||
luci.http.write_json(e)
|
|
||||||
end
|
|
@ -1,43 +0,0 @@
|
|||||||
m = Map("filebrowser", translate("文件管理器"))
|
|
||||||
m.description = translate("FileBrowser是一个基于Go的在线文件管理器,助您方便的管理设备上的文件。")
|
|
||||||
|
|
||||||
m:section(SimpleSection).template = "filebrowser/filebrowser_status"
|
|
||||||
|
|
||||||
s = m:section(TypedSection, "filebrowser")
|
|
||||||
s.addremove = false
|
|
||||||
s.anonymous = true
|
|
||||||
|
|
||||||
o = s:option(Flag, "enabled", translate("启用"))
|
|
||||||
o.rmempty = false
|
|
||||||
|
|
||||||
o = s:option(ListValue, "addr_type", translate("监听地址"))
|
|
||||||
o:value("local", translate("监听本机地址"))
|
|
||||||
o:value("lan", translate("监听局域网地址"))
|
|
||||||
o:value("wan", translate("监听全部地址"))
|
|
||||||
o.default = "lan"
|
|
||||||
o.rmempty = false
|
|
||||||
|
|
||||||
o = s:option(Value, "port", translate("监听端口"))
|
|
||||||
o.placeholder = 8989
|
|
||||||
o.default = 8989
|
|
||||||
o.datatype = "port"
|
|
||||||
o.rmempty = false
|
|
||||||
|
|
||||||
o = s:option(Value, "root_dir", translate("开放目录"))
|
|
||||||
o.placeholder = "/"
|
|
||||||
o.default = "/"
|
|
||||||
o.rmempty = false
|
|
||||||
|
|
||||||
o = s:option(Value, "db_dir", translate("数据库目录"))
|
|
||||||
o.description = translate("普通用户请勿随意更改")
|
|
||||||
o.placeholder = "/etc"
|
|
||||||
o.default = "/etc"
|
|
||||||
o.rmempty = false
|
|
||||||
|
|
||||||
o = s:option(Value, "db_name", translate("数据库名"))
|
|
||||||
o.description = translate("普通用户请勿随意更改")
|
|
||||||
o.placeholder = "filebrowser.db"
|
|
||||||
o.default = "filebrowser.db"
|
|
||||||
o.rmempty = false
|
|
||||||
|
|
||||||
return m
|
|
@ -1,27 +0,0 @@
|
|||||||
<script type="text/javascript">//<![CDATA[
|
|
||||||
XHR.poll(1, '<%=url([[admin]], [[nas]], [[filebrowser]], [[status]])%>', null,
|
|
||||||
function(x, data) {
|
|
||||||
var tb = document.getElementById('filebrowser_status');
|
|
||||||
if (data && tb) {
|
|
||||||
if (data.running) {
|
|
||||||
var links = '<font color=green>Filebrowser <%:运行中%></font><input class="cbi-button mar-10" type="button" value="<%:打开管理界面%>" onclick="openwebui();" />';
|
|
||||||
tb.innerHTML = links;
|
|
||||||
} else {
|
|
||||||
tb.innerHTML = '<font color=red>Filebrowser <%:未运行%></font>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
function openwebui(){
|
|
||||||
var url = window.location.host+":<%=luci.sys.exec("uci -q get filebrowser.config.port"):gsub("^%s*(.-)%s*$", "%1")%>";
|
|
||||||
window.open('http://'+url,'target','');
|
|
||||||
};
|
|
||||||
//]]>
|
|
||||||
</script>
|
|
||||||
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
|
|
||||||
<fieldset class="cbi-section">
|
|
||||||
<p id="filebrowser_status">
|
|
||||||
<em><%:Collecting data...%></em>
|
|
||||||
</p>
|
|
||||||
</fieldset>
|
|
51
luci-app-filebrowser/po/templates/filebrowser.pot
Normal file
51
luci-app-filebrowser/po/templates/filebrowser.pot
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
msgid ""
|
||||||
|
msgstr "Content-Type: text/plain; charset=UTF-8"
|
||||||
|
|
||||||
|
#: applications/luci-app-filebrowser/htdocs/luci-static/resources/view/filebrowser.js:62
|
||||||
|
msgid "Collecting data..."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: applications/luci-app-filebrowser/htdocs/luci-static/resources/view/filebrowser.js:81
|
||||||
|
msgid "Disable Command Runner feature"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: applications/luci-app-filebrowser/htdocs/luci-static/resources/view/filebrowser.js:68
|
||||||
|
msgid "Enable"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: applications/luci-app-filebrowser/htdocs/luci-static/resources/view/filebrowser.js:31
|
||||||
|
#: applications/luci-app-filebrowser/htdocs/luci-static/resources/view/filebrowser.js:33
|
||||||
|
#: applications/luci-app-filebrowser/htdocs/luci-static/resources/view/filebrowser.js:48
|
||||||
|
#: applications/luci-app-filebrowser/root/usr/share/luci/menu.d/luci-app-filebrowser.json:3
|
||||||
|
msgid "FileBrowser"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: applications/luci-app-filebrowser/htdocs/luci-static/resources/view/filebrowser.js:49
|
||||||
|
msgid ""
|
||||||
|
"FileBrowser provides a file managing interface within a specified directory "
|
||||||
|
"and it can be used to upload, delete, preview, rename and edit your files.."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: applications/luci-app-filebrowser/root/usr/share/rpcd/acl.d/luci-app-filebrowser.json:3
|
||||||
|
msgid "Grant UCI access for luci-app-filebrowser"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: applications/luci-app-filebrowser/htdocs/luci-static/resources/view/filebrowser.js:72
|
||||||
|
msgid "Listen port"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: applications/luci-app-filebrowser/htdocs/luci-static/resources/view/filebrowser.js:33
|
||||||
|
msgid "NOT RUNNING"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: applications/luci-app-filebrowser/htdocs/luci-static/resources/view/filebrowser.js:30
|
||||||
|
msgid "Open Web Interface"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: applications/luci-app-filebrowser/htdocs/luci-static/resources/view/filebrowser.js:31
|
||||||
|
msgid "RUNNING"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: applications/luci-app-filebrowser/htdocs/luci-static/resources/view/filebrowser.js:77
|
||||||
|
msgid "Root directory"
|
||||||
|
msgstr ""
|
1
luci-app-filebrowser/po/zh-cn
Symbolic link
1
luci-app-filebrowser/po/zh-cn
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
zh_Hans
|
60
luci-app-filebrowser/po/zh_Hans/filebrowser.po
Normal file
60
luci-app-filebrowser/po/zh_Hans/filebrowser.po
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
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-filebrowser/htdocs/luci-static/resources/view/filebrowser.js:62
|
||||||
|
msgid "Collecting data..."
|
||||||
|
msgstr "收集数据中..."
|
||||||
|
|
||||||
|
#: applications/luci-app-filebrowser/htdocs/luci-static/resources/view/filebrowser.js:81
|
||||||
|
msgid "Disable Command Runner feature"
|
||||||
|
msgstr "禁用命令执行功能"
|
||||||
|
|
||||||
|
#: applications/luci-app-filebrowser/htdocs/luci-static/resources/view/filebrowser.js:68
|
||||||
|
msgid "Enable"
|
||||||
|
msgstr "启用"
|
||||||
|
|
||||||
|
#: applications/luci-app-filebrowser/htdocs/luci-static/resources/view/filebrowser.js:31
|
||||||
|
#: applications/luci-app-filebrowser/htdocs/luci-static/resources/view/filebrowser.js:33
|
||||||
|
#: applications/luci-app-filebrowser/htdocs/luci-static/resources/view/filebrowser.js:48
|
||||||
|
#: applications/luci-app-filebrowser/root/usr/share/luci/menu.d/luci-app-filebrowser.json:3
|
||||||
|
msgid "FileBrowser"
|
||||||
|
msgstr "FileBrowser"
|
||||||
|
|
||||||
|
#: applications/luci-app-filebrowser/htdocs/luci-static/resources/view/filebrowser.js:49
|
||||||
|
msgid ""
|
||||||
|
"FileBrowser provides a file managing interface within a specified directory "
|
||||||
|
"and it can be used to upload, delete, preview, rename and edit your files.."
|
||||||
|
msgstr ""
|
||||||
|
"FileBrowser 提供指定目录下的文件管理界面,可用于上传、删除、预览、重命名和编"
|
||||||
|
"辑文件。"
|
||||||
|
|
||||||
|
#: applications/luci-app-filebrowser/root/usr/share/rpcd/acl.d/luci-app-filebrowser.json:3
|
||||||
|
msgid "Grant UCI access for luci-app-filebrowser"
|
||||||
|
msgstr "授予 luci-app-filebrowser 访问 UCI 配置的权限"
|
||||||
|
|
||||||
|
#: applications/luci-app-filebrowser/htdocs/luci-static/resources/view/filebrowser.js:72
|
||||||
|
msgid "Listen port"
|
||||||
|
msgstr "监听端口"
|
||||||
|
|
||||||
|
#: applications/luci-app-filebrowser/htdocs/luci-static/resources/view/filebrowser.js:33
|
||||||
|
msgid "NOT RUNNING"
|
||||||
|
msgstr "未运行"
|
||||||
|
|
||||||
|
#: applications/luci-app-filebrowser/htdocs/luci-static/resources/view/filebrowser.js:30
|
||||||
|
msgid "Open Web Interface"
|
||||||
|
msgstr "打开 Web 界面"
|
||||||
|
|
||||||
|
#: applications/luci-app-filebrowser/htdocs/luci-static/resources/view/filebrowser.js:31
|
||||||
|
msgid "RUNNING"
|
||||||
|
msgstr "运行中"
|
||||||
|
|
||||||
|
#: applications/luci-app-filebrowser/htdocs/luci-static/resources/view/filebrowser.js:77
|
||||||
|
msgid "Root directory"
|
||||||
|
msgstr "根目录"
|
@ -1,11 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
uci -q batch <<-EOF >/dev/null
|
|
||||||
delete ucitrack.@filebrowser[-1]
|
|
||||||
add ucitrack filebrowser
|
|
||||||
set ucitrack.@filebrowser[-1].init=filebrowser
|
|
||||||
commit ucitrack
|
|
||||||
EOF
|
|
||||||
|
|
||||||
rm -f /tmp/luci-indexcache
|
|
||||||
exit 0
|
|
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"admin/services/filebrowser": {
|
||||||
|
"title": "FileBrowser",
|
||||||
|
"action": {
|
||||||
|
"order": 30,
|
||||||
|
"type": "view",
|
||||||
|
"path": "filebrowser"
|
||||||
|
},
|
||||||
|
"depends": {
|
||||||
|
"acl": [ "luci-app-filebrowser" ],
|
||||||
|
"uci": { "filebrowser": true }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -2,6 +2,9 @@
|
|||||||
"luci-app-filebrowser": {
|
"luci-app-filebrowser": {
|
||||||
"description": "Grant UCI access for luci-app-filebrowser",
|
"description": "Grant UCI access for luci-app-filebrowser",
|
||||||
"read": {
|
"read": {
|
||||||
|
"ubus": {
|
||||||
|
"service": [ "list" ]
|
||||||
|
},
|
||||||
"uci": [ "filebrowser" ]
|
"uci": [ "filebrowser" ]
|
||||||
},
|
},
|
||||||
"write": {
|
"write": {
|
||||||
|
@ -7,6 +7,13 @@
|
|||||||
- Fixed the issue where some colors were out of control in dark mode.
|
- Fixed the issue where some colors were out of control in dark mode.
|
||||||
- Fixed the problem where the local startup script textarea could not be scrolled in the startup item.
|
- Fixed the problem where the local startup script textarea could not be scrolled in the startup item.
|
||||||
- Fixed the problem where the Passwall node list button was misaligned.
|
- Fixed the problem where the Passwall node list button was misaligned.
|
||||||
|
- Fixed the text overflow problem in dynlist
|
||||||
|
- Support wallpaper from Unsplashargon
|
||||||
|
- Fix menu style mis-match on macOS+Chrome
|
||||||
|
- Fixed the issue of the login page icon becoming larger
|
||||||
|
- Support wallpaper from wallhaven
|
||||||
|
> open footer links in new tab
|
||||||
|
- Remake theme icon
|
||||||
|
|
||||||
## v2.3 [ 2023.04.03 ]
|
## v2.3 [ 2023.04.03 ]
|
||||||
|
|
||||||
|
@ -7,6 +7,13 @@
|
|||||||
- 修复了暗色模式下个别颜色不受控制的问题
|
- 修复了暗色模式下个别颜色不受控制的问题
|
||||||
- 修复了启动项--本地启动脚本文本框不能滑动的问题
|
- 修复了启动项--本地启动脚本文本框不能滑动的问题
|
||||||
- 修复了Passwall节点列表按钮错位的问题
|
- 修复了Passwall节点列表按钮错位的问题
|
||||||
|
- 修复在dynlist中的文本溢出问题
|
||||||
|
- 登录页面 支持自来 Unsplash 的在线壁纸
|
||||||
|
- 修复在macOS的Chrome中,菜单的style异常
|
||||||
|
- 修复在登录页面中,主题图标变大的问题
|
||||||
|
- 登录页面 支持自来 wallhaven 的在线壁纸
|
||||||
|
> 打开页脚链接时使用新标签页
|
||||||
|
- 重制主题图标
|
||||||
|
|
||||||
## v2.3 [ 2023.04.03 ]
|
## v2.3 [ 2023.04.03 ]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user