89 lines
2.7 KiB
Smarty
89 lines
2.7 KiB
Smarty
{include file='./../parts/import_steps.tpl' step=5}
|
|
<p> </p>
|
|
|
|
{include file='./../parts/import_queue.tpl' import_queue=$import_queue import_button=0}
|
|
|
|
<div class="col-xs-12 panel">
|
|
<div class="panel-heading">
|
|
{l s='Generating combinations' mod='pshowimporter'}
|
|
</div>
|
|
<div class="panel-content">
|
|
<p>
|
|
<strong>{l s='Number of pending products' mod='pshowimporter'}:</strong>
|
|
<span class="numberOfPendingProducts"></span>
|
|
</p>
|
|
<p>
|
|
<strong>{l s='Status' mod='pshowimporter'}:</strong>
|
|
<span class="status"></span>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="clearfix"></div>
|
|
|
|
<div class="panel">
|
|
<div class="panel-heading">
|
|
{l s='Import log' mod='pshowimporter'}
|
|
</div>
|
|
<div id="log_content" style="height: 300px; overflow-y: scroll;">
|
|
{$log_content|nl2br}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="clearfix"></div>
|
|
|
|
<script>
|
|
|
|
var numberOfPendingProducts = {$numberOfPendingProducts};
|
|
window.log_url = "{$link->getAdminLink('PShowImporterMain', true)}&page=getlog&filename={$filename|urlencode}";
|
|
window.gen_url = "{$link->getAdminLink('PShowImporterImport', true)}&page=gencomb&import=1&ajax=1";
|
|
window.import_url = "{$link->getAdminLink('PShowImporterImport', true)}&page=import";
|
|
|
|
function getlog() {
|
|
$.get(window.log_url, function (data) {
|
|
$('#log_content').html(data);
|
|
|
|
var objDiv = document.getElementById("log_content");
|
|
objDiv.scrollTop = objDiv.scrollHeight;
|
|
|
|
setTimeout('getlog()', 3000);
|
|
});
|
|
}
|
|
|
|
function call() {
|
|
$.get(window.gen_url, function (data) {
|
|
console.log(data);
|
|
try {
|
|
data = JSON.parse(data);
|
|
} catch (ex) {
|
|
return false;
|
|
}
|
|
|
|
if (parseInt(data.numberOfPendingProducts) <= 0) {
|
|
document.location.href = window.import_url;
|
|
return;
|
|
}
|
|
|
|
$('.numberOfPendingProducts').text(data.numberOfPendingProducts);
|
|
call();
|
|
});
|
|
}
|
|
|
|
window.numberOfDots = 1;
|
|
function dots() {
|
|
++window.numberOfDots;
|
|
if (window.numberOfDots > 5) {
|
|
window.numberOfDots = 1;
|
|
}
|
|
$('.status').text("{l s='Generating' mod='pshowimporter'}"+'.'.repeat(window.numberOfDots));
|
|
setTimeout('dots()', 800);
|
|
}
|
|
|
|
$(function () {
|
|
$('.numberOfPendingProducts').text(numberOfPendingProducts);
|
|
dots();
|
|
getlog();
|
|
call();
|
|
});
|
|
|
|
</script> |