mysqlsyncr 1.0.82 → 1.0.84

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
- <!DOCTYPE html><html><head><title>MySQLsyncr</title><meta charset=utf-8><meta name=description content="A simple ui for the sync features in mysqlsyncr"><meta name=format-detection content="telephone=no"><meta name=msapplication-tap-highlight content=no><meta name=viewport content="user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1,width=device-width"><link rel=icon type=image/png sizes=128x128 href=/icons/favicon-128x128.png><link rel=icon type=image/png sizes=96x96 href=/icons/favicon-96x96.png><link rel=icon type=image/png sizes=32x32 href=/icons/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=/icons/favicon-16x16.png><link rel=icon type=image/ico href=/favicon.ico> <script type="module" crossorigin src="/assets/index-DomDZ6ci.js"></script>
1
+ <!DOCTYPE html><html><head><title>MySQLsyncr</title><meta charset=utf-8><meta name=description content="A simple ui for the sync features in mysqlsyncr"><meta name=format-detection content="telephone=no"><meta name=msapplication-tap-highlight content=no><meta name=viewport content="user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1,width=device-width"><link rel=icon type=image/png sizes=128x128 href=/icons/favicon-128x128.png><link rel=icon type=image/png sizes=96x96 href=/icons/favicon-96x96.png><link rel=icon type=image/png sizes=32x32 href=/icons/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=/icons/favicon-16x16.png><link rel=icon type=image/ico href=/favicon.ico> <script type="module" crossorigin src="/assets/index-CwWo8xmP.js"></script>
2
2
  <link rel="stylesheet" crossorigin href="/assets/index-kXpA8n8r.css">
3
3
  </head><body><div id=q-app></div></body></html>
@@ -43,9 +43,35 @@
43
43
  <!-- Database Structure Card -->
44
44
  <q-card v-if="Object.keys(existingDatabases).length > 0" class="q-mb-lg">
45
45
  <q-card-section class="bg-primary text-white">
46
- <div class="text-h6">
47
- <q-icon name="account_tree" class="q-mr-sm" />
48
- Database Structure
46
+ <div class="row items-center justify-between">
47
+ <div class="row items-center">
48
+ <q-icon name="account_tree" class="q-mr-sm" />
49
+ <div class="text-h6">Database Structure</div>
50
+ <q-badge
51
+ v-if="totalIssueCount > 0"
52
+ color="negative"
53
+ class="q-ml-sm"
54
+ >
55
+ {{ totalIssueCount }}
56
+ </q-badge>
57
+ </div>
58
+ <q-btn
59
+ v-if="totalIssueCount > 0"
60
+ flat
61
+ dense
62
+ color="white"
63
+ :loading="isFixingAll"
64
+ @click="fixAllIssues"
65
+ icon="build"
66
+ class="q-ml-md"
67
+ >
68
+ <q-tooltip>Fix All Issues ({{ totalIssueCount }})</q-tooltip>
69
+ <template v-slot:loading>
70
+ <span class="row items-center">
71
+ Fixing... ({{ currentFixProgress }}/{{ totalIssueCount }})
72
+ </span>
73
+ </template>
74
+ </q-btn>
49
75
  </div>
50
76
  </q-card-section>
51
77
 
@@ -428,8 +454,16 @@ export default {
428
454
  selectedNode: null,
429
455
  isNodeFixing: {}, // Tracks loading state for each node
430
456
  showFolderBrowser: false,
457
+ isFixingAll: false,
458
+ currentFixProgress: 0,
431
459
  }
432
460
  },
