Control 알림과 notice 설정 세분화

This commit is contained in:
seo
2026-06-26 03:21:01 +09:00
parent 7a9d4af9ad
commit da8c4e863d
4 changed files with 84 additions and 32 deletions
+11 -4
View File
@@ -625,7 +625,7 @@
return `
<span class="settings-toggle">
<input data-setting-key="${key}" type="checkbox" value="1" ${checked ? 'checked' : ''}>
<span>${checked ? 'ON' : 'OFF'}</span>
<span>${checked ? '켜기' : '끄기'}</span>
</span>
`;
}
@@ -662,6 +662,11 @@
if (item.type === 'select' && item.options && item.options[item.default]) {
return item.options[item.default];
}
if (item.type === 'boolean') {
return item.default === true || item.default === 1 || item.default === '1' || item.default === 'true'
? '켜기'
: '끄기';
}
return item.default ?? '';
};
@@ -687,7 +692,7 @@
els.settingsBody.querySelectorAll('.settings-toggle input').forEach(input => {
input.addEventListener('change', () => {
const label = input.closest('.settings-toggle')?.querySelector('span');
if (label) label.textContent = input.checked ? 'ON' : 'OFF';
if (label) label.textContent = input.checked ? '켜기' : '끄기';
});
input.closest('.settings-toggle')?.addEventListener('click', () => {
input.checked = !input.checked;
@@ -1382,8 +1387,10 @@
const m = noticeMetrics(row);
const reasons = [];
if (Math.abs(m.tempDelta) >= 3) reasons.push(t(m.tempDelta >= 0 ? 'tempHigher' : 'tempLower'));
if (Math.abs(m.rpmDelta) >= 1000) reasons.push(t(m.rpmDelta >= 0 ? 'rpmHigher' : 'rpmLower'));
const tempThreshold = Number(settingByKey('notice.temp_delta_threshold', 3));
const rpmThreshold = Number(settingByKey('notice.rpm_delta_threshold', 1000));
if (Math.abs(m.tempDelta) >= tempThreshold) reasons.push(t(m.tempDelta >= 0 ? 'tempHigher' : 'tempLower'));
if (Math.abs(m.rpmDelta) >= rpmThreshold) reasons.push(t(m.rpmDelta >= 0 ? 'rpmHigher' : 'rpmLower'));
return `${t('recordedReason')}: ${reasons.length ? reasons.join(', ') : t('instantChange')}`;
}