diff --git a/web/src/views/Settings.vue b/web/src/views/Settings.vue index 863c267..ea0af56 100755 --- a/web/src/views/Settings.vue +++ b/web/src/views/Settings.vue @@ -433,6 +433,18 @@ 保存 + + + 频道无人时自动暂停播放 + 机器人所在频道没有其他人时自动暂停,有人加入后可继续播放 + + + @@ -885,17 +897,22 @@ async function savePrefix() { // Idle timeout const idleTimeout = ref(0); +const autoPauseOnEmpty = ref(true); async function loadIdleTimeout() { try { const res = await axios.get('/api/bot/settings'); idleTimeout.value = res.data.idleTimeoutMinutes ?? 0; + autoPauseOnEmpty.value = res.data.autoPauseOnEmpty ?? true; } catch { /* ignore */ } } async function saveIdleTimeout() { try { - await axios.post('/api/bot/settings', { idleTimeoutMinutes: idleTimeout.value }); + await axios.post('/api/bot/settings', { + idleTimeoutMinutes: idleTimeout.value, + autoPauseOnEmpty: autoPauseOnEmpty.value, + }); } catch { /* ignore */ } } @@ -1794,6 +1811,12 @@ onUnmounted(() => { align-items: flex-start; } +// Standalone toggle inside 行为设置 (not part of a bordered list) +.behavior-toggle { + border-bottom: none; + padding-top: 4px; +} + @media (max-width: 768px) { .profile-bot-header { padding: 14px 12px;