|
171 | 171 | <tr> |
172 | 172 | <td><?= htmlspecialchars($d->domain) ?></td> |
173 | 173 | <td><?= htmlspecialchars($d->provider) ?></td> |
174 | | - <td><?= htmlspecialchars(@gethostbyname($d->domain)) ?></td> |
| 174 | + <?php |
| 175 | + $ip = gethostbyname($d->domain); |
| 176 | + $resolved = $ip === $d->domain ? null : $ip; |
| 177 | + ?> |
| 178 | + <td title="<?= $resolved ? '' : 'Domain could not be resolved' ?>"> |
| 179 | + <?= $resolved ?? 'N/A' ?> |
| 180 | + </td> |
175 | 181 | <td class="actions"> |
176 | 182 | <button class="small secondary"><i class="ti ti-eye"></i> Show</button> |
177 | 183 | <button class="small"><i class="ti ti-edit"></i> Edit</button> |
|
366 | 372 | }); |
367 | 373 |
|
368 | 374 |
|
369 | | -function appendDomainRow(d) { |
370 | | - const tbody = table.querySelector('tbody'); |
| 375 | + function appendDomainRow(d) { |
| 376 | + const tbody = table.querySelector('tbody'); |
371 | 377 |
|
372 | | - const placeholder = tbody.querySelector('tr[data-placeholder]'); |
373 | | - if (placeholder) placeholder.remove(); |
| 378 | + const placeholder = tbody.querySelector('tr[data-placeholder]'); |
| 379 | + if (placeholder) placeholder.remove(); |
374 | 380 |
|
375 | | - const row = document.createElement('tr'); |
376 | | - row.innerHTML = ` |
377 | | - <td>${d.domain}</td> |
378 | | - <td>${d.provider}</td> |
379 | | - <td>${d.ip}</td> |
380 | | - <td class="actions"> |
381 | | - <button class="small secondary"><i class="ti ti-eye"></i> Show</button> |
382 | | - <button class="small"><i class="ti ti-edit"></i> Edit</button> |
383 | | - <button class="small danger"><i class="ti ti-trash"></i> Delete</button> |
384 | | - </td>`; |
385 | | - tbody.appendChild(row); |
386 | | -} |
| 381 | + const row = document.createElement('tr'); |
| 382 | + |
| 383 | + const ip = d.ip && d.ip !== d.domain ? d.ip : 'N/A'; |
| 384 | + const ipTitle = ip === 'N/A' ? 'Domain could not be resolved' : ''; |
| 385 | + row.innerHTML = ` |
| 386 | +<td>${d.domain}</td> |
| 387 | +<td>${d.provider}</td> |
| 388 | +<td title="${ipTitle}">${ip}</td> |
| 389 | +<td class="actions"> |
| 390 | + <button class="small secondary"><i class="ti ti-eye"></i> Show</button> |
| 391 | + <button class="small"><i class="ti ti-edit"></i> Edit</button> |
| 392 | + <button class="small danger"><i class="ti ti-trash"></i> Delete</button> |
| 393 | +</td>`; |
| 394 | + tbody.appendChild(row); |
| 395 | + } |
387 | 396 |
|
388 | 397 | // Handle "Show" button click |
389 | 398 | table.addEventListener('click', e => { |
|
0 commit comments