Files
motr/ui/dash/scripts.templ

50 lines
1.8 KiB
Plaintext
Raw Permalink Normal View History

feat/ui (#11) * ui: improve visual consistency across components * feat: simplify task execution with consolidated commands * feat: enable account registration flow * feat: integrate price tracking functionality * feat: add metadata components for improved SEO and web crawling * refactor: improve code organization and consistency * fix: update login template package names * refactor: rename and restructure UI components for clarity * feat: introduce dynamic asset selection for transfer UI * chore: update dependencies and build process * feat: Add KVNamespace interface for Cloudflare KV store operations * refactor: Update JSON operations to use Golang generics with JSON Marshaller interface * feat: Add json import for KVNamespace generic JSON operations * refactor: Update PutJSON method to accept any type for JSON marshaling * refactor: migrate to modular architecture with domain-driven design * fix: directory structure for component routing * refactor: partial routes to htmx * docs: update documentation to reflect UI structure changes * refactor: relocate build artifacts for cleaner project structure * feat: integrate Cloudflare cache for improved performance * build: update import paths for middleware package * feat: implement core authentication flows * refactor: rename view handler to index handler for clarity * feat: introduce devbox for streamlined development environment * feat: introduce deployment and build scripts * feat: introduce radar and worker services with build automation * feat: introduce WASM-based worker and radar services * feat: migrate to standard go build process * fix: correct worker script path in wrangler configuration * feat: enhance service monitoring capabilities * refactor: migrate to new database and KV store context pattern * build: streamline worker builds using devbox scripts * feat: migrate to D1 database bindings for improved data access * feat: introduce session ID middleware * perf: optimize WASM build size by stripping debug information * feat: introduce process-compose for simplified local development * feat: enable direct wrangler commands and simplify deployment
2025-05-28 12:50:38 -04:00
package dash
feat/routes (#9) * refactor: decouple core logic from global configuration * fix: apply consistent error handling across application * refactor: improve component rendering for better performance * feat: migrate views to use directory for components * feat: streamline UI imports and package structure * feat: update templ version to v0.3.865 * feat: enhance application observability with status check * refactor: decouple database setup from command line tools * refactor: replace card component with styled divs for improved customization * refactor: rename and move Helia console components to blocks * chore: reorganize controllers under handlers * feat: implement home page UI with registration form * <no value> * fix: correct file path in templ error messages * refactor: use web component for connection status indicator * feat: enhance connection status indicator with visual cue * chore: move Helia initialization script to helia package * refactor: rename 'appComponent' to 'consoleComponent' * chore: standardize import paths across vault package * feat: introduce common error definitions for API responses * refactor: centralize handle input logic into reusable component * style: adjust user handle input for better visual feedback * build: update templ generated files * feat: automate builds, archives, and releases * ci: consolidate publishing workflows for improved automation * ci: simplify deployment workflows and leverage Cloudflare * ci: allow manual deployment initiation * ci: add trigger for deploy workflow * docs: Update README with new development workflow and component details
2025-05-21 12:38:54 -04:00
var heliaCardScriptHandle = templ.NewOnceHandle()
templ ScriptTag() {
@heliaCardScriptHandle.Once() {
<script>
document.addEventListener('DOMContentLoaded', async () => {
try {
// Use the globally available instantiateHeliaNode function
const helia = window.helia = await window.instantiateHeliaNode()
window.heliaFs = await HeliaUnixfs.unixfs(helia)
helia.libp2p.addEventListener('peer:discovery', (evt) => {
window.discoveredPeers.set(evt.detail.id.toString(), evt.detail)
addToLog(`Discovered peer ${evt.detail.id.toString()}`)
})
helia.libp2p.addEventListener('peer:connect', (evt) => {
addToLog(`Connected to ${evt.detail.toString()}`)
})
helia.libp2p.addEventListener('peer:disconnect', (evt) => {
addToLog(`Disconnected from ${evt.detail.toString()}`)
})
setInterval(() => {
const statusValueEl = document.getElementById('statusValue')
if (statusValueEl) {
statusValueEl.innerHTML = helia.libp2p.status === 'started' ? 'Online' : 'Offline'
}
updateConnectedPeers()
updateDiscoveredPeers()
}, 500)
const id = await helia.libp2p.peerId.toString()
const nodeIdEl = document.getElementById('nodeId')
if (nodeIdEl) {
nodeIdEl.innerHTML = id
}
addToLog('Helia node initialized successfully')
} catch (err) {
addToLog(`Error initializing Helia: ${err.message}`)
console.error('Error initializing Helia:', err)
}
})
</script>
}
}