diff --git a/.github/workflows/openwrt-ci.yml b/.github/workflows/openwrt-ci.yml index c06c42c706d33a..35c5020c7dd7e9 100644 --- a/.github/workflows/openwrt-ci.yml +++ b/.github/workflows/openwrt-ci.yml @@ -20,7 +20,9 @@ on: types: [published] jobs: + build: + runs-on: ubuntu-latest steps: @@ -29,35 +31,29 @@ jobs: with: ref: master - - name: Initialization environment + - name: Space cleanup env: DEBIAN_FRONTEND: noninteractive run: | docker rmi `docker images -q` - echo "Deleting files, please wait ..." - sudo rm -rf /usr/share/dotnet /etc/apt/sources.list.d/* - sudo rm -rf \ - /usr/share/dotnet \ - /etc/mysql \ - /etc/php - sudo -E apt-get -y purge \ - azure-cli \ - ghc* \ - zulu* \ - hhvm \ - llvm* \ - firefox \ - google* \ - dotnet* \ - powershell \ - openjdk* \ - mysql* \ - php* + sudo rm -rf /usr/share/dotnet /etc/mysql /etc/php /etc/apt/sources.list.d + sudo -E apt-get -y purge azure-cli ghc* zulu* hhvm llvm* firefox google* dotnet* powershell openjdk* mysql* php* sudo -E apt-get update sudo -E apt-get -y install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler sudo -E apt-get -y autoremove --purge sudo -E apt-get clean + # 利用挂载在 /mnt/ 的 14G 额外空间: + # sudo mkdir -p -m 777 /mnt/openwrt/bin /mnt/openwrt/build_dir/host /mnt/openwrt/build_dir/hostpkg /mnt/openwrt/dl /mnt/openwrt/feeds /mnt/openwrt/staging_dir + # ln -s /mnt/openwrt/bin ./bin + # mkdir -p ./build_dir/host && ln -s /mnt/openwrt/build_dir/host ./build_dir/host + # mkdir -p ./build_dir/host && ln -s /mnt/openwrt/build_dir/hostpkg ./build_dir/hostpkg + # ln -s /mnt/openwrt/dl ./dl + # ln -s /mnt/openwrt/feeds ./feeds + # ln -s /mnt/openwrt/staging_dir ./staging_dir + + df -h + - name: Update feeds run: | #git clone https://github.com/rosywrt/luci @@ -217,24 +213,25 @@ jobs: - name: Make download run: | make download -j8 - find dl -size -1024c -exec ls -l {} \; find dl -size -1024c -exec rm -f {} \; - name: Compile firmware run: | - echo -e "$(nproc) thread build." - make -j$(nproc) V=s - - - - name: Assemble artifact - run: | - rm -rf ./artifact/ - mkdir -p ./artifact/ - find ./bin/targets/ -name "*combined*img*" | xargs -i mv -f {} ./artifact/ - find ./bin/targets/ -name "*sysupgrade*bin*" | xargs -i mv -f {} ./artifact/ + make -j$(nproc) || make -j1 V=s + echo "=======================" + echo "Space usage:" + echo "=======================" + df -h + echo "=======================" + du -h --max-depth=1 ./ --exclude=build_dir --exclude=bin + du -h --max-depth=1 ./build_dir + du -h --max-depth=1 ./bin + + - name: Prepare artifact + run: find ./bin/targets/ -type d -name "packages" | xargs rm -rf {} - name: Upload artifact uses: actions/upload-artifact@master with: name: OpenWrt firmware - path: ./artifact/ + path: ./bin/targets/ diff --git a/include/prereq-build.mk b/include/prereq-build.mk index a416a2d2320990..f39ecbd0635779 100644 --- a/include/prereq-build.mk +++ b/include/prereq-build.mk @@ -37,7 +37,7 @@ $(eval $(call SetupHostCommand,gcc, \ gcc7 --version | grep gcc, \ gcc8 --version | grep gcc, \ gcc9 --version | grep gcc, \ - gcc --version | grep Apple.LLVM )) + gcc --version | grep -E 'Apple.(LLVM|clang)' )) $(eval $(call TestHostCommand,working-gcc, \ \nPlease reinstall the GNU C Compiler (4.8 or later) - \ @@ -56,7 +56,7 @@ $(eval $(call SetupHostCommand,g++, \ g++7 --version | grep g++, \ g++8 --version | grep g++, \ g++9 --version | grep g++, \ - g++ --version | grep Apple.LLVM )) + g++ --version | grep -E 'Apple.(LLVM|clang)' )) $(eval $(call TestHostCommand,working-g++, \ \nPlease reinstall the GNU C++ Compiler (4.8 or later) - \ diff --git a/package/lean/luci-app-kodexplorer/Makefile b/package/lean/luci-app-kodexplorer/Makefile index ee9cbc305c33fc..4575dd848de9c9 100644 --- a/package/lean/luci-app-kodexplorer/Makefile +++ b/package/lean/luci-app-kodexplorer/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 2018-2019 Lienol +# Copyright (C) 2018-2020 Lienol # # This is free software, licensed under the Apache License, Version 2.0 . # @@ -9,7 +9,7 @@ LUCI_TITLE:=LuCI support for KodExplorer LUCI_DEPENDS:=+nginx +zoneinfo-asia +php7 +php7-fpm +php7-mod-curl +php7-mod-gd +php7-mod-iconv +php7-mod-json +php7-mod-mbstring +php7-mod-opcache +php7-mod-session +php7-mod-zip LUCI_PKGARCH:=all PKG_VERSION:=1.0 -PKG_RELEASE:=5-20190518 +PKG_RELEASE:=10-20191217 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/package/lean/luci-app-kodexplorer/luasrc/controller/kodexplorer.lua b/package/lean/luci-app-kodexplorer/luasrc/controller/kodexplorer.lua index 9907e281d7ebb5..08ec22fba65a1e 100644 --- a/package/lean/luci-app-kodexplorer/luasrc/controller/kodexplorer.lua +++ b/package/lean/luci-app-kodexplorer/luasrc/controller/kodexplorer.lua @@ -1,46 +1,54 @@ +-- Copyright 2018-2020 Lienol 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 - - entry({"admin","nas","kodexplorer"},cbi("kodexplorer/settings"),_("KodExplorer"),3).dependent=true - - 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 + 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", "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 diff --git a/package/lean/luci-app-kodexplorer/luasrc/model/cbi/kodexplorer/api.lua b/package/lean/luci-app-kodexplorer/luasrc/model/cbi/kodexplorer/api.lua index dff82e570b30e5..46abf04712795b 100644 --- a/package/lean/luci-app-kodexplorer/luasrc/model/cbi/kodexplorer/api.lua +++ b/package/lean/luci-app-kodexplorer/luasrc/model/cbi/kodexplorer/api.lua @@ -1,217 +1,197 @@ -local fs = require "nixio.fs" -local sys = require "luci.sys" -local uci = require "luci.model.uci".cursor() +local fs = require "nixio.fs" +local sys = require "luci.sys" +local uci = require"luci.model.uci".cursor() local util = require "luci.util" local i18n = require "luci.i18n" module("luci.model.cbi.kodexplorer.api", package.seeall) -local api_url = "https://api.github.com/repos/kalcaddle/KodExplorer/releases/latest" +local api_url = + "https://api.github.com/repos/kalcaddle/KodExplorer/releases/latest" local download_url = "https://github.com/kalcaddle/KodExplorer/archive/" local wget = "/usr/bin/wget" -local wget_args = { "--no-check-certificate", "--quiet", "--timeout=10", "--tries=2" } -local curl = "/usr/bin/curl" +local wget_args = { + "--no-check-certificate", "--quiet", "--timeout=10", "--tries=2" +} + local command_timeout = 40 local function _unpack(t, i) - i = i or 1 - if t[i] ~= nil then - return t[i], _unpack(t, i + 1) - end + i = i or 1 + if t[i] ~= nil then return t[i], _unpack(t, i + 1) end end local function exec(cmd, args, writer, timeout) - local os = require "os" - local nixio = require "nixio" - - local fdi, fdo = nixio.pipe() - local pid = nixio.fork() - - if pid > 0 then - fdo:close() - - if writer or timeout then - local starttime = os.time() - while true do - if timeout and os.difftime(os.time(), starttime) >= timeout then - nixio.kill(pid, nixio.const.SIGTERM) - return 1 - end - - if writer then - local buffer = fdi:read(2048) - if buffer and #buffer > 0 then - writer(buffer) - end - end - - local wpid, stat, code = nixio.waitpid(pid, "nohang") - - if wpid and stat == "exited" then - return code - end - - if not writer and timeout then - nixio.nanosleep(1) - end - end - else - local wpid, stat, code = nixio.waitpid(pid) - return wpid and stat == "exited" and code - end - elseif pid == 0 then - nixio.dup(fdo, nixio.stdout) - fdi:close() - fdo:close() - nixio.exece(cmd, args, nil) - nixio.stdout:close() - os.exit(1) - end + local os = require "os" + local nixio = require "nixio" + + local fdi, fdo = nixio.pipe() + local pid = nixio.fork() + + if pid > 0 then + fdo:close() + + if writer or timeout then + local starttime = os.time() + while true do + if timeout and os.difftime(os.time(), starttime) >= timeout then + nixio.kill(pid, nixio.const.SIGTERM) + return 1 + end + + if writer then + local buffer = fdi:read(2048) + if buffer and #buffer > 0 then + writer(buffer) + end + end + + local wpid, stat, code = nixio.waitpid(pid, "nohang") + + if wpid and stat == "exited" then return code end + + if not writer and timeout then nixio.nanosleep(1) end + end + else + local wpid, stat, code = nixio.waitpid(pid) + return wpid and stat == "exited" and code + end + elseif pid == 0 then + nixio.dup(fdo, nixio.stdout) + fdi:close() + fdo:close() + nixio.exece(cmd, args, nil) + nixio.stdout:close() + os.exit(1) + end end local function compare_versions(ver1, comp, ver2) - local table = table + local table = table - local av1 = util.split(ver1, "[%.%-]", nil, true) - local av2 = util.split(ver2, "[%.%-]", nil, true) + local av1 = util.split(ver1, "[%.%-]", nil, true) + local av2 = util.split(ver2, "[%.%-]", nil, true) - local max = table.getn(av1) - local n2 = table.getn(av2) - if (max < n2) then - max = n2 - end + local max = table.getn(av1) + local n2 = table.getn(av2) + if (max < n2) then max = n2 end - for i = 1, max, 1 do - local s1 = av1[i] or "" - local s2 = av2[i] or "" + for i = 1, max, 1 do + local s1 = av1[i] or "" + local s2 = av2[i] or "" - if comp == "~=" and (s1 ~= s2) then return true end - if (comp == "<" or comp == "<=") and (s1 < s2) then return true end - if (comp == ">" or comp == ">=") and (s1 > s2) then return true end - if (s1 ~= s2) then return false end - end + if comp == "~=" and (s1 ~= s2) then return true end + if (comp == "<" or comp == "<=") and (s1 < s2) then return true end + if (comp == ">" or comp == ">=") and (s1 > s2) then return true end + if (s1 ~= s2) then return false end + end - return not (comp == "<" or comp == ">") + return not (comp == "<" or comp == ">") end local function get_api_json(url) - local jsonc = require "luci.jsonc" + local jsonc = require "luci.jsonc" + + local output = {} + -- exec(wget, { "-O-", url, _unpack(wget_args) }, + -- function(chunk) output[#output + 1] = chunk end) + -- local json_content = util.trim(table.concat(output)) - local output = { } - --exec(wget, { "-O-", url, _unpack(wget_args) }, - -- function(chunk) output[#output + 1] = chunk end) - --local json_content = util.trim(table.concat(output)) + local json_content = luci.sys.exec("wget-ssl -q --no-check-certificate -O- " .. url) - local json_content = luci.sys.exec(curl.." -sL "..url) - - if json_content == "" then - return { } - end + if json_content == "" then return {} end - return jsonc.parse(json_content) or { } + return jsonc.parse(json_content) or {} end function get_project_directory() - return uci:get("kodexplorer", "global", "project_directory") or luci.sys.exec("echo -n `uci get kodexplorer.@global[0].project_directory`") + return uci:get("kodexplorer", "global", "project_directory") or + luci.sys.exec( + "echo -n `uci get kodexplorer.@global[0].project_directory`") end function to_check() - local json = get_api_json(api_url) - if json.tag_name == nil then - return { - code = 1, - error = i18n.translate("Get remote version info failed.") - } - end - local remote_version = json.tag_name - local html_url = json.html_url - download_url = download_url..json.tag_name..".tar.gz" - if not download_url then - return { - code = 1, - version = remote_version, - html_url = html_url, - error = i18n.translate("New version found, but failed to get new version download url.") - } - end - return { - code = 0, - version = remote_version, - url = { - html = html_url, - download = download_url - } - } + local json = get_api_json(api_url) + if json.tag_name == nil then + return { + code = 1, + error = i18n.translate("Get remote version info failed.") + } + end + local remote_version = json.tag_name + local html_url = json.html_url + download_url = download_url .. json.tag_name .. ".tar.gz" + if not download_url then + return { + code = 1, + version = remote_version, + html_url = html_url, + error = i18n.translate( + "New version found, but failed to get new version download url.") + } + end + return { + code = 0, + version = remote_version, + url = {html = html_url, download = download_url} + } end function to_download(url) - if not url or url == "" then - return { - code = 1, - error = i18n.translate("Download url is required.") - } - end - - sys.call("/bin/rm -f /tmp/kodexplorer_download.*") - - local tmp_file = util.trim(util.exec("mktemp -u -t kodexplorer_download.XXXXXX")) - - local result = exec(wget, { - "-O", tmp_file, url, _unpack(wget_args) }, nil, command_timeout) == 0 - - if not result then - exec("/bin/rm", { "-f", tmp_file }) - return { - code = 1, - error = i18n.translatef("File download failed or timed out: %s", url) - } - end - - return { - code = 0, - file = tmp_file - } + if not url or url == "" then + return {code = 1, error = i18n.translate("Download url is required.")} + end + + sys.call("/bin/rm -f /tmp/kodexplorer_download.*") + + local tmp_file = util.trim(util.exec( + "mktemp -u -t kodexplorer_download.XXXXXX")) + + local result = exec(wget, {"-O", tmp_file, url, _unpack(wget_args)}, nil, + command_timeout) == 0 + + if not result then + exec("/bin/rm", {"-f", tmp_file}) + return { + code = 1, + error = i18n.translatef("File download failed or timed out: %s", url) + } + end + + return {code = 0, file = tmp_file} end function to_extract(file) - if not file or file == "" or not fs.access(file) then - return { - code = 1, - error = i18n.translate("File path required.") - } - end + if not file or file == "" or not fs.access(file) then + return {code = 1, error = i18n.translate("File path required.")} + end - sys.call("/bin/rm -rf /tmp/kodexplorer_extract.*") - local tmp_dir = util.trim(util.exec("mktemp -d -t kodexplorer_extract.XXXXXX")) + sys.call("/bin/rm -rf /tmp/kodexplorer_extract.*") + local tmp_dir = util.trim(util.exec( + "mktemp -d -t kodexplorer_extract.XXXXXX")) - local output = { } - exec("/bin/tar", { "-C", tmp_dir, "-zxvf", file }, - function(chunk) output[#output + 1] = chunk end) + local output = {} + exec("/bin/tar", {"-C", tmp_dir, "-zxvf", file}, + function(chunk) output[#output + 1] = chunk end) - local files = util.split(table.concat(output)) + local files = util.split(table.concat(output)) - exec("/bin/rm", { "-f", file }) + exec("/bin/rm", {"-f", file}) - return { - code = 0, - file = tmp_dir - } + return {code = 0, file = tmp_dir} end function to_move(file) - if not file or file == "" or not fs.access(file) then - sys.call("/bin/rm -rf /tmp/kodexplorer_extract.*") - return { - code = 1, - error = i18n.translate("Client file is required.") - } - end - - local client_file = get_project_directory() - sys.call("mkdir -p "..client_file) - sys.call("cp -R "..file.."/KodExplorer*/* "..client_file) - sys.call("/bin/rm -rf /tmp/kodexplorer_extract.*") - - return { code = 0 } + if not file or file == "" or not fs.access(file) then + sys.call("/bin/rm -rf /tmp/kodexplorer_extract.*") + return {code = 1, error = i18n.translate("Client file is required.")} + end + + local client_file = get_project_directory() + sys.call("mkdir -p " .. client_file) + sys.call("cp -R " .. file .. "/KodExplorer*/* " .. client_file) + sys.call("/bin/rm -rf /tmp/kodexplorer_extract.*") + + return {code = 0} end diff --git a/package/lean/luci-app-kodexplorer/luasrc/model/cbi/kodexplorer/settings.lua b/package/lean/luci-app-kodexplorer/luasrc/model/cbi/kodexplorer/settings.lua index 0882c7b64fdb20..2d66f2f3ff6b24 100644 --- a/package/lean/luci-app-kodexplorer/luasrc/model/cbi/kodexplorer/settings.lua +++ b/package/lean/luci-app-kodexplorer/luasrc/model/cbi/kodexplorer/settings.lua @@ -1,44 +1,56 @@ - -m = Map("kodexplorer",translate("KodExplorer"),translate("KodExplorer是一款快捷高效的私有云和在线文档管理系统,为个人网站、企业私有云部署、网络存储、在线文档管理、在线办公等提供安全可控,简便易用、可高度定制的私有云产品。采用windows风格界面、操作习惯,无需适应即可快速上手,支持几百种常用文件格式的在线预览,可扩展易定制。")) +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 Setting")) +s = m:section(TypedSection, "global", translate("Global Setting")) s.anonymous = true s.addremove = false -o = s:option(Flag,"enable",translate("Enable")) +o = s:option(Flag, "enable", translate("Enable")) o.rmempty = false -o = s:option(Value, "port", translate("Nginx监听端口")) -o.datatype="port" -o.default=81 +o = s:option(Value, "port", translate("Nginx Port")) +o.datatype = "port" +o.default = 8081 o.rmempty = false -o = s:option(Value, "memory_limit", translate("内存最大使用"), translate("如果你的设备内存较大的话,可以适当增加。")) -o.default="8M" +o = s:option(Value, "memory_limit", translate("Maximum memory usage"), + translate( + "If your device has a lot of memory, you can increase it.")) +o.default = "8M" o.rmempty = false -o = s:option(Value, "post_max_size", translate("POST最大容量"), translate("该值不能大于 内存最大使用")) -o.default="12M" +o = s:option(Value, "post_max_size", translate("Maximum POST capacity"), + translate( + "This value cannot be greater than the maximum memory usage")) +o.default = "12M" o.rmempty = false -o = s:option(Value, "upload_max_filesize", translate("上传文件最大使用内存"), translate("该值不能大于 POST最大容量")) -o.default="12M" +o = s:option(Value, "upload_max_filesize", + translate("Maximum memory usage for uploading files"), translate( + "This value cannot be greater than the POST maximum capacity")) +o.default = "12M" o.rmempty = false -o = s:option(Value, "storage_device_path", translate("存储设备路径"), translate("建议插入U盘或硬盘,然后输入路径。例如:/mnt/sda1/")) -o.default="/mnt/sda1/" +o = s:option(Value, "storage_device_path", translate("Storage device path"), + 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.rmempty = false -o = s:option(Value, "project_directory", translate("项目存放目录"), translate("建议插入U盘或硬盘,然后输入路径。例如:/mnt/sda1/kodexplorer")) -o.default="/mnt/sda1/kodexplorer" +o = s:option(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 -o = s:option(Button, "_download", translate("手动下载"), - translate("请确保具有足够的空间。
第一次运行务必填好设备路径和存放路径,然后保存应用。再手动下载,否则无法使用!")) +s:append(Template("kodexplorer/version")) + +o = s:option(Button, "_download", translate("Manually update"), translate( + "Make sure you have enough space.
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!")) o.template = "kodexplorer/download" o.inputstyle = "apply" o.btnclick = "downloadClick(this);" -o.id="download_btn" +o.id = "download_btn" return m diff --git a/package/lean/luci-app-kodexplorer/luasrc/view/kodexplorer/download.htm b/package/lean/luci-app-kodexplorer/luasrc/view/kodexplorer/download.htm index 3b1e3e178a4c1d..fa271d6a6f1ede 100644 --- a/package/lean/luci-app-kodexplorer/luasrc/view/kodexplorer/download.htm +++ b/package/lean/luci-app-kodexplorer/luasrc/view/kodexplorer/download.htm @@ -1,8 +1,3 @@ -<%# - Copyright (C) 2018-2019 Lienol - Licensed to the public under the Apache License 2.0. --%> - <% local dsp = require "luci.dispatcher" -%> @@ -11,11 +6,15 @@ var msgInfo; var tokenStr = '<%=token%>'; - var clickToDownloadText = '<%:点击下载%>'; - var inProgressText = '<%:正在下载...%>'; - var downloadInProgressNotice = '<%:正在下载,你确认要关闭吗?%>'; - var downloadSuccessText = '<%:下载成功.%>'; - var unexpectedErrorText = '<%:意外错误.%>'; + var clickToDownloadText = '<%:Click to update%>'; + var inProgressText = '<%:Updating...%>'; + var downloadInProgressNotice = '<%:Updating, are you sure to close?%>'; + var downloadSuccessText = '<%:Update successful%>'; + var unexpectedErrorText = '<%:Unexpected error%>'; + var downloadingText = '<%:Downloading...%>'; + var decompressioningText = '<%:Unpacking...%>'; + var movingText = '<%:Moving...%>'; + var latestVersionText = '<%:The latest version:%>'; function addPageNotice() { window.onbeforeunload = function(e) { @@ -97,7 +96,7 @@ if (ckeckDetailElm) { var urlNode = ''; if (json.version) { - urlNode = '最新版本号:' + json.version + ''; + urlNode = '' + latestVersionText + json.version + ''; if (json.url && json.url.html) { urlNode = '' + urlNode + ''; } @@ -110,7 +109,7 @@ function doDownload(btn) { btn.disabled = true; - btn.value = '<%:下载中...%>'; + btn.value = downloadingText; addPageNotice(); @@ -124,7 +123,7 @@ removePageNotice(); onRequestError(btn, json.error); } else { - btn.value = '<%:解压中...%>'; + btn.value = decompressioningText; // Extract file doAjaxGet(UpdateUrl, { @@ -136,7 +135,7 @@ removePageNotice(); onRequestError(btn, json.error); } else { - btn.value = '<%:移动中...%>'; + btn.value = movingText; // Move file to target dir doAjaxGet(UpdateUrl, { diff --git a/package/lean/luci-app-kodexplorer/luasrc/view/kodexplorer/version.htm b/package/lean/luci-app-kodexplorer/luasrc/view/kodexplorer/version.htm new file mode 100644 index 00000000000000..1a9c6d61a8d348 --- /dev/null +++ b/package/lean/luci-app-kodexplorer/luasrc/view/kodexplorer/version.htm @@ -0,0 +1,17 @@ +<% +local kodexplorer_path = luci.sys.exec("echo -n `uci get kodexplorer.@global[0].project_directory`") +local kodexplorer_version = luci.sys.exec("[ -f '" .. kodexplorer_path .. "/ChangeLog.md' ] && echo -n `cat " .. kodexplorer_path .. "/ChangeLog.md | head -1 | awk '{print $2}'`") +-%> + +<% if kodexplorer_version ~= nil and kodexplorer_version~="" then %> +
+ +
+
+ 【 <%=kodexplorer_version%> 】 +
+
+
+<% end %> \ No newline at end of file diff --git a/package/lean/luci-app-kodexplorer/po/zh-cn/kodexplorer.po b/package/lean/luci-app-kodexplorer/po/zh-cn/kodexplorer.po index 9b9e04331e0830..0b1facf349e4ad 100644 --- a/package/lean/luci-app-kodexplorer/po/zh-cn/kodexplorer.po +++ b/package/lean/luci-app-kodexplorer/po/zh-cn/kodexplorer.po @@ -1,2 +1,104 @@ msgid "KodExplorer" msgstr "可道云" + +msgid "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." +msgstr "KodExplorer是一款快捷高效的私有云和在线文档管理系统,为个人网站、企业私有云部署、网络存储、在线文档管理、在线办公等提供安全可控,简便易用、可高度定制的私有云产品。采用windows风格界面、操作习惯,无需适应即可快速上手,支持几百种常用文件格式的在线预览,可扩展易定制。" + +msgid "Nginx Port" +msgstr "Nginx监听端口" + +msgid "Maximum memory usage" +msgstr "内存最大使用" + +msgid "If your device has a lot of memory, you can increase it." +msgstr "如果你的设备内存较大的话,可以适当增加。" + +msgid "Maximum POST capacity" +msgstr "POST最大容量" + +msgid "This value cannot be greater than the maximum memory usage" +msgstr "该值不能大于 内存最大使用" + +msgid "Maximum memory usage for uploading files" +msgstr "上传文件最大使用内存" + +msgid "This value cannot be greater than the POST maximum capacity" +msgstr "该值不能大于 POST最大容量" + +msgid "Storage device path" +msgstr "存储设备路径" + +msgid "It is recommended to insert a usb flash drive or hard disk and enter the path. For example, /mnt/sda1/" +msgstr "建议插入U盘或硬盘,然后输入路径。例如:/mnt/sda1/" + +msgid "Project directory" +msgstr "项目存放目录" + +msgid "It is recommended to insert a usb flash drive or hard disk and enter the path. For example, /mnt/sda1/kodexplorer" +msgstr "建议插入U盘或硬盘,然后输入路径。例如:/mnt/sda1/kodexplorer" + +msgid "Make sure you have enough space.
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!" +msgstr "请确保具有足够的空间。
第一次运行务必填好设备路径和存放路径,然后保存应用。再手动下载,否则无法使用!" + +msgid "Manually update" +msgstr "手动更新" + +msgid "It is the latest version" +msgstr "已是最新版本" + +msgid "Update successful" +msgstr "更新成功" + +msgid "Click to update" +msgstr "点击更新" + +msgid "Updating..." +msgstr "更新中" + +msgid "Unexpected error" +msgstr "意外错误" + +msgid "Updating, are you sure to close?" +msgstr "正在更新,你确认要关闭吗?" + +msgid "Downloading..." +msgstr "下载中" + +msgid "Unpacking..." +msgstr "解压中" + +msgid "Moving..." +msgstr "移动中" + +msgid "The latest version:" +msgstr "最新版本:" + +msgid "Can't determine ARCH, or ARCH not supported." +msgstr "无法确认ARCH架构,或是不支持。" + +msgid "Get remote version info failed." +msgstr "获取远程版本信息失败。" + +msgid "New version found, but failed to get new version download url." +msgstr "发现新版本,但未能获得新版本的下载地址。" + +msgid "Download url is required." +msgstr "请指定下载地址。" + +msgid "File download failed or timed out: %s" +msgstr "文件下载失败或超时:%s" + +msgid "File path required." +msgstr "请指定文件路径。" + +msgid "Can't find client in file: %s" +msgstr "无法在文件中找到客户端:%s" + +msgid "Client file is required." +msgstr "请指定客户端文件。" + +msgid "The client file is not suitable for current device." +msgstr "客户端文件不适合当前设备。" + +msgid "Can't move new file to path: %s" +msgstr "无法移动新文件到:%s" diff --git a/package/lean/luci-app-kodexplorer/root/etc/config/kodexplorer b/package/lean/luci-app-kodexplorer/root/etc/config/kodexplorer index 323bc42dc68ed1..b049415ba1f538 100644 --- a/package/lean/luci-app-kodexplorer/root/etc/config/kodexplorer +++ b/package/lean/luci-app-kodexplorer/root/etc/config/kodexplorer @@ -1,10 +1,10 @@ config global - option port '8081' - option memory_limit '8M' - option post_max_size '12M' - option upload_max_filesize '12M' - option storage_device_path '/mnt/sda1/' - option project_directory '/mnt/sda1/kodexplorer' + option port '8080' + option storage_device_path '/opt/kodexplorer/' + option project_directory '/opt/kodexplorer' option enable '0' + option memory_limit '120M' + option post_max_size '100M' + option upload_max_filesize '100M' diff --git a/package/lean/luci-app-kodexplorer/root/etc/init.d/kodexplorer b/package/lean/luci-app-kodexplorer/root/etc/init.d/kodexplorer index 2431496ea95892..6916305e6d253b 100755 --- a/package/lean/luci-app-kodexplorer/root/etc/init.d/kodexplorer +++ b/package/lean/luci-app-kodexplorer/root/etc/init.d/kodexplorer @@ -1,5 +1,5 @@ #!/bin/sh /etc/rc.common -# Copyright (C) 2018-2019 Lienol +# Copyright (C) 2018-2020 Lienol START=99 diff --git a/package/lean/luci-theme-netgear/Makefile b/package/lean/luci-theme-netgear/Makefile index 57717b29693b51..9c361668436c5f 100644 --- a/package/lean/luci-theme-netgear/Makefile +++ b/package/lean/luci-theme-netgear/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=Netgear Theme LUCI_DEPENDS:= -PKG_RELEASE:=2 +PKG_RELEASE:=3 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/package/lean/luci-theme-netgear/htdocs/luci-static/netgear/css/style.css b/package/lean/luci-theme-netgear/htdocs/luci-static/netgear/css/style.css index 90251aeff39c41..5864e3f0adca68 100755 --- a/package/lean/luci-theme-netgear/htdocs/luci-static/netgear/css/style.css +++ b/package/lean/luci-theme-netgear/htdocs/luci-static/netgear/css/style.css @@ -997,7 +997,7 @@ form.inline + form.inline, vertical-align: middle; padding:6px 10px; width: 23rem; - float: left; + float: none; text-align: right; display: table-cell; }