Skip to content

Commit cec359a

Browse files
committed
Do not show the table and edit buttons when the option is set via ENV VAR
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
1 parent 6b5e9df commit cec359a

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

scripts/js/settings-dns.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,6 @@ function getRevServerArray() {
163163
}
164164

165165
function createRevServerTable() {
166-
// The Conditional Forwarding option will be disabled when this option was set via ENV VAR.
167-
// Check if the textarea is disabled.
168-
if ($(".revServers").prop("disabled")) {
169-
// In this case, we don't show the table because the values can't be changed.
170-
// Show the disabled textarea and return
171-
$(".revServers").show();
172-
return;
173-
}
174-
175166
// Get the data
176167
const tableRows = getRevServerArray();
177168

@@ -376,7 +367,16 @@ function processDNSConfig() {
376367
})
377368
.done(() => {
378369
// This will be executed only after the done block above is executed
379-
createRevServerTable();
370+
371+
// If Conditional Forwarding option is set via ENV VAR, the textarea will be disabled and no values can be edited
372+
if ($(".revServers").prop("disabled")) {
373+
// In this case, we hide the table and show the textarea
374+
$("#revServers-table").hide();
375+
$(".revServers").show().attr("title", "Disabled: Set by environment variable");
376+
} else {
377+
// We only populate the table when the textarea is enabled
378+
createRevServerTable();
379+
}
380380
})
381381
.fail(data => {
382382
apiFailure(data);

0 commit comments

Comments
 (0)