feat(NetworkConfigManager, PreviewConfigModal): improve clipboard functionality for MikroTik code; add title and description props to preview modal
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 1m37s

This commit is contained in:
2026-01-22 11:14:54 +07:00
parent 682c2ce96b
commit 03a47e7346
2 changed files with 70 additions and 18 deletions
+27 -1
View File
@@ -552,7 +552,31 @@ function NetworkConfigManager() {
// === Копирование кода MikroTik ===
const handleCopyMikrotikCode = async () => {
await copyToClipboard(generatedMikrotikCode);
try {
if (navigator.clipboard && navigator.clipboard.writeText) {
await navigator.clipboard.writeText(generatedMikrotikCode);
notify.success('Код скопирован в буфер обмена!');
} else {
// Fallback для старых браузеров
const textArea = document.createElement('textarea');
textArea.value = generatedMikrotikCode;
textArea.style.position = 'fixed';
textArea.style.left = '-999999px';
document.body.appendChild(textArea);
textArea.focus();
textArea.select();
try {
document.execCommand('copy');
notify.success('Код скопирован в буфер обмена!');
} catch (err) {
notify.error('Не удалось скопировать код');
}
document.body.removeChild(textArea);
}
} catch (err) {
console.error('Error copying to clipboard:', err);
notify.error('Не удалось скопировать код');
}
};
// === Получение цвета провайдера ===
@@ -1621,6 +1645,8 @@ function NetworkConfigManager() {
show={mikrotikCodeModalOpen}
config={generatedMikrotikCode}
mode="advanced"
title="Предварительный просмотр конфигурации"
description="Конфигурация MikroTik RouterOS для рекурсивных маршрутов"
onClose={() => setMikrotikCodeModalOpen(false)}
onCopy={handleCopyMikrotikCode}
/>