diff --git a/src/sunstone/public/js/plugins/oneflow-services.js b/src/sunstone/public/js/plugins/oneflow-services.js
index 2a0aaba905..ca92059b04 100644
--- a/src/sunstone/public/js/plugins/oneflow-services.js
+++ b/src/sunstone/public/js/plugins/oneflow-services.js
@@ -977,8 +977,11 @@ var service_tab_content = '\
\
\
\
+ \
\
- \
+\
+
'+tr("Cannot connect to OneFlow server")+'
×\
+
\
';
var dataTable_services;
@@ -987,8 +990,13 @@ var service_actions = {
"Service.list" : {
type: "list",
call: Service.list,
- callback: updateServicesView,
- error: onError
+ callback: function(request, service_list) {
+ $("#oneflow-services #error_message").hide();
+ updateServicesView(request, service_list);
+ },
+ error: function(request, error_json) {
+ onError(request, error_json, $("#oneflow-services #error_message"));
+ }
},
"Service.show" : {
diff --git a/src/sunstone/public/js/plugins/oneflow-templates.js b/src/sunstone/public/js/plugins/oneflow-templates.js
index a3bdb15d8a..a11256d157 100644
--- a/src/sunstone/public/js/plugins/oneflow-templates.js
+++ b/src/sunstone/public/js/plugins/oneflow-templates.js
@@ -108,7 +108,10 @@ var service_template_tab_content = '\
\
\
\
+ \
\
+ \
+
'+tr("Cannot connect to OneFlow server")+'
×\
\
';
@@ -465,8 +468,13 @@ var service_template_actions = {
"ServiceTemplate.list" : {
type: "list",
call: ServiceTemplate.list,
- callback: updateServiceTemplatesView,
- error: onError
+ callback: function(request, service_list) {
+ $("#oneflow-templates #error_message").hide();
+ updateServiceTemplatesView(request, service_list);
+ },
+ error: function(request, error_json) {
+ onError(request, error_json, $("#oneflow-templates #error_message"))
+ }
},
"ServiceTemplate.show" : {
diff --git a/src/sunstone/public/js/sunstone-util.js b/src/sunstone/public/js/sunstone-util.js
index 0b6af09b30..178bd5dec4 100644
--- a/src/sunstone/public/js/sunstone-util.js
+++ b/src/sunstone/public/js/sunstone-util.js
@@ -415,7 +415,7 @@ function initCheckAllBoxes(datatable, custom_context){
//standard handling for the server errors on ajax requests.
//Pops up a message with the information.
-function onError(request,error_json) {
+function onError(request,error_json, container) {
var method;
var action;
var object;
@@ -451,6 +451,11 @@ function onError(request,error_json) {
return false;
};
+ if (container) {
+ container.show();
+ return false;
+ }
+
if (message.match(/^Network is unreachable .+$/)){
if (!onError.disabled){
notifyError(tr("Network is unreachable: is OpenNebula running?"));