Search results slightly prettier

This commit is contained in:
Henrique Dias committed 2017-08-04 16:15:07 +01:00
1 parent 1234ee32e4
commit 522d50333f
4 files changed
+30 -2323

No files matched your search

+7 -1
View File
@@ -2,6 +2,7 @@ package filemanager
import (
"bytes"
"encoding/json"
"mime"
"net/http"
"os"
@@ -321,7 +322,12 @@ func search(c *RequestContext, w http.ResponseWriter, r *http.Request) (int, err
}
}
return conn.WriteMessage(websocket.TextMessage, []byte(path))
response, _ := json.Marshal(map[string]interface{}{
"dir": f.IsDir(),
"path": path,
})
return conn.WriteMessage(websocket.TextMessage, response)
})
if err != nil {