|
5 | 5 | const diagnostics = data.diagnostics || []; |
6 | 6 | const totalEntities = data.totalEntities || 0; |
7 | 7 | const totalRecords = data.totalRecords || 0; |
| 8 | + const orphanedEntities = data.orphanedEntities || []; |
8 | 9 |
|
9 | 10 | let searchQuery = $state(""); |
10 | 11 | let copiedId = $state<string | null>(null); |
@@ -159,6 +160,62 @@ ${diag.triedKeys ? `Tried Keys: ${diag.triedKeys.join(", ")}` : ""} |
159 | 160 | </div> |
160 | 161 | </div> |
161 | 162 |
|
| 163 | +<!-- Orphaned Entities --> |
| 164 | +{#if orphanedEntities.length > 0} |
| 165 | + <div class="mb-6 rounded-lg border-2 border-yellow-400 bg-yellow-50 shadow-sm dark:border-yellow-600 dark:bg-yellow-900/20"> |
| 166 | + <div class="border-b border-yellow-300 p-4 dark:border-yellow-700"> |
| 167 | + <div class="flex items-center gap-2"> |
| 168 | + <svg class="h-5 w-5 text-yellow-600 dark:text-yellow-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
| 169 | + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z" /> |
| 170 | + </svg> |
| 171 | + <h2 class="text-lg font-semibold text-yellow-800 dark:text-yellow-200"> |
| 172 | + Orphaned Entities ({orphanedEntities.length}) |
| 173 | + </h2> |
| 174 | + </div> |
| 175 | + <p class="mt-1 text-sm text-yellow-700 dark:text-yellow-300"> |
| 176 | + Data records whose Dynamic Entity definition has been deleted. These records still exist in the database but have no schema and cannot be accessed via the API. |
| 177 | + </p> |
| 178 | + </div> |
| 179 | + <div class="p-4"> |
| 180 | + <div class="overflow-x-auto"> |
| 181 | + <table class="min-w-full divide-y divide-yellow-300 dark:divide-yellow-700"> |
| 182 | + <thead> |
| 183 | + <tr> |
| 184 | + <th class="px-4 py-2 text-left text-xs font-medium uppercase tracking-wider text-yellow-700 dark:text-yellow-300">Entity Name</th> |
| 185 | + <th class="px-4 py-2 text-left text-xs font-medium uppercase tracking-wider text-yellow-700 dark:text-yellow-300">Bank ID</th> |
| 186 | + <th class="px-4 py-2 text-right text-xs font-medium uppercase tracking-wider text-yellow-700 dark:text-yellow-300">Record Count</th> |
| 187 | + </tr> |
| 188 | + </thead> |
| 189 | + <tbody class="divide-y divide-yellow-200 dark:divide-yellow-800"> |
| 190 | + {#each orphanedEntities as orphan} |
| 191 | + <tr class="hover:bg-yellow-100 dark:hover:bg-yellow-900/30"> |
| 192 | + <td class="whitespace-nowrap px-4 py-3 text-sm font-mono font-semibold text-yellow-900 dark:text-yellow-100"> |
| 193 | + {orphan.entity_name} |
| 194 | + </td> |
| 195 | + <td class="whitespace-nowrap px-4 py-3 text-sm font-mono text-yellow-800 dark:text-yellow-200"> |
| 196 | + {orphan.bank_id || ""} |
| 197 | + </td> |
| 198 | + <td class="whitespace-nowrap px-4 py-3 text-right text-sm font-mono font-semibold text-yellow-900 dark:text-yellow-100"> |
| 199 | + {orphan.record_count} |
| 200 | + </td> |
| 201 | + </tr> |
| 202 | + {/each} |
| 203 | + </tbody> |
| 204 | + </table> |
| 205 | + </div> |
| 206 | + </div> |
| 207 | + </div> |
| 208 | +{:else} |
| 209 | + <div class="mb-6 rounded-lg border border-green-200 bg-green-50 p-4 dark:border-green-800 dark:bg-green-900/20"> |
| 210 | + <div class="flex items-center gap-2"> |
| 211 | + <svg class="h-5 w-5 text-green-600 dark:text-green-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
| 212 | + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" /> |
| 213 | + </svg> |
| 214 | + <p class="text-sm font-medium text-green-800 dark:text-green-200">No orphaned entities detected.</p> |
| 215 | + </div> |
| 216 | + </div> |
| 217 | +{/if} |
| 218 | + |
162 | 219 | <!-- Search --> |
163 | 220 | <div class="mb-6"> |
164 | 221 | <input |
@@ -411,7 +468,7 @@ ${diag.triedKeys ? `Tried Keys: ${diag.triedKeys.join(", ")}` : ""} |
411 | 468 | class="whitespace-pre-wrap break-words rounded-lg bg-gray-50 p-4 text-xs dark:bg-gray-900"><code |
412 | 469 | class="text-gray-900 dark:text-gray-100" |
413 | 470 | >{JSON.stringify( |
414 | | - { diagnostics, totalEntities, totalRecords }, |
| 471 | + { diagnostics, totalEntities, totalRecords, orphanedEntities }, |
415 | 472 | null, |
416 | 473 | 2, |
417 | 474 | )}</code |
|
0 commit comments