[pve-devel] [PATCH] Add CT service support and remove type parameter

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Sep 1 12:07:05 CEST 2015


The type parameter is not needed anymore because the service type
can be extracted by only using the unique vmid.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 www/manager/ha/ResourceEdit.js | 6 ++----
 www/manager/ha/Resources.js    | 4 ++--
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/www/manager/ha/ResourceEdit.js b/www/manager/ha/ResourceEdit.js
index 8c57360..ea0939d 100644
--- a/www/manager/ha/ResourceEdit.js
+++ b/www/manager/ha/ResourceEdit.js
@@ -1,15 +1,13 @@
 Ext.define('PVE.ha.VMResourceInputPanel', {
     extend: 'PVE.panel.InputPanel',
 
-    // only usable to type 'vm'
-    
+
     vmid: undefined,
     
     onGetValues: function(values) {
 	var me = this;
 
 	if (me.create) {
-	    values.type = 'vm';
 	    values.sid = values.vmid;
 	}
 	
@@ -118,7 +116,7 @@ Ext.define('PVE.ha.VMResourceEdit', {
 		    var regex =  /^(\S+):(\S+)$/;
 		    var res = regex.exec(values.sid);
 
-		    if (res[1] !== 'vm') { throw "got unexpected resource type"; };
+		  if (res[1] !== 'vm' && res[1] !== 'ct') { throw "got unexpected resource type"; };
 
 		    values.vmid = res[2];
 		    
diff --git a/www/manager/ha/Resources.js b/www/manager/ha/Resources.js
index 6d6e97c..a8212bd 100644
--- a/www/manager/ha/Resources.js
+++ b/www/manager/ha/Resources.js
@@ -44,7 +44,7 @@ Ext.define('PVE.ha.ResourcesView', {
 	    var regex =  /^(\S+):(\S+)$/;
 	    var res = regex.exec(sid);
 
-	    if (res[1] !== 'vm') { return; };
+	  if (res[1] !== 'vm' && res[1] !== 'ct') { return; };
 	    
 	    var vmid = res[2];
 	    
@@ -146,7 +146,7 @@ Ext.define('PVE.ha.ResourcesView', {
     Ext.define('pve-ha-resources', {
 	extend: 'Ext.data.Model',
 	fields: [ 
-	    'sid', 'type', 'state', 'digest', 'errors', 'group', 'comment'
+	  'sid', 'state', 'digest', 'errors', 'group', 'comment'
 	],
 	idProperty: 'sid'
     });
-- 
2.1.4




More information about the pve-devel mailing list