67 lines
3.5 KiB
JavaScript
67 lines
3.5 KiB
JavaScript
const { Pool } = require('pg');
|
|
|
|
async function run() {
|
|
const pool = new Pool({ connectionString: 'postgresql://postgres:postgres@localhost:5432/xflow' });
|
|
|
|
const canvasId = 'xflow-project';
|
|
const res = await pool.query('SELECT * FROM "Canvas" WHERE id = $1', [canvasId]);
|
|
|
|
if (res.rowCount === 0) {
|
|
console.error('Canvas xflow-project not found');
|
|
await pool.end();
|
|
return;
|
|
}
|
|
|
|
const canvas = res.rows[0];
|
|
let nodes = typeof canvas.nodes === 'string' ? JSON.parse(canvas.nodes) : canvas.nodes;
|
|
let edges = typeof canvas.edges === 'string' ? JSON.parse(canvas.edges) : canvas.edges;
|
|
|
|
// 1. Update Tech Stack (tech-1)
|
|
const techNode = nodes.find(n => n.id === 'tech-1');
|
|
if (techNode) {
|
|
techNode.text = '# 🛠️ Технологический Стек\n\n```json\n{\n \"frontend\": \"Vue 3 + Nuxt 3\",\n \"styling\": \"TailwindCSS\",\n \"canvas\": \"Vue Flow\",\n \"auth\": \"Firebase Google\",\n \"database\": \"PostgreSQL + Prisma\",\n \"pwa\": \"@vite-pwa/nuxt\",\n \"git_sync\": \"Gitea API\"\n}\n```';
|
|
techNode.height = 400;
|
|
}
|
|
|
|
// 2. Update Backend API (be-1)
|
|
const beNode = nodes.find(n => n.id === 'be-1');
|
|
if (beNode) {
|
|
beNode.text = '# ⚙️ Backend API\n\n- `/api/canvas/*` - CRUD холстов\n- `/api/tasks` - **Канбан-агрегатор**\n- `/api/git/real-sync` - **Git Синхронизация**\n- `/api/auth/google` - Firebase Auth\n- `/api/users/*` - Профили и роли\n- `/api/groups/*` - Совместная работа';
|
|
beNode.height = 350;
|
|
}
|
|
|
|
// 3. Update Key Features (feat-1)
|
|
const featNode = nodes.find(n => n.id === 'feat-1');
|
|
if (featNode) {
|
|
featNode.text = '# ✨ Ключевые Функции\n\n- **Умный Редактор**\n - Drag & Drop палитра\n - Панель свойств узлов\n - **Кросс-ссылки между картами**\n\n- **Канбан-борд**\n - Персональные задачи\n - Синхронизация статусов\n\n- **Obsidian Sync**\n - Нативная поддержка `.canvas`\n - Сохранение метаданных\n\n- **Git Интеграция**\n - Авто-сохранение в Gitea';
|
|
featNode.height = 500;
|
|
}
|
|
|
|
// 4. Add "Latest Updates" Node (session-summary)
|
|
const updateNodeId = 'updates-apr-28';
|
|
if (!nodes.find(n => n.id === updateNodeId)) {
|
|
nodes.push({
|
|
id: updateNodeId,
|
|
type: 'text',
|
|
x: 1400,
|
|
y: -200,
|
|
width: 350,
|
|
height: 300,
|
|
text: '# 🔥 Обновления (28 Апреля)\n\n- ✅ **Data Persistence**: Исправлена потеря метаданных задач.\n- ✅ **Cross-Linking**: Навигация между картами через узлы-файлы.\n- ✅ **Personal Kanban**: Рабочая доска задач с фильтрацией.\n- ✅ **Admin Roles**: Система прав для удаления и редактирования.\n- ✅ **UX Fixes**: Переименование карт и выпадающие списки ссылок.',
|
|
style: { background: '#064e3b', border: '#10b981' }
|
|
});
|
|
edges.push({ id: 'e-update', source: 'feat-1', target: updateNodeId });
|
|
}
|
|
|
|
// Update in DB
|
|
await pool.query(
|
|
'UPDATE "Canvas" SET nodes = $1, edges = $2, "updatedAt" = NOW() WHERE id = $3',
|
|
[JSON.stringify(nodes), JSON.stringify(edges), canvasId]
|
|
);
|
|
|
|
console.log('Main project canvas updated with latest architecture and features');
|
|
await pool.end();
|
|
}
|
|
|
|
run().catch(console.error);
|