Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions tabs/ports.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,34 @@ TABS.ports.initialize = function (callback) {
import('./ports.html?raw').then(({default: html}) => GUI.load(html, on_tab_loaded_handler));
});

function checkMSPPortCount(excludeCheckbox) {
let mspCount = 0;

$('.tab-ports .portConfiguration').each(function () {
const $portConfig = $(this);

// Check each MSP checkbox in this port configuration
$portConfig.find('input:checkbox[value="MSP"]').each(function() {
const $checkbox = $(this);
// Skip the checkbox we're currently changing (to get "before" count)
if (excludeCheckbox && $checkbox.is(excludeCheckbox)) {
return;
}
if ($checkbox.is(':checked')) {
mspCount++;
}
});
});

return mspCount;
}

function showMSPWarning() {
if (mspWarningModal) {
mspWarningModal.open();
}
}

function update_ui() {

$(".tab-ports").addClass("supported");
Expand Down