perf: avoid to load schema elements if already loaded in export modal

This commit is contained in:
Fabio Di Stasio 2021-11-01 14:52:45 +01:00
parent 9e9de7b5c5
commit d9d3bf2bc9
4 changed files with 23 additions and 16 deletions

View File

@ -172,6 +172,7 @@ export default connections => {
switch (type) { switch (type) {
case 'mysql': case 'mysql':
case 'maria':
exporter = new MysqlExporter(connections[uid], tables, rest); exporter = new MysqlExporter(connections[uid], tables, rest);
break; break;
default: default:

View File

@ -48,11 +48,16 @@
</div> </div>
<div class="column col-auto col-ml-auto "> <div class="column col-auto col-ml-auto ">
<button class="btn btn-dark btn-sm" @click="refresh"> <button
class="btn btn-dark btn-sm"
:title="$t('word.refresh')"
@click="refresh"
>
<i class="mdi mdi-database-refresh" /> <i class="mdi mdi-database-refresh" />
</button> </button>
<button <button
class="btn btn-dark btn-sm" class="btn btn-dark btn-sm"
:title="$t('message.uncheckAllTables')"
:disabled="isRefreshing" :disabled="isRefreshing"
@click="uncheckAllTables" @click="uncheckAllTables"
> >
@ -60,6 +65,7 @@
</button> </button>
<button <button
class="btn btn-dark btn-sm" class="btn btn-dark btn-sm"
:title="$t('message.checkAllTables')"
:disabled="isRefreshing" :disabled="isRefreshing"
@click="checkAllTables" @click="checkAllTables"
> >
@ -258,8 +264,10 @@ export default {
} }
}, },
async created () { async created () {
await this.refresh(); if (!this.schemaItems.length) await this.refresh();
window.addEventListener('keydown', this.onKey); window.addEventListener('keydown', this.onKey);
this.basePath = await Application.getDownloadPathDirectory(); this.basePath = await Application.getDownloadPathDirectory();
this.tables = this.schemaItems.map(item => ({ this.tables = this.schemaItems.map(item => ({
table: item.name, table: item.name,

View File

@ -155,12 +155,10 @@ module.exports = {
downloadingUpdate: 'Downloading update', downloadingUpdate: 'Downloading update',
updateDownloaded: 'Update downloaded', updateDownloaded: 'Update downloaded',
restartToInstall: 'Restart Antares to install', restartToInstall: 'Restart Antares to install',
unableEditFieldWithoutPrimary: unableEditFieldWithoutPrimary: 'Unable to edit a field without a primary key in resultset',
'Unable to edit a field without a primary key in resultset',
editCell: 'Edit cell', editCell: 'Edit cell',
deleteRows: 'Delete row | Delete {count} rows', deleteRows: 'Delete row | Delete {count} rows',
confirmToDeleteRows: confirmToDeleteRows: 'Do you confirm to delete one row? | Do you confirm to delete {count} rows?',
'Do you confirm to delete one row? | Do you confirm to delete {count} rows?',
notificationsTimeout: 'Notifications timeout', notificationsTimeout: 'Notifications timeout',
uploadFile: 'Upload file', uploadFile: 'Upload file',
addNewRow: 'Add new row', addNewRow: 'Add new row',
@ -188,8 +186,7 @@ module.exports = {
deleteTable: 'Delete table', deleteTable: 'Delete table',
emptyCorfirm: 'Do you confirm to empty', emptyCorfirm: 'Do you confirm to empty',
unsavedChanges: 'Unsaved changes', unsavedChanges: 'Unsaved changes',
discardUnsavedChanges: discardUnsavedChanges: 'You have some unsaved changes. Closing this tab these changes will be discarded.',
'You have some unsaved changes. Closing this tab these changes will be discarded.',
thereAreNoIndexes: 'There are no indexes', thereAreNoIndexes: 'There are no indexes',
thereAreNoForeign: 'There are no foreign keys', thereAreNoForeign: 'There are no foreign keys',
createNewForeign: 'Create new foreign key', createNewForeign: 'Create new foreign key',
@ -266,7 +263,9 @@ module.exports = {
newInserStmtEvery: 'New INSERT statement every', newInserStmtEvery: 'New INSERT statement every',
processingTableExport: 'Processing {table}', processingTableExport: 'Processing {table}',
fechingTableExport: 'Fetching {table} data', fechingTableExport: 'Fetching {table} data',
writingTableExport: 'Writing {table} data' writingTableExport: 'Writing {table} data',
checkAllTables: 'Check all tables',
uncheckAllTables: 'Uncheck all tables'
}, },
faker: { faker: {
address: 'Address', address: 'Address',

View File

@ -155,12 +155,10 @@ module.exports = {
downloadingUpdate: 'Download dell\'aggiornamento', downloadingUpdate: 'Download dell\'aggiornamento',
updateDownloaded: 'Aggiornamento scaricato', updateDownloaded: 'Aggiornamento scaricato',
restartToInstall: 'Riavvia Antares per installare l\'aggiornamento', restartToInstall: 'Riavvia Antares per installare l\'aggiornamento',
unableEditFieldWithoutPrimary: unableEditFieldWithoutPrimary: 'Impossibile modificare il campo senza una primary key nel resultset',
'Impossibile modificare il campo senza una primary key nel resultset',
editCell: 'Modifica cella', editCell: 'Modifica cella',
deleteRows: 'Elimina riga | Elimina {count} righe', deleteRows: 'Elimina riga | Elimina {count} righe',
confirmToDeleteRows: confirmToDeleteRows: 'Confermi di voler cancellare una riga? | Confermi di voler cancellare {count} righe?',
'Confermi di voler cancellare una riga? | Confermi di voler cancellare {count} righe?',
notificationsTimeout: 'Timeout Notifiche', notificationsTimeout: 'Timeout Notifiche',
uploadFile: 'Carica file', uploadFile: 'Carica file',
addNewRow: 'Aggiungi nuova riga', addNewRow: 'Aggiungi nuova riga',
@ -188,8 +186,7 @@ module.exports = {
deleteTable: 'Cancella tabella', deleteTable: 'Cancella tabella',
emptyCorfirm: 'Confermi di voler svuotare', emptyCorfirm: 'Confermi di voler svuotare',
unsavedChanges: 'Modifiche non salvate', unsavedChanges: 'Modifiche non salvate',
discardUnsavedChanges: discardUnsavedChanges: 'Hai modifiche non salvate. Lasciando questa scheda le modifiche saranno scartate.',
'Hai modifiche non salvate. Lasciando questa scheda le modifiche saranno scartate.',
thereAreNoIndexes: 'Non ci sono indici', thereAreNoIndexes: 'Non ci sono indici',
thereAreNoForeign: 'Non ci sono chiavi esterne', thereAreNoForeign: 'Non ci sono chiavi esterne',
createNewForeign: 'Crea nuova chiave esterna', createNewForeign: 'Crea nuova chiave esterna',
@ -253,7 +250,9 @@ module.exports = {
newInserStmtEvery: 'Nuova istruzione INSERT ogni', newInserStmtEvery: 'Nuova istruzione INSERT ogni',
processingTableExport: 'Processo {table}', processingTableExport: 'Processo {table}',
fechingTableExport: 'Ricavo i dati {table}', fechingTableExport: 'Ricavo i dati {table}',
writingTableExport: 'Scrittura dati {table}' writingTableExport: 'Scrittura dati {table}',
checkAllTables: 'Seleziona tutte le tabelle',
uncheckAllTables: 'Deseleziona tutte le tabelle'
}, },
faker: { faker: {
address: 'Indirizzo', address: 'Indirizzo',