@@ -15,6 +15,7 @@ import { MoneroAccountAddMenuAnchor, MoneroAccountPage, StandaloneMoneroAccountA
1515import { PasswordAccountAddMenuAnchor , PasswordAccountAddPage , PasswordAccountPage } from "./password/mod.tsx" ;
1616import { SeedAccountAddMenuAnchor , SeedAccountAddPage , SeedAccountPage } from "./seed/mod.tsx" ;
1717import { SolanaAccountAddMenuAnchor , SolanaAccountPage , StandaloneSolanaAccountAddPage } from "./solana/mod.tsx" ;
18+ import { SshAccountAddMenuAnchor , SshAccountAddPage , SshAccountPage } from "./ssh/mod.tsx" ;
1819
1920React ;
2021
@@ -74,6 +75,9 @@ export function AccountCardInGrid(props: { $entry: KDBX.Inner.KeePassFile.Entry
7475 if ( type === "seed" )
7576 return < SeedAccountPage $entry = { $entry } />
7677
78+ if ( type === "ssh" )
79+ return < SshAccountPage $entry = { $entry } />
80+
7781 return null
7882 } ) ( ) }
7983 </ PathBoard > }
@@ -147,6 +151,9 @@ export function AccountCardInGrid(props: { $entry: KDBX.Inner.KeePassFile.Entry
147151 if ( type === "seed" )
148152 return $entry . getDirectStringByKeyOrNull ( "SeedPhrase" ) ?. getValueOrThrow ( ) . get ( ) . split ( " " ) . at ( 0 )
149153
154+ if ( type === "ssh" )
155+ return $entry . getDirectStringByKeyOrNull ( "SshPublicKey" ) ?. getValueOrThrow ( ) . get ( ) ?. trim ( ) . split ( / \s + / ) . slice ( 0 , 2 ) . join ( " " )
156+
150157 return null
151158 } ) ( ) }
152159 </ div >
@@ -191,6 +198,12 @@ export function AccountCardInGrid(props: { $entry: KDBX.Inner.KeePassFile.Entry
191198 Seed
192199 </ div >
193200
201+ if ( type === "ssh" )
202+ return < div className = "bg-default-contrast rounded-xl po-1 flex items-center gap-2" >
203+ < Outline . KeyIcon className = "size-5" />
204+ SSH
205+ </ div >
206+
194207 if ( type === "password" )
195208 return < div className = "bg-default-contrast rounded-xl po-1 flex items-center gap-2" >
196209 < Outline . LanguageIcon className = "size-5" />
@@ -274,6 +287,9 @@ export function AccountCard(props: { $entry: KDBX.Inner.KeePassFile.Entry }) {
274287 if ( type === "seed" )
275288 return $entry . getDirectStringByKeyOrNull ( "SeedPhrase" ) ?. getValueOrThrow ( ) . get ( ) . split ( " " ) . at ( 0 )
276289
290+ if ( type === "ssh" )
291+ return $entry . getDirectStringByKeyOrNull ( "SshPublicKey" ) ?. getValueOrThrow ( ) . get ( ) ?. trim ( ) . split ( / \s + / ) . slice ( 0 , 2 ) . join ( " " )
292+
277293 return null
278294 } ) ( ) }
279295 </ div >
@@ -318,6 +334,12 @@ export function AccountCard(props: { $entry: KDBX.Inner.KeePassFile.Entry }) {
318334 Seed
319335 </ div >
320336
337+ if ( type === "ssh" )
338+ return < div className = "bg-default-contrast rounded-xl po-1 flex items-center gap-2" >
339+ < Outline . KeyIcon className = "size-5" />
340+ SSH
341+ </ div >
342+
321343 if ( type === "password" )
322344 return < div className = "bg-default-contrast rounded-xl po-1 flex items-center gap-2" >
323345 < Outline . LanguageIcon className = "size-5" />
@@ -381,12 +403,17 @@ export function AccountAddMenu() {
381403 < PathBoard >
382404 < SeedAccountAddPage />
383405 </ PathBoard > }
406+ { hash . url . pathname === "/ssh" &&
407+ < PathBoard >
408+ < SshAccountAddPage />
409+ </ PathBoard > }
384410 </ SubpathProvider >
385411 < div className = "flex flex-col text-left gap-2" >
386412 < PasswordAccountAddMenuAnchor />
387413 < CryptoAccountAddMenuAnchor />
388414 < CardAccountAddMenuAnchor />
389415 < SeedAccountAddMenuAnchor />
416+ < SshAccountAddMenuAnchor />
390417 </ div >
391418 </ Fragment >
392419}
0 commit comments