Pārlūkot izejas kodu

Added config text filter

Toby Chui 1 gadu atpakaļ
vecāks
revīzija
0fb3ddec0d
2 mainītis faili ar 6 papildinājumiem un 1 dzēšanām
  1. 6 0
      storage.pool.go
  2. 0 1
      web/SystemAO/storage/fshedit.html

+ 6 - 0
storage.pool.go

@@ -549,6 +549,12 @@ func HandleStoragePoolRemove(w http.ResponseWriter, r *http.Request) {
 func buildOptionFromRequestForm(payload string) (fs.FileSystemOption, error) {
 	newFsOption := fs.FileSystemOption{}
 	err := json.Unmarshal([]byte(payload), &newFsOption)
+
+	//Do data cleaning
+	newFsOption.Name = strings.TrimSpace(newFsOption.Name)
+	newFsOption.Uuid = strings.TrimSpace(newFsOption.Uuid)
+	newFsOption.Path = strings.TrimSpace(newFsOption.Path)
+
 	if err != nil {
 		return fs.FileSystemOption{}, err
 	}

+ 0 - 1
web/SystemAO/storage/fshedit.html

@@ -240,7 +240,6 @@
                         window.location.href = "updateComplete.html#" + targetFSH;
                     }
                 }
-
             });
         }