+ console.log("Rendering", customApps.length, "dynamic apps");
+ dynamicAppsList.innerHTML = customApps.map(app => `
+
+
+
+
-
-
-
+
+
${app.name || 'Neznámá aplikace'}
+
${app.url || ''}
+ ${app.description ? `
${app.description}
` : ''}
- `;
- }).join('');
+
+
+
+
+
+ `).join('');
} catch (error) {
console.error('Error loading dynamic apps:', error);
@@ -2000,7 +1976,7 @@ async function saveApp(event) {
const name = document.getElementById('appName')?.value.trim() || '';
const url = document.getElementById('appLink')?.value.trim() || '';
const description = document.getElementById('appDescription')?.value.trim() || '';
- const icon = document.getElementById('appIconClass')?.value || 'fas fa-cube';
+ const icon = document.getElementById('appIcon')?.value || 'fa-globe';
const color = document.getElementById('appColor')?.value || '#4a6cf7';
console.log('Saving app with data:', { name, url, description, icon, color });
@@ -2021,19 +1997,7 @@ async function saveApp(event) {
formData.append('description', description);
formData.append('icon', icon);
formData.append('color', color);
-
- // Handle custom icon file upload if selected
- const customIconInput = document.getElementById('customIconInput');
- if (customIconInput && customIconInput.files.length > 0) {
- formData.append('iconFile', customIconInput.files[0]);
- } else {
- // Make sure we have a valid icon class
- if (!icon) {
- showNotification('Vyberte prosím ikonu pro aplikaci', 'error');
- return;
- }
- }
-
+
try {
const isEdit = !!appId;
const url = isEdit ? `/api/apps/${appId}` : '/api/apps';
@@ -2293,22 +2257,6 @@ function setupFileInput() {
selectedIcon.classList.remove('hidden');
appIcon.value = '';
}
-}
-
-document.addEventListener('DOMContentLoaded', function() {
- // Initialize file input for custom icon upload
- // setupFileInput(); // Removed custom icon upload functionality
-
- // Add click handler for custom icon button
- const customIconBtn = document.getElementById('customIconBtn');
- const customIconInput = document.getElementById('customIconInput');
-
- if (customIconBtn && customIconInput) {
- customIconBtn.addEventListener('click', function(e) {
- e.preventDefault();
- customIconInput.click();
- });
- }
// Color picker setup
const appColor = document.getElementById('appColor');
@@ -2331,7 +2279,7 @@ document.addEventListener('DOMContentLoaded', function() {
}
});
}
-});
+};
// Reset form when modal is closed
// Initialize icon picker when the modal is shown