This commit is contained in:
2026-04-30 21:33:58 +02:00
parent 2639242ca6
commit 5a3948fee5
11 changed files with 635 additions and 113 deletions

View File

@@ -94,6 +94,11 @@
<i class="fa-brands fa-facebook-f"></i> Facebook Ads
</button>
<?php endif; ?>
<?php if ( !empty( $client['xml_feed_url'] ) ): ?>
<button type="button" onclick="syncFromMenu(<?= $client['id']; ?>, 'xml_feed', this)">
<i class="fa-solid fa-file-code"></i> XML Feed
</button>
<?php endif; ?>
</div>
</div>
<button type="button" class="btn-icon btn-icon-edit" onclick="editClient(<?= $client['id']; ?>)" title="Edytuj">
@@ -183,6 +188,7 @@ function openClientForm()
$( '#client-gads-id' ).val( '' );
$( '#client-fbads-id' ).val( '' );
$( '#client-gmc-id' ).val( '' );
$( '#client-xml-feed-url' ).val( '' );
$( '#client-gads-start' ).val( '' );
$( '#client-modal' ).fadeIn();
}
@@ -300,7 +306,8 @@ function syncFromMenu( id, pipeline, btn )
products: 'produktow',
campaigns_product_alerts_merchant: 'walidacji Merchant',
supplemental_feed: 'supplemental feed',
facebook_ads: 'Facebook Ads'
facebook_ads: 'Facebook Ads',
xml_feed: 'XML feedu'
};
$.post( '/clients/force_sync', { id: id, pipeline: pipeline }, function( response )
@@ -312,9 +319,23 @@ function syncFromMenu( id, pipeline, btn )
if ( data.success )
{
var msg = data.immediate
? 'Supplemental feed wygenerowany pomyslnie.'
: 'Synchronizacja ' + labels[ pipeline ] + ' zostala zakolejkowana. Dane zostana pobrane przy najblizszym uruchomieniu CRON.';
var msg = '';
if ( data.immediate && pipeline === 'xml_feed' )
{
var report = data.report || {};
msg = 'XML feed odswiezony. Pobrane: ' + ( report.fetched || 0 )
+ ', zaktualizowane: ' + ( report.updated || 0 )
+ ', dodane: ' + ( report.inserted || 0 )
+ ', pominiete: ' + ( report.skipped || 0 ) + '.';
}
else if ( data.immediate )
{
msg = 'Supplemental feed wygenerowany pomyslnie.';
}
else
{
msg = 'Synchronizacja ' + labels[ pipeline ] + ' zostala zakolejkowana. Dane zostana pobrane przy najblizszym uruchomieniu CRON.';
}
$.alert({
title: data.immediate ? 'Gotowe' : 'Zakolejkowano',