refactor: simplify modal handler wiring for rerender safety
Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/15310f2a-9bf2-4813-b2be-7462cb923c9c Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
6ea8810881
commit
19273e6d10
@@ -222,13 +222,13 @@ function openPortRequirementsModal(featureName, ports, onContinue) {
|
|||||||
var continueBtn = onContinue
|
var continueBtn = onContinue
|
||||||
? '<button class="btn btn-primary" id="port-req-continue-btn">I Understand — Continue</button>'
|
? '<button class="btn btn-primary" id="port-req-continue-btn">I Understand — Continue</button>'
|
||||||
: '';
|
: '';
|
||||||
|
|
||||||
|
function renderPortRequirements(internalIp) {
|
||||||
var rows = ports.map(function(p) {
|
var rows = ports.map(function(p) {
|
||||||
return '<tr><td class="port-req-port">' + escHtml(p.port) + '</td>' +
|
return '<tr><td class="port-req-port">' + escHtml(p.port) + '</td>' +
|
||||||
'<td class="port-req-proto">' + escHtml(p.protocol) + '</td>' +
|
'<td class="port-req-proto">' + escHtml(p.protocol) + '</td>' +
|
||||||
'<td class="port-req-desc">' + escHtml(p.description) + '</td></tr>';
|
'<td class="port-req-desc">' + escHtml(p.description) + '</td></tr>';
|
||||||
}).join("");
|
}).join("");
|
||||||
|
|
||||||
function renderPortRequirements(internalIp) {
|
|
||||||
var ipLine = internalIp
|
var ipLine = internalIp
|
||||||
? '<p class="port-req-intro">Forward each port below <strong>to this machine\'s internal IP: <code class="port-req-internal-ip">' + escHtml(internalIp) + '</code></strong></p>'
|
? '<p class="port-req-intro">Forward each port below <strong>to this machine\'s internal IP: <code class="port-req-internal-ip">' + escHtml(internalIp) + '</code></strong></p>'
|
||||||
: "<p class=\"port-req-intro\">Forward each port below to this machine's internal LAN IP in your router's port forwarding settings.</p>";
|
: "<p class=\"port-req-intro\">Forward each port below to this machine's internal LAN IP in your router's port forwarding settings.</p>";
|
||||||
@@ -251,15 +251,15 @@ function openPortRequirementsModal(featureName, ports, onContinue) {
|
|||||||
continueBtn +
|
continueBtn +
|
||||||
'</div>';
|
'</div>';
|
||||||
|
|
||||||
document.getElementById("port-req-dismiss-btn").addEventListener("click", function() {
|
document.getElementById("port-req-dismiss-btn").onclick = function() {
|
||||||
closePortRequirementsModal();
|
closePortRequirementsModal();
|
||||||
});
|
};
|
||||||
|
|
||||||
if (onContinue) {
|
if (onContinue) {
|
||||||
document.getElementById("port-req-continue-btn").addEventListener("click", function() {
|
document.getElementById("port-req-continue-btn").onclick = function() {
|
||||||
closePortRequirementsModal();
|
closePortRequirementsModal();
|
||||||
onContinue();
|
onContinue();
|
||||||
});
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user