further work on backups

This commit is contained in:
Alex Pankratov
2021-04-14 17:00:49 +02:00
parent 5236e37af3
commit 1ca1d5d612

View File

@@ -766,8 +766,13 @@
position: relative; position: relative;
} }
.config .teaser i {
/* backups off */
font-style: normal;
}
.config .teaser u { .config .teaser u {
/* backup status */ /* backups on */
display: none; display: none;
text-decoration: none; text-decoration: none;
} }
@@ -859,20 +864,17 @@
} }
/***/ /***/
.config.backups-on .teaser i {
display: none;
}
.config.backups-on .teaser u { .config.backups-on .teaser u {
display: inline-block; display: inline-block;
position: absolute;
font-size: calc(8rem / 11); font-size: calc(8rem / 11);
top: 8px;
color: #555; color: #555;
} }
.config.backups-on .teaser u:before { .config.backups-on.backing-up .teaser u {
content: '\2714';
padding-left: 3px;
}
.config.backups-on.backing-up .teaser u:before {
opacity: 0.4; opacity: 0.4;
} }
@@ -884,8 +886,8 @@
} }
/***/ /***/
.config.backups-on.backup-err .teaser u:before { .config.backups-on.backup-err .teaser i {
content: ''; display: inline-block;
} }
.config.backups-on.backup-err .teaser u { .config.backups-on.backup-err .teaser u {
@@ -897,6 +899,7 @@
top: 13px; top: 13px;
right: -4px; right: -4px;
background: #d20; background: #d20;
color: transparent;
} }
.config.backups-on.backup-err .bulk .auto-backup { .config.backups-on.backup-err .bulk .auto-backup {
@@ -1376,7 +1379,7 @@
</div> </div>
<div class='config no-user-select'> <div class='config no-user-select'>
<a href=# class=teaser>&equiv;<u></u></a> <a href=# class=teaser><i>&equiv;</i><u>&#x2714;</u></a>
<div class=bulk> <div class=bulk>
<a href=# class=add-board>Add new board...</a> <a href=# class=add-board>Add new board...</a>
@@ -1855,8 +1858,12 @@
var success = true; var success = true;
var store_id = 1; var store_id = 1;
NB.storage.backupCb = backupStatusCb;
this.backups = []; this.backups = [];
self.setBackupStatus('');
this.conf.backups.forEach(function(agent){ this.conf.backups.forEach(function(agent){
var T = NB.backupTypes.get(agent.type); var T = NB.backupTypes.get(agent.type);
if (! T) if (! T)
@@ -1884,8 +1891,6 @@
self.setBackupStatus(success ? 'ok' : 'failed'); self.setBackupStatus(success ? 'ok' : 'failed');
}); });
}); });
NB.storage.backupCb = backupStatusCb;
} }
backupBoard(board_id, board, meta) backupBoard(board_id, board, meta)
@@ -3202,7 +3207,7 @@
if (! backups.length) if (! backups.length)
{ {
$config.removeClass('backups-on backup-err'); $config.removeClass('backups-on backup-err backing-up');
return; return;
} }
@@ -4284,7 +4289,7 @@
}); });
// //
$('.config .switch-them').on('click', function() { $('.config .switch-theme').on('click', function() {
var $html = $('html'); var $html = $('html');
$html.toggleClass('theme-dark'); $html.toggleClass('theme-dark');
NB.storage.setTheme($html.hasClass('theme-dark') ? 'dark' : ''); NB.storage.setTheme($html.hasClass('theme-dark') ? 'dark' : '');