Revision 9ffd10ce ui/static/snf/js/models.js
b/ui/static/snf/js/models.js | ||
---|---|---|
423 | 423 |
}, |
424 | 424 |
|
425 | 425 |
rename: function(name, callback) { |
426 |
return this.api.call(this.api_path(), "update", {network:{name:name}}, callback); |
|
426 |
return this.api.call(this.api_path(), "update", { |
|
427 |
network:{name:name}, |
|
428 |
_options:{ |
|
429 |
critical: false, |
|
430 |
error_params:{ |
|
431 |
title: "Network action failed", |
|
432 |
ns: "Networks", |
|
433 |
extra_details: {"Network id": this.id}, |
|
434 |
} |
|
435 |
}}, callback); |
|
427 | 436 |
}, |
428 | 437 |
|
429 | 438 |
get_connectable_vms: function() { |
... | ... | |
805 | 814 |
var url = this.api_path() + "/meta/" + meta.key; |
806 | 815 |
var payload = {meta:{}}; |
807 | 816 |
payload.meta[meta.key] = meta.value; |
817 |
payload._options = { |
|
818 |
critical:false, |
|
819 |
error_params: { |
|
820 |
title: "Machine metadata error", |
|
821 |
extra_details: {"Machine id": this.id} |
|
822 |
}}; |
|
808 | 823 |
|
809 |
// inject error settings |
|
810 |
payload._options = {critical: false}; |
|
811 |
|
|
812 |
this.api.call(url, "update", payload, complete, error) |
|
824 |
this.api.call(url, "update", payload, complete, error); |
|
813 | 825 |
}, |
814 | 826 |
|
815 | 827 |
set_firewall: function(net_id, value, callback, error, options) { |
... | ... | |
976 | 988 |
rename: function(new_name) { |
977 | 989 |
//this.set({'name': new_name}); |
978 | 990 |
this.sync("update", this, { |
991 |
critical: true, |
|
979 | 992 |
data: { |
980 | 993 |
'server': { |
981 | 994 |
'name': new_name |
... | ... | |
1081 | 1094 |
success: function(){ self.handle_action_succeed.apply(self, arguments); success.apply(this, arguments)}, |
1082 | 1095 |
error: function(){ self.handle_action_fail.apply(self, arguments); error.apply(this, arguments)}, |
1083 | 1096 |
error_params: { ns: "Machines actions", |
1084 |
message: "'" + this.get("name") + "'" + " action failed",
|
|
1097 |
title: "'" + this.get("name") + "'" + " " + action + " failed",
|
|
1085 | 1098 |
extra_details: { 'Machine ID': this.id, 'URL': url, 'Action': action || "undefined" }, |
1086 | 1099 |
allow_reload: false |
1087 | 1100 |
}, |
Also available in: Unified diff