diff --git a/horizon/static/horizon/js/horizon.d3linechart.js b/horizon/static/horizon/js/horizon.d3linechart.js index 804da8e24e..3fa97923d1 100644 --- a/horizon/static/horizon/js/horizon.d3linechart.js +++ b/horizon/static/horizon/js/horizon.d3linechart.js @@ -384,7 +384,8 @@ horizon.d3_line_chart = { // bigger. $(self.legend_element).css('height', ''); // FIXME add proper fail message - horizon.alert('error', gettext('An error occurred. Please try again later.')); + horizon.toast.add('error', + gettext('An error occurred. Please try again later.')); }; /************************************************************************/ diff --git a/horizon/static/horizon/js/horizon.firewalls.js b/horizon/static/horizon/js/horizon.firewalls.js index 99e6b05fad..15fd64c1ac 100644 --- a/horizon/static/horizon/js/horizon.firewalls.js +++ b/horizon/static/horizon/js/horizon.firewalls.js @@ -29,7 +29,7 @@ horizon.firewalls = { error: function() { if(via_user_submit) { horizon.clearErrorMessages(); - horizon.alert('error', gettext('There was a problem communicating with the server, please try again.')); + horizon.toast.add('error', gettext('There was a problem communicating with the server, please try again.')); } } }); diff --git a/horizon/static/horizon/js/horizon.instances.js b/horizon/static/horizon/js/horizon.instances.js index 028680ee6f..ab00b4e39a 100644 --- a/horizon/static/horizon/js/horizon.instances.js +++ b/horizon/static/horizon/js/horizon.instances.js @@ -29,7 +29,7 @@ horizon.instances = { error: function() { if(via_user_submit) { horizon.clearErrorMessages(); - horizon.alert('error', gettext('There was a problem communicating with the server, please try again.')); + horizon.toast.add('error', gettext('There was a problem communicating with the server, please try again.')); } } }); @@ -273,13 +273,13 @@ horizon.addInitFunction(horizon.instances.init = function () { }; reader.onerror = function() { horizon.clearErrorMessages(); - horizon.alert('error', gettext('Could not read the file')); + horizon.toast.add('error', gettext('Could not read the file')); }; reader.readAsText(file); } else { horizon.clearErrorMessages(); - horizon.alert('error', gettext('Could not decrypt the password')); + horizon.toast.add('error', gettext('Could not decrypt the password')); } }); /* @@ -308,7 +308,7 @@ horizon.addInitFunction(horizon.instances.init = function () { var decrypted_password = horizon.instances.decrypt_password(encrypted_password, private_key); if (decrypted_password === false || decrypted_password === null) { horizon.clearErrorMessages(); - horizon.alert('error', gettext('Could not decrypt the password')); + horizon.toast.add('error', gettext('Could not decrypt the password')); } else { $("#id_decrypted_password").val(decrypted_password); diff --git a/horizon/static/horizon/js/horizon.modals.js b/horizon/static/horizon/js/horizon.modals.js index 1574e1afeb..c926c9c7fc 100644 --- a/horizon/static/horizon/js/horizon.modals.js +++ b/horizon/static/horizon/js/horizon.modals.js @@ -320,7 +320,7 @@ horizon.addInitFunction(horizon.modals.init = function() { } else { $('.ajax-modal, .dropdown-toggle').removeAttr("disabled"); $formElement.closest(".modal").modal("hide"); - horizon.alert("danger", gettext("There was an error submitting the form. Please try again.")); + horizon.toast.add("danger", gettext("There was an error submitting the form. Please try again.")); } } @@ -425,7 +425,7 @@ horizon.addInitFunction(horizon.modals.init = function() { else { if (!horizon.ajax.get_messages(jqXHR)) { // Generic error handler. Really generic. - horizon.alert("danger", gettext("An error occurred. Please try again later.")); + horizon.toast.add("danger", gettext("An error occurred. Please try again later.")); } } }, diff --git a/horizon/static/horizon/js/horizon.networktopologycommon.js b/horizon/static/horizon/js/horizon.networktopologycommon.js index 29e2a9fb07..292ebeecbe 100644 --- a/horizon/static/horizon/js/horizon.networktopologycommon.js +++ b/horizon/static/horizon/js/horizon.networktopologycommon.js @@ -71,7 +71,7 @@ horizon.networktopologymessager = { angular.element(window).on('message', function(e) { var message = angular.element.parseJSON(e.originalEvent.data); if (self.previous_message !== message.message) { - horizon.alert(message.type, message.message); + horizon.toast.add(message.type, message.message); self.previous_message = message.message; self.delete_post_message(message.iframe_id); self.messageNotify(message); diff --git a/horizon/static/horizon/js/horizon.tables_inline_edit.js b/horizon/static/horizon/js/horizon.tables_inline_edit.js index 0e33e20d4d..4d217f8bac 100644 --- a/horizon/static/horizon/js/horizon.tables_inline_edit.js +++ b/horizon/static/horizon/js/horizon.tables_inline_edit.js @@ -83,13 +83,13 @@ horizon.inline_edit = { if (redir_url){ location.href = redir_url; } else { - horizon.alert("error", gettext("Not authorized to do this operation.")); + horizon.toast.add("error", gettext("Not authorized to do this operation.")); } } else { if (!horizon.ajax.get_messages(jqXHR)) { // Generic error handler. Really generic. - horizon.alert("error", gettext("An error occurred. Please try again later.")); + horizon.toast.add("error", gettext("An error occurred. Please try again later.")); } } }, @@ -158,13 +158,13 @@ horizon.inline_edit = { if (redir_url){ location.href = redir_url; } else { - horizon.alert("error", gettext("Not authorized to do this operation.")); + horizon.toast.add("error", gettext("Not authorized to do this operation.")); } } else { if (!horizon.ajax.get_messages(jqXHR)) { // Generic error handler. Really generic. - horizon.alert("error", gettext("An error occurred. Please try again later.")); + horizon.toast.add("error", gettext("An error occurred. Please try again later.")); } } }, diff --git a/openstack_dashboard/dashboards/project/instances/templates/instances/_detail_console.html b/openstack_dashboard/dashboards/project/instances/templates/instances/_detail_console.html index 2a1dfff7ef..15cf537015 100644 --- a/openstack_dashboard/dashboards/project/instances/templates/instances/_detail_console.html +++ b/openstack_dashboard/dashboards/project/instances/templates/instances/_detail_console.html @@ -22,7 +22,7 @@ {% else %}