Files
nginx-ui/model/site.go
Nemer Y Tamimi 93b10d7759 feat: Integrate DNS record management into site configuration (#1519)
* feat: Integrate DNS record management into site configuration

- Removed the 'External Notification Test' notification.
- Enhanced SiteAdd.vue to include DNS record integration, allowing users to select or create DNS records linked to the site.
- Added DNSRecordIntegration component for managing DNS records, including selection and creation of new records.
- Implemented DNS linking functionality in the RightPanel component, enabling users to link existing DNS records to their site configuration.
- Updated SiteEditor to provide DNS link status to child components.
- Extended the site model to include fields for linked DNS domain and record information.
- Added logic to handle DNS record recreation if a linked record is missing.

* fix: remove unnecessary type assertion for selectedDomainId and selectedRecordId

* feat: add computed properties for selectedDomainId and selectedRecordId to handle null values

* refactor: simplify setter syntax for computed properties of selectedDomainId and selectedRecordId

* fix: update computed properties to return undefined for null values in selectedDomainId and selectedRecordId

---------

Co-authored-by: Nemer Tamimi <nemer.tamimi@uopeople.edu>
2026-01-14 13:35:03 +08:00

31 lines
1.1 KiB
Go

package model
type Site struct {
Model
Path string `json:"path" gorm:"uniqueIndex"`
Advanced bool `json:"advanced"`
NamespaceID uint64 `json:"namespace_id"`
Namespace *Namespace `json:"namespace,omitempty"`
SyncNodeIDs []uint64 `json:"sync_node_ids" gorm:"serializer:json"`
DNSDomainID *int `json:"dns_domain_id"` // Linked DNS domain ID
DNSRecordID *string `json:"dns_record_id"` // Linked DNS record ID
DNSRecordName *string `json:"dns_record_name"` // Cached DNS record name
DNSRecordType *string `json:"dns_record_type"` // Cached DNS record type (A, AAAA, CNAME)
DNSRecordExists *bool `json:"dns_record_exists"` // Whether the DNS record still exists
}
// GetPath implements ConfigEntity interface
func (s *Site) GetPath() string {
return s.Path
}
// GetNamespaceID implements ConfigEntity interface
func (s *Site) GetNamespaceID() uint64 {
return s.NamespaceID
}
// GetNamespace implements ConfigEntity interface
func (s *Site) GetNamespace() *Namespace {
return s.Namespace
}