-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #256 from carverauto/253-refactorweb-switch-to-ssr…
…next 253 refactorweb switch to ssrnext
- Loading branch information
Showing
74 changed files
with
8,365 additions
and
5,226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,6 +133,7 @@ jspm_packages/ | |
lib | ||
.idea | ||
.bin | ||
bin | ||
|
||
pnpm-lock.yaml | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package api | ||
|
||
import ( | ||
"encoding/json" | ||
"sync" | ||
"time" | ||
|
||
"github.com/carverauto/serviceradar/pkg/checker/snmp" | ||
"github.com/carverauto/serviceradar/pkg/db" | ||
"github.com/carverauto/serviceradar/pkg/metrics" | ||
"github.com/carverauto/serviceradar/pkg/models" | ||
"github.com/gorilla/mux" | ||
) | ||
|
||
type ServiceStatus struct { | ||
Name string `json:"name"` | ||
Available bool `json:"available"` | ||
Message string `json:"message"` | ||
Type string `json:"type"` // e.g., "process", "port", "blockchain", etc. | ||
Details json.RawMessage `json:"details"` // Flexible field for service-specific data | ||
} | ||
|
||
type NodeStatus struct { | ||
NodeID string `json:"node_id"` | ||
IsHealthy bool `json:"is_healthy"` | ||
LastUpdate time.Time `json:"last_update"` | ||
Services []ServiceStatus `json:"services"` | ||
UpTime string `json:"uptime"` | ||
FirstSeen time.Time `json:"first_seen"` | ||
Metrics []models.MetricPoint `json:"metrics,omitempty"` | ||
} | ||
|
||
type SystemStatus struct { | ||
TotalNodes int `json:"total_nodes"` | ||
HealthyNodes int `json:"healthy_nodes"` | ||
LastUpdate time.Time `json:"last_update"` | ||
} | ||
|
||
type NodeHistory struct { | ||
NodeID string | ||
Timestamp time.Time | ||
IsHealthy bool | ||
Services []ServiceStatus | ||
} | ||
|
||
type NodeHistoryPoint struct { | ||
Timestamp time.Time `json:"timestamp"` | ||
IsHealthy bool `json:"is_healthy"` | ||
} | ||
|
||
type APIServer struct { | ||
mu sync.RWMutex | ||
nodes map[string]*NodeStatus | ||
router *mux.Router | ||
nodeHistoryHandler func(nodeID string) ([]NodeHistoryPoint, error) | ||
metricsManager metrics.MetricCollector | ||
snmpManager snmp.SNMPManager | ||
db db.Service | ||
knownPollers []string | ||
apiKey string | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.