-
-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e66fcd2
commit 97c4541
Showing
18 changed files
with
9,093 additions
and
10,690 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import SecretLogoSVG from './secretLogo.svg' | ||
import NoteIconSVG from './noteIcon.svg' | ||
|
||
export { SecretLogoSVG, NoteIconSVG } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
123 changes: 123 additions & 0 deletions
123
apps/platform/src/app/(main)/project/[project]/@secret/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
'use client' | ||
import React, { useEffect, useState } from 'react' | ||
// import { SecretLogoSVG } from '@public/svg/secret' | ||
import { usePathname } from 'next/navigation' | ||
import dayjs, { extend } from 'dayjs' | ||
import relativeTime from 'dayjs/plugin/relativeTime' | ||
import { NoteIconSVG } from '@public/svg/secret' | ||
import { | ||
Accordion, | ||
AccordionContent, | ||
AccordionItem, | ||
AccordionTrigger | ||
} from '@/components/ui/accordion' | ||
import { | ||
Table, | ||
TableBody, | ||
TableCell, | ||
TableHead, | ||
TableHeader, | ||
TableRow | ||
} from '@/components/ui/table' | ||
import { Secrets } from '@/lib/api-functions/secrets' | ||
import type { Secret } from '@/types' | ||
import { ScrollArea } from '@/components/ui/scroll-area' | ||
import { | ||
Tooltip, | ||
TooltipContent, | ||
TooltipProvider, | ||
TooltipTrigger | ||
} from '@/components/ui/tooltip' | ||
|
||
extend(relativeTime) | ||
|
||
function SecretPage(): React.JSX.Element { | ||
const [allSecrets, setAllSecrets] = useState<Secret[]>() | ||
const pathname = usePathname() | ||
|
||
useEffect(() => { | ||
Secrets.getAllSecretbyProjectId(pathname.split('/')[2]) | ||
.then((data) => { | ||
setAllSecrets(data) | ||
}) | ||
.catch((error) => { | ||
// eslint-disable-next-line no-console -- we need to log the error | ||
console.error(error) | ||
}) | ||
}, [pathname]) | ||
|
||
return ( | ||
<ScrollArea className=" mb-4 h-[50rem]"> | ||
<Accordion | ||
className="flex h-[50rem] flex-col gap-4" | ||
collapsible | ||
type="single" | ||
> | ||
{allSecrets?.map((secret) => { | ||
return ( | ||
<AccordionItem | ||
className="rounded-xl bg-white/5 px-5" | ||
key={secret.secret.id} | ||
value={secret.secret.id} | ||
> | ||
<AccordionTrigger | ||
className="hover:no-underline" | ||
rightChildren={ | ||
<div className="text-xs text-white/50"> | ||
{dayjs(secret.secret.updatedAt).toNow(true)} ago by{' '} | ||
<span className="text-white"> | ||
{secret.secret.lastUpdatedBy.name} | ||
</span> | ||
</div> | ||
} | ||
> | ||
<div className="flex gap-x-5"> | ||
<div className="flex items-center gap-x-4"> | ||
{/* <SecretLogoSVG /> */} | ||
{secret.secret.name} | ||
</div> | ||
{secret.secret.note ? ( | ||
<TooltipProvider> | ||
<Tooltip> | ||
<TooltipTrigger> | ||
<NoteIconSVG className="w-7" /> | ||
</TooltipTrigger> | ||
<TooltipContent className="border-white/20 bg-white/10 text-white backdrop-blur-xl"> | ||
<p>{secret.secret.note}</p> | ||
</TooltipContent> | ||
</Tooltip> | ||
</TooltipProvider> | ||
) : null} | ||
</div> | ||
</AccordionTrigger> | ||
<AccordionContent> | ||
<Table> | ||
<TableHeader> | ||
<TableRow> | ||
<TableHead>Environment</TableHead> | ||
<TableHead>Secret</TableHead> | ||
</TableRow> | ||
</TableHeader> | ||
<TableBody> | ||
{secret.values.map((value) => { | ||
return ( | ||
<TableRow key={value.environment.id}> | ||
<TableCell>{value.environment.name}</TableCell> | ||
<TableCell className="max-w-40 overflow-auto"> | ||
{value.value} | ||
</TableCell> | ||
</TableRow> | ||
) | ||
})} | ||
</TableBody> | ||
</Table> | ||
</AccordionContent> | ||
</AccordionItem> | ||
) | ||
})} | ||
</Accordion> | ||
</ScrollArea> | ||
) | ||
} | ||
|
||
export default SecretPage |
7 changes: 7 additions & 0 deletions
7
apps/platform/src/app/(main)/project/[project]/@variable/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react' | ||
|
||
function VariablePage(): React.JSX.Element { | ||
return <div>VariablePage</div> | ||
} | ||
|
||
export default VariablePage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.