| 1 |
<div id="DUI-snapshots" class="DUI-panel"> |
| 2 |
<div class="DUI-panel__headline"> |
| 3 |
View a previous snapshot |
| 4 |
</div> |
| 5 |
<div class="DUI-panel__content"> |
| 6 |
<div style="margin: 20px;"> |
| 7 |
|
| 8 |
<?php if (sizeof($DATABASES) > 0) { ?> |
| 9 |
|
| 10 |
<table class="DUI-table"> |
| 11 |
<thead> |
| 12 |
<tr class="DUI-table__header"> |
| 13 |
<th>Filename</th> |
| 14 |
<th>Snapshot Size</th> |
| 15 |
</tr> |
| 16 |
</thead> |
| 17 |
<tbody> |
| 18 |
<?php foreach ($DATABASES as $DB) { ?> |
| 19 |
<tr> |
| 20 |
<td><a href="?page=disk-usage-insights&snapshot=<?php echo esc_attr($DB['filename']); ?>"><?php echo esc_html($DB['filename']); ?></a></td> |
| 21 |
<td class="DUI-table__col--number"><?php echo esc_html(number_format_i18n($DB['filesize'])); ?></td> |
| 22 |
<td> |
| 23 |
|
| 24 |
<button |
| 25 |
hx-target="#DUI-snapshots" |
| 26 |
hx-post="<?php echo esc_url($WP_ADMIN_AJAX_URL); ?>?action=dui_delete_snapshot" |
| 27 |
hx-vals='{"_ajax_nonce":"<?php echo esc_js($WP_NONCE); ?>", "snapshot":"<?php echo esc_js($DB['filename']); ?>"}' |
| 28 |
hx-confirm="Are you sure to delete this snapshot?" |
| 29 |
>Delete</button> |
| 30 |
</td> |
| 31 |
</tr> |
| 32 |
<?php } ?> |
| 33 |
</tbody> |
| 34 |
</table> |
| 35 |
<?php } else { ?> |
| 36 |
You haven't taken any snapshots yet. |
| 37 |
<?php } ?> |
| 38 |
</div> |
| 39 |
</div> |
| 40 |
</div> |
| 41 |
|