Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/packages/next/lib/customize.ts
Views: 687
/*1* This file is part of CoCalc: Copyright © 2021 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { createContext, useContext } from "react";67import type { Customize as ServerCustomize } from "@cocalc/database/settings/customize";89interface EnabledPageBranch {10[key: string]: boolean | undefined | EnabledPageBranch;11}1213interface EnabledPageTree extends EnabledPageBranch {14auth: {15try: boolean | undefined;16};17about: {18index: boolean | undefined;19events: boolean | undefined;20team: boolean | undefined;21};22compute: boolean | undefined;23contact: boolean | undefined;24features: boolean | undefined;25info: boolean | undefined;26legal: boolean | undefined;27licenses: boolean | undefined;28news: boolean | undefined;29onPrem: boolean | undefined;30organization: boolean | undefined;31policies: {32index: boolean | undefined;33imprint: boolean | undefined;34};35pricing: boolean | undefined;36share: boolean | undefined;37software: boolean | undefined;38store: boolean | undefined;39support: boolean | undefined;40systemActivity: boolean | undefined;41status: boolean | undefined;42termsOfService: boolean | undefined;43}4445interface Customize extends ServerCustomize {46account?: {47account_id: string;48email_address?: string;49first_name?: string;50is_anonymous?: boolean;51last_name?: string;52name?: string;53};54defaultComputeImage?: string; // default compute image, e.g. used when creating new projects from a share55githubProjectId?: string; // proxy github urls56imprint?: string; // HTML/MD for an imprint page57imprintOrPolicies?: boolean; // is true if either of the above is more than an empty string58isAuthenticated?: boolean; // if true, the user has a valid authentication cookie59isCollaborator?: boolean; // if account_id and project_id are in the props then this gets filled in60noindex?: boolean; // tell search engines to not index that page61onCoCalcCom?: boolean; // true, if kucalc server settings flag is set to yes (i.e. for cocalc.com only!)62policies?: string; // HTML/MD for a policy page63sandboxProjectId?: string; // a sandbox project to put on landing pages...64serverTime?: number; // the time on the server, in milliseconds since the epoch65openaiEnabled?: boolean; // backend is configured to provide openai integration.66googleVertexaiEnabled?: boolean; // if enabled, e.g. Google Gemini is available67jupyterApiEnabled?: boolean; // backend configured to use a pool of projects for sandboxed ephemeral jupyter code execution68computeServersEnabled?: boolean; // backend configured to run on external compute servers69enabledPages?: EnabledPageTree; // tree structure which specifies supported routes for this install70support?: string; // HTML/MD to replace the generic support pages71}7273const CustomizeContext = createContext<Partial<Customize>>({});74const { Provider } = CustomizeContext;75export const useCustomize = () => useContext(CustomizeContext) ?? {};76export { Provider as Customize };77export type { Customize as CustomizeType };787980