|
@@ -2263,33 +2263,22 @@ func system_fs_listRoot(w http.ResponseWriter, r *http.Request) {
|
|
|
common.SendJSONResponse(w, string(jsonString))
|
|
|
} else {
|
|
|
type rootObject struct {
|
|
|
- rootID string //The vroot id
|
|
|
- RootName string //The name of this vroot
|
|
|
- RootPath string //The path of this vroot
|
|
|
- RootBackups bool //If there are backup for this vroot
|
|
|
+ rootID string //The vroot id
|
|
|
+ RootName string //The name of this vroot
|
|
|
+ RootPath string //The path of this vroot
|
|
|
+ BufferedFs bool //If buffer typed FS
|
|
|
}
|
|
|
|
|
|
roots := []*rootObject{}
|
|
|
- backupRoots := []string{}
|
|
|
for _, store := range userinfo.GetAllFileSystemHandler() {
|
|
|
var thisDevice = new(rootObject)
|
|
|
thisDevice.RootName = store.Name
|
|
|
thisDevice.RootPath = store.UUID + ":/"
|
|
|
thisDevice.rootID = store.UUID
|
|
|
+ thisDevice.BufferedFs = store.RequireBuffer
|
|
|
roots = append(roots, thisDevice)
|
|
|
}
|
|
|
|
|
|
- //Update root configs for backup roots
|
|
|
- for _, backupRoot := range backupRoots {
|
|
|
- //For this backup root, check if the parent root mounted
|
|
|
- for _, root := range roots {
|
|
|
- if root.rootID == backupRoot {
|
|
|
- //Parent root mounted. Label the parent root as "have backup"
|
|
|
- root.RootBackups = true
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
jsonString, _ := json.Marshal(roots)
|
|
|
common.SendJSONResponse(w, string(jsonString))
|
|
|
}
|