botserver/web/desktop/store.js
Rodrigo Rodriguez (Pragmatismo) 73805c4a98 feat(desktop): add desktop mode support with Tauri integration
- Changed default feature to include 'desktop' in Cargo.toml
- Replaced --noui flag with --desktop flag in launch.json
- Added Tauri desktop mode implementation in main.rs
- Simplified command line argument handling
- Cleaned up code formatting in main.rs

The changes introduce a new mode for running the application as a desktop app using Tauri framework, while maintaining the existing server functionality. The desktop mode loads a webview window with a specific HTML interface.
2025-11-14 16:54:55 -03:00

32 lines
666 B
JavaScript

document.addEventListener('alpine:init', () => {
Alpine.store('todo', {
title: 'Todo',
items: [],
nextId: 1,
addTodo(text) {
if (!text.trim()) return;
this.items.push({
id: this.nextId,
title: text.trim(),
done: false
});
this.nextId++;
},
toggleTodo(id) {
this.items = this.items.map(item =>
item.id === id ? { ...item, done: !item.done } : item
);
},
removeTodo(id) {
this.items = this.items.filter(item => item.id !== id);
},
clearCompleted() {
this.items = this.items.filter(item => !item.done);
}
});
});