[pve-devel] [PATCH v2 manager 1/4] parser: perform mountpoint classification

Wolfgang Bumiller w.bumiller at proxmox.com
Tue Feb 23 15:00:19 CET 2016


---
 www/manager/Parser.js | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/www/manager/Parser.js b/www/manager/Parser.js
index 550e2aa..68a6b70 100644
--- a/www/manager/Parser.js
+++ b/www/manager/Parser.js
@@ -307,6 +307,16 @@ Ext.define('PVE.Parser', { statics: {
 	    return;
 	}
 
+	var m = res.file.match(/^([a-z][a-z0-9\-\_\.]*[a-z0-9]):/);
+	if (m) {
+	    res.storage = m[1];
+	    res.type = 'volume';
+	} else if (res.file.match(/^\/dev\//)) {
+	    res.type = 'device';
+	} else {
+	    res.type = 'bind';
+	}
+
 	return res;
     },
 
@@ -314,7 +324,8 @@ Ext.define('PVE.Parser', { statics: {
 	var drivestr = mp.file;
 
 	Ext.Object.each(mp, function(key, value) {
-	    if (!Ext.isDefined(value) || key === 'file') {
+	    if (!Ext.isDefined(value) || key === 'file' ||
+		key === 'type' || key === 'storage') {
 		return; // continue
 	    }
 	    drivestr += ',' + key + '=' + value;
-- 
2.1.4





More information about the pve-devel mailing list