Merge branch 'tweak/clone-confirmation' into 'dev'

Add clone server confirmation.

See merge request crafty-controller/crafty-4!384
This commit is contained in:
Iain Powrie 2022-06-24 02:07:50 +00:00
commit a6bed55218
3 changed files with 33 additions and 9 deletions

View File

@ -7,6 +7,7 @@ None
- Fix cannot delete backup on page 2 ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/382))
### Tweaks
- Rework server list on status page display for use on small screens ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/383))
- Add clone server confirmation ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/384))
<br><br>
## --- [4.0.4-hotfix2] - 2022/06/21

View File

@ -849,19 +849,41 @@
$(".clone_button").click(function () {
server_id = $(this).attr("data-id");
send_command(server_id, 'clone_server');
bootbox.dialog({
backdrop: true,
title: '{% raw translate("dashboard", "sendingCommand", data["lang"]) %}',
message: '<div align="center"><i class="fas fa-spin fa-spinner"></i> &nbsp; {% raw translate("dashboard", "bePatientClone", data["lang"]) %} </div>',
closeButton: false,
bootbox.confirm({
message: "{{ translate('dashboard', 'cloneConfirm' , data['lang']) }}",
buttons: {
confirm: {
label: "{{ translate('dashboard', 'clone' , data['lang']) }}",
className: 'btn-outline-warning'
},
cancel: {
label: '{% raw translate("panelConfig", "cancel", data["lang"]) %}',
className: 'btn-secondary'
}
},
callback: function (result) {
if (result) {
cloneServer(server_id);
}
}
});
setTimeout(function () {
location.reload();
}, 5000)
});
});
function cloneServer(server_id) {
send_command(server_id, 'clone_server');
bootbox.dialog({
backdrop: true,
title: '{% raw translate("dashboard", "sendingCommand", data["lang"]) %}',
message: '<div align="center"><i class="fas fa-spin fa-spinner"></i> &nbsp; {% raw translate("dashboard", "bePatientClone", data["lang"]) %} </div>',
closeButton: false,
});
setTimeout(function () {
location.reload();
}, 5000)
}
</script>
<script src="/static/assets/vendors/js/jquery-ui.js"></script>
<link rel="stylesheet" href="/static/assets/vendors/css/jquery-ui.css">

View File

@ -66,6 +66,7 @@
"cannotSeeOnMobile": "Not seeing everything on mobile?",
"cannotSeeOnMobile2": "Try scrolling the table sideways.",
"clone": "Clone",
"cloneConfirm": "Are you sure you would like to clone this server? This process may take a while.",
"cpuCores": "CPU Cores",
"cpuCurFreq": "CPU Current Clock",
"cpuMaxFreq": "CPU Maximum Clock",