feat: add HTTP file server with beautiful file browser UI
This commit is contained in:
+6
-2
@@ -136,13 +136,17 @@ func (s *Server) handleLogout(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
func (s *Server) handleStatus(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
json.NewEncoder(w).Encode(map[string]interface{}{
|
||||
data := map[string]interface{}{
|
||||
"status": "running",
|
||||
"ftpPort": s.config.FTP.Port,
|
||||
"webPort": s.config.Web.Port,
|
||||
"rootDir": s.config.FTP.RootDir,
|
||||
"userCount": len(s.config.GetFTPUsers()),
|
||||
})
|
||||
}
|
||||
if s.config.HTTPFile.Enable {
|
||||
data["httpFilePort"] = s.config.HTTPFile.Port
|
||||
}
|
||||
json.NewEncoder(w).Encode(data)
|
||||
}
|
||||
|
||||
func (s *Server) handleUsers(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Reference in New Issue
Block a user