forked from coolsnowwolf/lede
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bot] AutoMerging: merge all upstream's changes:
* https://github.com/coolsnowwolf/lede: elfutils: sync upstream (coolsnowwolf#8652) toolchain/binutils: sync upstream (coolsnowwolf#8661) binutils: sync upstream (coolsnowwolf#8660) utils/mdadm: fix build on hosts without /run dir (coolsnowwolf#8651) luci-app-kodexplorer: sync to my upstream (coolsnowwolf#8657)
- Loading branch information
Showing
25 changed files
with
741 additions
and
594 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
# Copyright (C) 2018-2020 Lienol <[email protected]> | ||
# Copyright (C) 2018-2022 Lienol <[email protected]> | ||
# | ||
# This is free software, licensed under the GNU General Public License v3. | ||
# | ||
|
||
include $(TOPDIR)/rules.mk | ||
|
||
LUCI_TITLE:=LuCI support for KodExplorer | ||
LUCI_DEPENDS:=+nginx-ssl +unzip +zoneinfo-asia +php8 +php8-fpm +php8-mod-curl +php8-mod-gd +php8-mod-iconv +php8-mod-mbstring +php8-mod-opcache +php8-mod-session +php8-mod-zip +php8-mod-sqlite3 +php8-mod-pdo +php8-mod-pdo-sqlite +php8-mod-pdo-mysql +php8-cgi +php8-mod-dom | ||
LUCI_DEPENDS:=+nginx-ssl +unzip +zoneinfo-asia +php8 +php8-fastcgi +php8-fpm +php8-mod-curl +php8-mod-dom +php8-mod-gd +php8-mod-iconv +php8-mod-mbstring +php8-mod-opcache +php8-mod-session +php8-mod-zip +php8-mod-sqlite3 +php8-mod-pdo +php8-mod-pdo-sqlite +php8-mod-pdo-mysql +php8-mod-xml +php8-mod-xmlreader +php8-mod-xmlwriter | ||
LUCI_PKGARCH:=all | ||
PKG_VERSION:=14 | ||
PKG_DATE:=20210505 | ||
PKG_VERSION:=20220109 | ||
PKG_RELEASE:=1 | ||
|
||
include $(TOPDIR)/feeds/luci/luci.mk | ||
|
||
|
55 changes: 28 additions & 27 deletions
55
package/lean/luci-app-kodexplorer/luasrc/controller/kodexplorer.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,49 @@ | ||
-- Copyright 2018-2020 Lienol <[email protected]> | ||
-- Copyright 2018-2022 Lienol <[email protected]> | ||
module("luci.controller.kodexplorer", package.seeall) | ||
|
||
local http = require "luci.http" | ||
local api = require "luci.model.cbi.kodexplorer.api" | ||
|
||
function index() | ||
if not nixio.fs.access("/etc/config/kodexplorer") then | ||
return | ||
end | ||
if not nixio.fs.access("/etc/config/kodexplorer") then return end | ||
|
||
entry({"admin", "nas"}, firstchild(), "NAS", 44).dependent = false | ||
entry({"admin", "nas", "kodexplorer"}, cbi("kodexplorer/settings"), _("KodExplorer"), 3).dependent = true | ||
entry({"admin", "nas"}, firstchild(), "NAS", 44).dependent = false | ||
|
||
entry({"admin", "nas", "kodexplorer", "check"}, call("action_check")).leaf = true | ||
entry({"admin", "nas", "kodexplorer", "download"}, call("action_download")).leaf = true | ||
entry({"admin", "nas", "kodexplorer", "status"}, call("act_status")).leaf = true | ||
e = entry({"admin", "nas", "kodexplorer"}, cbi("kodexplorer/settings"), _("KodExplorer"), 3) | ||
e.dependent = true | ||
e.acl_depends = { "luci-app-kodexplorer" } | ||
|
||
entry({"admin", "nas", "kodexplorer", "check"}, call("action_check")).leaf = true | ||
entry({"admin", "nas", "kodexplorer", "download"}, call("action_download")).leaf = true | ||
entry({"admin", "nas", "kodexplorer", "status"}, call("act_status")).leaf = true | ||
end | ||
|
||
local function http_write_json(content) | ||
http.prepare_content("application/json") | ||
http.write_json(content or {code = 1}) | ||
http.prepare_content("application/json") | ||
http.write_json(content or {code = 1}) | ||
end | ||
|
||
function act_status() | ||
local e = {} | ||
e.nginx_status = luci.sys.call("ps -w | grep nginx | grep kodexplorer | grep -v grep > /dev/null") == 0 | ||
e.php_status = luci.sys.call("ps -w | grep php | grep kodexplorer | grep -v grep > /dev/null") == 0 | ||
http_write_json(e) | ||
local e = {} | ||
e.nginx_status = luci.sys.call("ps -w | grep nginx | grep kodexplorer | grep -v grep > /dev/null") == 0 | ||
e.php_status = luci.sys.call("ps -w | grep php | grep kodexplorer | grep -v grep > /dev/null") == 0 | ||
http_write_json(e) | ||
end | ||
|
||
function action_check() | ||
local json = api.to_check() | ||
http_write_json(json) | ||
local json = api.to_check() | ||
http_write_json(json) | ||
end | ||
|
||
function action_download() | ||
local json = nil | ||
local task = http.formvalue("task") | ||
if task == "extract" then | ||
json = api.to_extract(http.formvalue("file")) | ||
elseif task == "move" then | ||
json = api.to_move(http.formvalue("file")) | ||
else | ||
json = api.to_download(http.formvalue("url")) | ||
end | ||
http_write_json(json) | ||
local json = nil | ||
local task = http.formvalue("task") | ||
if task == "extract" then | ||
json = api.to_extract(http.formvalue("file")) | ||
elseif task == "move" then | ||
json = api.to_move(http.formvalue("file")) | ||
else | ||
json = api.to_download(http.formvalue("url")) | ||
end | ||
http_write_json(json) | ||
end |
103 changes: 73 additions & 30 deletions
103
package/lean/luci-app-kodexplorer/luasrc/model/cbi/kodexplorer/settings.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,96 @@ | ||
m = Map("kodexplorer") | ||
m.title = translate("KodExplorer") | ||
m.description = translate("KodExplorer is a fast and efficient private cloud and online document management system that provides secure, controllable, easy-to-use and highly customizable private cloud products for personal websites, enterprise private cloud deployment, network storage, online document management, and online office. With Windows style interface and operation habits, it can be used quickly without adaptation. It supports online preview of hundreds of common file formats and is extensible and easy to customize.") | ||
|
||
m = Map("kodexplorer", translate("KodExplorer"), translate("KodExplorer is a fast and efficient private cloud and online document management system that provides secure, controllable, easy-to-use and highly customizable private cloud products for personal websites, enterprise private cloud deployment, network storage, online document management, and online office. With Windows style interface and operation habits, it can be used quickly without adaptation. It supports online preview of hundreds of common file formats and is extensible and easy to customize.")) | ||
m:append(Template("kodexplorer/status")) | ||
|
||
s = m:section(TypedSection, "global", translate("Global Settings")) | ||
s = m:section(TypedSection, "global") | ||
s.anonymous = true | ||
s.addremove = false | ||
|
||
o = s:option(Flag, "enable", translate("Enable")) | ||
s:tab("global", translate("Global Settings")) | ||
s:tab("template", translate("Edit Template")) | ||
|
||
php_fpm = s:taboption("template", Value, "_php_fpm", | ||
translatef("Edit the template that is used for generating the %s configuration.", "php-fpm"), | ||
translatef("This is the content of the file '%s'", "/etc/kodexplorer/php-fpm.conf.template") .. | ||
translatef("Values enclosed by pipe symbols ('|') should not be changed. They get their values from the '%s' tab.", translate("Global Settings"))) | ||
php_fpm.template = "cbi/tvalue" | ||
php_fpm.rows = 10 | ||
|
||
function php_fpm.cfgvalue(self, section) | ||
return nixio.fs.readfile("/etc/kodexplorer/php-fpm.conf.template") | ||
end | ||
|
||
function php_fpm.write(self, section, value) | ||
value = value:gsub("\r\n?", "\n") | ||
nixio.fs.writefile("/etc/kodexplorer/php-fpm.conf.template", value) | ||
end | ||
|
||
php = s:taboption("template", Value, "_php", | ||
translatef("Edit the template that is used for generating the %s configuration.", "php"), | ||
translatef("This is the content of the file '%s'", "/etc/kodexplorer/php.ini.template") .. | ||
translatef("Values enclosed by pipe symbols ('|') should not be changed. They get their values from the '%s' tab.", translate("Global Settings"))) | ||
php.template = "cbi/tvalue" | ||
php.rows = 10 | ||
|
||
function php.cfgvalue(self, section) | ||
return nixio.fs.readfile("/etc/kodexplorer/php.ini.template") | ||
end | ||
|
||
function php.write(self, section, value) | ||
value = value:gsub("\r\n?", "\n") | ||
nixio.fs.writefile("/etc/kodexplorer/php.ini.template", value) | ||
end | ||
|
||
nginx = s:taboption("template", Value, "_nginx", | ||
translatef("Edit the template that is used for generating the %s configuration.", "nginx"), | ||
translatef("This is the content of the file '%s'", "/etc/kodexplorer/nginx.conf.template") .. | ||
translatef("Values enclosed by pipe symbols ('|') should not be changed. They get their values from the '%s' tab.", translate("Global Settings"))) | ||
nginx.template = "cbi/tvalue" | ||
nginx.rows = 10 | ||
|
||
function nginx.cfgvalue(self, section) | ||
return nixio.fs.readfile("/etc/kodexplorer/nginx.conf.template") | ||
end | ||
|
||
function nginx.write(self, section, value) | ||
value = value:gsub("\r\n?", "\n") | ||
nixio.fs.writefile("/etc/kodexplorer/nginx.conf.template", value) | ||
end | ||
|
||
o = s:taboption("global", Flag, "enable", translate("Enable")) | ||
o.rmempty = false | ||
|
||
o = s:taboption("global", Flag, "ipv6", translate("Listen IPv6")) | ||
o.rmempty = false | ||
|
||
o = s:option(Value, "port", translate("Nginx Port")) | ||
o = s:taboption("global", Value, "port", translate("Nginx Port")) | ||
o.datatype = "port" | ||
o.default = 8081 | ||
o.rmempty = false | ||
|
||
o = s:option(Value, "memory_limit", translate("Maximum memory usage")) | ||
o.description = translate("If your device has a lot of memory, you can increase it.") | ||
o.default = "8M" | ||
o = s:taboption("global", Flag, "https", translate("HTTPS")) | ||
o.rmempty = false | ||
|
||
o = s:option(Value, "post_max_size", translate("Maximum POST capacity")) | ||
o.description = translate("This value cannot be greater than the maximum memory usage") | ||
o.default = "12M" | ||
o = s:taboption("global", FileUpload, "certificate", translate("certificate")) | ||
o:depends("https", 1) | ||
|
||
o = s:taboption("global", FileUpload, "key", translate("key")) | ||
o:depends("https", 1) | ||
|
||
o = s:taboption("global", Value, "memory_limit", translate("Maximum memory usage"), translate("If your device has a lot of memory, you can increase it.")) | ||
o.default = "32M" | ||
o.rmempty = false | ||
|
||
o = s:option(Value, "upload_max_filesize", translate("Maximum memory usage for uploading files")) | ||
o.description = translate("This value cannot be greater than the POST maximum capacity") | ||
o.default = "12M" | ||
o = s:taboption("global", Value, "upload_max_filesize", translate("Maximum memory usage for uploading files")) | ||
o.default = "32M" | ||
o.rmempty = false | ||
|
||
o = s:option(Value, "storage_device_path", translate("Storage device path")) | ||
o.description = translate("It is recommended to insert a usb flash drive or hard disk and enter the path. For example, /mnt/sda1/") | ||
o.default = "/mnt/sda1/" | ||
o = s:taboption("global", DynamicList, "open_basedir", translate("Accessible directory")) | ||
o.rmempty = false | ||
|
||
o = s:option(Value, "project_directory", translate("Project directory")) | ||
o.description = translate("It is recommended to insert a usb flash drive or hard disk and enter the path. For example, /mnt/sda1/kodexplorer") | ||
o = s:taboption("global", Value, "project_directory", translate("Project directory"), translate("It is recommended to insert a usb flash drive or hard disk and enter the path. For example, /mnt/sda1/kodexplorer")) | ||
o.default = "/mnt/sda1/kodexplorer" | ||
o.rmempty = false | ||
|
||
s:append(Template("kodexplorer/version")) | ||
|
||
o = s:option(Button, "_download", translate("Manually update")) | ||
o.description = translate("Make sure you have enough space.<br /><font style='color:red'>Be sure to fill out the device path and store path for the first run, and then save the application. Then manually download, otherwise can not use!</font>") | ||
o.template = "kodexplorer/download" | ||
o.inputstyle = "apply" | ||
o.btnclick = "downloadClick(this);" | ||
o.id = "download_btn" | ||
|
||
o = s:taboption("global", Button, "_update") | ||
o.template = "kodexplorer/version" | ||
return m |
Oops, something went wrong.