mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
CS-13091: Remove enable/disable physical network actions
Due to limitations in the API, for now the enable/disable functionality for physical networks will be removed.
This commit is contained in:
parent
66c6d1ceba
commit
0753b1035f
@ -1827,81 +1827,7 @@
|
|||||||
notification: {
|
notification: {
|
||||||
poll: pollAsyncJobResult
|
poll: pollAsyncJobResult
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
enable: {
|
|
||||||
label: 'label.action.enable.physical.network',
|
|
||||||
messages: {
|
|
||||||
confirm: function(args) {
|
|
||||||
return 'message.action.enable.physical.network';
|
|
||||||
},
|
|
||||||
notification: function(args) {
|
|
||||||
return 'label.action.enable.physical.network';
|
|
||||||
}
|
|
||||||
},
|
|
||||||
action: function(args) {
|
|
||||||
$.ajax({
|
|
||||||
url: createURL('updatePhysicalNetwork'),
|
|
||||||
data: {
|
|
||||||
id: args.context.physicalNetworks[0].id,
|
|
||||||
state: 'Enabled'
|
|
||||||
},
|
|
||||||
success: function(json) {
|
|
||||||
args.response.success({
|
|
||||||
_custom: {
|
|
||||||
jobId: json.updatephysicalnetworkresponse.jobid,
|
|
||||||
getUpdatedItem: function(json) {
|
|
||||||
return {
|
|
||||||
state: 'Enabled'
|
|
||||||
};
|
|
||||||
},
|
|
||||||
getActionFilter: function() {
|
|
||||||
return cloudStack.actionFilter.physicalNetwork;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
error: function(json) { args.response.error(parseXMLHttpResponse(json)); }
|
|
||||||
});
|
|
||||||
},
|
|
||||||
notification: { poll: pollAsyncJobResult }
|
|
||||||
},
|
|
||||||
disable: {
|
|
||||||
label: 'label.action.disable.physical.network',
|
|
||||||
messages: {
|
|
||||||
confirm: function(args) {
|
|
||||||
return 'message.action.disable.physical.network';
|
|
||||||
},
|
|
||||||
notification: function(args) {
|
|
||||||
return 'label.action.disable.physical.network';
|
|
||||||
}
|
|
||||||
},
|
|
||||||
action: function(args) {
|
|
||||||
$.ajax({
|
|
||||||
url: createURL('updatePhysicalNetwork'),
|
|
||||||
data: {
|
|
||||||
id: args.context.physicalNetworks[0].id,
|
|
||||||
state: 'Disabled'
|
|
||||||
},
|
|
||||||
success: function(json) {
|
|
||||||
args.response.success({
|
|
||||||
_custom: {
|
|
||||||
jobId: json.updatephysicalnetworkresponse.jobid,
|
|
||||||
getUpdatedItem: function(json) {
|
|
||||||
return {
|
|
||||||
state: 'Disabled'
|
|
||||||
};
|
|
||||||
},
|
|
||||||
getActionFilter: function() {
|
|
||||||
return cloudStack.actionFilter.physicalNetwork;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
error: function(json) { args.response.error(parseXMLHttpResponse(json)); }
|
|
||||||
});
|
|
||||||
},
|
|
||||||
notification: { poll: pollAsyncJobResult }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
dataProvider: function(args) {
|
dataProvider: function(args) {
|
||||||
@ -9311,12 +9237,10 @@
|
|||||||
cloudStack.actionFilter.physicalNetwork = function(args) {
|
cloudStack.actionFilter.physicalNetwork = function(args) {
|
||||||
var state = args.context.item.state;
|
var state = args.context.item.state;
|
||||||
|
|
||||||
if (state == 'Enabled') {
|
if (state != 'Destroyed') {
|
||||||
return ['disable', 'remove'];
|
return ['remove'];
|
||||||
} else if (state == 'Disabled') {
|
|
||||||
return ['enable', 'remove'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return [];
|
return [];
|
||||||
};
|
};
|
||||||
})($, cloudStack);
|
})($, cloudStack);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user