notifications: make update alerts non-persistent

once acked, they remain acked. no need to keep nagging the user about them.
This commit is contained in:
Girish Ramakrishnan
2023-03-26 15:12:00 +02:00
parent 9182b01fe0
commit 8205beeabf
8 changed files with 38 additions and 25 deletions

View File

@@ -193,13 +193,13 @@ async function runSystemChecks() {
async function checkMailStatus() {
const message = await mail.checkConfiguration();
await notifications.alert(notifications.ALERT_MAIL_STATUS, 'Email is not configured properly', message);
await notifications.alert(notifications.ALERT_MAIL_STATUS, 'Email is not configured properly', message, { persist: true });
}
async function checkRebootRequired() {
const rebootRequired = await isRebootRequired();
if (rebootRequired) {
await notifications.alert(notifications.ALERT_REBOOT, 'Reboot Required', 'To finish ubuntu security updates, a reboot is necessary.');
await notifications.alert(notifications.ALERT_REBOOT, 'Reboot Required', 'To finish ubuntu security updates, a reboot is necessary.', { persist: true });
} else {
await notifications.clearAlert(notifications.ALERT_REBOOT, 'Reboot Required');
}
@@ -209,7 +209,7 @@ async function checkUbuntuVersion() {
const isXenial = fs.readFileSync('/etc/lsb-release', 'utf-8').includes('16.04');
if (!isXenial) return;
await notifications.alert(notifications.ALERT_UPDATE_UBUNTU, 'Ubuntu upgrade required', 'Ubuntu 16.04 has reached end of life and will not receive security and maintenance updates. Please follow https://docs.cloudron.io/guides/upgrade-ubuntu-18/ to upgrade to Ubuntu 18 at the earliest.');
await notifications.alert(notifications.ALERT_UPDATE_UBUNTU, 'Ubuntu upgrade required', 'Ubuntu 16.04 has reached end of life and will not receive security and maintenance updates. Please follow https://docs.cloudron.io/guides/upgrade-ubuntu-18/ to upgrade to Ubuntu 18 at the earliest.', { persist: true });
}
async function getLogs(unit, options) {