Merge branch 'translation/backup-schedule' into 'dev'

Dyamically change child action translation for backups

See merge request crafty-controller/crafty-4!806
This commit is contained in:
Iain Powrie 2025-01-19 19:18:33 +00:00
commit 94fdef5c2a
3 changed files with 11 additions and 5 deletions

View File

@ -10,6 +10,7 @@ TBD
- Bump requests to resolve yank for CVE-2024-35195 ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/808))
- Better handle malformed mcping data ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/799))
### Tweaks
- Dyamically change child action translation for backups ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/806))
- Remove EXIF image data on app Background Photos ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/805))
- Bump Docker base image `22.04` -> `24.04` ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/812))
- Bump python pip `2.0.3` -> `24.3.1` ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/812))

View File

@ -74,8 +74,10 @@
</select>
<div id="ifBackup" class="d-none">
<br>
<label for="action_id">{{ translate('serverSchedules', 'actionId' , data['lang']) }}<small class="text-muted ml-1"></small> </label><br>
<select id="action_id" name="action_id" class="form-control form-control-lg select-css" value="{{ data['schedule']['action_id'] }}">
<label id="action_id_label" for="action_id" data-backup-translate="{{ translate('serverSchedules', 'backupPol', data['lang']) }}" data-action-translate="{{ translate('serverSchedules', 'actionId', data['lang']) }}"><small
class="text-muted ml-1"></small> </label><br>
<select id="action_id" name="action_id"
class="form-control form-control-lg select-css" value="{{ data['schedule']['action_id'] }}">
{% for backup in data["backups"] %}
{% if backup.backup_id == data["schedule"]["action_id"] %}
<option id="{{backup.backup_id}}" value="{{backup.backup_id}}">{{backup.backup_name}}</option>
@ -350,7 +352,7 @@
function yesnoCheck() {
if (document.getElementById('action').value == "command") {
document.getElementById("ifYes").classList.add("d-block");
document.getElementById("ifYes").classList.remove("d-none");
document.getElementById("ifYes").classList.remove("d-none");
document.getElementById("command_input").required = true;
} else {
document.getElementById("ifYes").classList.add("d-none");
@ -361,11 +363,13 @@
document.getElementById("ifBackup").classList.add("d-block");
document.getElementById("ifBackup").classList.remove("d-none");
document.getElementById("action_id").required = true;
$("#action_id_label").html($("#action_id_label").attr("data-backup-translate"));
} else {
document.getElementById("ifBackup").classList.remove("d-block");
document.getElementById("ifBackup").classList.add("d-none");
document.getElementById("action_id").required = false;
$("#action_id").val(null);
$("#action_id_label").html($("#action_id_label").attr("data-action-translate"));
}
}
function basicAdvanced() {
@ -459,4 +463,4 @@
window.onload(startup())
</script>
{% end %}
{% end %}

View File

@ -508,7 +508,8 @@
},
"serverSchedules": {
"action": "Action",
"actionId": "Select Action Child",
"actionId": "Action Child",
"backupPol": "Backup Policy",
"areYouSure": "Delete Scheduled Task?",
"cancel": "Cancel",
"cannotSee": "Not seeing everything?",