461
+ computed: {
462
+ totalIssueCount() {
463
+ return Object.values(this.differences)
464
+ .reduce((total, dbIssues) => total + dbIssues.length, 0);
465
+ },
466
+ },
433
467
  methods: {
434
468
  openSettings() {
435
469
  this.settingsDialog = true
@@ -1014,21 +1048,21 @@ export default {
1014
1048
  const selectedDbName = this.getDbNameFromNode(node)
1015
1049
  console.log('Selected DB Name:', selectedDbName)
1016
1050
  let type = node.id.split('-')[1]
1017
- const dbDifferences = this.differences[selectedDbName]
1018
- console.log('DB Differences:', dbDifferences)
1019
- if(type === 'tables'){
1020
- console.log('Collecting table issues')
1021
- console.log('DB Differences:', dbDifferences)
1022
- issues.push(...dbDifferences.filter(diff => diff.type.includes('table') || diff.tableName))
1023
- }else if(type === 'views'){
1024
- console.log('Collecting view issues')
1025
- issues.push(...dbDifferences.filter(diff => diff.type.includes('view')))
1026
- }else if(type === 'procedures'){
1027
- console.log('Collecting procedure issues')
1028
- issues.push(...dbDifferences.filter(diff => diff.type.includes('procedure')))
1029
- }else{
1030
- console.error('Unknown type:', type)
1031
- }
1051
+ const dbDifferences = this.differences[selectedDbName]
1052
+ console.log('DB Differences:', dbDifferences)
1053
+ if(type === 'tables'){
1054
+ console.log('Collecting table issues')
1055
+ console.log('DB Differences:', dbDifferences)
1056
+ issues.push(...dbDifferences.filter(diff => diff.type.includes('table') || diff.tableName))
1057
+ }else if(type === 'views'){
1058
+ console.log('Collecting view issues')
1059
+ issues.push(...dbDifferences.filter(diff => diff.type.includes('view')))
1060
+ }else if(type === 'procedures'){
1061
+ console.log('Collecting procedure issues')
1062
+ issues.push(...dbDifferences.filter(diff => diff.type.includes('procedure')))
1063
+ }else{
1064
+ console.error('Unknown type:', type)
1065
+ }
1032
1066
 
1033
1067
  }
1034
1068
  break
@@ -1060,6 +1094,109 @@ export default {
1060
1094
  }
1061
1095
  localStorage.setItem('dbConfig', JSON.stringify(dbConfig));
1062
1096
  },
1097
+ async fixAllIssues() {
1098
+ if (this.isFixingAll) return;
1099
+
1100
+ try {
1101
+ this.isFixingAll = true;
1102
+ this.currentFixProgress = 0;
1103
+
1104
+ let iterationCount = 0;
1105
+
1106
+ // Create the initial dialog
1107
+ const dialog = this.$q.dialog({
1108
+ title: 'Fixing Database Issues',
1109
+ message: `<div class="text-h6">Iteration: 1/6</div>
1110
+ <div class="text-subtitle2">Remaining issues: ${this.totalIssueCount}</div>
1111
+ <div class="text-caption">Preparing...</div>`,
1112
+ html: true,
1113
+ progress: {
1114
+ spinner: true,
1115
+ color: 'primary'
1116
+ },
1117
+ persistent: true,
1118
+ ok: false
1119
+ });
1120
+
1121
+ while (iterationCount < 6 && this.totalIssueCount > 0) {
1122
+ iterationCount++;
1123
+
1124
+ // Update dialog for new iteration
1125
+ dialog.update({
1126
+ message: `<div class="text-h6">Iteration: ${iterationCount}/6</div>
1127
+ <div class="text-subtitle2">Remaining issues: ${this.totalIssueCount}</div>
1128
+ <div class="text-caption">Starting fixes...</div>`,
1129
+ html: true
1130
+ });
1131
+
1132
+ // Fix issues for each database
1133
+ for (const dbName of Object.keys(this.differences)) {
1134
+ if (this.differences[dbName].length > 0) {
1135
+ const node = {
1136
+ id: `db-${dbName}`,
1137
+ type: 'database'
1138
+ };
1139
+
1140
+ // Update progress before fixing
1141
+ dialog.update({
1142
+ message: `<div class="text-h6">Iteration: ${iterationCount}/6</div>
1143
+ <div class="text-subtitle2">Remaining issues: ${this.totalIssueCount}</div>
1144
+ <div class="text-caption q-mt-sm">Currently fixing: <span class="text-weight-bold">${dbName}</span></div>`,
1145
+ html: true
1146
+ });
1147
+
1148
+ await this.fixNodeIssues(node);
1149
+ }
1150
+ }
1151
+
1152
+ // Refresh differences after all databases are processed
1153
+ await this.fetchAllDifferences();
1154
+
1155
+ // If all issues are fixed, show success
1156
+ if (this.totalIssueCount === 0) {
1157
+ await dialog.hide();
1158
+ this.$q.dialog({
1159
+ title: 'Success!',
1160
+ message: `<div class="text-h6 text-positive">All issues have been fixed!</div>
1161
+ <div class="text-subtitle2">Completed in ${iterationCount} iterations</div>`,
1162
+ html: true,
1163
+ ok: true,
1164
+ persistent: false
1165
+ });
1166
+ break;
1167
+ }
1168
+
1169
+ }
1170
+
1171
+ // If we hit the iteration limit
1172
+ if (iterationCount >= 6 && this.totalIssueCount > 0) {
1173
+ await dialog.hide();
1174
+ this.$q.dialog({
1175
+ title: 'Process Complete',
1176
+ message: `<div class="text-h6 text-warning">Maximum iterations reached</div>
1177
+ <div class="text-subtitle2">${this.totalIssueCount} issues remaining</div>
1178
+ <div class="text-caption">Completed all 6 iterations</div>`,
1179
+ html: true,
1180
+ ok: true,
1181
+ persistent: false
1182
+ });
1183
+ }
1184
+
1185
+ } catch (error) {
1186
+ console.error('Error fixing all issues:', error);
1187
+ this.$q.dialog({
1188
+ title: 'Error',
1189
+ message: `<div class="text-negative">An error occurred while fixing issues</div>
1190
+ <div class="text-caption">${error.message}</div>`,
1191
+ html: true,
1192
+ ok: true,
1193
+ persistent: false
1194
+ });
1195
+ } finally {
1196
+ this.isFixingAll = false;
1197
+ this.currentFixProgress = 0;
1198
+ }
1199
+ },
1063
1200
  },
1064
1201
  mounted() {
1065
1202
  const dbConfig = localStorage.getItem('dbConfig')