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:
@@ -122,7 +122,7 @@ class Setting extends Model
|
||||
*/
|
||||
public function getAppVersion(): string
|
||||
{
|
||||
return $this->getValue('app_version', '1.1.3');
|
||||
return $this->getValue('app_version', '1.1.4');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user