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) {
case 'mysql':
case 'maria':
exporter = new MysqlExporter(connections[uid], tables, rest);
break;
default:

View File

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

View File

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

View File

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