handle speciallogfile-warning-note when editing domain as admin
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -73,6 +73,7 @@
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<div class="form-check form-switch">
|
||||
<input type="hidden" value="0" name="{{ id }}" />
|
||||
<input type="checkbox" {% if field.visible is defined and field.visible == false %} disabled {% endif %} value="{{ field.value }}" id="{{ id }}" name="{{ id }}" class="form-check-input {% if field.valid is defined and field.valid == false %}is-invalid{% endif %}" {% if field.checked is defined and field.checked == 1 %} checked="checked" {% endif %}>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -29,4 +29,31 @@ $(document).ready(function () {
|
||||
});
|
||||
});
|
||||
|
||||
// show warning if speciallogfile option is toggled
|
||||
if ($('input[name=speciallogverified]')) {
|
||||
$('input[name=speciallogfile]').click(function () {
|
||||
$('#speciallogfilenote').remove();
|
||||
$('#speciallogfile').removeClass('is-invalid');
|
||||
$('#speciallogverified').val(0);
|
||||
$.ajax({
|
||||
url: "admin_domains.php?s=" + window.$session + "&page=overview&action=jqSpeciallogfileNote",
|
||||
type: "POST",
|
||||
data: {
|
||||
id: $('input[name=id]').val(), newval: +$('#speciallogfile').is(':checked')
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.changed) {
|
||||
$('#speciallogfile').addClass('is-invalid');
|
||||
$('#speciallogfile').parent().append(json.info);
|
||||
$('#speciallogverified').val(1);
|
||||
}
|
||||
},
|
||||
error: function (a, b) {
|
||||
console.log(a, b);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user