Initial commit

This commit is contained in:
Brückner
2026-06-03 15:20:06 +02:00
commit eed01b9665
34 changed files with 11921 additions and 0 deletions

76
src/types.ts Normal file
View File

@ -0,0 +1,76 @@
/**
* @license
* SPDX-License-Identifier: Apache-2.0
*/
// Known presets plus any custom class the user defines.
// The `(string & {})` keeps literal autocomplete while allowing arbitrary values.
export type DeviceType = 'Switch' | 'Access-Point' | 'Firewall' | 'Controller' | (string & {});
export interface Device {
id: string;
hostname: string;
ip: string;
location: string;
notes: string;
type: DeviceType;
status: 'online' | 'offline' | 'unknown'; // 'unknown' until CheckMK reports a state
emergencySheet: string; // Markdown text
checkMkUrl: string; // Link to this host in CheckMK; live status comes from the CheckMK API
lastCheckedAt?: string;
}
export interface TopologyLink {
fromDevice: string;
toDevice: string;
type: string; // e.g. "LACP-Trunk", "Uplink", "OOB-Management", "VLAN-Core"
}
export interface LabTemplate {
id: string;
name: string;
description: string;
contactPerson: string;
location: string;
deviceIds: string[];
topology: TopologyLink[];
}
export interface Booking {
id: string;
labId: string;
userId: string;
startDateTime: string;
endDateTime: string;
notes: string;
status: 'active' | 'upcoming' | 'completed' | 'cancelled';
notified: boolean;
emailSent?: boolean;
}
export interface LogEntry {
id: string;
timestamp: string;
type: 'maintenance' | 'booking' | 'status' | 'system';
message: string;
deviceId?: string;
userId?: string;
}
export interface User {
id: string;
name: string;
role: string;
email: string;
}
export interface QuickLink {
id: string;
title: string;
url: string;
description: string;
category: string;
color: string; // accent key, e.g. 'emerald' | 'cyan' | 'amber' | ...
createdBy?: string;
createdAt: string;
}