Continue frontend building

This commit is contained in:
2025-07-13 12:03:43 +02:00
parent 6faed0dbd4
commit 746f809d28
44 changed files with 2057 additions and 632 deletions

View File

@ -0,0 +1,16 @@
export function generateRandomPassword(length: number = 16): string {
const lower = 'abcdefghijklmnopqrstuvwxyz'
const upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
const numbers = '0123456789'
const special = '!@#$%^&*()-_=+[]{};:,.<>?'
const allChars = lower + upper + numbers + special
let password = ''
for (let i = 0; i < length; i++) {
const index = Math.floor(Math.random() * allChars.length)
password += allChars[index]
}
return password
}

View File

@ -0,0 +1,13 @@
// Typeguards
import { OPERATIONS } from '@/api/types'
import { SUBSYSTEM } from '@/api/types'
import type { Operation, SubSystem } from '@/client'
export function isOperation(value: string): value is Operation {
return (OPERATIONS as readonly string[]).includes(value)
}
export function isSubSystem(value: string): value is SubSystem {
return (SUBSYSTEM as readonly string[]).includes(value)
}

View File

@ -1,3 +1,4 @@
import type { SubSystem, Operation } from "@/client";
export type PageRequest = {
offset: number;
limit: number;
@ -6,9 +7,67 @@ export type PageRequest = {
export enum SshecretObjectType {
Client = "Client",
ClientSecret = "ClientSecret",
SecretGroup = "SecretGroup",
}
export type SshecretObject = {
objectType: SshecretObjectType,
id: string,
param?: string,
}
export type AuditFilter = {
/**
* Subsystem
*/
subsystem?: SubSystem | null;
/**
* Operation
*/
operation?: Operation | null;
/**
* Client Id
*/
client_id?: string | null;
/**
* Client Name
*/
client_name?: string | null;
/**
* Secret Id
*/
secret_id?: string | null;
/**
* Secret Name
*/
secret_name?: string | null;
/**
* Origin
*/
origin?: string | null;
/**
*/
offset?: number;
/**
* Limit
*/
limit?: number;
}
export const OPERATIONS = [
'create',
'read',
'update',
'delete',
'deny',
'permit',
'login',
'none',
] as const
export const SUBSYSTEM = [
'admin',
'sshd',
'backend',
] as const