mirror of
https://github.com/StarFleetCPTN/GoMFT.git
synced 2026-11-05 19:47:26 +01:00
feat: Implement frontend asset build process and update Docker configuration
- Added a new build script using esbuild to bundle JavaScript and CSS assets, including Tailwind CSS and Font Awesome. - Updated the Dockerfile to include a multi-stage build process for frontend assets, ensuring efficient image creation. - Enhanced GitHub workflows to automate the installation of Node.js dependencies and build frontend assets during CI/CD. - Introduced a .gitignore entry for the dist directory to prevent unnecessary files from being tracked. - Improved caching and content type handling for static files served by the application.
This commit is contained in:
1 parent
405b2e605e
commit
fde60b7d68
30 files changed
+2556
-241
No files matched your search
@@ -0,0 +1,32 @@
|
||||
// Add script to ensure dark mode is properly applied
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Apply body dark class when theme changes
|
||||
const isDark = document.documentElement.classList.contains('dark');
|
||||
if (isDark) {
|
||||
document.body.classList.add('dark');
|
||||
|
||||
// Also apply to containers
|
||||
const jobsContainer = document.getElementById('jobs-container');
|
||||
const configsContainer = document.getElementById('configs-container');
|
||||
|
||||
if (jobsContainer) jobsContainer.classList.add('dark');
|
||||
if (configsContainer) configsContainer.classList.add('dark');
|
||||
}
|
||||
|
||||
// Initialize admin dropdown toggle if available
|
||||
const adminDropdownToggle = document.querySelector('[data-collapse-toggle="dropdown-settings"]');
|
||||
const adminDropdown = document.getElementById('dropdown-settings');
|
||||
|
||||
if (adminDropdownToggle && adminDropdown) {
|
||||
// Check if we should show the dropdown (if current page is under admin section)
|
||||
const currentPath = window.location.pathname;
|
||||
if (currentPath.startsWith('/admin')) {
|
||||
adminDropdown.classList.remove('hidden');
|
||||
}
|
||||
|
||||
// Add click event listener
|
||||
adminDropdownToggle.addEventListener('click', function() {
|
||||
adminDropdown.classList.toggle('hidden');
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,53 @@
|
||||
// Import HTMX
|
||||
import 'htmx.org';
|
||||
|
||||
// Import Alpine.js
|
||||
import Alpine from 'alpinejs';
|
||||
window.Alpine = Alpine;
|
||||
|
||||
// Import Flowbite
|
||||
import 'flowbite';
|
||||
import 'flowbite/dist/flowbite.css';
|
||||
|
||||
// Initialize Flowbite components
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
// Initialize Alpine.js
|
||||
Alpine.start();
|
||||
|
||||
// Initialize Flowbite modals
|
||||
const modalTriggers = document.querySelectorAll('[data-modal-target]');
|
||||
modalTriggers.forEach(trigger => {
|
||||
const targetId = trigger.getAttribute('data-modal-target');
|
||||
const targetModal = document.getElementById(targetId);
|
||||
if (targetModal) {
|
||||
// Show modal
|
||||
trigger.addEventListener('click', () => {
|
||||
targetModal.classList.remove('hidden');
|
||||
targetModal.classList.add('flex');
|
||||
// Add backdrop
|
||||
document.body.style.overflow = 'hidden';
|
||||
});
|
||||
|
||||
// Handle modal hide buttons
|
||||
const hideButtons = targetModal.querySelectorAll('[data-modal-hide]');
|
||||
hideButtons.forEach(button => {
|
||||
button.addEventListener('click', () => {
|
||||
targetModal.classList.add('hidden');
|
||||
targetModal.classList.remove('flex');
|
||||
// Remove backdrop
|
||||
document.body.style.overflow = '';
|
||||
});
|
||||
});
|
||||
|
||||
// Handle clicking outside the modal
|
||||
targetModal.addEventListener('click', (event) => {
|
||||
if (event.target === targetModal || event.target.classList.contains('fixed')) {
|
||||
targetModal.classList.add('hidden');
|
||||
targetModal.classList.remove('flex');
|
||||
// Remove backdrop
|
||||
document.body.style.overflow = '';
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user