[Web] Archive settings, domain and mailbox switches, archive log and API

This commit is contained in:
FreddleSpl0it committed 2026-11-07 00:45:11 +01:00
1 parent fb85a9eb5c
commit 1c24de19c3
25 files changed
+834 -12

No files matched your search

@@ -37,10 +37,10 @@ class ArchiveApiController
return $this->read(fn(): array => $this->status->status());
}
/** GET archive/log */
public function getLog(): array
/** GET logs/archive[/count] */
public function getLog(int $count = 0): array
{
return $this->read(fn(): array => $this->status->log());
return $this->read(fn(): array => $this->status->log($count));
}
/** GET archive/mailboxes */
@@ -72,13 +72,14 @@ class StatusService
}
/**
* GET archive/log: deliveries, expired copies and mails not archived, newest first (admins, read-only keys included).
* GET logs/archive: deliveries, expired copies and mails not archived, newest first (admins, read-only keys included);
* $count limits the entries, 0 keeps the default.
*
* @throws AccessDenied
*/
public function log(): array
public function log(int $count = 0): array
{
$this->context->requireAdmin(false);
return $this->state->events();
return ($count > 0) ? $this->state->events($count) : $this->state->events();
}
}