From 0e181cdc823283b15852826666d7c53ac1e6e58c Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Tue, 10 Dec 2024 14:46:30 +0100 Subject: [PATCH] archive: implement unarchive made a separate route instead of reusing install route. this was because we want to copy over all the old app config as much as possible. --- dashboard/public/js/client.js | 10 +++ dashboard/public/translation/en.json | 5 ++ dashboard/public/views/app.html | 4 +- dashboard/public/views/backups.html | 64 ++++++++-------- dashboard/public/views/backups.js | 105 +++++++++++++++------------ src/archives.js | 38 +++++++++- src/routes/apps.js | 2 - src/routes/archives.js | 26 +++++++ src/server.js | 9 ++- 9 files changed, 173 insertions(+), 90 deletions(-) diff --git a/dashboard/public/js/client.js b/dashboard/public/js/client.js index 0a67213ce..ef258710a 100644 --- a/dashboard/public/js/client.js +++ b/dashboard/public/js/client.js @@ -1524,6 +1524,16 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout }); }; + Client.prototype.unarchiveApp = function (archiveId, data, callback) { + post('/api/v1/archives/' + archiveId + '/unarchive', data, null, function (error, data, status) { + if (error) return callback(error); + if (status !== 202) return callback(new ClientError(status, data)); + + callback(null, data); + }); + }; + + Client.prototype.getBackups = function (callback) { var page = 1; var perPage = 100; diff --git a/dashboard/public/translation/en.json b/dashboard/public/translation/en.json index e488f1c57..842585469 100644 --- a/dashboard/public/translation/en.json +++ b/dashboard/public/translation/en.json @@ -659,6 +659,11 @@ }, "deleteArchive": { "deleteAction": "Delete" + }, + "restoreArchiveDialog": { + "title": "Restore from Archive", + "description": "This will install {{appId}} at the specified location with backup from {{creationTime}}.", + "restoreAction": "Restore {{ dnsOverwrite ? 'and overwrite DNS' : '' }}" } }, "branding": { diff --git a/dashboard/public/views/app.html b/dashboard/public/views/app.html index fbcead3b7..669d52ce3 100644 --- a/dashboard/public/views/app.html +++ b/dashboard/public/views/app.html @@ -185,7 +185,7 @@ -