Commit 405c82a3 authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

ui: Port connect/disconnect api calls

parent e9458c38
......@@ -1308,6 +1308,13 @@
},
connect_floating_ip: function(ip, cb) {
synnefo.storage.ports.create({
port: {
network_id: ip.get('floating_network_id'),
device_id: this.id,
fixed_ips: [{'ip_address': ip.get('floating_ip_address')}]
}
}, {complete: cb, skip_api_error: false})
// TODO: Implement
},
......
......@@ -62,11 +62,10 @@
return views.IconView.VM_OS_ICON_TPLS()[icon_type].format(os);
},
ventdisconnect: function() {
disconnect: function() {
this.model.actions.reset_pending();
this.model.set({status: 'DISCONNECTING'});
}
});
views.IpView = views.ext.ModelView.extend({
......@@ -81,6 +80,7 @@
},
status_cls_map: {
'CONNECTED': 'status-active',
'CONNECTING': 'status-active',
'DISCONNECTING': 'status-inactive',
'DOWN': 'status-inactive',
......@@ -133,8 +133,12 @@
remove: function(model, e) {
e && e.stopPropagation();
this.model.actions.reset_pending();
this.model.set({status: 'REMOVING'});
this.model.remove();
this.model.destroy({
success: _.bind(function() {
this.model.set({status: 'REMOVING'});
}, this),
silent: true
});
}
});
......
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