1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

Show error message in one flow tab instead of growl, when the server is not available(cherry picked from commit 525788947b244199e7956ec9305e4953947b56c8)

This commit is contained in:
Daniel Molina 2013-07-16 12:39:38 +02:00
parent d513de9f08
commit 24f1a55499
3 changed files with 27 additions and 6 deletions

View File

@ -977,8 +977,11 @@ var service_tab_content = '\
<tbody>\
</tbody>\
</table>\
</div>\
</div>\
</div>\
<div class="row" id="error_message" hidden>\
<div class="alert-box alert">'+tr("Cannot connect to OneFlow server")+'<a href="" class="close">&times;</a></div>\
</div>\
</form>';
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" : {

View File

@ -108,7 +108,10 @@ var service_template_tab_content = '\
<tbody>\
</tbody>\
</table>\
</div>\
</div>\
<div class="row" id="error_message" hidden>\
<div class="alert-box alert">'+tr("Cannot connect to OneFlow server")+'<a href="" class="close">&times;</a></div>\
</div>\
</form>';
@ -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" : {

View File

@ -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?"));