@@ -17,14 +17,37 @@ import (
1717
1818// Global atoms for config and data
1919var (
20- pollIntervalAtom = app .ConfigAtom ("pollInterval" , 5 )
21- repositoryAtom = app .ConfigAtom ("repository" , "wavetermdev/waveterm" )
22- workflowAtom = app .ConfigAtom ("workflow" , "build-helper.yml" )
23- maxWorkflowRunsAtom = app .ConfigAtom ("maxWorkflowRuns" , 10 )
24- workflowRunsAtom = app .DataAtom ("workflowRuns" , []WorkflowRun {})
25- lastErrorAtom = app .DataAtom ("lastError" , "" )
26- isLoadingAtom = app .DataAtom ("isLoading" , true )
27- lastRefreshTimeAtom = app .DataAtom ("lastRefreshTime" , time.Time {})
20+ pollIntervalAtom = app .ConfigAtom ("pollInterval" , 5 , & app.AtomMeta {
21+ Desc : "Polling interval for GitHub API requests" ,
22+ Units : "s" ,
23+ Min : app .Ptr (1.0 ),
24+ Max : app .Ptr (300.0 ),
25+ })
26+ repositoryAtom = app .ConfigAtom ("repository" , "wavetermdev/waveterm" , & app.AtomMeta {
27+ Desc : "GitHub repository in owner/repo format" ,
28+ Pattern : `^[a-zA-Z0-9._-]+/[a-zA-Z0-9._-]+$` ,
29+ })
30+ workflowAtom = app .ConfigAtom ("workflow" , "build-helper.yml" , & app.AtomMeta {
31+ Desc : "GitHub Actions workflow file name" ,
32+ Pattern : `^.+\.(yml|yaml)$` ,
33+ })
34+ maxWorkflowRunsAtom = app .ConfigAtom ("maxWorkflowRuns" , 10 , & app.AtomMeta {
35+ Desc : "Maximum number of workflow runs to fetch" ,
36+ Min : app .Ptr (1.0 ),
37+ Max : app .Ptr (100.0 ),
38+ })
39+ workflowRunsAtom = app .DataAtom ("workflowRuns" , []WorkflowRun {}, & app.AtomMeta {
40+ Desc : "List of GitHub Actions workflow runs" ,
41+ })
42+ lastErrorAtom = app .DataAtom ("lastError" , "" , & app.AtomMeta {
43+ Desc : "Last error message from GitHub API" ,
44+ })
45+ isLoadingAtom = app .DataAtom ("isLoading" , true , & app.AtomMeta {
46+ Desc : "Loading state for workflow data fetch" ,
47+ })
48+ lastRefreshTimeAtom = app .DataAtom ("lastRefreshTime" , time.Time {}, & app.AtomMeta {
49+ Desc : "Timestamp of last successful data refresh" ,
50+ })
2851)
2952
3053type WorkflowRun struct {
@@ -388,7 +411,7 @@ var App = app.DefineComponent("App",
388411 vdom .H ("span" , map [string ]any {
389412 "className" : "text-blue-400 mt-1" ,
390413 }, "•" ),
391- "Polls GitHub API every 5 seconds for real-time updates" ,
414+ "Polls GitHub API every " , pollInterval , " seconds for real-time updates" ,
392415 ),
393416 vdom .H ("li" , map [string ]any {
394417 "className" : "flex items-start gap-2" ,
0 commit comments