Updated deps, go.19 migration, nginx template work
This commit is contained in:
@ -139,3 +139,37 @@ func (m *Model) Expand(items []string) error {
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// GetTemplate will convert the Model to a Template
|
||||
func (m *Model) GetTemplate() Template {
|
||||
domainNames, _ := m.DomainNames.AsStringArray()
|
||||
|
||||
t := Template{
|
||||
ID: m.ID,
|
||||
CreatedOn: m.CreatedOn.Time.String(),
|
||||
ModifiedOn: m.ModifiedOn.Time.String(),
|
||||
UserID: m.UserID,
|
||||
Type: m.Type,
|
||||
HostTemplateID: m.HostTemplateID,
|
||||
ListenInterface: m.ListenInterface,
|
||||
DomainNames: domainNames,
|
||||
UpstreamID: m.UpstreamID,
|
||||
CertificateID: m.CertificateID,
|
||||
AccessListID: m.AccessListID,
|
||||
SSLForced: m.SSLForced,
|
||||
CachingEnabled: m.CachingEnabled,
|
||||
BlockExploits: m.BlockExploits,
|
||||
AllowWebsocketUpgrade: m.AllowWebsocketUpgrade,
|
||||
HTTP2Support: m.HTTP2Support,
|
||||
HSTSEnabled: m.HSTSEnabled,
|
||||
HSTSSubdomains: m.HSTSSubdomains,
|
||||
Paths: m.Paths,
|
||||
UpstreamOptions: m.UpstreamOptions,
|
||||
AdvancedConfig: m.AdvancedConfig,
|
||||
Status: m.Status,
|
||||
ErrorMessage: m.ErrorMessage,
|
||||
IsDisabled: m.IsDisabled,
|
||||
}
|
||||
|
||||
return t
|
||||
}
|
||||
|
29
backend/internal/entity/host/template.go
Normal file
29
backend/internal/entity/host/template.go
Normal file
@ -0,0 +1,29 @@
|
||||
package host
|
||||
|
||||
// Template is the model given to the template parser, converted from the Model
|
||||
type Template struct {
|
||||
ID int
|
||||
CreatedOn string
|
||||
ModifiedOn string
|
||||
UserID int
|
||||
Type string
|
||||
HostTemplateID int
|
||||
ListenInterface string
|
||||
DomainNames []string
|
||||
UpstreamID int
|
||||
CertificateID int
|
||||
AccessListID int
|
||||
SSLForced bool
|
||||
CachingEnabled bool
|
||||
BlockExploits bool
|
||||
AllowWebsocketUpgrade bool
|
||||
HTTP2Support bool
|
||||
HSTSEnabled bool
|
||||
HSTSSubdomains bool
|
||||
IsDisabled bool
|
||||
Paths string
|
||||
UpstreamOptions string
|
||||
AdvancedConfig string
|
||||
Status string
|
||||
ErrorMessage string
|
||||
}
|
Reference in New Issue
Block a user