dynamically load dns-record help-text for selected dns-type; fixes #719
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -137,9 +137,6 @@
|
||||
{% if field.type == 'hidden' and field.display is defined %}
|
||||
<input type="text" readonly class="form-control-plaintext" value="{{ field.display }}">
|
||||
{% endif %}
|
||||
{% if field.note is defined and field.note is not empty %}
|
||||
<div class="invalid-feedback">{{ field.note|raw }}</div>
|
||||
{% endif %}
|
||||
{% if field.next_to is defined %}
|
||||
{% for nid, nfield in field.next_to %}
|
||||
{% if nfield.next_to_prefix is defined %}
|
||||
|
||||
19
templates/Froxlor/src/js/components/dnseditor.js
Normal file
19
templates/Froxlor/src/js/components/dnseditor.js
Normal file
@@ -0,0 +1,19 @@
|
||||
$(function () {
|
||||
|
||||
// Display helptext to content box according to dns-record type selected
|
||||
$("select[name='dns_type']").on('change', function () {
|
||||
var selVal = $(this).val();
|
||||
$.ajax({
|
||||
url: "lib/ajax.php?action=loadLanguageString",
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
data: { langid: 'dnseditor.notes.' + selVal },
|
||||
success: function (data) {
|
||||
$("#dns_content").next().html(data);
|
||||
},
|
||||
error: function (request, status, error) {
|
||||
console.log(request, status, error)
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -22,3 +22,4 @@ require('./components/domains')
|
||||
require('./components/configfiles')
|
||||
require('./components/apikeys')
|
||||
require('./components/install')
|
||||
require('./components/dnseditor')
|
||||
|
||||
Reference in New Issue
Block a user