로그 송수신 잔여 제거와 패널 주기 조정
This commit is contained in:
1 parent
c0dadcc8a9
commit
3f3198b29f
5 files changed
+67
-77
No files matched your search
+2
-2
@@ -188,7 +188,7 @@ function command_first_line(array $cmd, bool $root = false, int $timeout = 3): s
|
||||
return (int)$result['code'] === 0 && $lines ? (string)$lines[0] : '';
|
||||
}
|
||||
|
||||
function remote_log_status(): array
|
||||
function log_retention_status(): array
|
||||
{
|
||||
$journalDir = '/var/log/journal';
|
||||
$journalDisk = command_first_line(['/usr/bin/journalctl', '--disk-usage', '--no-pager'], false, 3);
|
||||
@@ -4681,7 +4681,7 @@ function collect_snapshot(bool $applyFan = true): array
|
||||
'history' => $history,
|
||||
'processes' => $processes,
|
||||
'custom_services' => custom_systemd_services(),
|
||||
'remote_logs' => remote_log_status(),
|
||||
'log_status' => log_retention_status(),
|
||||
'touch_display' => touch_display_status(),
|
||||
'fan_spike' => $fanSpike,
|
||||
'fan_spike_history' => fan_spike_history((int)setting_value('display.fan_notice_history_limit')),
|
||||
|
||||
+39
-55
@@ -37,7 +37,7 @@
|
||||
statusBatteryRemaining: $('#statusBatteryRemaining'),
|
||||
batteryRuntimeTooltip: $('#batteryRuntimeTooltip'),
|
||||
spikeLogList: $('#spikeLogList'),
|
||||
remoteLogList: $('#remoteLogList'),
|
||||
logStatusList: $('#logStatusList'),
|
||||
customServiceList: $('#customServiceList'),
|
||||
noticeBaseline: $('#noticeBaseline'),
|
||||
rebootBtn: $('#rebootBtn'),
|
||||
@@ -203,22 +203,14 @@
|
||||
noNoticeHistory: 'No system notice history.',
|
||||
customServices: 'Custom Services',
|
||||
noCustomServices: 'No custom services.',
|
||||
remoteLogs: 'Remote Logs',
|
||||
remoteLogsLoading: 'Remote log status loading...',
|
||||
remotePiToSynology: 'Raspberry -> Synology',
|
||||
remoteSynologyToPi: 'Synology -> Raspberry',
|
||||
remotePersistentJournal: 'Persistent Journal',
|
||||
remoteCrashLogs: 'Crash Logs',
|
||||
remoteOk: 'OK',
|
||||
remoteWarn: 'Check',
|
||||
remoteTarget: 'Target',
|
||||
remoteTransport: 'Transport',
|
||||
remoteQueue: 'Queue',
|
||||
remoteListener: 'Listener',
|
||||
remoteLatest: 'Latest',
|
||||
remoteFiles: 'Files',
|
||||
remoteUsage: 'Usage',
|
||||
remoteBoots: 'Boots',
|
||||
logStatus: 'Log Status',
|
||||
logStatusLoading: 'Log status loading...',
|
||||
logPersistentJournal: 'Persistent Journal',
|
||||
logCrashLogs: 'Crash Logs',
|
||||
logOk: 'OK',
|
||||
logWarn: 'Check',
|
||||
logUsage: 'Usage',
|
||||
logBoots: 'Boots',
|
||||
logFilterAll: 'All',
|
||||
logFilterImportant: 'Important',
|
||||
logFilterError: 'Error',
|
||||
@@ -230,8 +222,8 @@
|
||||
qualityOk: 'OK',
|
||||
qualityWarn: 'Increasing',
|
||||
qualityBad: 'Attention',
|
||||
remoteSaved: 'Saved',
|
||||
remotePending: 'Pending',
|
||||
logSaved: 'Saved',
|
||||
logPending: 'Pending',
|
||||
serviceLogs: 'Logs',
|
||||
serviceEnabled: 'enabled',
|
||||
servicePid: 'pid',
|
||||
@@ -435,22 +427,14 @@
|
||||
noNoticeHistory: '시스템 알림 이력이 없습니다.',
|
||||
customServices: '사용자 서비스',
|
||||
noCustomServices: '사용자 생성 서비스가 없습니다.',
|
||||
remoteLogs: '원격 로그',
|
||||
remoteLogsLoading: '원격 로그 상태 확인 중...',
|
||||
remotePiToSynology: '라즈베리파이 -> 시놀로지',
|
||||
remoteSynologyToPi: '시놀로지 -> 라즈베리파이',
|
||||
remotePersistentJournal: '영구 저널',
|
||||
remoteCrashLogs: '커널 크래시',
|
||||
remoteOk: '정상',
|
||||
remoteWarn: '확인',
|
||||
remoteTarget: '대상',
|
||||
remoteTransport: '전송',
|
||||
remoteQueue: '대기열',
|
||||
remoteListener: '수신',
|
||||
remoteLatest: '최근',
|
||||
remoteFiles: '파일',
|
||||
remoteUsage: '사용량',
|
||||
remoteBoots: '부팅 이력',
|
||||
logStatus: '로그 보존',
|
||||
logStatusLoading: '로그 보존 상태 확인 중...',
|
||||
logPersistentJournal: '영구 저널',
|
||||
logCrashLogs: '커널 크래시',
|
||||
logOk: '정상',
|
||||
logWarn: '확인',
|
||||
logUsage: '사용량',
|
||||
logBoots: '부팅 이력',
|
||||
logFilterAll: '전체',
|
||||
logFilterImportant: '중요',
|
||||
logFilterError: '오류',
|
||||
@@ -462,8 +446,8 @@
|
||||
qualityOk: '정상',
|
||||
qualityWarn: '증가',
|
||||
qualityBad: '주의',
|
||||
remoteSaved: '저장',
|
||||
remotePending: '대기',
|
||||
logSaved: '저장',
|
||||
logPending: '대기',
|
||||
serviceLogs: '로그',
|
||||
serviceEnabled: '활성화',
|
||||
servicePid: 'PID',
|
||||
@@ -2086,56 +2070,56 @@
|
||||
: `<div class="spike-log-empty">${escapeHtml(t('noNoticeHistory'))}</div>`;
|
||||
}
|
||||
|
||||
function remoteState(ok, warn = false) {
|
||||
function logStatusState(ok, warn = false) {
|
||||
if (ok) {
|
||||
return {
|
||||
className: 'active',
|
||||
label: t('remoteOk'),
|
||||
label: t('logOk'),
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
className: warn ? 'warning' : 'failed',
|
||||
label: t('remoteWarn'),
|
||||
label: t('logWarn'),
|
||||
};
|
||||
}
|
||||
|
||||
function remoteMeta(items) {
|
||||
function logStatusMeta(items) {
|
||||
return items
|
||||
.filter(item => item.value !== null && item.value !== undefined && item.value !== '')
|
||||
.map(item => `${item.label}: ${item.value}`)
|
||||
.join(' · ') || '-';
|
||||
}
|
||||
|
||||
function renderRemoteLogs(data = {}) {
|
||||
if (!els.remoteLogList) return;
|
||||
function renderLogStatus(data = {}) {
|
||||
if (!els.logStatusList) return;
|
||||
|
||||
const journal = data.journal || {};
|
||||
const pstore = data.pstore || {};
|
||||
const rows = [
|
||||
{
|
||||
title: t('remotePersistentJournal'),
|
||||
title: t('logPersistentJournal'),
|
||||
desc: journal.path || '-',
|
||||
meta: remoteMeta([
|
||||
{ label: t('remoteUsage'), value: journal.disk_usage || '-' },
|
||||
{ label: t('remoteBoots'), value: journal.boot_count === null || journal.boot_count === undefined ? '-' : Number(journal.boot_count).toLocaleString() },
|
||||
meta: logStatusMeta([
|
||||
{ label: t('logUsage'), value: journal.disk_usage || '-' },
|
||||
{ label: t('logBoots'), value: journal.boot_count === null || journal.boot_count === undefined ? '-' : Number(journal.boot_count).toLocaleString() },
|
||||
]),
|
||||
state: remoteState(Boolean(journal.ok), true),
|
||||
state: logStatusState(Boolean(journal.ok), true),
|
||||
},
|
||||
{
|
||||
title: t('remoteCrashLogs'),
|
||||
title: t('logCrashLogs'),
|
||||
desc: pstore.saved_path || '-',
|
||||
meta: remoteMeta([
|
||||
meta: logStatusMeta([
|
||||
{ label: 'pstore', value: pstore.mounted ? 'mounted' : '-' },
|
||||
{ label: 'collector', value: pstore.collector_active || '-' },
|
||||
{ label: t('remoteSaved'), value: Number(pstore.saved_files || 0).toLocaleString() },
|
||||
{ label: t('remotePending'), value: Number(pstore.pending_files || 0).toLocaleString() },
|
||||
{ label: t('logSaved'), value: Number(pstore.saved_files || 0).toLocaleString() },
|
||||
{ label: t('logPending'), value: Number(pstore.pending_files || 0).toLocaleString() },
|
||||
]),
|
||||
state: remoteState(Boolean(pstore.ok), true),
|
||||
state: logStatusState(Boolean(pstore.ok), true),
|
||||
},
|
||||
];
|
||||
|
||||
els.remoteLogList.innerHTML = rows.map(row => `
|
||||
els.logStatusList.innerHTML = rows.map(row => `
|
||||
<div class="service-item">
|
||||
<div class="service-head">
|
||||
<div class="service-title">
|
||||
@@ -2203,7 +2187,7 @@
|
||||
? `${baselineTemp.toFixed(1)}°C / ${Math.round(baselineRpm).toLocaleString()} RPM · ${stateText}`
|
||||
: stateText;
|
||||
renderSpikeHistory(data.fan_spike_history || []);
|
||||
renderRemoteLogs(data.remote_logs || {});
|
||||
renderLogStatus(data.log_status || {});
|
||||
renderCustomServices(data.custom_services || []);
|
||||
setText(els.noticeBaseline, baselineText);
|
||||
|
||||
|
||||
+3
-3
@@ -371,9 +371,9 @@ html[data-theme="light"] .details-panel{background:#edf3fa;border-color:#b8c7da}
|
||||
<summary data-i18n="diagnostics">Diagnostics</summary>
|
||||
<div class="details-body">
|
||||
<div class="spike-log-box">
|
||||
<h3 data-i18n="remoteLogs">Remote Logs</h3>
|
||||
<div id="remoteLogList" class="service-list remote-log-list">
|
||||
<div class="spike-log-empty" data-i18n="remoteLogsLoading">Remote log status loading...</div>
|
||||
<h3 data-i18n="logStatus">Log Status</h3>
|
||||
<div id="logStatusList" class="service-list">
|
||||
<div class="spike-log-empty" data-i18n="logStatusLoading">Log status loading...</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in new issue
Block a user