]> git.datanom.net - omvzfs.git/blobdiff - src/Utils.php
Support for cloned filesystems and volumes.
[omvzfs.git] / src / Utils.php
index 0f67e369aa79ffe739eeebfd38a9d32c2a4ef4d2..c7049dc752a570042ac2cb799e15db8ea689f2c3 100644 (file)
@@ -185,7 +185,8 @@ class OMVModuleZFSUtil {
                                                "type" => "zfs",
                                                "opts" => "rw,relatime,xattr,noacl",
                                                "freq" => "0",
-                                               "passno" => "0"
+                                               "passno" => "0",
+                                               "hidden" => "1"
                                        );
                                        $xmlConfig->set("//system/fstab",array("mntent" => $object));
                                }
@@ -225,6 +226,7 @@ class OMVModuleZFSUtil {
                                                'expanded'=>$expanded,
                                                'path'=>$path);
                                        $pool = new OMVModuleZFSZpool($path);
+                                       $tmp['origin'] = "n/a";
                                        $tmp['size'] = $pool->getSize();
                                        $tmp['used'] = $pool->getAttribute("allocated");
                                        $tmp['available'] = $pool->getAttribute("free");
@@ -242,12 +244,12 @@ class OMVModuleZFSUtil {
                                        $ds =  new OMVModuleZFSDataset($path);
                                        if ($ds->isClone()) {
                                                //This is a cloned Filesystem
-                                               $tmp['type'] = "Clone";
                                                $tmp['origin'] = $ds->getOrigin();
                                        } else {
                                                //This is a standard Filesystem.
-                                               $tmp['type']= ucfirst($type);
+                                               $tmp['origin'] = "n/a";
                                        }
+                                       $tmp['type']= ucfirst($type);
                                        $tmp['size'] = "n/a";
                                        $used = $ds->getProperty("used");
                                        $tmp['used'] = $used['value'];
@@ -267,7 +269,15 @@ class OMVModuleZFSUtil {
                                        'icon'=>"images/save.png",
                                        'path'=>$path,
                                        'expanded'=>$expanded);
-                               $vol = new OMVModuleZFSZvol();
+                               $vol = new OMVModuleZFSZvol($path);
+                               if ($vol->isClone()) {
+                                       //This is a cloned Volume
+                                       $tmp['origin'] = $vol->getOrigin();
+                               } else {
+                                       //This is a standard Volume
+                                       $tmp['origin'] = "n/a";
+                               }
+                               $tmp['type']= ucfirst($type);
                                $tmp['size'] = $vol->getSize();
                                $tmp['used'] = "n/a";
                                $tmp['available'] = "n/a";
@@ -286,6 +296,7 @@ class OMVModuleZFSUtil {
                                        'icon'=>'images/zfs_snap.png',
                                        'path'=>$path,
                                        'expanded'=>$expanded);
+                               $tmp['origin'] = "n/a";
                                $tmp['size'] = "n/a";
                                $tmp['used'] = "n/a";
                                $tmp['available'] = "n/a";
This page took 0.031663 seconds and 5 git commands to generate.