mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
added ctime to backup list #4321
This commit is contained in:
parent
0a172d8bc1
commit
87a60e325f
@ -84,11 +84,11 @@ export default class BackupOptions extends OptionsWidget {
|
|||||||
this.$existingBackupList.empty();
|
this.$existingBackupList.empty();
|
||||||
|
|
||||||
if (!backupFiles.length) {
|
if (!backupFiles.length) {
|
||||||
backupFiles = [{filePath: "no backup yet"}];
|
backupFiles = [{filePath: "no backup yet", ctime: ''}];
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const {filePath} of backupFiles) {
|
for (const {filePath, ctime} of backupFiles) {
|
||||||
this.$existingBackupList.append($("<li>").text(filePath));
|
this.$existingBackupList.append($("<li>").text(`${filePath} ${ctime ? ` - ${ctime}` : ''}`));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -17,10 +17,12 @@ function getExistingBackups() {
|
|||||||
|
|
||||||
return fs.readdirSync(dataDir.BACKUP_DIR)
|
return fs.readdirSync(dataDir.BACKUP_DIR)
|
||||||
.filter(fileName => fileName.includes("backup"))
|
.filter(fileName => fileName.includes("backup"))
|
||||||
.map(fileName => ({
|
.map(fileName => {
|
||||||
fileName: fileName,
|
const filePath = path.resolve(dataDir.BACKUP_DIR, fileName);
|
||||||
filePath: path.resolve(dataDir.BACKUP_DIR, fileName)
|
const stat = fs.statSync(filePath)
|
||||||
}));
|
|
||||||
|
return {fileName, filePath, ctime: stat.ctime};
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function regularBackup() {
|
function regularBackup() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user