Files
SimpleCloudNotifier/webapp/src/app/core/models/client.model.ts
Mike Schwörer 1f9abb8574
All checks were successful
Build Docker and Deploy / Build Docker Container (push) Successful in 1m48s
Build Docker and Deploy / Run Unit-Tests (push) Successful in 4m11s
Build Docker and Deploy / Deploy to Server (push) Successful in 22s
WebApp: Fix channel-detail page for non-owned channels
2026-03-26 17:05:51 +01:00

51 lines
1011 B
TypeScript

import { UserPreview } from "./user.model";
export type ClientType = 'ANDROID' | 'IOS' | 'LINUX' | 'MACOS' | 'WINDOWS';
export interface Client {
client_id: string;
user_id: string;
type: ClientType;
fcm_token: string;
timestamp_created: string;
agent_model: string;
agent_version: string;
name: string | null;
}
export interface ClientListResponse {
clients: Client[];
}
export interface ClientPreview {
client_id: string;
user_id: string;
name: string | null;
type: ClientType;
timestamp_created: string;
agent_model: string;
agent_version: string;
}
export interface ClientPreviewResponse {
user: UserPreview;
client: ClientPreview;
}
export function getClientTypeIcon(type: ClientType): string {
switch (type) {
case 'ANDROID':
return 'android';
case 'IOS':
return 'apple';
case 'MACOS':
return 'apple';
case 'WINDOWS':
return 'windows';
case 'LINUX':
return 'desktop';
default:
return 'desktop';
}
}