Add factory reset functionality and update identity service
- Introduced a new DELETE endpoint `/api/admin/maintenance/factory-reset` for a complete reset of the admin panel, removing all users except the current admin and clearing various data. - Implemented the `FactoryReset` method in `AdminMaintenanceEndpoints` to handle the reset logic. - Added a new method `ListAllUserIdsExceptAsync` in `IIdentityService` to retrieve user IDs excluding a specified user, aiding in the factory reset process. - Updated the frontend to include a confirmation dialog for the factory reset action, enhancing user experience and safety. - Enhanced localization support for the new factory reset feature in both Russian and English, ensuring clarity for all users.
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
namespace PnvPanel.Application.Common.Interfaces;
|
||||
|
||||
/// <summary>
|
||||
/// Сидинг стартового каталога клиентских приложений из seed/client-apps.json. Идемпотентно —
|
||||
/// не трогает таблицу, если в ней уже что-то есть (используется и при старте, и после полного
|
||||
/// сброса панели, когда таблица заведомо пуста).
|
||||
/// </summary>
|
||||
public interface IClientAppCatalogSeeder
|
||||
{
|
||||
Task SeedIfEmptyAsync(CancellationToken cancellationToken);
|
||||
}
|
||||
@@ -128,4 +128,11 @@ public interface IIdentityService
|
||||
Task<IReadOnlyCollection<long>> GetActivatedLinkedTelegramUserIdsAsync(
|
||||
CancellationToken cancellationToken
|
||||
);
|
||||
|
||||
/// <summary>Все Id пользователей, кроме указанного — для полного сброса панели (сохраняется
|
||||
/// только текущий админ).</summary>
|
||||
Task<IReadOnlyList<Guid>> ListAllUserIdsExceptAsync(
|
||||
Guid exceptUserId,
|
||||
CancellationToken cancellationToken
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user