Implement routes and transitions

This commit is contained in:
2025-07-14 12:08:09 +02:00
parent 736dad748b
commit 5ac4c987d3
27 changed files with 860 additions and 376 deletions

View File

@ -0,0 +1,23 @@
/*
* Split a path like /foo/bar/baz into ['foo', 'bar', 'baz']
*/
export function splitPath(path: string): string[] {
if (path.startsWith('/')) {
const newPath = path.substring(1)
return newPath.split("/")
}
return path.split("/")
}
/*
* Reassemble a path array like ['foo', 'bar', 'baz'] into /foo/bar/baz
*/
export function reassemblePath(segments: string[]): string {
const elements = segments.join('/')
return '/' + elements
}
export function idKey(id: string): string {
return 'id:' + id
}

View File

@ -8,6 +8,7 @@ export enum SshecretObjectType {
Client = "Client",
ClientSecret = "ClientSecret",
SecretGroup = "SecretGroup",
Audit = "Audit", // Not technically an object, but added for navigational purposes.
}
export type SshecretObject = {
@ -71,3 +72,8 @@ export const SUBSYSTEM = [
'sshd',
'backend',
] as const
export interface PageState {
activePane: 'clients' | 'secrets' | 'audit',
selectedObject?: string,
}