Formatting.

This commit is contained in:
2025-10-14 07:13:00 +00:00
parent afb0e09aae
commit 2fd71c32dc
6 changed files with 35 additions and 36 deletions

3
go.mod
View File

@@ -4,7 +4,6 @@ go 1.24
require ( require (
github.com/gorilla/mux v1.8.1 github.com/gorilla/mux v1.8.1
github.com/rs/cors v1.11.1
gopkg.in/yaml.v3 v3.0.1 gopkg.in/yaml.v3 v3.0.1
) )
require github.com/rs/cors v1.11.1 // indirect

View File

@@ -26,27 +26,27 @@ func NewManager(dataDir string) *Manager {
// Asset represents a Talos boot asset // Asset represents a Talos boot asset
type Asset struct { type Asset struct {
Type string `json:"type"` // kernel, initramfs, iso Type string `json:"type"` // kernel, initramfs, iso
Path string `json:"path"` // Full path to asset file Path string `json:"path"` // Full path to asset file
Size int64 `json:"size"` // File size in bytes Size int64 `json:"size"` // File size in bytes
SHA256 string `json:"sha256"` // SHA256 hash SHA256 string `json:"sha256"` // SHA256 hash
Downloaded bool `json:"downloaded"` // Whether asset exists Downloaded bool `json:"downloaded"` // Whether asset exists
} }
// Schematic represents a Talos schematic and its assets // Schematic represents a Talos schematic and its assets
type Schematic struct { type Schematic struct {
SchematicID string `json:"schematic_id"` SchematicID string `json:"schematic_id"`
Version string `json:"version"` Version string `json:"version"`
Path string `json:"path"` Path string `json:"path"`
Assets []Asset `json:"assets"` Assets []Asset `json:"assets"`
} }
// AssetStatus represents download status for a schematic // AssetStatus represents download status for a schematic
type AssetStatus struct { type AssetStatus struct {
SchematicID string `json:"schematic_id"` SchematicID string `json:"schematic_id"`
Version string `json:"version"` Version string `json:"version"`
Assets map[string]Asset `json:"assets"` Assets map[string]Asset `json:"assets"`
Complete bool `json:"complete"` Complete bool `json:"complete"`
} }
// GetAssetDir returns the asset directory for a schematic // GetAssetDir returns the asset directory for a schematic

View File

@@ -109,14 +109,14 @@ type InstanceConfig struct {
IP string `yaml:"ip" json:"ip"` IP string `yaml:"ip" json:"ip"`
ExternalResolver string `yaml:"externalResolver" json:"externalResolver"` ExternalResolver string `yaml:"externalResolver" json:"externalResolver"`
} `yaml:"dns" json:"dns"` } `yaml:"dns" json:"dns"`
DHCPRange string `yaml:"dhcpRange" json:"dhcpRange"` DHCPRange string `yaml:"dhcpRange" json:"dhcpRange"`
Dnsmasq struct { Dnsmasq struct {
Interface string `yaml:"interface" json:"interface"` Interface string `yaml:"interface" json:"interface"`
} `yaml:"dnsmasq" json:"dnsmasq"` } `yaml:"dnsmasq" json:"dnsmasq"`
BaseDomain string `yaml:"baseDomain" json:"baseDomain"` BaseDomain string `yaml:"baseDomain" json:"baseDomain"`
Domain string `yaml:"domain" json:"domain"` Domain string `yaml:"domain" json:"domain"`
InternalDomain string `yaml:"internalDomain" json:"internalDomain"` InternalDomain string `yaml:"internalDomain" json:"internalDomain"`
NFS struct { NFS struct {
MediaPath string `yaml:"mediaPath" json:"mediaPath"` MediaPath string `yaml:"mediaPath" json:"mediaPath"`
Host string `yaml:"host" json:"host"` Host string `yaml:"host" json:"host"`
StorageCapacity string `yaml:"storageCapacity" json:"storageCapacity"` StorageCapacity string `yaml:"storageCapacity" json:"storageCapacity"`

View File

@@ -89,11 +89,11 @@ func (g *ConfigGenerator) RestartService() error {
// ServiceStatus represents the status of the dnsmasq service // ServiceStatus represents the status of the dnsmasq service
type ServiceStatus struct { type ServiceStatus struct {
Status string `json:"status"` Status string `json:"status"`
PID int `json:"pid"` PID int `json:"pid"`
ConfigFile string `json:"config_file"` ConfigFile string `json:"config_file"`
InstancesConfigured int `json:"instances_configured"` InstancesConfigured int `json:"instances_configured"`
LastRestart time.Time `json:"last_restart"` LastRestart time.Time `json:"last_restart"`
} }
// GetStatus checks the status of the dnsmasq service // GetStatus checks the status of the dnsmasq service

View File

@@ -38,13 +38,13 @@ func (k *Kubectl) DeploymentExists(name, namespace string) bool {
// PodInfo represents pod information from kubectl // PodInfo represents pod information from kubectl
type PodInfo struct { type PodInfo struct {
Name string Name string
Status string Status string
Ready string Ready string
Restarts int Restarts int
Age string Age string
Node string Node string
IP string IP string
} }
// DeploymentInfo represents deployment information // DeploymentInfo represents deployment information

View File

@@ -78,9 +78,9 @@ func main() {
// Configure CORS // Configure CORS
// Default to development origins // Default to development origins
allowedOrigins := []string{ allowedOrigins := []string{
"http://localhost:5173", // Vite dev server "http://localhost:5173", // Vite dev server
"http://localhost:5174", // Alternative port "http://localhost:5174", // Alternative port
"http://localhost:3000", // Common React dev port "http://localhost:3000", // Common React dev port
"http://127.0.0.1:5173", "http://127.0.0.1:5173",
"http://127.0.0.1:5174", "http://127.0.0.1:5174",
"http://127.0.0.1:3000", "http://127.0.0.1:3000",