graphs: always show /var/backups size

often this has old backups
This commit is contained in:
Girish Ramakrishnan
2023-08-01 17:38:48 +05:30
parent 28dab0bc9b
commit 0722692210
3 changed files with 9 additions and 2 deletions
+7 -1
View File
@@ -115,6 +115,13 @@ async function getDisks() {
if (disks[filesystem]) disks[filesystem].contents.push({ type: 'standard', id: 'cloudron-backup', path: backupConfig.backupFolder });
}
// often the default backup dir is not cleaned up
if (backupConfig.provider !== 'filesystem' || backupConfig.backupFolder !== paths.DEFAULT_BACKUP_DIR) {
const [, dfResult] = await safe(df.file(paths.DEFAULT_BACKUP_DIR));
const filesystem = dfResult?.filesystem || rootDisk.filesystem;
if (disks[filesystem]) disks[filesystem].contents.push({ type: 'standard', id: 'cloudron-backup-default', path: paths.DEFAULT_BACKUP_DIR });
}
const [dockerError, dockerInfo] = await safe(docker.info());
if (!dockerError) {
const [, dfResult] = await safe(df.file(dockerInfo.DockerRootDir));
@@ -233,7 +240,6 @@ async function updateDiskUsage(progressCallback) {
const [error, usage] = await safe(du(content.path));
if (error) progressCallback({ message: `du error: ${error.message}`}); // can happen if app is installing etc
content.usage = usage || 0;
}
progressCallback({ message: `du of ${JSON.stringify(content)}: ${content.usage}`});
}