diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c4c4ffc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.zip diff --git a/files/client/custom/modules/data-migration/res/templates/admin/data-migration.tpl b/files/client/custom/modules/data-migration/res/templates/admin/data-migration.tpl new file mode 100644 index 0000000..544ee60 --- /dev/null +++ b/files/client/custom/modules/data-migration/res/templates/admin/data-migration.tpl @@ -0,0 +1,179 @@ +
+ {{translate 'exportDescription' category='messages' scope='DataMigration'}} +
+ + {{! Status filter }} +No data
').show(); + return; + } + + let html = '| ' + this.translate('Entity Type') + ' | ' + this.translate('Count') + ' |
|---|---|
| ' + type + ' | ' + counts[type].toLocaleString() + ' |
| ' + this.translate('Total') + ' | '; + html += '' + total.toLocaleString() + ' |
'; + html += ' '; + html += this.translate('Attachments') + ': ' + (this.statusData.attachmentFiles || 0).toLocaleString(); + html += ' (' + (this.statusData.attachmentSizeFormatted || '0 B') + ')'; + html += '
'; + + $container.html(html).show(); + }, + + loadBackups: function () { + this.isLoadingBackups = true; + this.$el.find('.backups-spinner').show(); + + Espo.Ajax.getRequest('DataMigration/action/listBackups') + .then(response => { + this.backups = response.backups || []; + this.isLoadingBackups = false; + this.renderBackups(); + }) + .catch(() => { + this.isLoadingBackups = false; + this.$el.find('.backups-spinner').hide(); + Espo.Ui.error('Failed to load backups'); + }); + }, + + renderBackups: function () { + const $container = this.$el.find('.backups-list'); + const $spinner = this.$el.find('.backups-spinner'); + $spinner.hide(); + + if (!this.backups || this.backups.length === 0) { + $container.html( + ''; + html += ' ' + date; + html += ' | ' + totalRecords.toLocaleString() + ' ' + this.translate('records', 'labels', 'DataMigration'); + html += ' | ' + (backup.totalAttachmentFiles || 0).toLocaleString() + ' ' + this.translate('files', 'labels', 'DataMigration'); + html += ' (' + (backup.sizeFormatted || '0 B') + ')'; + html += '
'; + + // Details (hidden by default) + html += ''; + html += '';
+
+ lines.forEach(line => {
+ let lineClass = '';
+
+ if (line.includes('ERROR')) {
+ lineClass = 'text-danger';
+ } else if (line.includes('WARNING')) {
+ lineClass = 'text-warning';
+ } else if (line.includes('===') || line.includes('Complete')) {
+ lineClass = 'text-success';
+ }
+
+ if (lineClass) {
+ html += '' + this.escapeHtml(line) + '\n';
+ } else {
+ html += this.escapeHtml(line) + '\n';
+ }
+ });
+
+ html += '