feat(mikrotikBackup): add endpoint and UI for manual backup execution
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 4m39s

This commit is contained in:
2026-02-09 19:50:29 +07:00
parent 5eecb8d070
commit 89d35cd7ef
3 changed files with 148 additions and 1 deletions
+32
View File
@@ -268,6 +268,38 @@ function MikrotikBackupsManager() {
<IconRefresh size={16} className="me-1" />
Обновить список
</button>
<button
type="button"
className="btn btn-primary btn-sm d-inline-flex align-items-center"
onClick={async () => {
if (!selectedServer) return;
try {
const serverId = selectedServer.id || selectedServer.dns || selectedServer.ip;
if (!serverId) {
notify.error('У выбранного сервера нет id/dns/ip для идентификации');
return;
}
notify.info('Запуск ручного бэкапа MikroTik...');
const res = await api.post('/mikrotik/backups/run', { serverId });
if (res?.data?.ok) {
notify.success('Ручной бэкап успешно создан');
await fetchBackups(serverId);
} else {
notify.error(res?.data?.message || 'Не удалось выполнить ручной бэкап');
}
} catch (err) {
console.error('Error running manual backup:', err);
const msg =
err?.response?.data?.message ||
err?.response?.data ||
'Ошибка при выполнении ручного бэкапа';
notify.error(msg);
}
}}
disabled={!selectedServer || loadingBackups}
>
Создать бэкап сейчас
</button>
<Tooltip content="Выберите два бэкапа в таблице" position="top">
<button
type="button"