사용자 서비스 로그 갱신 흐름 정리

This commit is contained in:
seo
2026-07-20 12:39:19 +09:00
parent 52b04453e7
commit ab55e7d4a6
4 changed files with 18 additions and 2 deletions
+1 -1
View File
@@ -3065,7 +3065,7 @@ function parse_systemctl_show_records(string $out): array
function systemd_service_logs(string $unit, int $limit = 12): array
{
$limit = max(1, min(50, $limit));
$limit = max(1, min(500, $limit));
$cmd = [
'/usr/bin/journalctl',
'-u',
+12
View File
@@ -92,6 +92,7 @@
settingsPayload: null,
settingsOpen: false,
settingsDirty: false,
customServiceScrollHoldUntil: 0,
};
const storageKeys = {
@@ -1621,6 +1622,9 @@
function renderCustomServices(rows = []) {
if (!els.customServiceList) return;
if (Date.now() < state.customServiceScrollHoldUntil) return;
const scrollTop = els.customServiceList.scrollTop;
els.customServiceList.innerHTML = rows.length
? rows.map(row => {
@@ -1653,6 +1657,8 @@
`;
}).join('')
: `<div class="spike-log-empty">${escapeHtml(t('noCustomServices'))}</div>`;
els.customServiceList.scrollTop = scrollTop;
}
function renderFanCause(data) {
@@ -2214,6 +2220,12 @@
els.dmesgToggle?.addEventListener('click', () => {
setDmesgOpen(!state.dmesgOpen);
});
const holdCustomServiceScroll = () => {
state.customServiceScrollHoldUntil = Date.now() + 4000;
};
['scroll', 'wheel', 'touchstart', 'touchmove', 'pointerdown'].forEach(eventName => {
els.customServiceList?.addEventListener(eventName, holdCustomServiceScroll, { passive: true });
});
els.wifiTable?.addEventListener('click', event => {
const button = event.target?.closest?.('.wifi-host-edit');
if (!button) return;