1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Merge pull request #3754 from netbox-community/2248-svg-rack-elevations

2248 svg rack elevations
This commit is contained in:
John Anderson
2019-12-11 14:26:32 -05:00
committed by GitHub
15 changed files with 318 additions and 264 deletions

View File

@@ -55,3 +55,63 @@ COMPATIBLE_TERMINATION_TYPES = {
'rearport': ['consoleport', 'consoleserverport', 'interface', 'frontport', 'rearport', 'circuittermination'],
'circuittermination': ['interface', 'frontport', 'rearport'],
}
RACK_ELEVATION_STYLE = """
* {
font-family: 'Helvetica Neue';
font-size: 13px;
}
rect {
box-sizing: border-box;
}
text {
text-anchor: middle;
dominant-baseline: middle;
}
.rack {
background-color: #f0f0f0;
fill: none;
stroke: black;
stroke-width: 3px;
}
.slot {
fill: #f7f7f7;
stroke: #a0a0a0;
}
.slot:hover {
fill: #fff;
}
.slot+.add-device {
fill: none;
}
.slot:hover+.add-device {
fill: blue;
}
.reserved {
fill: url(#reserved);
}
.reserved:hover {
fill: url(#reserved);
}
.occupied {
fill: url(#occupied);
}
.occupied:hover {
fill: url(#occupied);
}
.blocked {
fill: url(#blocked);
}
.blocked:hover {
fill: url(#blocked);
}
.blocked:hover+.add-device {
fill: none;
}
"""
# Rack Elevation SVG Size
RACK_ELEVATION_UNIT_WIDTH_DEFAULT = 230
RACK_ELEVATION_UNIT_HEIGHT_DEFAULT = 20