77 lines
2.3 KiB
TypeScript
77 lines
2.3 KiB
TypeScript
|
|
import type { ModuleType } from '../types';
|
||
|
|
|
||
|
|
// ---- Port count defaults per module type ----
|
||
|
|
export const MODULE_PORT_DEFAULTS: Record<ModuleType, number> = {
|
||
|
|
SWITCH: 24,
|
||
|
|
AGGREGATE_SWITCH: 8,
|
||
|
|
ROUTER: 4,
|
||
|
|
FIREWALL: 8,
|
||
|
|
PATCH_PANEL: 24,
|
||
|
|
AP: 1,
|
||
|
|
MODEM: 2,
|
||
|
|
SERVER: 2,
|
||
|
|
NAS: 1,
|
||
|
|
PDU: 12,
|
||
|
|
BLANK: 0,
|
||
|
|
OTHER: 0,
|
||
|
|
};
|
||
|
|
|
||
|
|
// ---- U-height defaults per module type ----
|
||
|
|
export const MODULE_U_DEFAULTS: Record<ModuleType, number> = {
|
||
|
|
SWITCH: 1,
|
||
|
|
AGGREGATE_SWITCH: 2,
|
||
|
|
ROUTER: 1,
|
||
|
|
FIREWALL: 1,
|
||
|
|
PATCH_PANEL: 1,
|
||
|
|
AP: 1,
|
||
|
|
MODEM: 1,
|
||
|
|
SERVER: 2,
|
||
|
|
NAS: 4,
|
||
|
|
PDU: 1,
|
||
|
|
BLANK: 1,
|
||
|
|
OTHER: 1,
|
||
|
|
};
|
||
|
|
|
||
|
|
// ---- Module type display labels ----
|
||
|
|
export const MODULE_TYPE_LABELS: Record<ModuleType, string> = {
|
||
|
|
SWITCH: 'Switch',
|
||
|
|
AGGREGATE_SWITCH: 'Agg Switch',
|
||
|
|
MODEM: 'Modem',
|
||
|
|
ROUTER: 'Router',
|
||
|
|
NAS: 'NAS',
|
||
|
|
PDU: 'PDU',
|
||
|
|
PATCH_PANEL: 'Patch Panel',
|
||
|
|
SERVER: 'Server',
|
||
|
|
FIREWALL: 'Firewall',
|
||
|
|
AP: 'Access Point',
|
||
|
|
BLANK: 'Blank',
|
||
|
|
OTHER: 'Other',
|
||
|
|
};
|
||
|
|
|
||
|
|
// ---- Tailwind bg+border color per module type ----
|
||
|
|
export const MODULE_TYPE_COLORS: Record<ModuleType, { bg: string; border: string; text: string }> =
|
||
|
|
{
|
||
|
|
SWITCH: { bg: 'bg-blue-700', border: 'border-blue-500', text: 'text-blue-100' },
|
||
|
|
AGGREGATE_SWITCH: {
|
||
|
|
bg: 'bg-indigo-700',
|
||
|
|
border: 'border-indigo-500',
|
||
|
|
text: 'text-indigo-100',
|
||
|
|
},
|
||
|
|
MODEM: { bg: 'bg-green-700', border: 'border-green-500', text: 'text-green-100' },
|
||
|
|
ROUTER: { bg: 'bg-teal-700', border: 'border-teal-500', text: 'text-teal-100' },
|
||
|
|
NAS: { bg: 'bg-purple-700', border: 'border-purple-500', text: 'text-purple-100' },
|
||
|
|
PDU: { bg: 'bg-yellow-700', border: 'border-yellow-500', text: 'text-yellow-100' },
|
||
|
|
PATCH_PANEL: { bg: 'bg-slate-600', border: 'border-slate-400', text: 'text-slate-100' },
|
||
|
|
SERVER: { bg: 'bg-slate-700', border: 'border-slate-500', text: 'text-slate-100' },
|
||
|
|
FIREWALL: { bg: 'bg-red-700', border: 'border-red-500', text: 'text-red-100' },
|
||
|
|
AP: { bg: 'bg-cyan-700', border: 'border-cyan-500', text: 'text-cyan-100' },
|
||
|
|
BLANK: { bg: 'bg-slate-800', border: 'border-slate-700', text: 'text-slate-500' },
|
||
|
|
OTHER: { bg: 'bg-slate-600', border: 'border-slate-500', text: 'text-slate-100' },
|
||
|
|
};
|
||
|
|
|
||
|
|
// ---- U-slot height in px (used for layout calculations) ----
|
||
|
|
export const U_HEIGHT_PX = 28;
|
||
|
|
|
||
|
|
// ---- Default rack size ----
|
||
|
|
export const DEFAULT_RACK_U = 42;
|