mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-24 13:01:56 +00:00
chore(menu): add API reference link to the sidebar (#6289)
Co-authored-by: Pablo Lara <larabjj@gmail.com>
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
PROWLER_UI_VERSION="latest"
|
||||
SITE_URL=http://localhost:3000
|
||||
API_BASE_URL=http://prowler-api:8080/api/v1
|
||||
NEXT_PUBLIC_API_DOCS_URL=http://prowler-api:8080/api/v1/docs
|
||||
AUTH_TRUST_HOST=true
|
||||
UI_PORT=3000
|
||||
# openssl rand -base64 32
|
||||
|
||||
@@ -26,8 +26,14 @@ interface InvitationDetailsProps {
|
||||
}
|
||||
|
||||
export const InvitationDetails = ({ attributes }: InvitationDetailsProps) => {
|
||||
const baseURL = process.env.SITE_URL;
|
||||
const invitationLink = `${baseURL}/sign-up?invitation_token=${attributes.token}`;
|
||||
// window.location.origin to get the current base URL
|
||||
const baseUrl =
|
||||
typeof window !== "undefined"
|
||||
? window.location.origin
|
||||
: "http://localhost:3000";
|
||||
|
||||
const invitationLink = `${baseUrl}/invitations/check-details?id=${attributes.token}`;
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-x-4 gap-y-8">
|
||||
<Card
|
||||
|
||||
@@ -160,6 +160,50 @@ export const SidebarWrap = () => {
|
||||
)}
|
||||
</CustomButton>
|
||||
</Tooltip>
|
||||
<Tooltip
|
||||
content="API reference"
|
||||
isDisabled={!isCompact}
|
||||
placement="right"
|
||||
>
|
||||
<CustomButton
|
||||
asLink={
|
||||
process.env.NEXT_PUBLIC_IS_CLOUD_ENV === "true"
|
||||
? "https://api.prowler.com/api/v1/docs"
|
||||
: `${process.env.NEXT_PUBLIC_API_DOCS_URL}`
|
||||
}
|
||||
target="_blank"
|
||||
ariaLabel="API reference"
|
||||
variant="flat"
|
||||
className={clsx(
|
||||
"justify-start truncate bg-transparent text-default-500 data-[hover=true]:text-foreground dark:bg-transparent",
|
||||
{
|
||||
"justify-center": isCompact,
|
||||
},
|
||||
)}
|
||||
isIconOnly={isCompact}
|
||||
startContent={
|
||||
isCompact ? null : (
|
||||
<Icon
|
||||
className="flex-none text-default-500"
|
||||
icon="tabler:api"
|
||||
width={24}
|
||||
aria-hidden="true"
|
||||
/>
|
||||
)
|
||||
}
|
||||
>
|
||||
{isCompact ? (
|
||||
<Icon
|
||||
className="text-default-500"
|
||||
icon="tabler:api"
|
||||
width={24}
|
||||
aria-hidden="true"
|
||||
/>
|
||||
) : (
|
||||
"API reference"
|
||||
)}
|
||||
</CustomButton>
|
||||
</Tooltip>
|
||||
|
||||
<Tooltip content="Support" isDisabled={!isCompact} placement="right">
|
||||
<CustomButton
|
||||
|
||||
Reference in New Issue
Block a user