mirror of
https://github.com/minio/minio.git
synced 2025-11-21 10:16:03 -05:00
refactor: refactor code to separate fs into object-layer and fs layer. (#1305)
This commit is contained in:
committed by
Harshavardhana
parent
188bb92d8a
commit
3c48537f20
@@ -107,15 +107,16 @@ type DiskInfoRep struct {
|
||||
|
||||
// DiskInfo - get disk statistics.
|
||||
func (web *webAPI) DiskInfo(r *http.Request, args *WebGenericArgs, reply *DiskInfoRep) error {
|
||||
if !isJWTReqAuthenticated(r) {
|
||||
return &json2.Error{Message: "Unauthorized request"}
|
||||
}
|
||||
info, e := disk.GetInfo(web.ObjectAPI.(*Filesystem).GetRootPath())
|
||||
if e != nil {
|
||||
return &json2.Error{Message: e.Error()}
|
||||
}
|
||||
reply.DiskInfo = info
|
||||
reply.UIVersion = miniobrowser.UIVersion
|
||||
// FIXME: bring in StatFS in StorageAPI interface and uncomment the below lines.
|
||||
// if !isJWTReqAuthenticated(r) {
|
||||
// return &json2.Error{Message: "Unauthorized request"}
|
||||
// }
|
||||
// info, e := disk.GetInfo(web.ObjectAPI.(*Filesystem).GetRootPath())
|
||||
// if e != nil {
|
||||
// return &json2.Error{Message: e.Error()}
|
||||
// }
|
||||
// reply.DiskInfo = info
|
||||
// reply.UIVersion = miniobrowser.UIVersion
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -212,7 +213,7 @@ func (web *webAPI) ListObjects(r *http.Request, args *ListObjectsArgs, reply *Li
|
||||
for _, obj := range lo.Objects {
|
||||
reply.Objects = append(reply.Objects, WebObjectInfo{
|
||||
Key: obj.Name,
|
||||
LastModified: obj.ModifiedTime,
|
||||
LastModified: obj.ModTime,
|
||||
Size: obj.Size,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user