|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"use strict"; |
|
|
|
var Core = Core || {}; |
|
Core.Agent = Core.Agent || {}; |
|
Core.Agent.Admin = Core.Agent.Admin || {}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Core.Agent.Admin.SupportDataCollector = (function (TargetNS) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TargetNS.Init = function () { |
|
|
|
|
|
$('#SendUpdate').on('click', function (Event) { |
|
var TextClass = ''; |
|
Core.UI.Dialog.ShowContentDialog('<div class="Spacing Center"><span class="AJAXLoader W33pc" title='+ Core.Language.Translate("Sending Update...") + '></span></div>',Core.Language.Translate("Sending Update..."), '10px', 'Center', true, undefined, true); |
|
|
|
Core.AJAX.FunctionCall(Core.Config.Get('CGIHandle'), 'Action=' + Core.Config.Get('Action') + ';Subaction=SendUpdate;', function (Response) { |
|
|
|
var ResponseMessage = Core.Language.Translate('Support Data information was successfully sent.'); |
|
|
|
|
|
|
|
if (!$('.Dialog:visible').length) { |
|
return; |
|
} |
|
|
|
if (Response === 0) { |
|
ResponseMessage = Core.Language.Translate('Was not possible to send Support Data information.'); |
|
TextClass = 'Error'; |
|
} |
|
|
|
Core.UI.Dialog.ShowContentDialog( |
|
'<div class="Spacing Center SendUpdateResultDialog"><span class="W50pc ' + TextClass + '" title="' + ResponseMessage + '">' + ResponseMessage + '</span></div>', Core.Language.Translate("Update Result"), |
|
'10px', |
|
'Center', |
|
true, |
|
[ |
|
{ |
|
Label: Core.Language.Translate('Close this dialog'), |
|
Class: 'Primary', |
|
Function: function () { |
|
Core.UI.Dialog.CloseDialog($('.SendUpdateResultDialog')); |
|
} |
|
} |
|
], |
|
true |
|
); |
|
|
|
}); |
|
|
|
Event.preventDefault(); |
|
Event.stopPropagation(); |
|
return false; |
|
}); |
|
|
|
|
|
$('#GenerateSupportBundle').on('click', function (Event) { |
|
Core.UI.Dialog.ShowContentDialog('<div class="Spacing Center LoadingSupportBundleDialog"><span class="AJAXLoader W75pc" title=' + Core.Language.Translate("Generating...") + '></span></div>', Core.Language.Translate("Generating..."), '10px', 'Center', true, undefined, true); |
|
|
|
Core.AJAX.FunctionCall(Core.Config.Get('CGIHandle'), 'Action=' + Core.Config.Get('Action') + ';Subaction=GenerateSupportBundle;', function (Response) { |
|
var TextClass, ResponseMessage; |
|
|
|
|
|
|
|
if (!$('.Dialog:visible').length) { |
|
return; |
|
} |
|
|
|
Core.UI.Dialog.CloseDialog($('.LoadingSupportBundleDialog')); |
|
|
|
if (!Response.Success) { |
|
ResponseMessage = Core.Language.Translate('It was not possible to generate the Support Bundle.'), |
|
TextClass = 'Error'; |
|
|
|
Core.UI.Dialog.ShowContentDialog( |
|
'<div class="Spacing Center NoSupportBunle"><span class="W50pc ' + TextClass + '" title="' + ResponseMessage + '">' + ResponseMessage + '</span></div>', Core.Language.Translate("Generate Result"), |
|
'10px', |
|
'Center', |
|
true, |
|
[ |
|
{ |
|
Label: Core.Language.Translate('Close this dialog'), |
|
Class: 'Primary', |
|
Function: function () { |
|
Core.UI.Dialog.CloseDialog($('.NoSupportBunle')); |
|
} |
|
} |
|
], |
|
true |
|
); |
|
} |
|
else { |
|
|
|
Core.UI.Dialog.ShowContentDialog( |
|
$('#SupportBundleOptionsDialogContainer'), Core.Language.Translate("Support Bundle"), |
|
'10px', |
|
'Center', |
|
true, |
|
[ |
|
{ |
|
Label: Core.Language.Translate("Close this dialog"), |
|
Class: 'Primary', |
|
Function: function () { |
|
Core.UI.Dialog.CloseDialog($('#SupportBundleOptionsDialog')); |
|
} |
|
} |
|
], |
|
true |
|
); |
|
|
|
|
|
if (parseInt(Response.Filesize,10)>10) { |
|
$('.SupportBundleSendFieldSet').addClass('Hidden'); |
|
$('.NoSupportBundleSendMessage').removeClass('Hidden'); |
|
$('.SizeMessage').removeClass('Hidden'); |
|
} |
|
|
|
|
|
else if ($('#Sender').val() === '') { |
|
$('.SupportBundleSendFieldSet').addClass('Hidden'); |
|
$('.NoSupportBundleSendMessage').removeClass('Hidden'); |
|
$('.EmailMessage').removeClass('Hidden'); |
|
} |
|
|
|
|
|
else { |
|
$('#SendSupportBundle').on('click', function () { |
|
$('#SendingAJAXLoader').addClass('AJAXLoader'); |
|
$('#SendSupportBundle').prop('disabled', true); |
|
$('#DownloadSupportBundle').prop('disabled', true); |
|
Core.AJAX.FunctionCall(Core.Config.Get('CGIHandle'), 'Action=' + Core.Config.Get('Action') + ';Subaction=SendSupportBundle;Filename=' + Response.Filename + ';RandomID=' + Response.RandomID, function (SendResponse) { |
|
|
|
if (!SendResponse || !SendResponse.Success) { |
|
alert(Core.Language.Translate("The mail could not be sent")); |
|
} |
|
Core.UI.Dialog.CloseDialog($('#SupportBundleOptionsDialog')); |
|
}); |
|
}); |
|
} |
|
|
|
$('#DownloadSupportBundle').on('click', function () { |
|
|
|
|
|
|
|
window.location.href = Core.Config.Get('Baselink') + 'Action=' + Core.Config.Get('Action') + ';Subaction=DownloadSupportBundle;Filename=' + Response.Filename + ';RandomID=' + Response.RandomID + ';ChallengeToken=' + Core.Config.Get('ChallengeToken'); |
|
Core.UI.Dialog.CloseDialog($('#SupportBundleOptionsDialog')); |
|
}); |
|
} |
|
}); |
|
|
|
Event.preventDefault(); |
|
Event.stopPropagation(); |
|
return false; |
|
}); |
|
|
|
|
|
$('.ShowItemMessage').on('click', function() { |
|
Core.UI.Dialog.ShowContentDialog($(this).next('.Hidden').html(), $(this).closest('tr').find('.ItemLabel').text(), '200px', 'Center'); |
|
return false; |
|
}); |
|
|
|
|
|
$('.DataTable').each(function() { |
|
if ($(this).find('.Flag.Problem').length) { |
|
$(this).prev('h3').find('.Flag').addClass('Problem'); |
|
return true; |
|
} |
|
if ($(this).find('.Flag.Warning').length) { |
|
$(this).prev('h3').find('.Flag').addClass('Warning'); |
|
return true; |
|
} |
|
if ($(this).find('.Flag.OK').length) { |
|
$(this).prev('h3').find('.Flag').addClass('OK'); |
|
return true; |
|
} |
|
if ($(this).find('.Flag.Information').length) { |
|
$(this).prev('h3').find('.Flag').addClass('Information'); |
|
return true; |
|
} |
|
if ($(this).find('.Flag.Unknown').length) { |
|
$(this).prev('h3').find('.Flag').addClass('Unknown'); |
|
return true; |
|
} |
|
}); |
|
}; |
|
|
|
Core.Init.RegisterNamespace(TargetNS, 'APP_MODULE'); |
|
|
|
return TargetNS; |
|
}(Core.Agent.Admin.SupportDataCollector || {})); |
|
|