Add TLD registry import/export/create & logging

Add CSV/JSON export and import endpoints and UI for the TLD registry, plus a manual Create TLD modal and drag-and-drop import UX. Standardize import/export logging by adding Logger('import'/'export') calls to Domains, Tags, Notification Groups and TLD flows. Add TldRegistry model helpers (findByTld, getAll) used for deduplication and exports. Update routes for /tld-registry export/import/create and add a migration to bump app_version to 1.1.4. Also update default app_version, enhance WhoisService parsing (registrar regex and ISO-8601 date handling), and adjust the TLD registry index view to include IANA and Export dropdowns, import modal, create modal, and related JS behavior.
This commit is contained in:
Hosteroid
2026-03-02 11:17:58 +02:00
parent aca4c14b8b
commit ed3e5739f4
13 changed files with 792 additions and 29 deletions

View File

@@ -242,6 +242,29 @@ class TldRegistry extends Model
return $stmt->fetchAll();
}
/**
* Find TLD by extension (regardless of active status)
*/
public function findByTld(string $tld): ?array
{
if (!str_starts_with($tld, '.')) {
$tld = '.' . $tld;
}
$stmt = $this->db->prepare("SELECT * FROM tld_registry WHERE tld = ?");
$stmt->execute([$tld]);
return $stmt->fetch() ?: null;
}
/**
* Get all TLDs (regardless of active status) for export
*/
public function getAll(): array
{
$stmt = $this->db->query("SELECT * FROM tld_registry ORDER BY tld ASC");
return $stmt->fetchAll();
}
/**
* Execute a custom SQL query
*/