secubox-openwrt/secubox-tools/webui/static/js/store.js
CyberMind-FR 0d6aaa1111 feat(webui): add Project Hub workspace and remove Command Center glow effects
- Add complete Project Hub & Workspace Interface implementation
  - New data models: Project, ModuleKit, Workspace
  - 3 fixture projects (cybermind.fr, cybermood.eu, secubox-c3)
  - 4 module kits (Security, Network, Automation, Media)
  - Workspace routes with project switching and kit installation
  - 4 workspace tabs: Overview, Module Kits, Devices, Composer
  - New navigation item: Workspace (7th section)

- Remove all glowing effects from UI
  - Remove Command Center widget glow and backdrop blur
  - Remove device status indicator glow
  - Remove toggle button glow effects

- Extend DataStore with 13 new methods for workspace management
- Add 270+ lines of workspace-specific CSS with responsive layouts
- Create workspace templates and result partials

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-03 08:10:22 +01:00

101 lines
2.1 KiB
JavaScript

/**
* SecuBox WebUI - Alpine.js Global Store
*
* Manages application-wide state including:
* - Active section navigation
* - Search and filter state
* - Toast notifications
* - Modal state
*/
document.addEventListener('alpine:init', () => {
Alpine.store('app', {
// Current active section
activeSection: 'modules',
// Search and filter state
searchQuery: '',
filters: {
tags: [],
categories: [],
health: null,
installed: null,
},
// Toast notification state
toast: {
message: '',
type: 'info', // 'info', 'success', 'warning', 'error'
show: false,
},
// Modal state
modal: {
isOpen: false,
title: '',
content: '',
},
// Methods
setSection(section) {
this.activeSection = section;
// Store in localStorage for persistence
localStorage.setItem('secubox_active_section', section);
},
showToast(message, type = 'info', duration = 3000) {
this.toast = { message, type, show: true };
setTimeout(() => {
this.toast.show = false;
}, duration);
},
updateSearch(query) {
this.searchQuery = query;
},
addFilter(filterType, value) {
if (!this.filters[filterType]) {
this.filters[filterType] = [];
}
if (!this.filters[filterType].includes(value)) {
this.filters[filterType].push(value);
}
},
removeFilter(filterType, value) {
if (this.filters[filterType]) {
this.filters[filterType] = this.filters[filterType].filter(v => v !== value);
}
},
clearFilters() {
this.filters = {
tags: [],
categories: [],
health: null,
installed: null,
};
},
openModal(title, content) {
this.modal = { isOpen: true, title, content };
},
closeModal() {
this.modal.isOpen = false;
},
// Initialize from localStorage
init() {
const savedSection = localStorage.getItem('secubox_active_section');
if (savedSection) {
this.activeSection = savedSection;
}
}
});
// Initialize the store
Alpine.store('app').init();
});