Adds staging/prod admin console links

staging
zomars 2022-04-24 13:51:35 -06:00
parent 20c4777d83
commit dc33da59f7
3 changed files with 9 additions and 8 deletions

View File

@ -2,6 +2,8 @@ import { ExclamationIcon } from "@heroicons/react/solid";
import { useSession } from "next-auth/react";
import { AriaRole, FC, Fragment } from "react";
import { CONSOLE_URL } from "@calcom/lib/constants";
import EmptyScreen from "@components/EmptyScreen";
type LicenseRequiredProps = {
@ -27,13 +29,9 @@ const LicenseRequired: FC<LicenseRequiredProps> = ({ children, as = "", ...rest
headline="This is an enterprise feature"
description={
<>
To enable this feature, please refer to{" "}
<a
href="https://cal.com/enterprise"
target="_blank"
rel="noopener noreferrer"
className="underline">
cal.com/enterprise
To enable this feature, get a deployment key at{" "}
<a href={CONSOLE_URL} target="_blank" rel="noopener noreferrer" className="underline">
Cal.com console
</a>
.
</>

View File

@ -1,7 +1,9 @@
import cache from "memory-cache";
import { CONSOLE_URL } from "@calcom/lib/constants";
async function checkLicense(license: string): Promise<boolean> {
const url = `${process.env.NEXT_PUBLIC_CONSOLE_URL}/api/license?key=${license}`;
const url = `${CONSOLE_URL}/api/license?key=${license}`;
const cachedResponse = cache.get(url);
if (cachedResponse) {
return cachedResponse;

View File

@ -2,6 +2,7 @@ export const WEBAPP_URL = process.env.NEXT_PUBLIC_WEBAPP_URL || `https://${proce
/** @deprecated use `WEBAPP_URL` */
export const BASE_URL = WEBAPP_URL;
export const WEBSITE_URL = process.env.NEXT_PUBLIC_WEBSITE_URL || "https://cal.com";
export const CONSOLE_URL = `https://console.cal.${process.env.VERCEL_ENV === "production" ? "com" : "dev"}`;
export const IS_PRODUCTION = process.env.NODE_ENV === "production";
export const TRIAL_LIMIT_DAYS = 14;
export const HOSTED_CAL_FEATURES = process.env.HOSTED_CAL_FEATURES || BASE_URL === "https://app.cal.com";