Add factory reset functionality and update identity service
CI / Backend (build + test) (push) Successful in 1m18s
CI / Frontend (lint + typecheck + build) (push) Successful in 32s

- 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:
Leonid Pershin
2026-07-14 18:58:51 +03:00
parent 94ba514b8e
commit 701c3a1d51
16 changed files with 564 additions and 64 deletions
@@ -0,0 +1,11 @@
using PnvPanel.Application.Common.Messaging;
using PnvPanel.Application.Common.Models;
namespace PnvPanel.Application.Admin.Maintenance;
/// <summary>
/// Полный сброс панели к состоянию свежего деплоя: все пользователи кроме текущего админа,
/// конфиги, ноды/инбаунды, тикеты (+вложения), новости, аудит и кастомные роли удаляются;
/// каталог приложений пересеивается из seed/client-apps.json. Необратимо.
/// </summary>
public sealed record FactoryResetCommand : ICommand<Result>;