2020-11-06 12:21:47 +01:00
< nav class = "navbar navbar-expand-lg navbar-dark bg-primary" >
2021-02-08 22:56:02 +01:00
< button class = "navbar-toggler" type = "button" data-toggle = "collapse" data-target = "#topNavbar" aria-controls = "topNavbar" aria-expanded = "false" aria-label = "Toggle navigation" >
2020-11-06 12:21:47 +01:00
< span class = "navbar-toggler-icon" ></ span >
</ button >
2020-11-10 09:31:02 +01:00
< a class = "navbar-brand" href = "/" >< img src = "{{$.Static.WebsiteLogo}}" alt = "{{$.Static.CompanyName}}" /></ a >
2020-11-06 12:21:47 +01:00
< div id = "topNavbar" class = "navbar-collapse collapse" >
< ul class = "navbar-nav mr-auto mt-2 mt-lg-0" >
< li class = "nav-spacer" ></ li >
2021-02-24 21:24:45 +01:00
{{with eq $.Session.LoggedIn true}}{{with eq $.Session.IsAdmin true}}
{{with eq $.Route "/admin/"}}
2020-11-09 20:26:34 +01:00
< form class = "form-inline my-2 my-lg-0" method = "get" >
2021-02-24 21:24:45 +01:00
< input class = "form-control mr-sm-2" name = "search" type = "search" placeholder = "Search" aria-label = "Search" value = "{{index $.Session.Search " peers "}}" >
2020-11-06 12:21:47 +01:00
< button class = "btn btn-outline-success my-2 my-sm-0" type = "submit" >< i class = "fa fa-search" ></ i ></ button >
</ form >
2021-02-24 21:24:45 +01:00
{{end}}
{{with eq $.Route "/admin/users/"}}
< form class = "form-inline my-2 my-lg-0" method = "get" >
< input class = "form-control mr-sm-2" name = "search" type = "search" placeholder = "Search" aria-label = "Search" value = "{{index $.Session.Search " users "}}" >
< button class = "btn btn-outline-success my-2 my-sm-0" type = "submit" >< i class = "fa fa-search" ></ i ></ button >
</ form >
{{end}}
{{end}}{{end}}
2020-11-06 12:21:47 +01:00
</ ul >
2021-03-21 12:36:11 +01:00
{{with eq $.Session.LoggedIn true}}{{with eq $.Session.IsAdmin true}}
{{with startsWith $.Route "/admin/"}}
< form class = "form-inline my-2 my-lg-0" method = "get" >
< div class = "form-group mr-sm-2" >
< select name = "device" id = "inputDevice" class = "form-control device-selector" >
2021-04-05 19:12:27 +02:00
{{range $d, $dn := $.DeviceNames}}
< option value = "{{$d}}" {{ if eq $ d $. Session . DeviceName }} selected {{ end }} > {{$d}} {{if and (ne $dn "") (ne $d $dn)}}({{$dn}}){{end}}</ option >
2021-03-21 12:36:11 +01:00
{{end}}
</ select >
</ div >
</ form >
{{end}}
{{end}}{{end}}
2020-11-06 12:21:47 +01:00
{{if eq $.Session.LoggedIn true}}
< div class = "nav-item dropdown" >
< a href = "#" class = "navbar-text dropdown-toggle" data-toggle = "dropdown" > {{$.Session.Firstname}} {{$.Session.Lastname}} < span class = "caret" ></ span ></ a >
< div class = "dropdown-menu" >
{{with eq $.Session.LoggedIn true}}{{with eq $.Session.IsAdmin true}}
2021-02-24 21:24:45 +01:00
< a class = "dropdown-item" href = "/admin/" >< i class = "fas fa-cogs" ></ i > Administration</ a >
< a class = "dropdown-item" href = "/admin/users/" >< i class = "fas fa-users-cog" ></ i > User Management</ a >
2020-11-06 12:21:47 +01:00
< div class = "dropdown-divider" ></ div >
{{end}}{{end}}
2020-11-09 23:24:14 +01:00
< a class = "dropdown-item" href = "/user/profile" >< i class = "fas fa-user" ></ i > Profile</ a >
2020-11-06 12:21:47 +01:00
< div class = "dropdown-divider" ></ div >
2020-11-10 09:31:02 +01:00
< a class = "dropdown-item" href = "/auth/logout" >< i class = "fas fa-sign-out-alt" ></ i > Logout</ a >
2020-11-06 12:21:47 +01:00
</ div >
</ div >
{{else}}
2020-11-10 09:31:02 +01:00
< a href = "/auth/login" class = "navbar-text" >< i class = "fas fa-sign-in-alt fa-sm fa-fw mr-2 text-gray-400" ></ i > Login</ a ></ li >
2020-11-06 12:21:47 +01:00
{{end}}
</ div > <!--/.navbar-collapse -->
</ nav >
{{if not $.Device.IsValid}}
< div class = "container" >
2021-03-21 12:36:11 +01:00
< div class = "alert alert-danger" > Warning: WireGuard Interface {{$.Device.DeviceName}} is not fully configured! Configurations may be incomplete and non functional!</ div >
2020-11-06 12:21:47 +01:00
</ div >
{{end}}