2017-09-26 12:50:09 +00:00
{ { extends "../../_layouts/default" } }
{ { import "../../_modules/pager" } }
{ { import "../../_modules/form" } }
{ { block script ( ) } }
< script > $ ( ( ) = > new Swirl . Setting . IndexPage ( ) ) < / script >
{ { end } }
{ { block body ( ) } }
< section class = "hero is-dark" >
< div class = "hero-body" >
< div class = "container has-text-centered" >
2017-10-12 09:30:21 +00:00
< h1 class = "title is-2 is-uppercase" > { { i18n ( "setting.title" ) } } < / h1 >
< h2 class = "subtitle is-5" > { { i18n ( "setting.description" ) } } < / h2 >
2017-09-26 12:50:09 +00:00
< / div >
< / div >
< div class = "hero-foot" >
< div class = "container" >
< nav class = "tabs is-boxed" >
< ul >
< li >
2017-10-12 09:30:21 +00:00
< a href = "/system/role/" > { { i18n ( "menu.role" ) } } < / a >
2017-09-26 12:50:09 +00:00
< / li >
< li >
2017-10-12 09:30:21 +00:00
< a href = "/system/user/" > { { i18n ( "menu.user" ) } } < / a >
2017-09-26 12:50:09 +00:00
< / li >
2018-04-16 12:47:20 +00:00
< li >
< a href = "/system/chart/" > { { i18n ( "menu.chart" ) } } < / a >
< / li >
2017-09-26 12:50:09 +00:00
< li class = "is-active" >
2017-10-12 09:30:21 +00:00
< a href = "/system/setting/" > { { i18n ( "menu.setting" ) } } < / a >
2017-09-26 12:50:09 +00:00
< / li >
< li >
2017-10-12 09:30:21 +00:00
< a href = "/system/event/" > { { i18n ( "menu.event" ) } } < / a >
2018-03-22 08:13:54 +00:00
< / li >
2017-09-26 12:50:09 +00:00
< / ul >
< / nav >
< / div >
< / div >
< / section >
< section class = "section" >
< div class = "container" >
< form method = "post" data - form = "ajax-json" data - message = "The settings have been successfully modified" >
2017-11-13 10:16:16 +00:00
< fieldset id = "fs-zone" >
< legend class = "lead is-5 is-bordered" > Time zone and language < / legend >
< div class = "field is-horizontal" >
< div class = "field-label is-normal" >
< label class = "label" > Time zone < / label >
< / div >
< div class = "field-body" >
< div class = "field has-addons" >
< div class = "control has-icons-left" >
2017-11-22 03:38:24 +00:00
< div class = "select" >
< select name = "tz.name" >
{ { offset := . Setting . TimeZone . Offset } }
{ { range . TimeZones } }
< option value = "{{ .Name }}" { { if offset == . Offset } } selected { { end } } > { { . Name } } < / option >
{ { end } }
< / select >
< / div >
2017-11-13 10:16:16 +00:00
< div class = "icon is-left" >
2018-01-26 05:10:38 +00:00
< i class = "fas fa-globe" > < / i >
2017-11-13 10:16:16 +00:00
< / div >
< / div >
< / div >
< / div >
< / div >
< div class = "field is-horizontal" >
< div class = "field-label is-normal" >
< label class = "label" > Language < / label >
< / div >
< div class = "field-body" >
< div class = "control has-icons-left" >
< div class = "select" >
< select name = "lang" >
{ { yield option ( value = "en" , label = "English" , selected = . Setting . Language ) } }
{ { yield option ( value = "zh" , label = "中文" , selected = . Setting . Language ) } }
< / select >
< / div >
< div class = "icon is-left" >
2018-01-26 05:10:38 +00:00
< i class = "fas fa-language" > < / i >
2017-11-13 10:16:16 +00:00
< / div >
< / div >
< / div >
< / div >
< / fieldset >
2017-09-26 12:50:09 +00:00
< fieldset id = "fs-ldap" >
< legend class = "lead is-5 is-bordered" > LDAP < / legend >
< div class = "field is-horizontal" >
< div class = "field-label is-normal" >
{ * < label class = "label" > Enabled < / label > * }
< / div >
< div class = "field-body" >
< div class = "field" >
< div class = "control" >
{ { yield switch ( id = "ldap-enabled" , name = "ldap.enabled" , label = "Enabled" , checked = . Setting . LDAP . Enabled ) } }
< / div >
< / div >
< / div >
< / div >
< div class = "field is-horizontal" >
< div class = "field-label is-normal" >
2017-10-16 12:49:09 +00:00
< label class = "label" > { { i18n ( "field.address" ) } } < / label >
2017-09-26 12:50:09 +00:00
< / div >
< div class = "field-body" >
< div class = "field" >
< div class = "control" >
2017-10-16 12:49:09 +00:00
< input name = "ldap.address" value = "{{ .Setting.LDAP.Address }}" class = "input" type = "text" placeholder = "e.g. 127.0.0.1:389" >
2017-09-26 12:50:09 +00:00
< / div >
< / div >
< / div >
< / div >
< div class = "field is-horizontal" >
< div class = "field-label is-normal" >
2017-11-09 09:16:18 +00:00
< label class = "label" > Security < / label >
2017-09-26 12:50:09 +00:00
< / div >
< div class = "field-body" >
< div class = "field" >
< div class = "control" >
2017-11-09 09:16:18 +00:00
{ { yield radio ( id = "ldap.security-none" , name = "ldap.security" , value = "0" , label = "None" , checked = . Setting . LDAP . Security ) content } } data - type = "integer" { { end } }
2017-11-13 10:49:00 +00:00
{ { yield radio ( id = "ldap.security-tls" , name = "ldap.security" , value = "1" , label = "TLS" , checked = . Setting . LDAP . Security ) content } } data - type = "integer" { { end } }
{ { yield radio ( id = "ldap.security-starttls" , name = "ldap.security" , value = "2" , label = "StartTLS" , checked = . Setting . LDAP . Security ) content } } data - type = "integer" { { end } }
2017-09-26 12:50:09 +00:00
< / div >
< / div >
< / div >
< / div >
< div class = "field is-horizontal" >
< div class = "field-label is-normal" >
2017-11-09 09:16:18 +00:00
< label class = "label" > Authentication < / label >
2017-09-26 12:50:09 +00:00
< / div >
< div class = "field-body" >
< div class = "field" >
< div class = "control" >
2017-11-09 09:16:18 +00:00
{ { yield radio ( id = "ldap-auth-simple" , name = "ldap.auth" , value = "0" , label = "Simple" , checked = . Setting . LDAP . Authentication ) content } } data - type = "integer" { { end } }
2017-11-13 10:16:16 +00:00
{ { yield radio ( id = "ldap-auth-bind" , name = "ldap.auth" , value = "1" , label = "Bind" , checked = . Setting . LDAP . Authentication ) content } } data - type = "integer" { { end } }
2017-11-09 09:16:18 +00:00
< / div >
< / div >
< / div >
< / div >
< div id = "div-auth-simple" class = "field is-horizontal" { { if . Setting . LDAP . Authentication == 1 } } style = "display: none" { { end } } >
< div class = "field-label is-normal" >
< label class = "label" > User DN < / label >
< / div >
< div class = "field-body" >
< div class = "field" >
< div class = "control" >
2017-11-13 10:16:16 +00:00
< input name = "ldap.user_dn" value = "{{ .Setting.LDAP.UserDN }}" class = "input" type = "text" placeholder = "User DN template for direct binding, e.g. cn=%s,dc=xxx,dc=com" >
2017-11-09 09:16:18 +00:00
< / div >
< / div >
< / div >
< / div >
< div id = "div-auth-bind" class = "field is-horizontal" { { if . Setting . LDAP . Authentication == 0 } } style = "display: none" { { end } } >
< div class = "field-label is-normal" >
2017-11-13 10:16:16 +00:00
< label class = "label" > Bind account < / label >
2017-11-09 09:16:18 +00:00
< / div >
< div class = "field-body" >
< div class = "field has-addons" >
< p class = "control" >
< a class = "button is-static" > DN < / a >
< / p >
< div class = "control is-expanded" >
< input name = "ldap.bind_dn" value = "{{ .Setting.LDAP.BindDN }}" class = "input" type = "text" placeholder = "e.g. cn=search,dc=xxx,dc=com" >
< / div >
< / div >
< div class = "field has-addons" >
< p class = "control" >
< a class = "button is-static" > Password < / a >
< / p >
< div class = "control is-expanded" >
< input name = "ldap.bind_pwd" value = "{{ .Setting.LDAP.BindPassword }}" class = "input" type = "password" autocomplete = "new-password" placeholder = "Bind DN password" >
2017-09-26 12:50:09 +00:00
< / div >
< / div >
< / div >
< / div >
< div class = "field is-horizontal" >
< div class = "field-label is-normal" >
2017-11-09 09:16:18 +00:00
< label class = "label" > Base DN < / label >
2017-09-26 12:50:09 +00:00
< / div >
< div class = "field-body" >
< div class = "field" >
< div class = "control" >
2017-11-13 10:16:16 +00:00
< input name = "ldap.base_dn" value = "{{ .Setting.LDAP.BaseDN }}" class = "input" type = "text" placeholder = "Base DN for searching user, e.g. dc=xxx,dc=com" >
2017-11-09 09:16:18 +00:00
< / div >
< / div >
< / div >
< / div >
< div class = "field is-horizontal" >
< div class = "field-label is-normal" >
< label class = "label" > User filter < / label >
< / div >
< div class = "field-body" >
< div class = "field" >
< div class = "control" >
< input name = "ldap.user_filter" value = "{{ .Setting.LDAP.UserFilter }}" class = "input" type = "text" placeholder = "e.g. (&(objectClass=organizationalPerson)(sAMAccountName=%s))" >
< / div >
< / div >
< / div >
< / div >
< div class = "field is-horizontal" >
< div class = "field-label is-normal" >
< label class = "label" > Attributes < / label >
< / div >
< div class = "field-body" >
< div class = "field has-addons" >
< p class = "control" >
< a class = "button is-static" > Username < / a >
< / p >
< div class = "control is-expanded" >
< input name = "ldap.name_attr" value = "{{ .Setting.LDAP.NameAttr }}" class = "input" type = "text" placeholder = "e.g. displayName" >
< / div >
< / div >
< div class = "field has-addons" >
< p class = "control" >
< a class = "button is-static" > Email < / a >
< / p >
< div class = "control is-expanded" >
2017-10-16 12:49:09 +00:00
< input name = "ldap.email_attr" value = "{{ .Setting.LDAP.EmailAttr }}" class = "input" type = "text" placeholder = "e.g. mail" >
2017-09-26 12:50:09 +00:00
< / div >
< / div >
< / div >
< / div >
< / fieldset >
2018-03-09 11:00:03 +00:00
< fieldset id = "fs-metrics" >
< legend class = "lead is-5 is-bordered" > Metrics < / legend >
< div class = "field is-horizontal" >
< div class = "field-label is-normal" >
< label class = "label" > Prometheus address < / label >
< / div >
< div class = "field-body" >
< div class = "field" >
< div class = "control" >
< input name = "metrics.prometheus" value = "{{ .Setting.Metrics.Prometheus }}" class = "input" type = "text" placeholder = "e.g. http://prometheus.xxx.com" >
< / div >
< / div >
< / div >
< / div >
< / fieldset >
2017-09-26 12:50:09 +00:00
< hr >
< div class = "field" >
< p class = "control" >
2017-10-16 12:49:09 +00:00
< button class = "button is-primary" type = "submit" > { { i18n ( "button.save" ) } } < / button >
2017-09-26 12:50:09 +00:00
< / p >
< / div >
2018-03-09 11:00:03 +00:00
< div class = "notification is-info" >
NOTICE : To activate modifications , you must restart swirl .
< / div >
2017-09-26 12:50:09 +00:00
< / form >
< / div >
< / section >
{ { end } }