uawdijnntqw1x1x1
IP : 52.14.189.148
Hostname : axolotl
Kernel : Linux axolotl 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
OS : Linux
PATH:
/
var
/
www
/
axolotl
/
data
/
www
/
axolotl.ru
/
www
/
bitrix
/
js
/
timeman
/
export
/
src
/
..
/
src
/
export.js
/
/
import {ajax, Type} from 'main.core'; import {ExportState} from './export-state'; import {ExportPopup} from './export-popup'; export class Export { constructor(options) { options = {...{ signedParameters: '', componentName: '', siteId: '', stExportId: '', managerId: '', sToken: '', }, ...options}; this.signedParameters = options.signedParameters; this.componentName = options.componentName; this.siteId = options.siteId; this.stExportId = options.stExportId; this.managerId = options.managerId; this.sToken = options.sToken; this.cToken = 'c'; this.exportState = new ExportState(); this.exportPopup = new ExportPopup({ exportManager: this, exportState: this.exportState }); this.availableTypes = ['excel', 'csv']; } startExport(exportType) { if (!this.availableTypes.includes(exportType)) { throw 'Export: parameter "exportType" has invalid value'; } this.exportType = exportType; this.exportPopup.createPopup(); this.exportPopup.showPopup(); this.startRequest(); } getExcelExportType() { return 'excel'; } getCsvExportType() { return 'csv'; } startRequest() { this.cToken += Date.now(); this.request('timeman.api.export.dispatcher'); } nextRequest() { this.request('timeman.api.export.dispatcher'); } stopRequest() { this.request('timeman.api.export.cancel'); } clearRequest() { this.request('timeman.api.export.clear'); } request(action) { this.exportState.setRunning(); ajax.runAction(action, { data: { 'SITE_ID': this.siteId, 'PROCESS_TOKEN': this.sToken + this.cToken, 'EXPORT_TYPE': this.exportType, 'COMPONENT_NAME': this.componentName, 'signedParameters': this.signedParameters } }).then((response) => { this.handleResponse(response); }).catch((response) => { this.handleResponse(response); }); } handleResponse(response) { if (response.errors.length) { this.exportPopup.setPopupContent(response.errors.shift().message); this.exportState.setError(); } else if (response.status === 'success') { const data = response.data; switch (data['STATUS']) { case 'COMPLETED': case 'NOT_REQUIRED': this.exportState.setCompleted(); break; case 'PROGRESS': const processedItems = (Type.isInteger(data['PROCESSED_ITEMS']) ? data['PROCESSED_ITEMS'] : 0); const totalItems = (Type.isInteger(data['TOTAL_ITEMS']) ? data['TOTAL_ITEMS'] : 0); this.exportPopup.setProgressBar(processedItems, totalItems); setTimeout(() => this.nextRequest(), 200); break; } this.exportPopup.setPopupContent(data); } else { this.exportState.setError(); } this.exportPopup.adjustPosition(); } }
/var/www/axolotl/data/www/axolotl.ru/www/bitrix/js/timeman/export/src/../src/export.js