- Added HTTP server with CORS support and various endpoints - Introduced http_tx/http_rx channels for HTTP server control - Cleaned up build.rs by removing commented code - Updated .gitignore to use *.rdb pattern instead of .rdb - Simplified capabilities.json to empty object - Improved UI initialization with better error handling - Reorganized module imports in main.rs - Added worker count configuration for HTTP server The changes introduce a new HTTP server capability while cleaning up and improving existing code structure. The HTTP server includes authentication, session management, and websocket support.
32 lines
666 B
JavaScript
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);
|
|
}
|
|
});
|
|
});
|