update 2024-12-17 12:26:43

This commit is contained in:
kenzok8 2024-12-17 12:26:43 +08:00
parent 3461ad42b5
commit 37433fe1fe
14 changed files with 364 additions and 190 deletions

View File

@ -189,7 +189,7 @@ $razordVersion = getRazordVersion();
</div>
<div class="text-center mt-2">
<button class="btn btn-pink" id="checkCliverButton">🔍 检测版本</button>
<button class="btn btn-info" id="updateButton" title="更新到最新版本" onclick="showUpdateVersionModal()">🔄 更新版本</button>
<button class="btn btn-info" id="updateButton" title="更新到最新版本" onclick="showVersionTypeModal()">🔄 更新版本</button>
</div>
</div>
</div>
@ -237,27 +237,42 @@ $razordVersion = getRazordVersion();
</tbody>
</table>
<div class="modal fade" id="updateVersionModal" tabindex="-1" aria-labelledby="updateVersionModalLabel" aria-hidden="true" data-bs-backdrop="static" data-bs-keyboard="false">
<div class="modal fade" id="updateVersionTypeModal" tabindex="-1" aria-labelledby="updateVersionTypeModalLabel" aria-hidden="true" data-bs-backdrop="static" data-bs-keyboard="false">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="updateVersionModalLabel">选择更新版本语言</h5>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h5 class="modal-title" id="updateVersionTypeModalLabel">选择更新版本类型</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="form-group text-center">
<button id="stableBtn" class="btn btn-success btn-lg" style="margin: 10px;" onclick="selectVersionType('stable')">正式版</button>
<button id="previewBtn" class="btn btn-warning btn-lg" style="margin: 10px;" onclick="selectVersionType('preview')">预览版</button>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="updateLanguageModal" tabindex="-1" aria-labelledby="updateLanguageModalLabel" aria-hidden="true" data-bs-backdrop="static" data-bs-keyboard="false">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="updateLanguageModalLabel">选择语言</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="form-group">
<label for="languageSelect">选择语言</label>
<select id="languageSelect" class="form-select">
<option value="cn">中文版</option>
<option value="en">英文版</option>
<option value="en">英文版</option>
</select>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary" onclick="confirmUpdateVersion()">确认</button>
<button type="button" class="btn btn-primary" onclick="confirmLanguageSelection()">确认</button>
</div>
</div>
</div>
@ -327,6 +342,7 @@ $razordVersion = getRazordVersion();
<option value="v1.11.0-alpha.15">v1.11.0-alpha.15</option>
<option value="v1.11.0-alpha.20">v1.11.0-alpha.20</option>
<option value="v1.11.0-beta.5">v1.11.0-beta.5</option>
<option value="v1.11.0-beta.10">v1.11.0-beta.10</option>
</select>
</div>
<div class="modal-footer">
@ -476,6 +492,7 @@ let selectedMihomoVersion = 'stable';
let selectedLanguage = 'cn';
let selectedSingboxVersionForChannelTwo = 'preview';
let selectedPanel = 'zashboard';
let selectedVersionType = 'stable';
function showPanelSelector() {
$('#panelSelectionModal').modal('show');
@ -487,14 +504,51 @@ function confirmPanelSelection() {
selectOperation('panel');
}
function showUpdateVersionModal() {
$('#updateVersionModal').modal('show');
function showVersionTypeModal() {
$('#updateVersionTypeModal').modal('show');
}
function confirmUpdateVersion() {
selectedLanguage = document.getElementById('languageSelect').value;
$('#updateVersionModal').modal('hide');
selectOperation('client');
function confirmVersionTypeSelection() {
selectedVersionType = document.getElementById('versionTypeSelect').value;
$('#updateVersionTypeModal').modal('hide');
if (selectedVersionType === 'stable') {
$('#updateLanguageModal').modal('show');
} else {
selectOperation('client');
}
}
function selectVersionType(type) {
selectedVersionType = type;
if (type === 'stable') {
document.getElementById('stableBtn').classList.add('btn-success');
document.getElementById('previewBtn').classList.remove('btn-warning');
document.getElementById('previewBtn').classList.add('btn-light');
} else {
document.getElementById('previewBtn').classList.add('btn-warning');
document.getElementById('stableBtn').classList.remove('btn-success');
document.getElementById('stableBtn').classList.add('btn-light');
}
handleVersionSelection();
}
function handleVersionSelection() {
$('#updateVersionTypeModal').modal('hide');
if (selectedVersionType === 'stable') {
$('#updateLanguageModal').modal('show');
} else {
selectOperation('client');
}
}
function confirmLanguageSelection() {
selectedLanguage = document.getElementById('languageSelect').value;
$('#updateLanguageModal').modal('hide');
selectOperation('client');
}
function showSingboxVersionSelector() {
@ -573,9 +627,15 @@ function selectOperation(type) {
description: '正在更新 Mihomo 内核到最新版本 (' + selectedMihomoVersion + ')'
},
'client': {
url: 'update_script.php?lang=' + selectedLanguage,
message: '开始下载客户端更新...',
description: '正在更新客户端到最新版本'
url: selectedVersionType === 'stable'
? 'update_script.php?lang=' + selectedLanguage
: 'update_preview.php',
message: selectedVersionType === 'stable'
? '开始下载客户端更新...'
: '开始下载客户端预览版更新...',
description: selectedVersionType === 'stable'
? '正在更新客户端到最新正式版'
: '正在更新客户端到最新预览版'
},
'panel': {
url: selectedPanel === 'zashboard'

View File

@ -0,0 +1,81 @@
<?php
$repo_owner = "Thaolga";
$repo_name = "neko";
$package_name = "luci-app-nekobox";
$api_url = "https://api.github.com/repos/$repo_owner/$repo_name/releases/latest";
$local_api_response = "/tmp/api_response.json";
$curl_command = "curl -H 'User-Agent: PHP' -s " . escapeshellarg($api_url) . " -o " . escapeshellarg($local_api_response);
exec($curl_command . " 2>&1", $output, $return_var);
if ($return_var !== 0 || !file_exists($local_api_response)) {
echo "<script>appendLog('curl 获取版本信息失败,尝试使用 wget...');</script>";
$wget_command = "wget -q --no-check-certificate " . escapeshellarg($api_url) . " -O " . escapeshellarg($local_api_response);
exec($wget_command . " 2>&1", $output, $return_var);
if ($return_var !== 0 || !file_exists($local_api_response)) {
die("无法访问GitHub API。请检查URL或网络连接。输出: " . implode("\n", $output));
}
echo "<script>appendLog('wget 获取版本信息完成。');</script>";
}
$response = file_get_contents($local_api_response);
$data = json_decode($response, true);
unlink($local_api_response);
$new_version = $data['tag_name'] ?? '';
if (empty($new_version)) {
die("未找到最新版本或版本信息为空。");
}
$preview_suffix = "-preview";
$download_url = "https://github.com/$repo_owner/$repo_name/releases/download/$new_version/{$package_name}_{$new_version}{$preview_suffix}_all.ipk";
echo "<pre>最新版本: $new_version</pre>";
echo "<pre>下载URL: $download_url</pre>";
echo "<pre id='logOutput'></pre>";
echo "<script>
function appendLog(message) {
document.getElementById('logOutput').innerHTML += message + '\\n';
}
</script>";
echo "<script>appendLog('开始下载更新...');</script>";
$local_file = "/tmp/{$package_name}_{$new_version}{$preview_suffix}_all.ipk";
$curl_command = "curl -sL " . escapeshellarg($download_url) . " -o " . escapeshellarg($local_file);
exec($curl_command . " 2>&1", $output, $return_var);
if ($return_var !== 0 || !file_exists($local_file)) {
echo "<script>appendLog('curl 下载失败,尝试使用 wget...');</script>";
$wget_command = "wget -q --show-progress --no-check-certificate " . escapeshellarg($download_url) . " -O " . escapeshellarg($local_file);
exec($wget_command . " 2>&1", $output, $return_var);
if ($return_var !== 0 || !file_exists($local_file)) {
echo "<pre>下载失败。命令输出: " . implode("\n", $output) . "</pre>";
die("下载失败。未找到下载的文件。");
}
echo "<script>appendLog('wget 下载完成。');</script>";
} else {
echo "<script>appendLog('curl 下载完成。');</script>";
}
echo "<script>appendLog('更新软件包列表...');</script>";
$output = shell_exec("opkg update");
echo "<pre>$output</pre>";
echo "<script>appendLog('开始安装...');</script>";
$output = shell_exec("opkg install --force-reinstall " . escapeshellarg($local_file));
echo "<pre>$output</pre>";
echo "<script>appendLog('安装完成。');</script>";
unlink($local_file);
?>

View File

@ -0,0 +1 @@
board.zash.run.place

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,16 +1,55 @@
<!DOCTYPE html>
<!doctype html>
<html lang="">
<head>
<meta charset="UTF-8">
<meta charset="UTF-8" />
<title>zashboard</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="A dashboard using clash api" />
<link rel="apple-touch-icon" href="./apple-touch-icon.png">
<link rel="icon" href="./favicon.ico" sizes="48x48">
<link rel="icon" href="./favicon.svg" sizes="any" type="image/svg+xml">
<meta name="theme-color" content="#FFFFFF">
<script type="module" crossorigin src="./assets/index-Eir5DzNE.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-BpMWcX30.css">
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
<meta
name="description"
content="A dashboard using clash api"
/>
<link
rel="apple-touch-icon"
href="./apple-touch-icon.png"
/>
<link
rel="icon"
href="./favicon.ico"
sizes="48x48"
/>
<link
rel="icon"
href="./favicon.svg"
sizes="any"
type="image/svg+xml"
/>
<meta
name="theme-color"
content="#FFFFFF"
/>
<link
rel="stylesheet"
media="print"
onload="this.media='all'"
href="https://unpkg.com/subsetted-fonts@latest/MiSans-VF/MiSans-VF.css"
/>
<link
rel="stylesheet"
media="print"
onload="this.media='all'"
href="https://unpkg.com/subsetted-fonts@latest/SarasaUiSC-Regular/SarasaUiSC-Regular.css"
/>
<link
rel="stylesheet"
media="print"
onload="this.media='all'"
href="https://unpkg.com/subsetted-fonts@latest/PingFangSC-Regular\PingFangSC-Regular.css"
/>
<script type="module" crossorigin src="./assets/index-D9NwuV-C.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-BYhhgJN7.css">
<link rel="manifest" href="./manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="./registerSW.js"></script></head>
<body>
<div id="app"></div>

View File

@ -1 +1 @@
if(!self.define){let e,i={};const s=(s,n)=>(s=new URL(s+".js",n).href,i[s]||new Promise((i=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=i,document.head.appendChild(e)}else e=s,importScripts(s),i()})).then((()=>{let e=i[s];if(!e)throw new Error(`Module ${s} didnt register its module`);return e})));self.define=(n,r)=>{const c=e||("document"in self?document.currentScript.src:"")||location.href;if(i[c])return;let f={};const o=e=>s(e,c),d={module:{uri:c},exports:f,require:o};i[c]=Promise.all(n.map((e=>d[e]||o(e)))).then((e=>(r(...e),f)))}}define(["./workbox-3e8df8c8"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"assets/index-BpMWcX30.css",revision:null},{url:"assets/index-Eir5DzNE.js",revision:null},{url:"index.html",revision:"81dcf3167b5ce1226484c65c1c5f3282"},{url:"registerSW.js",revision:"402b66900e731ca748771b6fc5e7a068"},{url:"favicon.svg",revision:"7f1c4521acc10694fefef8f72dd2ea5f"},{url:"pwa-192x192.png",revision:"021df52501f4357c03eebd808f40dc6a"},{url:"pwa-512x512.png",revision:"d2f759aaabcb2c44ff52b27fde3de6e0"},{url:"pwa-maskable-192x192.png",revision:"7cd11dc5f0490b349d23eef5591d10e5"},{url:"pwa-maskable-512x512.png",revision:"8c97dc367a85a5a1eba523b24f79d03b"},{url:"manifest.webmanifest",revision:"c452912633990899ffe790f985ad0db9"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}));
if(!self.define){let e,i={};const s=(s,n)=>(s=new URL(s+".js",n).href,i[s]||new Promise((i=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=i,document.head.appendChild(e)}else e=s,importScripts(s),i()})).then((()=>{let e=i[s];if(!e)throw new Error(`Module ${s} didnt register its module`);return e})));self.define=(n,r)=>{const f=e||("document"in self?document.currentScript.src:"")||location.href;if(i[f])return;let d={};const o=e=>s(e,f),c={module:{uri:f},exports:d,require:o};i[f]=Promise.all(n.map((e=>c[e]||o(e)))).then((e=>(r(...e),d)))}}define(["./workbox-3e8df8c8"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"assets/index-BYhhgJN7.css",revision:null},{url:"assets/index-D9NwuV-C.js",revision:null},{url:"index.html",revision:"cfdf488d6346498f0e0c29ee500f6038"},{url:"registerSW.js",revision:"402b66900e731ca748771b6fc5e7a068"},{url:"favicon.svg",revision:"7f1c4521acc10694fefef8f72dd2ea5f"},{url:"pwa-192x192.png",revision:"021df52501f4357c03eebd808f40dc6a"},{url:"pwa-512x512.png",revision:"d2f759aaabcb2c44ff52b27fde3de6e0"},{url:"pwa-maskable-192x192.png",revision:"7cd11dc5f0490b349d23eef5591d10e5"},{url:"pwa-maskable-512x512.png",revision:"8c97dc367a85a5a1eba523b24f79d03b"},{url:"manifest.webmanifest",revision:"c452912633990899ffe790f985ad0db9"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}));

View File

@ -1 +1 @@
v1.19.0
v1.29.0

View File

@ -11,7 +11,7 @@ LUCI_DEPENDS:=+curl +opkg +luci-base +tar +libuci-lua +mount-utils +luci-lib-tas
LUCI_EXTRA_DEPENDS:=luci-lib-taskd (>=1.0.19)
LUCI_PKGARCH:=all
PKG_VERSION:=0.1.27-2
PKG_VERSION:=0.1.27-3
# PKG_RELEASE MUST be empty for luci.mk
PKG_RELEASE:=

View File

@ -74,7 +74,7 @@ opkg_wrap_mirrors() {
alias fcurl='curl -L --fail --show-error'
check_space() {
local free="$((`df -k / | awk 'NR==2 {print $4}'` >> 10 ))"
local free="$((`df -kP / | awk 'NR==2 {print $4}'` >> 10 ))"
if [ "$free" -lt 1 ]; then
echo "Root disk full!" >&2
exit 1