Skip to content

Commit 9499844

Browse files
committed
fixes
1 parent 97acea8 commit 9499844

File tree

6 files changed

+54
-28
lines changed

6 files changed

+54
-28
lines changed

menus/menu-full.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ spec:
4242
icon: "mdi:ethernet"
4343
kind: DcimInterface
4444

45+
- name: VLAN
46+
namespace: Dcim
47+
label: "VLANs"
48+
icon: "mdi:ethernet"
49+
kind: IpamVLAN
50+
4551
- name: GenericSFP
4652
namespace: Dcim
4753
label: "SFP Modules"

schemas/base/dcim.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ nodes:
457457
label: Network Device
458458
description: A configurable network device for managing and directing data traffic, including routers, switches...
459459
icon: clarity:network-switch-solid
460+
include_in_menu: false
460461
generate_template: true
461462
namespace: Dcim
462463
inherit_from:

schemas/extensions/cable/cable.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ nodes:
77
namespace: Dcim
88
description: Physical cable connecting two endpoints
99
label: Cable
10+
include_in_menu: false
1011
icon: mdi:cable-data
1112
inherit_from:
1213
- DcimConnector

schemas/extensions/vlan/vlan.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ nodes:
8080
description: Represents layer 2 domain.
8181
label: Layer 2 Domain
8282
icon: mdi:domain-switch
83+
include_in_menu: false
8384
human_friendly_id:
8485
- name__value
8586
display_label: name__value

service_catalog/utils/rack.py

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,8 @@ def _generate_rack_css() -> str:
342342
343343
.device {
344344
height: 100%;
345-
border: 2px solid #2E7D32;
346-
color: white;
345+
border: 2px solid #a8a8cc;
346+
color: #333;
347347
padding: 2px 8px;
348348
text-align: center;
349349
font-size: 12px;
@@ -353,7 +353,7 @@ def _generate_rack_css() -> str:
353353
flex-direction: column;
354354
justify-content: center;
355355
align-items: center;
356-
background-color: #4CAF50;
356+
background-color: #e6e6fa;
357357
border-radius: 3px;
358358
box-sizing: border-box;
359359
transition: all 0.2s ease;
@@ -371,7 +371,7 @@ def _generate_rack_css() -> str:
371371
overflow: hidden;
372372
text-overflow: ellipsis;
373373
line-height: 1.2;
374-
text-shadow: 0 1px 2px rgba(0,0,0,0.3);
374+
text-shadow: 0 1px 1px rgba(255,255,255,0.5);
375375
width: 100%;
376376
}
377377
@@ -383,43 +383,57 @@ def _generate_rack_css() -> str:
383383
text-overflow: ellipsis;
384384
margin-top: 1px;
385385
line-height: 1.1;
386-
text-shadow: 0 1px 1px rgba(0,0,0,0.2);
386+
text-shadow: 0 1px 1px rgba(255,255,255,0.3);
387387
width: 100%;
388388
}
389389
390-
/* Role-based color classes */
390+
/* Role-based color classes - colors match schemas/base/dcim.yml */
391391
.device-role-leaf {
392-
background-color: #4CAF50;
393-
border-color: #2E7D32;
392+
background-color: #e6e6fa;
393+
border-color: #a8a8cc;
394394
}
395395
396396
.device-role-spine {
397-
background-color: #2196F3;
398-
border-color: #1565C0;
397+
background-color: #aeeeee;
398+
border-color: #7cb8b8;
399399
}
400400
401401
.device-role-border-leaf {
402-
background-color: #9C27B0;
403-
border-color: #6A1B9A;
402+
background-color: #dda0dd;
403+
border-color: #b070b0;
404404
}
405405
406406
.device-role-console {
407-
background-color: #FF9800;
408-
border-color: #E65100;
407+
background-color: #e8e7ad;
408+
border-color: #b8b77d;
409409
}
410410
411411
.device-role-oob {
412-
background-color: #795548;
413-
border-color: #4E342E;
412+
background-color: #e8e7ed;
413+
border-color: #b8b7bd;
414414
}
415415
416416
.device-role-edge {
417-
background-color: #00BCD4;
418-
border-color: #00838F;
417+
background-color: #bf7fbf;
418+
border-color: #8f4f8f;
419419
}
420420
421421
.device-role-firewall {
422-
background-color: #F44336;
423-
border-color: #C62828;
422+
background-color: #6a5acd;
423+
border-color: #4a3a9d;
424+
color: white;
425+
}
426+
427+
.device-role-firewall .device-name {
428+
text-shadow: 0 1px 2px rgba(0,0,0,0.3);
429+
}
430+
431+
.device-role-firewall .device-type-label {
432+
text-shadow: 0 1px 1px rgba(0,0,0,0.2);
433+
}
434+
435+
.device-role-load-balancer {
436+
background-color: #38e7fb;
437+
border-color: #08b7cb;
424438
}
425439
"""

service_catalog/utils/ui.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def get_device_color(device_role: Optional[str]) -> str:
197197
"""Get CSS color class for device based on role.
198198
199199
Args:
200-
device_role: Device role (e.g., "leaf", "spine", "border_leaf", "console", "oob").
200+
device_role: Device role (e.g., "leaf", "spine", "border_leaf", "console", "oob", "load_balancer").
201201
202202
Returns:
203203
str: CSS class name for device color styling.
@@ -217,6 +217,7 @@ def get_device_color(device_role: Optional[str]) -> str:
217217
"edge": "device device-role-edge",
218218
"dc_firewall": "device device-role-firewall",
219219
"edge_firewall": "device device-role-firewall",
220+
"load_balancer": "device device-role-load-balancer",
220221
}
221222

222223
return role_color_map.get(device_role_lower, "device")
@@ -227,15 +228,17 @@ def get_role_legend() -> Dict[str, str]:
227228
228229
Returns:
229230
Dict mapping role names to color hex codes for legend display.
231+
Colors match the DcimDevice role attribute in schemas/base/dcim.yml
230232
"""
231233
return {
232-
"Leaf": "#4CAF50", # Green
233-
"Spine": "#2196F3", # Blue
234-
"Border Leaf": "#9C27B0", # Purple
235-
"Console": "#FF9800", # Orange
236-
"OOB": "#795548", # Brown
237-
"Edge": "#00BCD4", # Cyan
238-
"Firewall": "#F44336", # Red
234+
"Leaf": "#e6e6fa", # Lavender
235+
"Spine": "#aeeeee", # Pale cyan
236+
"Border Leaf": "#dda0dd", # Plum
237+
"Console": "#e8e7ad", # Pale yellow
238+
"OOB": "#e8e7ed", # Very pale lavender
239+
"Edge": "#bf7fbf", # Medium purple
240+
"Firewall": "#6a5acd", # Slate blue (dc_firewall and edge_firewall)
241+
"Load Balancer": "#38e7fb", # Cyan
239242
}
240243

241244

0 commit comments

Comments
 (0)