Skip to content

Commit 6c31fd9

Browse files
authored
Confirm before restoring part of backup (hestiacp#4147)
1 parent 7b2e491 commit 6c31fd9

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

web/templates/pages/list_backup_detail.php

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22
<div class="toolbar">
33
<div class="toolbar-inner">
44
<div class="toolbar-buttons">
5-
<a class="button button-secondary button-back js-button-back" href="/list/backup/"><i class="fas fa-arrow-left icon-blue"></i><?= _("Back") ?></a>
6-
<a href="/schedule/restore/?token=<?= $_SESSION["token"] ?>&backup=<?= htmlentities($_GET["backup"]) ?>" class="button button-secondary"><i class="fas fa-arrow-rotate-left icon-green"></i><?= _("Restore All") ?></a>
5+
<a class="button button-secondary button-back js-button-back" href="/list/backup/">
6+
<i class="fas fa-arrow-left icon-blue"></i><?= _("Back") ?>
7+
</a>
8+
<a href="/schedule/restore/?token=<?= $_SESSION["token"] ?>&backup=<?= htmlentities($_GET["backup"]) ?>" class="button button-secondary">
9+
<i class="fas fa-arrow-rotate-left icon-green"></i><?= _("Restore All") ?>
10+
</a>
711
</div>
812
<div class="toolbar-right">
913
<form x-data x-bind="BulkEdit" action="/bulk/restore/" method="post">
@@ -72,9 +76,11 @@
7276
<ul class="units-table-row-actions">
7377
<li class="units-table-row-action shortcut-enter" data-key-action="href">
7478
<a
75-
class="units-table-row-action-link"
79+
class="units-table-row-action-link data-controls js-confirm-action"
7680
href="/schedule/restore/?backup=<?= $backup ?>&type=web&object=<?= $key ?>&token=<?= $_SESSION["token"] ?>"
7781
title="<?= _("Restore") ?>"
82+
data-confirm-title="<?= _("Restore") ?>"
83+
data-confirm-message="<?= sprintf(_("Are you sure you want to restore %s?"), $key) ?>"
7884
>
7985
<i class="fas fa-arrow-rotate-left icon-green"></i>
8086
<span class="u-hide-desktop"><?= _("Restore") ?></span>
@@ -110,9 +116,11 @@ class="units-table-row-action-link"
110116
<ul class="units-table-row-actions">
111117
<li class="units-table-row-action shortcut-enter" data-key-action="href">
112118
<a
113-
class="units-table-row-action-link"
119+
class="units-table-row-action-link data-controls js-confirm-action"
114120
href="/schedule/restore/?backup=<?= $backup ?>&type=mail&object=<?= $key ?>&token=<?= $_SESSION["token"] ?>"
115121
title="<?= _("Restore") ?>"
122+
data-confirm-title="<?= _("Restore") ?>"
123+
data-confirm-message="<?= sprintf(_("Are you sure you want to restore %s?"), $key) ?>"
116124
>
117125
<i class="fas fa-arrow-rotate-left icon-green"></i>
118126
<span class="u-hide-desktop"><?= _("Restore") ?></span>
@@ -148,9 +156,11 @@ class="units-table-row-action-link"
148156
<ul class="units-table-row-actions">
149157
<li class="units-table-row-action shortcut-enter" data-key-action="href">
150158
<a
151-
class="units-table-row-action-link"
159+
class="units-table-row-action-link data-controls js-confirm-action"
152160
href="/schedule/restore/?backup=<?= $backup ?>&type=dns&object=<?= $key ?>&token=<?= $_SESSION["token"] ?>"
153161
title="<?= _("Restore") ?>"
162+
data-confirm-title="<?= _("Restore") ?>"
163+
data-confirm-message="<?= sprintf(_("Are you sure you want to restore %s?"), $key) ?>"
154164
>
155165
<i class="fas fa-arrow-rotate-left icon-green"></i>
156166
<span class="u-hide-desktop"><?= _("Restore") ?></span>
@@ -186,9 +196,11 @@ class="units-table-row-action-link"
186196
<ul class="units-table-row-actions">
187197
<li class="units-table-row-action shortcut-enter" data-key-action="href">
188198
<a
189-
class="units-table-row-action-link"
199+
class="units-table-row-action-link data-controls js-confirm-action"
190200
href="/schedule/restore/?backup=<?= $backup ?>&type=db&object=<?= $key ?>&token=<?= $_SESSION["token"] ?>"
191201
title="<?= _("Restore") ?>"
202+
data-confirm-title="<?= _("Restore") ?>"
203+
data-confirm-message="<?= sprintf(_("Are you sure you want to restore %s?"), $key) ?>"
192204
>
193205
<i class="fas fa-arrow-rotate-left icon-green"></i>
194206
<span class="u-hide-desktop"><?= _("Restore") ?></span>
@@ -221,9 +233,11 @@ class="units-table-row-action-link"
221233
<ul class="units-table-row-actions">
222234
<li class="units-table-row-action shortcut-enter" data-key-action="href">
223235
<a
224-
class="units-table-row-action-link"
236+
class="units-table-row-action-link data-controls js-confirm-action"
225237
href="/schedule/restore/?backup=<?= $backup ?>&type=cron&object=records&token=<?= $_SESSION["token"] ?>"
226238
title="<?= _("Restore") ?>"
239+
data-confirm-title="<?= _("Restore") ?>"
240+
data-confirm-message="<?= sprintf(_("Are you sure you want to restore %s?"), $key) ?>"
227241
>
228242
<i class="fas fa-arrow-rotate-left icon-green"></i>
229243
<span class="u-hide-desktop"><?= _("Restore") ?></span>
@@ -259,9 +273,11 @@ class="units-table-row-action-link"
259273
<ul class="units-table-row-actions">
260274
<li class="units-table-row-action shortcut-enter" data-key-action="href">
261275
<a
262-
class="units-table-row-action-link"
276+
class="units-table-row-action-link data-controls js-confirm-action"
263277
href="/schedule/restore/?backup=<?= $backup ?>&type=udir&object=<?= $key ?>&token=<?= $_SESSION["token"] ?>"
264278
title="<?= _("Restore") ?>"
279+
data-confirm-title="<?= _("Restore") ?>"
280+
data-confirm-message="<?= sprintf(_("Are you sure you want to restore %s?"), $key) ?>"
265281
>
266282
<i class="fas fa-arrow-rotate-left icon-green"></i>
267283
<span class="u-hide-desktop"><?= _("Restore") ?></span>

0 commit comments

Comments
 (0)