Submit
Path:
~
/
/
opt
/
psa
/
admin
/
htdocs
/
modules
/
revisium-antivirus
/
js
/
File Content:
ra_domain.js
var list_component = null; var domain_list_current_values = []; var timeout_pointer = null; var button_lock = false; var cancel_all_button_lock = false; function startTask(sendButton, event, domain_id, task_name) { event.preventDefault(); if (sendButton.readAttribute('disabled') !== null) return; sendButton.writeAttribute('disabled', ''); sendButton.addClassName('disabled'); if (task_name == 'cure') { $('cleanup_hint').show(); } new Ajax.Request(start_task_url, { method: 'post', parameters: {domain_id: domain_id, task: task_name}, onFailure: function() { sendButton.disabled = false; sendButton.removeClassName('disabled'); }, onSuccess: function (transport) { var data = transport.responseText.evalJSON(); if (data.redirect !== undefined) { window.location.href = data.redirect; } reAjaxUpdate(); } }); } function scanAll(sendButton, event) { event.preventDefault(); if (sendButton.disabled) return; button_lock = true; progressShow(null); scanAllDisable(); cancelAllDisable(); new Ajax.Request(scan_all_url, { method: 'post', parameters: {start: 1, client_id: client_id}, onFailure: function() { button_lock = false; }, onSuccess: function (transport) { var data = transport.responseText.evalJSON(); if (data.redirect !== undefined) { window.location.href = data.redirect; } reAjaxUpdate(); button_lock = false; } }); } function cancelTask(sendButton, event, domain_id, task_name) { event.preventDefault(); if (sendButton.disabled) return; button_lock = true; sendButton.disabled = true; new Ajax.Request(cancel_task_url, { method: 'post', parameters: {domain_id: domain_id, task: task_name}, onFailure: function() { sendButton.disabled = false; button_lock = false; }, onSuccess: function (transport) { var data = transport.responseText.evalJSON(); sendButton.disabled = false; if (data.redirect !== undefined) { window.location.href = data.redirect; } button_lock = false; reAjaxUpdate(); } }); } function cancelAll(sendButton, event) { event.preventDefault(); if (sendButton.disabled) return; button_lock = true; cancel_all_button_lock = true; progressShow(null); scanAllDisable(); cancelAllDisable(); new Ajax.Request(cancel_all_url, { method: 'post', parameters: {start: 1, client_id: client_id}, onFailure: function() { button_lock = false; }, onSuccess: function (transport) { var data = transport.responseText.evalJSON(); if (data.redirect !== undefined) { window.location.href = data.redirect; } reAjaxUpdate(); button_lock = false; } }); } function needUpdateDomainListCell(domain_id, type, value) { if (typeof domain_list_current_values[domain_id] === "undefined") { domain_list_current_values[domain_id] = {}; } if (typeof domain_list_current_values[domain_id][type] === "undefined") { domain_list_current_values[domain_id][type] = ''; } if (domain_list_current_values[domain_id][type] === value) { return false; } domain_list_current_values[domain_id][type] = value; return true; } function reAjaxUpdate() { clearTimeout(timeout_pointer); ajaxUpdate(); } function ajaxUpdate() { var current_button_lock = button_lock; new Ajax.Request(ajax_update_url, { method: 'get', parameters: {last_update_time: last_update_time}, onSuccess: function (transport) { var data = transport.responseText.evalJSON(); if (typeof data.domains_list === "undefined") { onTimeoutAjaxUpdate(); return; } if (typeof data.last_update_time !== "undefined") { last_update_time = data.last_update_time; } data.domains_list.forEach(function(item, index, array){ var domain_id = item.domain_id; if ($('domain_' + domain_id) === null) { return; } if (needUpdateDomainListCell(domain_id, 'domain_status', item.domain)) { $('domain_' + domain_id).replace(item.domain); } if (needUpdateDomainListCell(domain_id, 'report_time_domain', item.report_time)) { $('report_time_domain_' + domain_id).replace(item.report_time); } if (needUpdateDomainListCell(domain_id, 'status', item.status)) { $('status_' + domain_id).replace(item.status); } if (needUpdateDomainListCell(domain_id, 'state', item.state)) { $('state_' + domain_id).replace(item.state); } if (needUpdateDomainListCell(domain_id, 'buttons' , item.buttons)) { $('buttons_domain_' + item.domain_id).replace(item.buttons); } }); if (cancel_all_button_lock && data.cnt_working_domains == 0) { cancel_all_button_lock = false; } if (!current_button_lock && !button_lock) { if (data.progress_text != "") { progressShow(data.progress_text); scanAllDisable(); if (!cancel_all_button_lock) { cancelAllEnable(); } } else { progressHide(); scanAllEnable(); cancelAllDisable(); } } onTimeoutAjaxUpdate(); }, onFailure: function (transport) { onTimeoutAjaxUpdate(); } }); } function setClientFilter() { window.location.href = '?client_id=' + $('select_login').value; } function onTimeoutAjaxUpdate() { clearTimeout(timeout_pointer); timeout_pointer = setTimeout(function(){ ajaxUpdate(); }, ajax_update_interval); } function scanAllDisable() { if ($('btn_scan_all') === null) { return; } $('btn_scan_all').disabled = true; $('btn_scan_all').up().addClassName('disabled'); } function cancelAllEnable() { if ($('btn_cancel_all') === null) { return; } $('btn_cancel_all').disabled = false; $('btn_cancel_all').up().removeClassName('disabled'); } function cancelAllDisable() { if ($('btn_cancel_all') === null) { return; } $('btn_cancel_all').disabled = true; $('btn_cancel_all').up().addClassName('disabled'); } function scanAllEnable() { if ($('btn_scan_all') === null) { return; } $('btn_scan_all').disabled = false; $('btn_scan_all').up().removeClassName('disabled'); } function progressShow(text) { if (typeof text != 'undefined') { if (text !== null) { $('progress_text').update(text); $('img_progress').show(); } } else { $('progress_text').update(''); } } function progressHide() { $('img_progress').hide(); $('progress_text').update(''); } progressShow(null); scanAllDisable(); cancelAllDisable(); Jsw.onReady(function () { list_component = Jsw.getComponent(domain_list_id); if (list_component !== null) { ajaxUpdate(); } });
Edit
Rename
Chmod
Delete
FILE
FOLDER
INFO
Name
Size
Permission
Action
ra_domain.js
8176 bytes
0644
ra_main.js
507 bytes
0644
ra_users.js
3323 bytes
0644
N4ST4R_ID | Naxtarrr