Files
motr/ui/dash/scripts_templ.go

61 lines
3.9 KiB
Go
Raw Permalink Normal View History

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
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.3.857
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
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import templruntime "github.com/a-h/templ/runtime"
var heliaCardScriptHandle = templ.NewOnceHandle()
func ScriptTag() templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
return templ_7745c5c3_CtxErr
}
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
if templ_7745c5c3_Var1 == nil {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<script>\n document.addEventListener('DOMContentLoaded', async () => {\n try {\n // Use the globally available instantiateHeliaNode function\n const helia = window.helia = await window.instantiateHeliaNode()\n window.heliaFs = await HeliaUnixfs.unixfs(helia)\n\n helia.libp2p.addEventListener('peer:discovery', (evt) => {\n window.discoveredPeers.set(evt.detail.id.toString(), evt.detail)\n addToLog(`Discovered peer ${evt.detail.id.toString()}`)\n })\n\n helia.libp2p.addEventListener('peer:connect', (evt) => {\n addToLog(`Connected to ${evt.detail.toString()}`)\n })\n \n helia.libp2p.addEventListener('peer:disconnect', (evt) => {\n addToLog(`Disconnected from ${evt.detail.toString()}`)\n })\n\n setInterval(() => {\n const statusValueEl = document.getElementById('statusValue')\n if (statusValueEl) {\n statusValueEl.innerHTML = helia.libp2p.status === 'started' ? 'Online' : 'Offline'\n }\n updateConnectedPeers()\n updateDiscoveredPeers()\n }, 500)\n\n const id = await helia.libp2p.peerId.toString()\n const nodeIdEl = document.getElementById('nodeId')\n if (nodeIdEl) {\n nodeIdEl.innerHTML = id\n }\n addToLog('Helia node initialized successfully')\n } catch (err) {\n addToLog(`Error initializing Helia: ${err.message}`)\n console.error('Error initializing Helia:', err)\n }\n })\n </script>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return nil
})
templ_7745c5c3_Err = heliaCardScriptHandle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return nil
})
}
var _ = templruntime.GeneratedTemplate