%PDF- %PDF- 403WebShell
403Webshell
Server IP : 37.220.80.31  /  Your IP : 3.147.49.183
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux 3051455-guretool.twc1.net 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64
User : www-root ( 1010)
PHP Version : 7.4.33
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,
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/www-root/data/www/dev.artlot24.ru/bitrix/js/sale/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/js/sale/vk_admin.js
;(function (window) {

	if (!BX.Sale)
		BX.Sale = {};

	if (!BX.Sale.VkAdmin) {
		BX.Sale.VkAdmin = {};

	}
	BX.Sale.VkAdmin = {

		ajaxUrl: '/bitrix/admin/sale_vk_ajax.php',

		startFeed: function (feedType, exportId, firstRun) {
			BX.Sale.VkAdmin.exportProcessProlog();

			if(firstRun)
				BX.cleanNode(BX('vk_export_notify__progress'));

			BX.showWait();

			var postData = {
				action: "startFeed",
				type: feedType,
				exportId: exportId,
				firstRun: firstRun,
				sessid: BX.bitrix_sessid()
			};

			BX.ajax({
				timeout: 120,
				method: 'POST',
				dataType: 'json',
				url: BX.Sale.VkAdmin.ajaxUrl,
				data: postData,

				onsuccess: function (result) {
					// reload page to show ERRORS
					if (result && result.ERRORS_CRITICAL) {
						BX.closeWait();
						BX.adjust(BX('vk_export_notify__error_critical'), {style: {display: 'block'}});
						BX.adjust(BX('vk_export_notify__error_critical'), {html: result.ERRORS_CRITICAL});
						if (result.PROGRESS.length > 0)
							BX.adjust(BX('vk_export_notify__progress'), {html: result.PROGRESS});
						BX.Sale.VkAdmin.exportProcessEpilog();
					}

					// NOT error
					else {
						// NORMAL mode, continue process
						if (result && result.CONTINUE) {
							BX.closeWait();
							BX.Sale.VkAdmin.startFeed(result.TYPE, exportId, false);
						}
						// FINISH process
						else {
							BX.closeWait();
							BX.Sale.VkAdmin.exportProcessEpilog();
						}

						if (result.PROGRESS.length > 0)
							BX.adjust(BX('vk_export_notify__progress'), {html: result.PROGRESS});

						if (typeof(result.STATS_ALBUMS) != 'undefined' && result.STATS_ALBUMS.length > 0)
							BX.adjust(BX('vk_export_statistic__albums'), {html: result.STATS_ALBUMS});

						if (typeof(result.STATS_PRODUCTS) != 'undefined' && result.STATS_PRODUCTS.length > 0)
							BX.adjust(BX('vk_export_statistic__products'), {html: result.STATS_PRODUCTS});

						if (typeof(result.ERRORS_NORMAL) != 'undefined' && result.ERRORS_NORMAL.length > 0) {
							BX.adjust(BX('vk_export_notify__error_normal'), {style: {display: 'block'}});
							BX.adjust(BX('vk_export_notify__error_normal__msg'), {html: result.ERRORS_NORMAL});
						}
					}
				},

				onfailure: function () {
					BX.closeWait();
					BX.Sale.VkAdmin.exportProcessEpilog();
					BX.debug('Feed failure!');
					location.reload();
				}
			});
		},


		exportProcessProlog: function () {
			// hide button "start export"
			BX.adjust(BX('vk_export_button__startFeed_all'), {props: {disabled: true}});
			// hide additional buttons
			var buttons = document.getElementsByClassName("adm-btn-menu");
			for (var i = 0; i < buttons.length; i++) {
				BX.adjust(buttons[i], {style: {display: 'none'}});
				BX.addClass(buttons[i], 'adm-btn-disabled');
			}
			// hide system buttons
			BX.adjust(BX('vk_export_button__save'), {props: {disabled: true}});
			BX.adjust(BX('vk_export_button__apply'), {props: {disabled: true}});
			BX.adjust(BX('vk_export_button__cancel'), {props: {disabled: true}});
		},


		exportProcessEpilog: function () {
			// show button "start export"
			BX.adjust(BX('vk_export_button__startFeed_all'), {props: {disabled: false}});
			// show additional buttons
			var buttons = document.getElementsByClassName("adm-btn-menu");
			for (var i = 0; i < buttons.length; i++) {
				BX.adjust(buttons[i], {style: {display: 'inline-block'}});
				BX.removeClass(buttons[i], 'adm-btn-disabled');
			}
			// show system buttons
			BX.adjust(BX('vk_export_button__save'), {props: {disabled: false}});
			BX.adjust(BX('vk_export_button__apply'), {props: {disabled: false}});
			BX.adjust(BX('vk_export_button__cancel'), {props: {disabled: false}});
		},


		stopProcess: function (exportId) {
			BX.showWait();

			var postData = {
				action: "stopProcess",
				exportId: exportId,
				sessid: BX.bitrix_sessid()
			};

			BX.ajax({
				timeout: 120,
				method: 'POST',
				dataType: 'json',
				url: BX.Sale.VkAdmin.ajaxUrl,
				data: postData,

				onsuccess: function (result) {
					BX.closeWait();

					if (result && result.COMPLETED) {
						//all right
					}
					else {
						alert(result.ERROR);
					}

					BX.Sale.VkAdmin.exportProcessEpilog();
				},

				onfailure: function () {
					BX.debug('Feed SALE_VK_SETTINGS_RESET_ERROR');
				}
			});
		},

		clearErrorLog: function (exportId) {
			BX.showWait();

			var postData = {
				action: "clearErrorLog",
				exportId: exportId,
				sessid: BX.bitrix_sessid()
			};

			BX.ajax({
				timeout: 120,
				method: 'POST',
				dataType: 'json',
				url: BX.Sale.VkAdmin.ajaxUrl,
				data: postData,

				onsuccess: function (result) {
					BX.closeWait();

					if (result && result.COMPLETED) {
						BX.adjust(BX('vk_export_notify__error_normal'), {style: {display: 'none'}});
						BX.adjust(BX('vk_export_notify__error_critical'), {style: {display: 'none'}});
						//all right, do nothing
					}
					else {
						alert(result.MESSAGE);
					}
				},

				onfailure: function () {
					BX.closeWait();
					BX.debug('Feed SALE_VK_SETTINGS_RESET_ERROR');
				}
			});
		},

		loadExportMapOk: false,
		loadExportMap: function(exportId) {
			if(!BX.Sale.VkAdmin.loadExportMapOk) {

				var postData = {
					action: "loadExportMap",
					exportId: exportId,
					sessid: BX.bitrix_sessid()
				};

				BX.ajax({
					timeout: 120,
					method: 'POST',
					dataType: 'json',
					url: BX.Sale.VkAdmin.ajaxUrl,
					async: true,
					data: postData,

					onsuccess: function (result) {

						if (result && result.COMPLETED) {
							BX.adjust(BX('vk_export_map_edit_table__content'), {html: result.MAP});
							BX.Sale.VkAdmin.loadExportMapOk = true;
						}
					},
					onfailure: function () {
						BX.debug('LOAD EXPORT MAP ERROR');
					}
				});
			}
		},

		changeVkGroupLink: function()
		{
			BX("vk_export_groupselector__link").href = 'https://vk.com/club' + BX("vk_export_groupselector").value;
		}
	};
})(window);

Youez - 2016 - github.com/yon3zu
LinuXploit