opt
/
kaspersky
/
kav4fs
/
share
/
wmconsole
/
html
/
js
/
pages
➕ New
📤 Upload
✎ Editing:
reportsPage.js
← Back
reportRowTmpl = new Template( '<tr id="tr_#{reportId}">' + '<td class="l"><div align="center"><input type="checkbox" class="checkBox" id="cb_#{reportId}" /></div></td>' + '<td class="w100" id="htmlLink">#{htmlLink}</td>'+ '<td id="ctimeFmt" class="nobr">#{ctimeFmt}</td>' + '<td class="nobr" style="color:#c3c3c3" id="exportLinks">#{exportLinks}</td>'+ '</tr>' ); function reportsPage_fireResultItem(item) { item.reportName = misc_preparetoView(item.reportName); if(!item.ctime) { if(item.reportError) { item.ctimeFmt = _res('REPORT_ERROR'); if(item.logUrl) { item.ctimeFmt += '<br />' + linkTemplate.fire({ url : item.logUrl, title : _res('REPORT_VIEW_LOG_FULL') }) } } else { item.ctimeFmt = _res('REPORT_GENERATING'); setTimeout(function(){ ic.getReportStatus(item.reportId, reportStatusCallback); }, 3000); } } else { item.ctimeFmt = misc_formatTime(item.ctime); } var exportLinks = new Array(); if(item.pdfUrl) exportLinks.push( linkTemplate.fire({url : item.pdfUrl, title : 'pdf'}) ) if(item.xlsUrl) exportLinks.push( linkTemplate.fire({url : item.xlsUrl, title : 'xls'}) ) item.exportLinks = exportLinks.join(' | '); function reduceReportName(name) { if(name.length > 40) return name.substr(0, 40) + '...'; return name; } if(item.htmlUrl) item.htmlLink = linkTemplate.fire({ url : item.htmlUrl, title : item.reportName, text : reduceReportName(item.reportName) }) else item.htmlLink = reduceReportName(item.reportName); if(item.logUrl) item.logLink = linkTemplate.fire({ url : item.logUrl, title : _res('REPORT_VIEW_LOG') }) return reportRowTmpl.evaluate(item); } function reportsPage_onload() { searchForm = new SearchObjectsForm(); searchForm.name = 'reports'; linkTemplate = new Template( '<a href="#{url}" title="#{title}" target="_blank" id="#{title}">#{text}</a>' ); linkTemplate.fire = function(params) { if(typeof(params.text) == 'undefined') params.text = params.title; return this.evaluate(params); } searchForm.fireResultItem = reportsPage_fireResultItem; searchForm.showSimpleMode = function(){} searchForm.getSimpleSearchParams = function(){ return {} } searchForm.deleteFunc = function(objectIds, callback) { ic.removeReports({objectId : objectIds}, callback); } searchForm.searchFunc = function(params, callback) { function callback__(response) { if(typeof(response.length) != 'undefined') { reportList = response; reportListCallback = callback; } callback(response); } ic.getReportList(params, callback__); } searchForm.run(); reportsPage_showCreateLink(); } function updateReportList(response) { if(typeof(reportList) == 'undefined') return; for(var i = 0; i < reportList.length; i++) if(reportList[i].reportId == response.reportId) reportList[i] = response; } function reportStatusCallback(response) { if(ic.ajaxError(response)) return; updateReportList(response); searchForm.fireResultItem(response); // response changes! var $tr = $('#resultTable #tr_' + response.reportId); ['htmlLink', 'ctimeFmt', 'exportLinks', 'logLink'].each(function(val){ $tr.find('#' + val).html(response[val]); }) } function reportsPage_showCreateLink() { // $('#createReportLink').loadCache('pages/reports_create_link.html') $('#createReportLink').unbind() .click(function(){ getDialog('newReport').open(); }); } function reportsPage_showCreateDlg() { getDialog('newReport').open(); // $('#createReportLink').loadCache('pages/reports_create_dlg.html') } connectionLostState = {}; ic.registerConnectionErrorHandler(function(connLostId){ if( (0 == $('#createReportLink').length) || (connectionLostState.connLostId == connLostId)) return; connectionLostState = { connLostId : connLostId, deleteButton : ($('a#deleteButton:not(.disabledLink)').length > 0) }; $('#resultTable :checkbox').disable(); $('#resultTable a').disable(); $('#createReportLink a').disable(); $('#createReportBtn').disable(); if(connectionLostState.deleteButton) searchForm.toggleDeleteButtonState(false); }) ic.registerConnectionRestoredHandler(function(){ if($('#createReportLink').length == 0) { connectionLostState = {}; return; } if(connectionLostState.deleteButton) searchForm.toggleDeleteButtonState(true); $('#resultTable :checkbox').enable(); $('#resultTable a').enable(); $('#createReportLink a').enable(); connectionLostState = {}; if( $('#createReportBtn').length > 0 ) updateButtonState(); })
💾 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