package templates import "git.jmbit.de/jmb/goipam/db" import "fmt" templ SubnetDetails(metaContent MetaContent, title string, subnet *db.Subnet) { @wrapBase(metaContent, title) { @subnetMain(subnet) } } templ subnetMain(subnet *db.Subnet) {
@SubnetStatic(subnet)
} templ SubnetStatic(subnet *db.Subnet) {
{ subnet.Name }
{ subnet.DisplayName }
{ fmt.Sprint(subnet.VLAN) }
{ subnet.IPv4Net }
{ subnet.IPv6Net }
{ subnet.Location().Name }
{ fmt.Sprint(subnet.VLAN) }
} templ SubnetForm(subnet *db.Subnet) {
@formField("Name", "text", "name", subnet.Name) @formField("Display Name", "text", "display-name", subnet.DisplayName) @formField("VLAN", "number", "vlan", fmt.Sprint(subnet.VLAN)) @formField("IPv4 Network Address", "text", "ipv4", subnet.IPv4Net) @formField("IPv6 Network Address", "text", "ipv6", subnet.IPv6Net)
{ subnet.Location().Name }
@formField("Comment", "text", "comment", subnet.Comment)
}