fix: compact device sizing and deploy configuration
All checks were successful
continuous-integration/drone/push Build is passing

Reduce device node height by removing minimum port height and tightening
card gaps. Fix deployment by correcting Angular outputPath for Docker
build context and adding frontend.context to service.yaml.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Alina
2026-02-18 09:02:31 +03:00
parent f355caa9ad
commit 542317ecda
4 changed files with 17 additions and 16 deletions

View File

@ -38,7 +38,10 @@
"build": { "build": {
"builder": "@angular-devkit/build-angular:application", "builder": "@angular-devkit/build-angular:application",
"options": { "options": {
"outputPath": "../dist", "outputPath": {
"base": "dist",
"browser": ""
},
"index": "src/index.html", "index": "src/index.html",
"browser": "src/main.ts", "browser": "src/main.ts",
"polyfills": [ "polyfills": [

View File

@ -51,14 +51,12 @@ function getDeviceSize(
) { ) {
return { width: SPLICE_SIZE, height: SPLICE_SIZE }; return { width: SPLICE_SIZE, height: SPLICE_SIZE };
} }
const portHeight = Math.max(portCount * 22, 60); const portHeight = portCount * 22;
const cardsHeight = cardCount > 0 ? cardCount * (CARD_HEIGHT + 6) + 8 : 0; const cardsHeight = cardCount > 0 ? cardCount * (CARD_HEIGHT + 4) + 4 : 0;
const bodyHeight = cardCount > 0 && portCount > 0 const bodyHeight = cardsHeight + portHeight;
? cardsHeight + portHeight
: Math.max(portHeight, cardsHeight);
return { return {
width: DEVICE_MIN_WIDTH, 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 hasCards = deviceCards.length > 0;
const cardsEndY = hasCards const cardsEndY = hasCards
? DEVICE_HEADER_HEIGHT + deviceCards.length * (CARD_HEIGHT + 6) + 8 ? DEVICE_HEADER_HEIGHT + deviceCards.length * (CARD_HEIGHT + 4) + 4
: 0; : 0;
const leftDevicePorts = devicePorts.filter( const leftDevicePorts = devicePorts.filter(
@ -225,7 +223,7 @@ export function buildGraphData(
).indexOf(card); ).indexOf(card);
const cardX = parentPos.x + 10; 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 portItems = cardPorts.map((port) => {
const resolvedSide = portSideMap.get(port.id) ?? port.side; const resolvedSide = portSideMap.get(port.id) ?? port.side;

View File

@ -36,15 +36,12 @@ function getDeviceSize(device: Device, portCount: number, cardCount: number): {
} }
// Dynamic height based on port count + header + cards // Dynamic height based on port count + header + cards
const portHeight = Math.max(portCount * 22, 60); const portHeight = portCount * 22;
const cardsHeight = cardCount > 0 ? cardCount * (CARD_HEIGHT + 6) + 8 : 0; const cardsHeight = cardCount > 0 ? cardCount * (CARD_HEIGHT + 4) + 4 : 0;
// When device has both cards and ports, stack them vertically to avoid overlap const bodyHeight = cardsHeight + portHeight;
const bodyHeight = cardCount > 0 && portCount > 0
? cardsHeight + portHeight
: Math.max(portHeight, cardsHeight);
return { return {
width: DEVICE_MIN_WIDTH, 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),
}; };
} }

View File

@ -2,6 +2,9 @@ service:
name: test-x6 name: test-x6
type: web-frontend type: web-frontend
frontend:
context: ./frontend
deploy: deploy:
namespace: test-x6 namespace: test-x6
domain: test-x6.vigdorov.ru domain: test-x6.vigdorov.ru