mirror of
https://github.com/kenzok8/small.git
synced 2025-01-09 12:38:15 +08:00
update 2024-09-08 00:13:16
This commit is contained in:
parent
f9a8e91a6c
commit
355552d1b5
@ -784,7 +784,7 @@ function to_check(arch, app_name)
|
|||||||
remote_version = remote_version:gsub(com[app_name].remote_version_str_replace, "")
|
remote_version = remote_version:gsub(com[app_name].remote_version_str_replace, "")
|
||||||
end
|
end
|
||||||
local has_update = compare_versions(local_version:match("[^v]+"), "<", remote_version:match("[^v]+"))
|
local has_update = compare_versions(local_version:match("[^v]+"), "<", remote_version:match("[^v]+"))
|
||||||
|
--[[
|
||||||
if not has_update then
|
if not has_update then
|
||||||
return {
|
return {
|
||||||
code = 0,
|
code = 0,
|
||||||
@ -792,7 +792,7 @@ function to_check(arch, app_name)
|
|||||||
remote_version = remote_version
|
remote_version = remote_version
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
]]--
|
||||||
local asset = {}
|
local asset = {}
|
||||||
for _, v in ipairs(json.assets) do
|
for _, v in ipairs(json.assets) do
|
||||||
if v.name and v.name:match(match_file_name) then
|
if v.name and v.name:match(match_file_name) then
|
||||||
@ -813,7 +813,7 @@ function to_check(arch, app_name)
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
code = 0,
|
code = 0,
|
||||||
has_update = true,
|
has_update = has_update,
|
||||||
local_version = local_version,
|
local_version = local_version,
|
||||||
remote_version = remote_version,
|
remote_version = remote_version,
|
||||||
html_url = json.html_url,
|
html_url = json.html_url,
|
||||||
@ -1003,6 +1003,7 @@ function to_check_self()
|
|||||||
end
|
end
|
||||||
local local_version = get_version()
|
local local_version = get_version()
|
||||||
local remote_version = sys.exec("echo -n $(grep 'PKG_VERSION' /tmp/passwall_makefile|awk -F '=' '{print $2}')")
|
local remote_version = sys.exec("echo -n $(grep 'PKG_VERSION' /tmp/passwall_makefile|awk -F '=' '{print $2}')")
|
||||||
|
exec("/bin/rm", {"-f", tmp_file})
|
||||||
|
|
||||||
local has_update = compare_versions(local_version, "<", remote_version)
|
local has_update = compare_versions(local_version, "<", remote_version)
|
||||||
if not has_update then
|
if not has_update then
|
||||||
|
@ -10,6 +10,8 @@ local version = {}
|
|||||||
var inProgressCount = 0;
|
var inProgressCount = 0;
|
||||||
var tokenStr = '<%=token%>';
|
var tokenStr = '<%=token%>';
|
||||||
var checkUpdateText = '<%:Check update%>';
|
var checkUpdateText = '<%:Check update%>';
|
||||||
|
var forceUpdateText = '<%:Force update%>';
|
||||||
|
var retryText = '<%:Retry%>';
|
||||||
var noUpdateText = '<%:It is the latest version%>';
|
var noUpdateText = '<%:It is the latest version%>';
|
||||||
var updateSuccessText = '<%:Update successful%>';
|
var updateSuccessText = '<%:Update successful%>';
|
||||||
var clickToUpdateText = '<%:Click to update%>';
|
var clickToUpdateText = '<%:Click to update%>';
|
||||||
@ -55,7 +57,7 @@ local version = {}
|
|||||||
|
|
||||||
function onRequestError(btn, errorMessage) {
|
function onRequestError(btn, errorMessage) {
|
||||||
btn.disabled = false;
|
btn.disabled = false;
|
||||||
btn.value = checkUpdateText;
|
btn.value = retryText;
|
||||||
|
|
||||||
var ckeckDetailElm = document.getElementById(btn.id + '-detail');
|
var ckeckDetailElm = document.getElementById(btn.id + '-detail');
|
||||||
if (errorMessage && ckeckDetailElm) {
|
if (errorMessage && ckeckDetailElm) {
|
||||||
@ -90,8 +92,8 @@ local version = {}
|
|||||||
appInfoList[app] = undefined;
|
appInfoList[app] = undefined;
|
||||||
onRequestError(btn, json.error);
|
onRequestError(btn, json.error);
|
||||||
} else {
|
} else {
|
||||||
|
appInfoList[app] = json;
|
||||||
if (json.has_update) {
|
if (json.has_update) {
|
||||||
appInfoList[app] = json;
|
|
||||||
btn.disabled = false;
|
btn.disabled = false;
|
||||||
btn.value = clickToUpdateText;
|
btn.value = clickToUpdateText;
|
||||||
btn.placeholder = clickToUpdateText;
|
btn.placeholder = clickToUpdateText;
|
||||||
@ -109,6 +111,7 @@ local version = {}
|
|||||||
} else {
|
} else {
|
||||||
btn.disabled = true;
|
btn.disabled = true;
|
||||||
btn.value = noUpdateText;
|
btn.value = noUpdateText;
|
||||||
|
window['_' + app + '-force_btn'].style.display = "inline";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 300);
|
}, 300);
|
||||||
@ -197,6 +200,8 @@ local version = {}
|
|||||||
<span>【 <%=version[k] ~="" and version[k] or translate("Null") %> 】</span>
|
<span>【 <%=version[k] ~="" and version[k] or translate("Null") %> 】</span>
|
||||||
<input class="btn cbi-button cbi-button-apply" type="button" id="_<%=k%>-check_btn"
|
<input class="btn cbi-button cbi-button-apply" type="button" id="_<%=k%>-check_btn"
|
||||||
onclick="onBtnClick(this,'<%=k%>');" value="<%:Check update%>" />
|
onclick="onBtnClick(this,'<%=k%>');" value="<%:Check update%>" />
|
||||||
|
<input class="btn cbi-button cbi-button-apply" type="button" id="_<%=k%>-force_btn"
|
||||||
|
onclick="doUpdate(this,'<%=k%>');" value="<%:Force update%>" style="display:none"/>
|
||||||
<span id="_<%=k%>-check_btn-detail"></span>
|
<span id="_<%=k%>-check_btn-detail"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -841,6 +841,9 @@ msgstr "备用"
|
|||||||
msgid "Check update"
|
msgid "Check update"
|
||||||
msgstr "检查更新"
|
msgstr "检查更新"
|
||||||
|
|
||||||
|
msgid "Force update"
|
||||||
|
msgstr "强制更新"
|
||||||
|
|
||||||
msgid "Manually update"
|
msgid "Manually update"
|
||||||
msgstr "手动更新"
|
msgstr "手动更新"
|
||||||
|
|
||||||
@ -934,6 +937,9 @@ msgstr "点击更新"
|
|||||||
msgid "Updating..."
|
msgid "Updating..."
|
||||||
msgstr "更新中"
|
msgstr "更新中"
|
||||||
|
|
||||||
|
msgid "Retry"
|
||||||
|
msgstr "重试"
|
||||||
|
|
||||||
msgid "Unexpected error"
|
msgid "Unexpected error"
|
||||||
msgstr "意外错误"
|
msgstr "意外错误"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user