From 9a6529d6f79a29052589794da33fa4eca549c1ee Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 6 Sep 2020 21:23:17 +0200 Subject: [PATCH] Small rework of backup view + add backup download button --- src/js/yunohost/controllers/backup.js | 14 ++++++----- src/views/backup/backup_info.ms | 34 ++++++++------------------- 2 files changed, 18 insertions(+), 30 deletions(-) diff --git a/src/js/yunohost/controllers/backup.js b/src/js/yunohost/controllers/backup.js index 42a5d455..0d2eab44 100644 --- a/src/js/yunohost/controllers/backup.js +++ b/src/js/yunohost/controllers/backup.js @@ -102,19 +102,21 @@ data.locale = y18n.locale; c.view('backup/backup_info', data, function() { - // Configure buttons "select all" and "select none" - - // Remove active style from buttons - $(".select_all-none input").click(function(){ $(this).toggleClass("active"); }); // Select all checkbox in this panel - $(".select_all").click(function(){ + $('button[data-action="select_all"]').on('click', function() { $(this).parents(".panel").children(".list-group").find("input").prop("checked", true); }); + // Deselect all checkbox in this panel - $(".select_none").click(function(){ + $('button[data-action="select_none"]').on('click', function() { $(this).parents(".panel").children(".list-group").find("input").prop("checked", false); }); + $('button[data-action="download"]').on('click', function() { + var archive = $(this).data('archive'); + window.open('https://' + store.get('url') + '/backup/download/'+archive, '_blank'); + }); + // Delete button $('button[data-action="delete"]').on('click', function() { var storage = $(this).data('storage'); diff --git a/src/views/backup/backup_info.ms b/src/views/backup/backup_info.ms index 117558a7..92b9dbaf 100644 --- a/src/views/backup/backup_info.ms +++ b/src/views/backup/backup_info.ms @@ -9,7 +9,13 @@
-

{{t 'infos'}}

+

{{t 'infos'}}

+ +
@@ -25,14 +31,12 @@
-

+

{{t 'backup_content'}} - - - -

+ +
{{#if items}}
@@ -73,21 +77,3 @@ {{/if}}
- -
- -
-
-

- {{t 'operations'}} -

-
-
-
-

{{t 'backup_archive_delete'}}

- -
-
-