|
|
|
|
@ -63,18 +63,18 @@ function populateAppsList(apps) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let html = '<div class="select-all-group">';
|
|
|
|
|
html += '<input type="checkbox" id="select-all" onchange="toggleSelectAll(this)">';
|
|
|
|
|
html += '<label for="select-all">Select All (' + apps.length + ' apps)</label>';
|
|
|
|
|
let html = '<div class="app-header">';
|
|
|
|
|
html += '<span>Select Applications</span>';
|
|
|
|
|
html += '<input type="checkbox" id="select-all">';
|
|
|
|
|
html += '</div>';
|
|
|
|
|
|
|
|
|
|
apps.forEach((app, index) => {
|
|
|
|
|
const checkboxId = 'app-' + index;
|
|
|
|
|
html += '<div class="dashboard-item">';
|
|
|
|
|
html += '<input type="checkbox" id="' + checkboxId + '" value="' + app.id + '" data-app="' + app.id + '" data-name="' + app.name + '">';
|
|
|
|
|
html += '<div class="app-item">';
|
|
|
|
|
html += '<input type="checkbox" id="' + checkboxId + '" value="' + app.id + '" data-app="true" data-name="' + app.name + '">';
|
|
|
|
|
html += '<label for="' + checkboxId + '"><strong>' + app.name + '</strong> <span class="app-badge">' + app.id + '</span>';
|
|
|
|
|
if (app.description) {
|
|
|
|
|
html += '<div style="font-size: 11px; color: #666; margin-top: 3px;">' + app.description + '</div>';
|
|
|
|
|
html += '<div style="font-size: 11px; color: #999; margin-top: 3px;">' + app.description + '</div>';
|
|
|
|
|
}
|
|
|
|
|
html += '</label>';
|
|
|
|
|
html += '</div>';
|
|
|
|
|
@ -82,6 +82,27 @@ function populateAppsList(apps) {
|
|
|
|
|
|
|
|
|
|
container.innerHTML = html;
|
|
|
|
|
console.log('Successfully populated ' + apps.length + ' apps');
|
|
|
|
|
|
|
|
|
|
// Ajouter les event listeners
|
|
|
|
|
addCheckboxListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function addCheckboxListeners() {
|
|
|
|
|
console.log("addCheckboxListeners called");
|
|
|
|
|
|
|
|
|
|
const selectAllCheckbox = document.getElementById('select-all');
|
|
|
|
|
if (selectAllCheckbox) {
|
|
|
|
|
selectAllCheckbox.addEventListener('change', function() {
|
|
|
|
|
toggleSelectAll(this);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const appCheckboxes = document.querySelectorAll('#dashboard-list input[type="checkbox"][data-app]');
|
|
|
|
|
appCheckboxes.forEach(checkbox => {
|
|
|
|
|
checkbox.addEventListener('change', function() {
|
|
|
|
|
console.log("App checkbox changed");
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function showAppsEmpty() {
|
|
|
|
|
@ -350,7 +371,7 @@ function showAppsEmpty() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function toggleSelectAll(checkbox) {
|
|
|
|
|
const checkboxes = document.querySelectorAll('#dashboard-list input[type="checkbox"]:not(#select-all)');
|
|
|
|
|
const checkboxes = document.querySelectorAll('#dashboard-list input[type="checkbox"][data-app]');
|
|
|
|
|
checkboxes.forEach(cb => cb.checked = checkbox.checked);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|