hassio-nextcloud-backup/nextcloud_backup/rootfs/opt/nextcloud_backup/views/backupSnaps.ejs
2022-05-02 11:39:59 +02:00

66 lines
3.4 KiB
Plaintext

<% if (locals.backups) { %>
<div class="list-group ">
<% for(const index in backups) { %>
<a class="list-group-item list-group-item-action d-flex justify-content-between align-items-center"
href="#"
data-id="<%= backups[index].etag %>"
data-bs-toggle="modal"
data-bs-target="#modal-<%= backups[index].etag %>">
<%= backups[index].basename %>
<span class="badge bg-primary">
<%= DateTime.fromRFC2822(backups[index].lastmod).toFormat("MMM dd, yyyy HH:mm") %>
</span>
</a>
<div id="modal-<%= backups[index].etag %>" class="modal fade">
<div class="modal-dialog modal-lg">
<div class="modal-content bg-dark">
<div class="modal-header border-secondary">
<h5 class="modal-title" id="exampleModalLabel"> Backup Detail</h5>
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"
aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="mb-3">
<label for="name-<%= backups[index].etag %>" class="form-label">Name</label>
<input disabled type="text" class="form-control bg-secondary border-dark text-accent"
id="name-<%= backups[index].etag %>"
value="<%= backups[index].basename %>"/>
</div>
<div class="mb-3">
<label for="date-<%= backups[index].etag %>" class="form-label">Date</label>
<input disabled type="text" class="form-control bg-secondary border-dark text-accent"
id="date-<%= backups[index].etag %>"
value="<%= DateTime.fromRFC2822(backups[index].lastmod).toFormat("MMM dd, yyyy HH:mm") %>"/>
</div>
<div class="input-field col s12">
<label for="size-<%= backups[index].etag %>" class="form-label">Size</label>
<input disabled type="text" class="form-control bg-secondary border-dark text-accent"
id="size-<%= backups[index].etag %>"
value="<%= humanFileSize(backups[index].size, false) %>"/>
</div>
</div>
<div class="modal-footer border-secondary">
<button data-bs-dismiss="modal" class="btn btn-danger">Close</button>
<button class="btn btn-success restore"
data-id="<%= backups[index].filename %>"
data-name='<%= backups[index].basename ? backups[index].basename : backups[index].etag %>'
data-bs-dismiss="modal">
Upload to HA
</button>
</div>
</div>
</div>
</div>
<% } %>
</div>
<% } %>