use cookie over path for namespace
parent
08dfb715d3
commit
44d548c603
|
|
@ -10,10 +10,11 @@ func main() {
|
|||
as := args.NewArgSet()
|
||||
as.Append(args.INT, "p", "port to listen on", 3004)
|
||||
as.Append(args.STRING, "d", "root dir with /index.html and /media and /files", "./public")
|
||||
as.Append(args.BOOL, "ldap", "ldap features", false)
|
||||
if err := as.Parse(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
s := NewServer(as.GetString("d"))
|
||||
s := NewServer(as.GetString("d"), as.GetBool("ldap"))
|
||||
if err := s.Routes(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
<script>
|
||||
function setNamespace() {
|
||||
document.getElementById("namespace").disabled = true
|
||||
window.location.href = `${window.location.protocol}`+"//"+`${window.location.host}/ui/files/${document.getElementById("namespace").value}`
|
||||
document.cookie = "namespace=" + document.getElementById("namespace").value
|
||||
window.location.href = `${window.location.protocol}`+"//"+`${window.location.host}/ui/files`
|
||||
}
|
||||
</script>
|
||||
{{ if .This.Namespaces }}
|
||||
|
|
|
|||
|
|
@ -28,12 +28,14 @@ import (
|
|||
type Server struct {
|
||||
router *router.Router
|
||||
root string
|
||||
ldap bool
|
||||
}
|
||||
|
||||
func NewServer(root string) *Server {
|
||||
func NewServer(root string, ldap bool) *Server {
|
||||
return &Server{
|
||||
router: router.New(),
|
||||
root: root,
|
||||
ldap: ldap,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue