browse backups dialog: add styling for empty session list

This commit is contained in:
juliandescottes 2017-08-01 22:39:27 +02:00 committed by Julian Descottes
parent da2e9f99e4
commit 6b7f04b63e
4 changed files with 28 additions and 2 deletions

View File

@ -56,6 +56,21 @@
height: 90px;
}
.browse-backups .session-list-empty,
.browse-backups .snapshot-list-empty {
position: absolute;
left: 50%;
width: 200px;
margin-top: 100px;
margin-left: -130px;
padding: 30px;
font-size: 16px;
text-align: center;
border: 1px solid;
color: #bbb;
}
.browse-backups .session-item {
transition: all 500ms;
}

View File

@ -39,7 +39,7 @@
pskl.app.backupService.list().then(function (sessions) {
var html = '';
if (sessions.length === 0) {
html = 'No session found ...';
html = pskl.utils.Template.get('session-list-empty');
} else {
var sessionItemTemplate = pskl.utils.Template.get('session-list-item');
var html = '';

View File

@ -26,7 +26,10 @@
pskl.app.backupService.getSnapshotsBySessionId(sessionId).then(function (snapshots) {
var html = '';
if (snapshots.length === 0) {
html = 'No snapshot found...';
// This should normally never happen, all sessions have at least one snapshot and snapshots
// can not be individually deleted.
console.warn('Could not retrieve snapshots for a session');
html = pskl.utils.Template.get('snapshot-list-empty');
} else {
var sessionItemTemplate = pskl.utils.Template.get('snapshot-list-item');
var html = '';

View File

@ -27,6 +27,10 @@
</div>
</script>
<script type="text/template" id="session-list-empty">
<div class="session-list-empty">No session found ...</div>
</script>
<script type="text/template" id="session-list-item">
<div class="session-item">
<div class="session-details">
@ -52,6 +56,10 @@
</div>
</script>
<script type="text/template" id="snapshot-list-empty">
<div class="snapshot-list-empty">No snapshot found ...</div>
</script>
<script type="text/template" id="snapshot-list-item">
<div class="snapshot-item">
<div class="snapshot-details">