diff --git a/frontend/angular.json b/frontend/angular.json index 55fb561..03ef732 100644 --- a/frontend/angular.json +++ b/frontend/angular.json @@ -38,7 +38,10 @@ "build": { "builder": "@angular-devkit/build-angular:application", "options": { - "outputPath": "../dist", + "outputPath": { + "base": "dist", + "browser": "" + }, "index": "src/index.html", "browser": "src/main.ts", "polyfills": [ diff --git a/frontend/src/app/features/schema/helpers/data-mapper.ts b/frontend/src/app/features/schema/helpers/data-mapper.ts index 89328d2..2d4061b 100644 --- a/frontend/src/app/features/schema/helpers/data-mapper.ts +++ b/frontend/src/app/features/schema/helpers/data-mapper.ts @@ -51,14 +51,12 @@ function getDeviceSize( ) { return { width: SPLICE_SIZE, height: SPLICE_SIZE }; } - const portHeight = Math.max(portCount * 22, 60); - const cardsHeight = cardCount > 0 ? cardCount * (CARD_HEIGHT + 6) + 8 : 0; - const bodyHeight = cardCount > 0 && portCount > 0 - ? cardsHeight + portHeight - : Math.max(portHeight, cardsHeight); + const portHeight = portCount * 22; + const cardsHeight = cardCount > 0 ? cardCount * (CARD_HEIGHT + 4) + 4 : 0; + const bodyHeight = cardsHeight + portHeight; return { width: DEVICE_MIN_WIDTH, - height: Math.max(DEVICE_MIN_HEIGHT, DEVICE_HEADER_HEIGHT + bodyHeight + 10), + height: Math.max(DEVICE_MIN_HEIGHT, DEVICE_HEADER_HEIGHT + bodyHeight + 6), }; } @@ -116,7 +114,7 @@ export function buildGraphData( const hasCards = deviceCards.length > 0; const cardsEndY = hasCards - ? DEVICE_HEADER_HEIGHT + deviceCards.length * (CARD_HEIGHT + 6) + 8 + ? DEVICE_HEADER_HEIGHT + deviceCards.length * (CARD_HEIGHT + 4) + 4 : 0; const leftDevicePorts = devicePorts.filter( @@ -225,7 +223,7 @@ export function buildGraphData( ).indexOf(card); const cardX = parentPos.x + 10; - const cardY = parentPos.y + DEVICE_HEADER_HEIGHT + 8 + cardIndex * (CARD_HEIGHT + 6); + const cardY = parentPos.y + DEVICE_HEADER_HEIGHT + 4 + cardIndex * (CARD_HEIGHT + 4); const portItems = cardPorts.map((port) => { const resolvedSide = portSideMap.get(port.id) ?? port.side; diff --git a/frontend/src/app/features/schema/layout/auto-layout.ts b/frontend/src/app/features/schema/layout/auto-layout.ts index 9b9246d..764d0af 100644 --- a/frontend/src/app/features/schema/layout/auto-layout.ts +++ b/frontend/src/app/features/schema/layout/auto-layout.ts @@ -36,15 +36,12 @@ function getDeviceSize(device: Device, portCount: number, cardCount: number): { } // Dynamic height based on port count + header + cards - const portHeight = Math.max(portCount * 22, 60); - const cardsHeight = cardCount > 0 ? cardCount * (CARD_HEIGHT + 6) + 8 : 0; - // When device has both cards and ports, stack them vertically to avoid overlap - const bodyHeight = cardCount > 0 && portCount > 0 - ? cardsHeight + portHeight - : Math.max(portHeight, cardsHeight); + const portHeight = portCount * 22; + const cardsHeight = cardCount > 0 ? cardCount * (CARD_HEIGHT + 4) + 4 : 0; + const bodyHeight = cardsHeight + portHeight; return { width: DEVICE_MIN_WIDTH, - height: Math.max(DEVICE_MIN_HEIGHT, DEVICE_HEADER_HEIGHT + bodyHeight + 10), + height: Math.max(DEVICE_MIN_HEIGHT, DEVICE_HEADER_HEIGHT + bodyHeight + 6), }; } diff --git a/service.yaml b/service.yaml index 6f7bdff..43a4112 100644 --- a/service.yaml +++ b/service.yaml @@ -2,6 +2,9 @@ service: name: test-x6 type: web-frontend +frontend: + context: ./frontend + deploy: namespace: test-x6 domain: test-x6.vigdorov.ru