Skip to content

Commit 3d80234

Browse files
authored
Fix: Undefined error in Edit/Add DNS hint (hestiacp#3263)
1 parent 7ec355b commit 3d80234

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

web/js/pages/add_dns_rec.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
// Updates database dns record dynamically, showing its full domain path
44
App.Actions.DB.update_dns_record_hint = function (elm, hint) {
5+
domain = $('input[name="v_domain"]').val();
56
// clean hint
67
if (hint.trim() == '') {
78
$(elm).parent().find('.hint').text('');
@@ -13,7 +14,7 @@ App.Actions.DB.update_dns_record_hint = function (elm, hint) {
1314
}
1415

1516
// dont show pregix if domain name = rec value
16-
if (hint == Alpine.store('globals').DNS_REC_PREFIX + '.') {
17+
if (hint == domain) {
1718
hint = '';
1819
}
1920

@@ -25,7 +26,7 @@ App.Actions.DB.update_dns_record_hint = function (elm, hint) {
2526
$(elm)
2627
.parent()
2728
.find('.hint')
28-
.text(hint + Alpine.store('globals').DNS_REC_PREFIX);
29+
.text(hint + domain);
2930
};
3031

3132
//

web/js/pages/edit_dns_rec.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// Updates database dns record dynamically, showing its full domain path
44
App.Actions.DB.update_dns_record_hint = function (elm, hint) {
55
// clean hint
6+
domain = $('input[name="v_domain"]').val();
67
if (hint.trim() == '') {
78
$(elm).parent().find('.hint').text('');
89
}
@@ -13,7 +14,7 @@ App.Actions.DB.update_dns_record_hint = function (elm, hint) {
1314
}
1415

1516
// dont show prefix if domain name = rec value
16-
if (hint == Alpine.store('globals').DNS_REC_PREFIX + '.') {
17+
if (hint == domain) {
1718
hint = '';
1819
}
1920

@@ -25,7 +26,7 @@ App.Actions.DB.update_dns_record_hint = function (elm, hint) {
2526
$(elm)
2627
.parent()
2728
.find('.hint')
28-
.text(hint + Alpine.store('globals').DNS_REC_PREFIX);
29+
.text(hint + domain);
2930
};
3031

3132
//

0 commit comments

Comments
 (0)