Commit e03c739f authored by Thomas Lamprecht's avatar Thomas Lamprecht Committed by Dietmar Maurer

Add CT service support and remove type parameter

The type parameter is not needed anymore because the service type
can be extracted by only using the unique vmid.
Signed-off-by: 's avatarThomas Lamprecht <t.lamprecht@proxmox.com>
parent 8e703e48
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;
}
......@@ -88,7 +86,7 @@ Ext.define('PVE.ha.VMResourceEdit', {
me.url = '/api2/extjs/cluster/ha/resources';
me.method = 'POST';
} else {
me.url = '/api2/extjs/cluster/ha/resources/vm:' + me.vmid;
me.url = '/api2/extjs/cluster/ha/resources/' + me.vmid;
me.method = 'PUT';
}
......@@ -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];
......
......@@ -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'
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment