下载非内核
This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
const $ = (id) => document.getElementById(id)
|
||||
|
||||
const DEFAULT_CONFIG = {
|
||||
rpcUrl: 'http://127.0.0.1:6800/jsonrpc',
|
||||
rpcSecret: '',
|
||||
serverUrl: 'http://127.0.0.1:16800',
|
||||
secret: '',
|
||||
interceptDownload: true,
|
||||
minSize: 0,
|
||||
excludeDomains: [],
|
||||
@@ -53,8 +53,8 @@ async function loadConfig() {
|
||||
}
|
||||
|
||||
function fillForm(config) {
|
||||
$('rpcUrl').value = config.rpcUrl || DEFAULT_CONFIG.rpcUrl
|
||||
$('rpcSecret').value = config.rpcSecret || ''
|
||||
$('serverUrl').value = config.serverUrl || DEFAULT_CONFIG.serverUrl
|
||||
$('secret').value = config.secret || ''
|
||||
$('interceptDownload').checked = config.interceptDownload !== false
|
||||
$('sniffEnabled').checked = config.sniffEnabled !== false
|
||||
$('showNotifications').checked = config.showNotifications !== false
|
||||
@@ -65,8 +65,8 @@ function fillForm(config) {
|
||||
|
||||
function readForm() {
|
||||
return {
|
||||
rpcUrl: $('rpcUrl').value.trim() || DEFAULT_CONFIG.rpcUrl,
|
||||
rpcSecret: $('rpcSecret').value.trim(),
|
||||
serverUrl: $('serverUrl').value.trim() || DEFAULT_CONFIG.serverUrl,
|
||||
secret: $('secret').value.trim(),
|
||||
interceptDownload: $('interceptDownload').checked,
|
||||
sniffEnabled: $('sniffEnabled').checked,
|
||||
showNotifications: $('showNotifications').checked,
|
||||
@@ -97,7 +97,7 @@ $('testBtn').addEventListener('click', async () => {
|
||||
await send('saveConfig', { config })
|
||||
const res = await send('testConnection', {})
|
||||
if (res && res.ok) {
|
||||
setStatus('ok', `已连接 · aria2 ${res.version}`)
|
||||
setStatus('ok', '已连接 · Thing 下载引擎')
|
||||
} else {
|
||||
setStatus('fail', '连接失败:' + (res?.error || '未知错误'))
|
||||
}
|
||||
@@ -312,7 +312,7 @@ document.querySelectorAll('.sniff-tab').forEach(btn => {
|
||||
setStatus('', '检测中...')
|
||||
const res = await send('testConnection', {})
|
||||
if (res && res.ok) {
|
||||
setStatus('ok', `已连接 · aria2 ${res.version}`)
|
||||
setStatus('ok', '已连接 · Thing 下载引擎')
|
||||
} else {
|
||||
setStatus('fail', '未连接')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user