Formatting.
This commit is contained in:
3
go.mod
3
go.mod
@@ -4,7 +4,6 @@ go 1.24
|
||||
|
||||
require (
|
||||
github.com/gorilla/mux v1.8.1
|
||||
github.com/rs/cors v1.11.1
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
)
|
||||
|
||||
require github.com/rs/cors v1.11.1 // indirect
|
||||
|
||||
@@ -26,27 +26,27 @@ func NewManager(dataDir string) *Manager {
|
||||
|
||||
// Asset represents a Talos boot asset
|
||||
type Asset struct {
|
||||
Type string `json:"type"` // kernel, initramfs, iso
|
||||
Path string `json:"path"` // Full path to asset file
|
||||
Size int64 `json:"size"` // File size in bytes
|
||||
SHA256 string `json:"sha256"` // SHA256 hash
|
||||
Downloaded bool `json:"downloaded"` // Whether asset exists
|
||||
Type string `json:"type"` // kernel, initramfs, iso
|
||||
Path string `json:"path"` // Full path to asset file
|
||||
Size int64 `json:"size"` // File size in bytes
|
||||
SHA256 string `json:"sha256"` // SHA256 hash
|
||||
Downloaded bool `json:"downloaded"` // Whether asset exists
|
||||
}
|
||||
|
||||
// Schematic represents a Talos schematic and its assets
|
||||
type Schematic struct {
|
||||
SchematicID string `json:"schematic_id"`
|
||||
Version string `json:"version"`
|
||||
Path string `json:"path"`
|
||||
Assets []Asset `json:"assets"`
|
||||
SchematicID string `json:"schematic_id"`
|
||||
Version string `json:"version"`
|
||||
Path string `json:"path"`
|
||||
Assets []Asset `json:"assets"`
|
||||
}
|
||||
|
||||
// AssetStatus represents download status for a schematic
|
||||
type AssetStatus struct {
|
||||
SchematicID string `json:"schematic_id"`
|
||||
Version string `json:"version"`
|
||||
Assets map[string]Asset `json:"assets"`
|
||||
Complete bool `json:"complete"`
|
||||
SchematicID string `json:"schematic_id"`
|
||||
Version string `json:"version"`
|
||||
Assets map[string]Asset `json:"assets"`
|
||||
Complete bool `json:"complete"`
|
||||
}
|
||||
|
||||
// GetAssetDir returns the asset directory for a schematic
|
||||
|
||||
@@ -109,14 +109,14 @@ type InstanceConfig struct {
|
||||
IP string `yaml:"ip" json:"ip"`
|
||||
ExternalResolver string `yaml:"externalResolver" json:"externalResolver"`
|
||||
} `yaml:"dns" json:"dns"`
|
||||
DHCPRange string `yaml:"dhcpRange" json:"dhcpRange"`
|
||||
Dnsmasq struct {
|
||||
DHCPRange string `yaml:"dhcpRange" json:"dhcpRange"`
|
||||
Dnsmasq struct {
|
||||
Interface string `yaml:"interface" json:"interface"`
|
||||
} `yaml:"dnsmasq" json:"dnsmasq"`
|
||||
BaseDomain string `yaml:"baseDomain" json:"baseDomain"`
|
||||
Domain string `yaml:"domain" json:"domain"`
|
||||
InternalDomain string `yaml:"internalDomain" json:"internalDomain"`
|
||||
NFS struct {
|
||||
BaseDomain string `yaml:"baseDomain" json:"baseDomain"`
|
||||
Domain string `yaml:"domain" json:"domain"`
|
||||
InternalDomain string `yaml:"internalDomain" json:"internalDomain"`
|
||||
NFS struct {
|
||||
MediaPath string `yaml:"mediaPath" json:"mediaPath"`
|
||||
Host string `yaml:"host" json:"host"`
|
||||
StorageCapacity string `yaml:"storageCapacity" json:"storageCapacity"`
|
||||
|
||||
@@ -89,11 +89,11 @@ func (g *ConfigGenerator) RestartService() error {
|
||||
|
||||
// ServiceStatus represents the status of the dnsmasq service
|
||||
type ServiceStatus struct {
|
||||
Status string `json:"status"`
|
||||
PID int `json:"pid"`
|
||||
ConfigFile string `json:"config_file"`
|
||||
InstancesConfigured int `json:"instances_configured"`
|
||||
LastRestart time.Time `json:"last_restart"`
|
||||
Status string `json:"status"`
|
||||
PID int `json:"pid"`
|
||||
ConfigFile string `json:"config_file"`
|
||||
InstancesConfigured int `json:"instances_configured"`
|
||||
LastRestart time.Time `json:"last_restart"`
|
||||
}
|
||||
|
||||
// GetStatus checks the status of the dnsmasq service
|
||||
|
||||
@@ -38,13 +38,13 @@ func (k *Kubectl) DeploymentExists(name, namespace string) bool {
|
||||
|
||||
// PodInfo represents pod information from kubectl
|
||||
type PodInfo struct {
|
||||
Name string
|
||||
Status string
|
||||
Ready string
|
||||
Restarts int
|
||||
Age string
|
||||
Node string
|
||||
IP string
|
||||
Name string
|
||||
Status string
|
||||
Ready string
|
||||
Restarts int
|
||||
Age string
|
||||
Node string
|
||||
IP string
|
||||
}
|
||||
|
||||
// DeploymentInfo represents deployment information
|
||||
|
||||
6
main.go
6
main.go
@@ -78,9 +78,9 @@ func main() {
|
||||
// Configure CORS
|
||||
// Default to development origins
|
||||
allowedOrigins := []string{
|
||||
"http://localhost:5173", // Vite dev server
|
||||
"http://localhost:5174", // Alternative port
|
||||
"http://localhost:3000", // Common React dev port
|
||||
"http://localhost:5173", // Vite dev server
|
||||
"http://localhost:5174", // Alternative port
|
||||
"http://localhost:3000", // Common React dev port
|
||||
"http://127.0.0.1:5173",
|
||||
"http://127.0.0.1:5174",
|
||||
"http://127.0.0.1:3000",
|
||||
|
||||
Reference in New Issue
Block a user