Initial commit
This commit is contained in:
76
src/types.ts
Normal file
76
src/types.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user