diff --git a/frontend/src/modules/graph/api/index.ts b/frontend/src/modules/graph/api/index.ts index e69de29..dc19f02 100644 --- a/frontend/src/modules/graph/api/index.ts +++ b/frontend/src/modules/graph/api/index.ts @@ -0,0 +1,62 @@ +import api from '@/shared/api' +import type { ScanResult, GraphView, Capability, Module as DesignModule, Entity, Integration, ValueFlow, UserJourney, DataFlow, ExternalSystem, TraceabilityLink, RuntimeComponent, CapabilityDetail, ModuleDetail, EntityDetail, ImplProgress } from '@/shared/types/api' + +export async function triggerScan(projectId: string): Promise { + const { data } = await api.post(`/projects/${projectId}/scan`) + return data +} + +export async function getLatestScan(projectId: string): Promise { + const { data } = await api.get(`/projects/${projectId}/scan`) + return data +} + +export async function getGraph(projectId: string): Promise { + const { data } = await api.get(`/projects/${projectId}/graph`) + return data +} + +export async function getNodeNeighbors(projectId: string, nodeId: string): Promise { + const { data } = await api.get(`/projects/${projectId}/graph/nodes/${nodeId}/neighbors`) + return data +} + +export async function listCapabilities(projectId: string): Promise { + const { data } = await api.get(`/projects/${projectId}/entities/capabilities`) + return data +} + +export async function listModules(projectId: string): Promise { + const { data } = await api.get(`/projects/${projectId}/entities/modules`) + return data +} + +export async function listEntities(projectId: string): Promise { + const { data } = await api.get(`/projects/${projectId}/entities/entities`) + return data +} + +export async function getCapabilityDetail(projectId: string, capId: string): Promise { + const { data } = await api.get(`/projects/${projectId}/entities/capabilities/${capId}`) + return data +} + +export async function getModuleDetail(projectId: string, modId: string): Promise { + const { data } = await api.get(`/projects/${projectId}/entities/modules/${modId}`) + return data +} + +export async function getEntityDetail(projectId: string, entId: string): Promise { + const { data } = await api.get(`/projects/${projectId}/entities/entities/${entId}`) + return data +} + +export async function evaluateImplProgress(projectId: string): Promise { + const { data } = await api.post(`/projects/${projectId}/impl-progress`) + return data +} + +export async function getImplProgress(projectId: string): Promise { + const { data } = await api.get(`/projects/${projectId}/impl-progress`) + return data +} diff --git a/frontend/src/modules/graph/components/GraphDetail.vue b/frontend/src/modules/graph/components/GraphDetail.vue index e69de29..9d4f7a8 100644 --- a/frontend/src/modules/graph/components/GraphDetail.vue +++ b/frontend/src/modules/graph/components/GraphDetail.vue @@ -0,0 +1,47 @@ + + + + + diff --git a/frontend/src/modules/graph/components/GraphPanorama.vue b/frontend/src/modules/graph/components/GraphPanorama.vue index e69de29..53f4dfe 100644 --- a/frontend/src/modules/graph/components/GraphPanorama.vue +++ b/frontend/src/modules/graph/components/GraphPanorama.vue @@ -0,0 +1,173 @@ + + + + + diff --git a/frontend/src/modules/graph/composables/useGraph.ts b/frontend/src/modules/graph/composables/useGraph.ts index e69de29..766c8cd 100644 --- a/frontend/src/modules/graph/composables/useGraph.ts +++ b/frontend/src/modules/graph/composables/useGraph.ts @@ -0,0 +1,40 @@ +import { defineStore } from 'pinia' +import { ref } from 'vue' +import type { GraphView, GraphNode, ScanResult } from '@/shared/types/api' +import * as graphApi from '../api' + +export const useGraphStore = defineStore('graph', () => { + const graphView = ref(null) + const selectedNode = ref(null) + const scanResult = ref(null) + const loading = ref(false) + + async function loadGraph(projectId: string) { + loading.value = true + try { + scanResult.value = await graphApi.triggerScan(projectId) + graphView.value = await graphApi.getGraph(projectId) + } finally { + loading.value = false + } + } + + function selectNode(node: GraphNode | null) { + selectedNode.value = node + } + + async function loadNeighbors(projectId: string, nodeId: string) { + loading.value = true + try { + graphView.value = await graphApi.getNodeNeighbors(projectId, nodeId) + } finally { + loading.value = false + } + } + + function clearSelection() { + selectedNode.value = null + } + + return { graphView, selectedNode, scanResult, loading, loadGraph, selectNode, loadNeighbors, clearSelection } +}) diff --git a/frontend/src/modules/graph/types/index.ts b/frontend/src/modules/graph/types/index.ts index e69de29..390978c 100644 --- a/frontend/src/modules/graph/types/index.ts +++ b/frontend/src/modules/graph/types/index.ts @@ -0,0 +1 @@ +export type { GraphView, GraphNode, GraphEdge, GraphGroup, ScanResult, ScanSummary } from '@/shared/types/api'