添加异常处理
This commit is contained in:
parent
8cb285866f
commit
ec5c2db848
@ -435,6 +435,7 @@ $configs = $db->query('SELECT * FROM configs ORDER BY id');
|
|||||||
<div class="checkbox-group">
|
<div class="checkbox-group">
|
||||||
<input type="checkbox" name="auto_monitor" id="auto_monitor" checked>
|
<input type="checkbox" name="auto_monitor" id="auto_monitor" checked>
|
||||||
<label for="auto_monitor">开启自动开机监控</label>
|
<label for="auto_monitor">开启自动开机监控</label>
|
||||||
|
<span id="monitor_hint" style="color: #dc3545; margin-left: 10px; display: none;">⚠️ 不支持监控此源</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -513,6 +514,23 @@ $configs = $db->query('SELECT * FROM configs ORDER BY id');
|
|||||||
const urlInput = document.getElementById('site_url_input');
|
const urlInput = document.getElementById('site_url_input');
|
||||||
const accountLabel = document.querySelector('label[for="account_input"]') || document.querySelector('input[name="account"]').previousElementSibling;
|
const accountLabel = document.querySelector('label[for="account_input"]') || document.querySelector('input[name="account"]').previousElementSibling;
|
||||||
const keyLabel = document.querySelector('label[for="api_key_input"]') || document.querySelector('input[name="api_key"]').previousElementSibling;
|
const keyLabel = document.querySelector('label[for="api_key_input"]') || document.querySelector('input[name="api_key"]').previousElementSibling;
|
||||||
|
const autoMonitorCheckbox = document.getElementById('auto_monitor');
|
||||||
|
const monitorHint = document.getElementById('monitor_hint');
|
||||||
|
|
||||||
|
// 判断是否为魔方平台
|
||||||
|
const isMofang = (siteType === 'mofang');
|
||||||
|
|
||||||
|
if (isMofang) {
|
||||||
|
// 魔方平台:启用监控选项
|
||||||
|
autoMonitorCheckbox.disabled = false;
|
||||||
|
autoMonitorCheckbox.checked = true;
|
||||||
|
monitorHint.style.display = 'none';
|
||||||
|
} else {
|
||||||
|
// 非魔方平台:禁用监控选项
|
||||||
|
autoMonitorCheckbox.disabled = true;
|
||||||
|
autoMonitorCheckbox.checked = false;
|
||||||
|
monitorHint.style.display = 'inline';
|
||||||
|
}
|
||||||
|
|
||||||
if (siteType === 'mofang') {
|
if (siteType === 'mofang') {
|
||||||
// 魔方平台
|
// 魔方平台
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user