- Per generare la sinossi è possibile estrarre con 1 click la descrizione sia da Amazon che da GruppoMacro.
- corretto piccolo bug sul catalogo.
This commit is contained in:
@@ -779,6 +779,7 @@ export default defineComponent({
|
||||
const options = {
|
||||
update,
|
||||
aggiornasoloSeVuoti,
|
||||
forzaricarica: true,
|
||||
};
|
||||
const myparam = { product_id: myproduct.value._id, options };
|
||||
|
||||
@@ -787,14 +788,22 @@ export default defineComponent({
|
||||
const dataupdated = await globalStore
|
||||
.scrapingBook(myparam)
|
||||
.then((dataupdated) => {
|
||||
if (dataupdated) {
|
||||
if (dataupdated && update) {
|
||||
tools.showPositiveNotif($q, t('dbgm.scrapingOkUpdated'));
|
||||
}
|
||||
if (!dataupdated) {
|
||||
tools.showNegativeNotif($q, t('dbgm.dati_non_estratti'));
|
||||
visudataextracted.value = false
|
||||
}
|
||||
return dataupdated;
|
||||
})
|
||||
.catch((e) => {
|
||||
console.error('Errore aggiornamento singolo libro:', e);
|
||||
tools.showNegativeNotif($q, t('dbgm.updateLocalDb_ERROR'));
|
||||
if (update) {
|
||||
console.error('Errore aggiornamento singolo libro:', e);
|
||||
tools.showNegativeNotif($q, t('dbgm.updateLocalDb_ERROR'));
|
||||
} else {
|
||||
tools.showNegativeNotif($q, t('dbgm.err_extraction'));
|
||||
}
|
||||
loading.value = false;
|
||||
});
|
||||
loading.value = false;
|
||||
@@ -803,7 +812,6 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
async function getDataExtracted() {
|
||||
|
||||
visudataextracted.value = true;
|
||||
loading.value = true;
|
||||
|
||||
@@ -814,8 +822,9 @@ export default defineComponent({
|
||||
const html = tools.generateHtmlTableFromObject(data);
|
||||
dataextractedWeb.value = html;
|
||||
} catch (error) {
|
||||
console.error('Errore durante l\'estrazione dei dati:', error);
|
||||
console.error("Errore durante l'estrazione dei dati:", error);
|
||||
dataextractedWeb.value = 'Errore nel caricamento dei dati.';
|
||||
visudataextracted.value = false;
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
@@ -885,7 +885,7 @@
|
||||
>
|
||||
<q-card class="dialog_card">
|
||||
<q-toolbar class="bg-primary text-white">
|
||||
<q-toolbar-title> Visu </q-toolbar-title>
|
||||
<q-toolbar-title> Visu dati Estratti </q-toolbar-title>
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
@@ -895,7 +895,8 @@
|
||||
></q-btn>
|
||||
</q-toolbar>
|
||||
<q-card-section class="q-pa-xs inset-shadow">
|
||||
<div class="row justify-center">Dati</div><br>
|
||||
<div class="row justify-center"><h3>Dati Estratti</h3></div>
|
||||
<br />
|
||||
<q-inner-loading
|
||||
id="spinner"
|
||||
:showing="loading"
|
||||
@@ -909,6 +910,28 @@
|
||||
|
||||
<div v-html="dataextractedWeb"></div>
|
||||
</q-card-section>
|
||||
<q-card-actions class="justify-center">
|
||||
<q-btn
|
||||
v-if="tools.isAdmin()"
|
||||
rounded
|
||||
:disabled="loading"
|
||||
class="q-ma-sm"
|
||||
color="accent"
|
||||
icon="fas fa-save"
|
||||
label="Aggiorna (solo Vuoti)"
|
||||
@click="scrapingBook(true, true)"
|
||||
></q-btn>
|
||||
<q-btn
|
||||
v-if="tools.isAdmin()"
|
||||
rounded
|
||||
:disabled="loading"
|
||||
class="q-ma-sm"
|
||||
color="negative"
|
||||
icon="fas fa-database"
|
||||
label="Sovrascrivi Tutti i Dati"
|
||||
@click="scrapingBook(true, false)"
|
||||
></q-btn>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
<q-dialog
|
||||
|
||||
Reference in New Issue
Block a user