fix: graphs
ci-front / build (push) Successful in 2m5s

This commit is contained in:
nikita
2026-04-04 12:38:21 +03:00
parent aac3fa3758
commit e7f1ea2386
6 changed files with 544 additions and 466 deletions
@@ -68,82 +68,54 @@ export const GraphControls: React.FC<GraphControlsProps> = ({
};
return (
<div className="flex items-center justify-between mt-4 text-sm text-gray-400">
<div className="flex gap-6">
<div className="flex items-center gap-2">
<span>
Сервисы: {data.nodes.filter((n) => n.type === "service").length}
</span>
</div>
<div className="flex items-center gap-2">
<span>
Агенты: {data.nodes.filter((n) => n.type === "agent").length}
</span>
</div>
<div className="flex items-center gap-2">
<div className="w-3 h-3 bg-gray-500 rounded-sm"></div>
<span>Связи: {data.links.length}</span>
</div>
</div>
<div className="flex items-center justify-end gap-2 mt-2">
{/* Режим создания связи */}
<button
onClick={toggleLinkMode}
className={`flex w-full items-center gap-2 px-3 py-2 rounded-lg transition-colors ${
isLinkMode
? "bg-green-600 hover:bg-green-700 text-white"
: "bg-gray-800 hover:bg-gray-700 text-gray-300"
}`}
>
<FiLink />
<span className="text-sm">
{isLinkMode ? "Создание связи..." : "Добавить связь"}
</span>
</button>
<div className="flex gap-2">
{/* Режим создания связи */}
<button
onClick={toggleLinkMode}
className={`flex items-center gap-2 px-3 py-2 rounded-lg transition-colors ${
isLinkMode
? "bg-green-600 hover:bg-green-700 text-white"
: "bg-gray-800 hover:bg-gray-700 text-gray-300"
}`}
>
<FiLink />
<span className="text-sm">
{isLinkMode ? "Создание связи..." : "Добавить связь"}
</span>
</button>
{/* Зум + */}
<button
onClick={handleZoomIn}
className="p-2 bg-gray-800 hover:bg-gray-700 rounded-lg transition-colors text-gray-300"
>
<FiZoomIn />
</button>
{/* Добавить узел */}
<button
onClick={handleAddNode}
className="flex items-center gap-2 px-3 py-2 bg-gray-800 hover:bg-gray-700 rounded-lg transition-colors text-gray-300"
>
<FiPlus />
<span className="text-sm">Узел</span>
</button>
{/* Зум - */}
<button
onClick={handleZoomOut}
className="p-2 bg-gray-800 hover:bg-gray-700 rounded-lg transition-colors text-gray-300"
>
<FiZoomOut />
</button>
{/* Зум + */}
<button
onClick={handleZoomIn}
className="p-2 bg-gray-800 hover:bg-gray-700 rounded-lg transition-colors text-gray-300"
>
<FiZoomIn />
</button>
{/* Fit */}
<button
onClick={handleFit}
className="p-2 bg-gray-800 hover:bg-gray-700 rounded-lg transition-colors text-gray-300"
>
<FiMove />
</button>
{/* Зум - */}
<button
onClick={handleZoomOut}
className="p-2 bg-gray-800 hover:bg-gray-700 rounded-lg transition-colors text-gray-300"
>
<FiZoomOut />
</button>
{/* Fit */}
<button
onClick={handleFit}
className="p-2 bg-gray-800 hover:bg-gray-700 rounded-lg transition-colors text-gray-300"
>
<FiMove />
</button>
{/* Экспорт */}
<button
onClick={onExport || exportData}
className="flex items-center gap-2 px-3 py-2 bg-gray-800 hover:bg-gray-700 rounded-lg transition-colors text-gray-300"
>
<FiDownload />
<span className="text-sm">Экспорт</span>
</button>
</div>
{/* Экспорт */}
<button
onClick={onExport || exportData}
className="flex items-center gap-2 px-3 py-2 bg-gray-800 hover:bg-gray-700 rounded-lg transition-colors text-gray-300"
>
<FiDownload />
<span className="text-sm">Экспорт</span>
</button>
</div>
);
};