opt
/
kaspersky
/
kav4fs
/
share
/
wmconsole
/
html
/
js
/
pages
➕ New
📤 Upload
✎ Editing:
notifyPage.js
← Back
var NotifyTabs = [ ["NOTIFY_TAB_MESSAGES" ,"notify_messages.html" ,""], ["NOTIFY_TAB_ACTIONS" ,"notify_actions.html" ,"__actions__"], ["NOTIFY_TAB_SNMP" ,"notify_snmp_traps.html" ,"__snmp__"] ]; var eventList =[ [ 1, "NOTIFY_EVENT_01"], // [ 2, "NOTIFY_EVENT_02"], [ 3, "NOTIFY_EVENT_03"], [ 4, "NOTIFY_EVENT_04"], [ 5, "NOTIFY_EVENT_05"], [ 6, "NOTIFY_EVENT_06"], [ 7, "NOTIFY_EVENT_07"], [ 8, "NOTIFY_EVENT_08"], [ 9, "NOTIFY_EVENT_09"], [10, "NOTIFY_EVENT_10"], [11, "NOTIFY_EVENT_11"], [12, "NOTIFY_EVENT_12"], [13, "NOTIFY_EVENT_13"], [14, "NOTIFY_EVENT_14"], [15, "NOTIFY_EVENT_15"], [16, "NOTIFY_EVENT_16"], [17, "NOTIFY_EVENT_17"], [18, "NOTIFY_EVENT_18"], [19, "NOTIFY_EVENT_19"], [20, "NOTIFY_EVENT_20"], [21, "NOTIFY_EVENT_21"], [22, "NOTIFY_EVENT_22"], [23, "NOTIFY_EVENT_23"], [24, "NOTIFY_EVENT_24"], [25, "NOTIFY_EVENT_25"], [26, "NOTIFY_EVENT_26"], [27, "NOTIFY_EVENT_27"], [28, "NOTIFY_EVENT_28"], [33, "NOTIFY_EVENT_33"] ]; var macroList=[ //common [-1, "%NOW%" , "NOTIFY_MACRO_NOW"], [-1, "%HOST_NAME%" , "NOTIFY_MACRO_HOST_NAME"], //AVBasesAttachedEvent: [ 7, "%RECORDS%" , "NOTIFY_MACRO_RECORDS"], //LicenseExpiresSoonEvent: [ 5, "%DAYS_LEFT%" , "NOTIFY_MACRO_DAYS_LEFT"], //LicenseErrorEvent: [ 6, "%REASON%" , "NOTIFY_MACRO_REASON"], //BasesAreOutOfDateEvent [ 8, "%DAYS_PASSED%", "NOTIFY_MACRO_DAYS_PASSED"], //AVBasesAreTotallyOutOfDateEvent [ 9, "%DAYS_PASSED%", "NOTIFY_MACRO_DAYS_PASSED"], //UpdateErrorEvent [10, "%REASON%" , "NOTIFY_MACRO_REASON"], //RetranslateErrorEvent [11, "%REASON%" , "NOTIFY_MACRO_REASON"], //ThreatDetectedEvent [ 3, "%OBJECT%" , "NOTIFY_MACRO_OBJECT"], [ 3, "%SOURCE%" , "NOTIFY_MACRO_SOURCE"], [ 3, "%VERDICT%" , "NOTIFY_MACRO_VERDICT"], [ 3, "%THREAT_NAME%", "NOTIFY_MACRO_THREAT_NAME"], [ 3, "%DANGER%" , "NOTIFY_MACRO_DANGER"], //new [12, "%SERIAL%" , "NOTIFY_MACRO_SERIAL"], [13, "%SERIAL%" , "NOTIFY_MACRO_SERIAL"], [14, "%REASON%" , "NOTIFY_MACRO_REASON"], [15, "%OBJECT%" , "NOTIFY_MACRO_OBJECT"], [15, "%SOURCE%" , "NOTIFY_MACRO_SOURCE"], [15, "%REASON%" , "NOTIFY_MACRO_REASON"], [16, "%OBJECT%" , "NOTIFY_MACRO_OBJECT"], [16, "%SOURCE%" , "NOTIFY_MACRO_SOURCE"], [16, "%REASON%" , "NOTIFY_MACRO_REASON"], [17, "%OBJECT%" , "NOTIFY_MACRO_OBJECT"], [17, "%SOURCE%" , "NOTIFY_MACRO_SOURCE"], [18, "%OBJECT%" , "NOTIFY_MACRO_OBJECT"], [18, "%SOURCE%" , "NOTIFY_MACRO_SOURCE"], [19, "%OBJECT%" , "NOTIFY_MACRO_QF_OBJECT"], [19, "%OBJECT_SIZE%", "NOTIFY_MACRO_QF_OBJECT_SIZE"], [20, "%SIZE_LIMIT%" , "NOTIFY_MACRO_QSIZE_LIMIT"], [20, "%ACTUAL_SIZE%", "NOTIFY_MACRO_QACTUAL_SIZE"], [21, "%OBJECT%" , "NOTIFY_MACRO_OBJECT"], [21, "%DESCRIPTION%", "NOTIFY_MACRO_OBJECT_DESCRIPTION"], [22, "%OBJECT%" , "NOTIFY_MACRO_OBJECT"], [22, "%OBJECT_SIZE%", "NOTIFY_MACRO_Q_OBJECT_SIZE"], [22, "%OBJECT_TYPE%", "NOTIFY_MACRO_Q_OBJECT_TYPE"], [22, "%VERDICT%" , "NOTIFY_MACRO_VERDICT"], [22, "%DANGER%" , "NOTIFY_MACRO_DANGER"], [23, "%OBJECT%" , "NOTIFY_MACRO_OBJECT"], [23, "%OBJECT_SIZE%", "NOTIFY_MACRO_Q_OBJECT_SIZE"], [23, "%OBJECT_TYPE%", "NOTIFY_MACRO_Q_OBJECT_TYPE"], [24, "%OBJECT%" , "NOTIFY_MACRO_OBJECT"], [24, "%OBJECT_SIZE%", "NOTIFY_MACRO_Q_OBJECT_SIZE"], [24, "%OBJECT_TYPE%", "NOTIFY_MACRO_Q_OBJECT_TYPE"], [25, "%OBJECT%" , "NOTIFY_MACRO_OBJECT"], [25, "%VERDICT%" , "NOTIFY_MACRO_VERDICT"], [25, "%DANGER%" , "NOTIFY_MACRO_DANGER"], [25, "%THREAT_NAME%", "NOTIFY_MACRO_THREAT_NAME"], [26, "%OBJECT%" , "NOTIFY_MACRO_OBJECT"], [26, "%REASON%" , "NOTIFY_MACRO_REASON"], [27, "%OBJECT%" , "NOTIFY_MACRO_OBJECT"], [28, "%OBJECT%" , "NOTIFY_MACRO_OBJECT"], [33, "%OAS_FAIL_REASON%" , "NOTIFY_MACRO_OAS_FAIL_REASON"] ]; var notifyPage_selEventId = -1; //g_taskId = 1000 function notifyPage_findTabByHref() { var loc = window.location.hash; for(var i = 1; i < NotifyTabs.length; i++){ var s = NotifyTabs[i][2]; if((s.length > 0) && (loc.indexOf('/' + s) > -1)) return i; } return 0; } function notifyPage_selectNotifyTab(num) { if (num>0) $('#notify_content #crasy_corner').addClass('l').removeClass('l_no') else $('#notify_content #crasy_corner').addClass('l_no').removeClass('l') for(i = 0; i < 3; i++) $('#tablink' + i).removeClass('active'); $('#tablink' + num).addClass('active'); $('#view_data_info').loadCache('pages/notify/' + NotifyTabs[num][1]); } function notifyPage_baseref() { var loc = window.location.hash; for(var i = 0; i < NotifyTabs.length; i++) { if((NotifyTabs[i][2].length > 0) && (loc.indexOf(NotifyTabs[i][2]) > -1)){ a = loc.split('/'); a.pop(); return a.join('/'); } } return window.location.hash; } function notifyPage_initializeTabs() { var _baseref = notifyPage_baseref(); for(var i = 0; i < NotifyTabs.length; i++) { if( $('#tablink' + i + ' div.c').html() ) continue; var href_ = _baseref; if(NotifyTabs[i][2].length > 0) href_ += '/' + NotifyTabs[i][2]; $('#tablink' + i + ' div.c').html(getLocalString(NotifyTabs[i][0])) $('#tablink' + i) .attr('href', href_) .icHistory(function(){ window.location.href = this.href; notifyPage_main_onload(); }) } } function notifyPage_setNotifySettingsChange(){ editTask.setSettingsTaskChange() } function notifyPage_main_onload() { ic.loading.show(); taskSettings_clearRevertFunctions(); g_taskId = editTask.taskInfo.id $('#b_SaveSettings').unbind('click').click(function(){ editTask.saveSettings() }) $('#b_RevertSettings').unbind('click').click(taskSettings_doRevert); function __editTaskRevert() { editTask.revertSettings(); taskSettings_addRevertFunc(__editTaskRevert); } taskSettings_addRevertFunc(__editTaskRevert); notifyPage_selEventId = -1; notifyPage_initializeTabs(); notifyPage_selectNotifyTab(notifyPage_findTabByHref()); editTask.initButtonSaveEnabled() ic.loading.hide(); } function notifyPage_findSmtpNotifyById(id){ settings_id = -1; for(var j=0; j < editTask.SettingsTask.notifier.SmtpNotifies.length;j++) { if( editTask.SettingsTask.notifier.SmtpNotifies[j].EventName == eventList[id][0] ){ settings_id = j; } } return settings_id; } var notifyPage_shortNotifyTmpl = new Template( '<td class="dt #{cellClass}">#{notifyUrlPrefix}#{notifyName}#{notifyUrlPostfix}</td>' + '<td class="dt #{cellClass}">#{notifyUrlPrefix}#{notifyText}#{notifyUrlPostfix}</td>' + '<td class="dt #{cellClass}">#{notifyUrlPrefix}#{notifyRecipients}#{notifyUrlPostfix}</td>' + '<td class="dt nobr #{chekboxCellClass}"><input type="checkbox" class="checkBox" id="ntf_enabled" #{checkState}/> <span class="res:NOTIFY_ENABLED"/></td>'); function notifyPage_showShortNotify(id){ if(id==-1) return; var params = { cellClass : "grey", chekboxCellClass : "grey", notifyUrlPrefix : "", notifyUrlPostfix : "", notifyName : getLocalString(eventList[id][1]), notifyText : _res('LABEL_NOTIFICATION_EVENT_RECIPIENTS_EMPTY'), notifyRecipients : _res('LABEL_NOTIFICATION_EVENT_TEXT_NOT_SET'), checkState : "" }; sIdx = notifyPage_findSmtpNotifyById(id); if(sIdx!=-1){ var shortRcptList = ""; var RecipientsArray = editTask.SettingsTask.notifier.CommonSmtpSettings.DefaultRecipients; if( editTask.SettingsTask.notifier.SmtpNotifies[sIdx].UseRecipientList==1 || (editTask.SettingsTask.notifier.SmtpNotifies[sIdx].UseRecipientList==3 && RecipientsArray.length==0)){ RecipientsArray = editTask.SettingsTask.notifier.SmtpNotifies[sIdx].Recipients; } if(RecipientsArray.length > 0 ) shortRcptList = RecipientsArray[0]; else shortRcptList = _res('LABEL_NOTIFICATION_EVENT_TEXT_NOT_SET'); if(RecipientsArray.length > 1 ) shortRcptList += ",..."; if(editTask.SettingsTask.notifier.SmtpNotifies[sIdx].Enable) { if(notifyPage_isSmtpEnabled()) { params["cellClass"]=""; params["notifyUrlPrefix"]='<a href="javascript:notifyPage_showFullNotify('+id+')">'; params["notifyUrlPostfix"]="</a>"; } params["checkState"]="checked"; } if(editTask.SettingsTask.notifier.SmtpNotifies[sIdx].Body.length>0) params["notifyText"]=editTask.SettingsTask.notifier.SmtpNotifies[sIdx].Body; params["notifyRecipients"]=shortRcptList; } if(notifyPage_isSmtpEnabled()) { params["chekboxCellClass"]=""; } params.notifyText = misc_preparetoView(params.notifyText); params.notifyRecipients = misc_preparetoView(params.notifyRecipients); var notify_record = notifyPage_shortNotifyTmpl.evaluate(params); $('#tableArea #ntf_list #notify_'+id+'') .empty() .removeClass('open') .html(notify_record); notifyPage_setupEnableAction(id); }; function notifyPage_createDefaultNotify(){ return {"Body":"","EventName":1,"Recipients":[],"UseRecipientList":2,"Subject":"","Enable":true,"__VersionInfo":"1 0"}; }; function notifyPage_appendDefaultNotify(id){ var new_notify = notifyPage_createDefaultNotify(); new_notify.Body = ""; new_notify.Subject = getLocalString(eventList[id][1]); new_notify.EventName = eventList[id][0]; editTask.SettingsTask.notifier.SmtpNotifies.push(new_notify); return editTask.SettingsTask.notifier.SmtpNotifies.length-1; } function notifyPage_setupEnableAction(id){ $('#ntf_list').find('#notify_'+id).find('#ntf_enabled').click(function(){ sIdx = notifyPage_findSmtpNotifyById(id); if(this.checked==1){ if(sIdx==-1) notifyPage_appendDefaultNotify(id); else editTask.SettingsTask.notifier.SmtpNotifies[sIdx].Enable=true; }else{ if(sIdx!=-1) editTask.SettingsTask.notifier.SmtpNotifies[sIdx].Enable=false; } notifyPage_setNotifySettingsChange(); notifyPage_showShortNotify(id); }); if(!notifyPage_isSmtpEnabled()) $('#ntf_list').find('#notify_'+id).find('#ntf_enabled').attr('disabled', true); } function notifyPage_setupMacroList(parent, body, event_id){ macroListCtrl = parent.find('#macro_text'); macroLable = parent.find('#macro_lbl'); macroListCtrl.empty(); macroList.each(function(item, i){ if( item[0]==-1 || item[0]==event_id ) macroListCtrl.append('<option value="' + i + '">' + item[1] + '</option>'); }) macroLable.html(getLocalString(macroList[0][2])); macroListCtrl.change(function(){ macroLable.html(getLocalString(macroList[this.value][2])); }); parent.find('#add_macro').unbind(); parent.find('#add_macro').click(function(){ body.val(body.val()+macroList[macroListCtrl.val()][1]); body.trigger('fastChange'); }); } function notifyPage_closeFullNotify(){ notifyPage_showShortNotify(notifyPage_selEventId); notifyPage_selEventId=-1; } var selected_notify_rlist = null; function notifyPage_showFullNotify(id){ // notifyPage_showShortNotify(notifyPage_selEventId); notifyPage_selEventId=id; settings_id = notifyPage_findSmtpNotifyById(id); if(settings_id == -1) { settings_id = notifyPage_appendDefaultNotify(id); } getDialog('notifyProperties').open({propertiesChange: notifyPage_setNotifySettingsChange, propertiesClose: notifyPage_closeFullNotify, macroListSetup:notifyPage_setupMacroList, editTask:editTask, innerTitle : getLocalString(eventList[id][1]), title: getLocalString(eventList[id][1]), eventId:eventList[id][0], settingsId:settings_id}); } function notifyPage_addSmallNotifyInfo(ntbl, id){ sIdx = notifyPage_findSmtpNotifyById(id); var notify_record = '<tr id="notify_'+id+'"><td colspan=4 class="dt"></td></tr>'; ntbl.append(notify_record); notifyPage_showShortNotify(id); } function notifyPage_messages_redrawTableArea() { ic.loading.show(); $('#tableArea') .html( '<table id="ntf_list" class="content_tblEvent w100" cellspacing="0">' + '<tr><th class="hdr w25 res:NOTIFY_EVENT_HDR"/><th class="hdr w45 res:NOTIFY_TEXT_HDR"/><th class="hdr w25 res:NOTIFY_RECIPIENTS_HDR"/><th class="hdr w10 res:NOTIFY_STATUS_HDR"/></tr>'+ '</table>') .addClass('content_tbl_in'); for(var i=0; i < eventList.length;i++) { notifyPage_addSmallNotifyInfo($('#tableArea #ntf_list'), i); } ic.loading.hide(); } function notifyPage_handleEnableSmtp(){ notifyPage_messages_redrawTableArea(); notifyPage_setNotifySettingsChange(); } function notifyPage_isSmtpEnabled() { if( editTask.SettingsTask.notifier.EnableSmtp==1 || editTask.SettingsTask.notifier.EnableSmtp==true) return true; return false; } function notifyPage_messages_onLoad() { $('#tableAreaCtrl').html( '<table cellspacing="0" class="w100">' + '<tr>' + ' <td class="w90 nobr"><input type="checkbox" class="checkBox" id="smtp_enable"/>' + ' <label for="smtp_enable" class="res:NOTIFY_ENABLE_SMTP" /></td>' + '</tr>' + '</table>'); common_checks = [['smtp_enable', 'EnableSmtp']]; bindChangeValuesById("#tableAreaCtrl", editTask.SettingsTask.notifier, common_checks, notifyPage_handleEnableSmtp); notifyPage_messages_redrawTableArea(); notifyPage_settings_onLoad(); notifyPage_addTabRevertFunction(notifyPage_messages_onLoad); } //----------Actions Begin-------------------- function notifyPage_findActionById(id){ settings_id = -1; for(var j=0; j < editTask.SettingsTask.notifier.Actions.length;j++) { if( editTask.SettingsTask.notifier.Actions[j].EventName == eventList[id][0] ){ settings_id = j; } } return settings_id; } var notifyPage_shortActionTmpl = new Template( '<td class="dt #{cellClass}">#{actUrlPrefix}#{actName}#{actUrlPostfix}</td>' + '<td class="dt #{cellClass}">#{actUrlPrefix}#{actText}#{actUrlPostfix}</td>' + '<td class="dt nobr #{chekboxCellClass}"><input type="checkbox" class="checkBox" id="act_enabled" #{checkState}/> <span class="res:NOTIFY_ENABLED"/></td>'); function notifyPage_showShortAction(id){ if(id==-1) return; var params = { cellClass : "grey", chekboxCellClass : "grey", actUrlPrefix : "", actUrlPostfix : "", actName : getLocalString(eventList[id][1]), actText : "Not set", checkState : "" }; sIdx = notifyPage_findActionById(id); if(sIdx!=-1){ if( editTask.SettingsTask.notifier.Actions[sIdx].Enable ) { if(notifyPage_isActionsEnabled()) { params["cellClass"]=""; params["actUrlPrefix"]='<a href="javascript:notifyPage_showFullAction('+id+')">'; params["actUrlPostfix"]="</a>"; } params["checkState"]="checked"; } if(editTask.SettingsTask.notifier.Actions[sIdx].Command.length>0) params["actText"]=editTask.SettingsTask.notifier.Actions[sIdx].Command; } if(notifyPage_isActionsEnabled()) { params["chekboxCellClass"]=""; } params.actText = misc_preparetoView(params.actText); var action_record = notifyPage_shortActionTmpl.evaluate(params); $('#tableArea #act_list #action_'+id+'') .empty() .removeClass('open') .html(action_record); notifyPage_actions_setupEnableAction(id); } function notifyPage_createDefaultAction(){ return {"Command":"","EventName":1,"Enable":true,"__VersionInfo":"1 0"}; }; function notifyPage_appendDefaultAction(id){ var new_action = notifyPage_createDefaultAction(); new_action.Command = ""; new_action.EventName = eventList[id][0]; editTask.SettingsTask.notifier.Actions.push(new_action); return editTask.SettingsTask.notifier.Actions.length-1; } function notifyPage_actions_setupEnableAction(id){ $('#act_list').find('#action_'+id).find('#act_enabled').click(function(){ sIdx = notifyPage_findActionById(id); if(this.checked==1){ if(sIdx==-1) notifyPage_appendDefaultAction(id); else editTask.SettingsTask.notifier.Actions[sIdx].Enable=true; }else{ if(sIdx!=-1) editTask.SettingsTask.notifier.Actions[sIdx].Enable=false; } notifyPage_setNotifySettingsChange(); notifyPage_showShortAction(id); }); if(!notifyPage_isActionsEnabled()) $('#act_list').find('#action_'+id).find('#act_enabled').attr('disabled', true); } function notifyPage_closeFullAction(){ notifyPage_showShortAction(notifyPage_selEventId); notifyPage_selEventId=-1; } function notifyPage_showFullAction(id){ // notifyPage_showShortAction(notifyPage_selEventId); notifyPage_selEventId=id; settings_id = notifyPage_findActionById(id); if(settings_id == -1) { settings_id = notifyPage_appendDefaultAction(id); } getDialog('actionProperties').open({propertiesChange: notifyPage_setNotifySettingsChange, propertiesClose: notifyPage_closeFullAction, macroListSetup:notifyPage_setupMacroList, editTask:editTask, innerTitle : getLocalString(eventList[id][1]), title: getLocalString(eventList[id][1]), eventId:eventList[id][0], settingsId:settings_id}); } function notifyPage_addSmallActionInfo(tbl, id){ sIdx = notifyPage_findActionById(id); var act_record = '<tr id="action_'+id+'"><td colspan=4 class="dt"></td></tr>'; tbl.append(act_record); notifyPage_showShortAction(id); } function notifyPage_isActionsEnabled() { if( editTask.SettingsTask.notifier.EnableActions==1 || editTask.SettingsTask.notifier.EnableActions==true) return true; return false; } function notifyPage_actions_redrawTableArea() { ic.loading.show(); $('#tableArea') .html( '<table id="act_list" class="content_tblEvent w100" cellspacing="0">' + '<tr><th class="hdr w25 res:NOTIFY_EVENT_HDR"/><th class="hdr w70 res:NOTIFY_COMMAND_HDR"/><th class="hdr w10 res:NOTIFY_STATUS_HDR"/></tr>'+ '</table>') .addClass('content_tbl_in'); for(var i=0; i < eventList.length;i++) { notifyPage_addSmallActionInfo($('#tableArea #act_list'), i); } ic.loading.hide(); } function notifyPage_handleEnableActions(){ notifyPage_actions_redrawTableArea(); notifyPage_setNotifySettingsChange(); } function notifyPage_addTabRevertFunction(func) { var hash_ = window.location.hash; function revertTab() { if(hash_ === window.location.hash) func(); } taskSettings_addRevertFunc(revertTab); } function notifyPage_actions_onLoad() { $('#tableAreaCtrl').html( '<table cellspacing="0" class="w100">' + '<tr>' + ' <td class="w90 nobr"><input type="checkbox" class="checkBox" id="actions_enable"/>' + ' <label for="actions_enable" class="res:NOTIFY_ENABLE_ACTIONS" /></td>' + '</tr>' + '</table>'); common_checks = [['actions_enable', 'EnableActions']]; bindChangeValuesById("#tableAreaCtrl", editTask.SettingsTask.notifier, common_checks, notifyPage_handleEnableActions); notifyPage_actions_redrawTableArea(); notifyPage_addTabRevertFunction(notifyPage_actions_onLoad); } //----------Actions End-------------------- var notifyPage_InternalMailerControls= [ "#settingsArea #smtp_addr", "#settingsArea #smtp_port", "#settingsArea #queue_folder", "#settingsArea #smtp_timeout" ]; var notifyPage_SendmailControls= [ "#settingsArea #sendmail_path" ]; function notifyPage_switchSettingsStatus(controls, enable){ var tmp_val = "disabled"; if(enable==1 || enable==true) tmp_val = ""; for(i = 0; i < controls.length; i++) $(controls[i]).attr("disabled", tmp_val); } function notifyPage_displayMailerSettings(){ if(editTask.SettingsTask.notifier.CommonSmtpSettings.Mailer==1) { $('#settingsArea #sendmail_settings').css("display","none"); $('#settingsArea #internal_settings').css("display","block"); } else { $('#settingsArea #sendmail_settings').css("display","block"); $('#settingsArea #internal_settings').css("display","none"); } } function notifyPage_handleMailerSelect(){ notifyPage_displayMailerSettings(); notifyPage_setNotifySettingsChange(); } function notifyPage_settings_onLoad() { internal_smtp_checks = [ ['smtp_addr' ,'SmtpServer' ], ['smtp_port' ,'SmtpPort' ], ['smtp_timeout' ,'ConnectionTimeout' ], ['queue_folder' ,'SmtpQueueFolder' ] ]; bindChangeValuesById("#settingsArea #internal_settings", editTask.SettingsTask.notifier.CommonSmtpSettings.InternalMailerSettings, internal_smtp_checks, notifyPage_setNotifySettingsChange); bindChangeValuesById("#settingsArea", editTask.SettingsTask.notifier.CommonSmtpSettings, [['email_from','Sender' ]], notifyPage_setNotifySettingsChange); bindChangeValuesById("#settingsArea #sendmail_settings", editTask.SettingsTask.notifier.CommonSmtpSettings, [['sendmail_path','SendmailPath' ]], notifyPage_setNotifySettingsChange); bindChangeValuesById("#settingsArea", editTask.SettingsTask.notifier.CommonSmtpSettings, [['mailer','Mailer' ]], notifyPage_handleMailerSelect); notifyPage_displayMailerSettings(); var rlist = new multiSelectList({ base_name: "global_rcpt", width: 300, height: 100, store: editTask.SettingsTask.notifier.CommonSmtpSettings.DefaultRecipients, onchange: notifyPage_setNotifySettingsChange }); misc_setupSizeCorrector( $('#smtp_port'), { parseFunc : parseInt, min : 1, max : 65535 }); misc_setupSizeCorrector( $('#smtp_timeout'), { parseFunc : parseInt, min : 1, max : 120 }); notifyPage_addTabRevertFunction(notifyPage_settings_onLoad); } //------------------SNMP Traps------------------- var trapList =[ ["AVBasesAppliedEventEnable", "TRAP_NAME_25"], ["AVBasesAreOutOfDateEventEnable", "TRAP_NAME_11"], ["AVBasesAreTotallyOutOfDateEventEnable", "TRAP_NAME_12"], ["AVBasesAttachedEventEnable", "TRAP_NAME_10"], ["AVBasesIntegrityCheckFailedEventEnable", "TRAP_NAME_19"], ["AVBasesRollbackCompletedEventEnable", "TRAP_NAME_23"], ["AVBasesRollbackErrorEventEnable", "TRAP_NAME_24"], ["ApplicationSettingsChangedEventEnable", "TRAP_NAME_3"], ["ApplicationStartedEventEnable", "TRAP_NAME_1"], ["LicenseErrorEventEnable", "TRAP_NAME_56"], ["LicenseExpiredEventEnable", "TRAP_NAME_54"], ["LicenseExpiresSoonEventEnable", "TRAP_NAME_55"], ["LicenseInstalledEventEnable", "TRAP_NAME_50"], ["LicenseNotInstalledEventEnable", "TRAP_NAME_51"], ["LicenseNotRevokedEventEnable", "TRAP_NAME_53"], ["LicenseRevokedEventEnable", "TRAP_NAME_52"], ["ModuleNotDownloadedEventEnable", "TRAP_NAME_17"], // ["ModuleNotRetranslatedEventEnable", "TRAP_NAME_21"], ["NothingToUpdateEventEnable", "TRAP_NAME_15"], ["ObjectDeletedEventEnable", "TRAP_NAME_302"], ["ObjectDisinfectedEventEnable", "TRAP_NAME_303"], ["ObjectSavedToQuarantineEventEnable", "TRAP_NAME_351"], ["ObjectSavedToBackupEventEnable", "TRAP_NAME_353"], ["RetranslationErrorEventEnable", "TRAP_NAME_49"], ["TaskStateChangedEventEnable", "TRAP_NAME_200"], ["ThreatDetectedEventEnable", "TRAP_NAME_301"], ["UpdateErrorEventEnable", "TRAP_NAME_22"] ]; var notifyPage_snmpTrapTmpl = new Template( '<td class="dt #{cellClass}">#{trapName}</td>' + '<td class="dt nobr #{chekboxCellClass}"><input type="checkbox" class="checkBox" id="trap_enabled" #{checkState}/> <span class="res:NOTIFY_ENABLED"/></td>'); function notifyPage_snmp_showTrap(id){ if(id==-1) return; var params = { cellClass : "grey", chekboxCellClass : "grey", trapName : getLocalString(trapList[id][1]), checkState : "" }; if(editTask.SettingsTask.snmp.TrapSuite[trapList[id][0]]) { if( editTask.SettingsTask.snmp.TrapsEnable) params["cellClass"]=""; params["checkState"]="checked"; } if( editTask.SettingsTask.snmp.TrapsEnable) params["chekboxCellClass"]=""; var trap_record = notifyPage_snmpTrapTmpl.evaluate(params); $('#tableArea #trap_list #trap_'+id+'') .empty() .html(trap_record); notifyPage_snmp_setupEnableAction(id); }; function notifyPage_snmp_setupEnableAction(id){ $('#tableArea #trap_list #trap_'+id).find('#trap_enabled').click(function(){ if(this.checked==1){ editTask.SettingsTask.snmp.TrapSuite[trapList[id][0]]=true; }else{ editTask.SettingsTask.snmp.TrapSuite[trapList[id][0]]=false; } notifyPage_setNotifySettingsChange(); notifyPage_snmp_showTrap(id); }); if( !editTask.SettingsTask.snmp.TrapsEnable ) $('#tableArea #trap_list #trap_'+id).find('#trap_enabled').attr('disabled', true); } function notifyPage_snmp_addTrapInfo(ttbl, id){ var trap_record = '<tr id="trap_'+id+'"><td colspan=2 class="dt"></td></tr>'; ttbl.append(trap_record); notifyPage_snmp_showTrap(id); } function notifyPage_snmp_redrawTableArea() { // if( editTask.SettingsTask.snmp.TrapsEnable) // { ic.loading.show(); $('#tableArea') .html( '<table id="trap_list" class="content_tblEvent w100" cellspacing="0">' + '<tr><th class="hdr w90 res:TRAP_NAME_HDR"/><th class="hdr w10 res:TRAP_STATUS_HDR"/></tr>'+ '</table>') .addClass('content_tbl_in'); for(var i=0; i < trapList.length;i++) { notifyPage_snmp_addTrapInfo($('#tableArea #trap_list'), i); } ic.loading.hide(); /* } else { $('#tableArea') .empty() .removeClass('content_tbl_in'); }*/ } function notifyPage_handleEnableTraps(){ notifyPage_snmp_redrawTableArea(); notifyPage_setNotifySettingsChange(); } function notifyPage_snmp_onLoad() { snmp_checks = [ ['snmp_xaddr' ,'MasterAgentXAddress' ], ['snmp_ping' ,'PingInterval' ] ]; bindChangeValuesById("#settingsArea", editTask.SettingsTask.snmp, snmp_checks, notifyPage_setNotifySettingsChange); var MAX_INT=2147483648; misc_setupSizeCorrector($('#snmp_ping'),{ parseFunc:parseInt, min:1, max:MAX_INT }); $('#tableAreaCtrl').html( '<table cellspacing="0" class="w90">' + '<tr>' + ' <td class="nobr"><input type="checkbox" class="checkBox" id="traps_enable"/>' + ' <label for="traps_enable" class="res:SNMP_ENABLE_TRAPS" /></td>' + '</tr>' + '</table>'); common_checks = [ ['traps_enable', 'TrapsEnable'] ]; bindChangeValuesById("#tableAreaCtrl", editTask.SettingsTask.snmp, common_checks, notifyPage_handleEnableTraps); notifyPage_snmp_redrawTableArea(); notifyPage_addTabRevertFunction(notifyPage_snmp_onLoad); }
💾 Save Changes
Cancel
📤 Upload File
×
Select File
Upload
Cancel
➕ Create New
×
Type
📄 File
📁 Folder
Name
Create
Cancel
✎ Rename Item
×
Current Name
New Name
Rename
Cancel
🔐 Change Permissions
×
Target File
Permission (e.g., 0755, 0644)
0755
0644
0777
Apply
Cancel