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/components/account/config/system/behavior.tsx
Views: 687
import { Space } from "antd";1import Loading from "components/share/loading";2import register from "../register";3import useEditTable from "lib/hooks/edit-table";45const desc = {6confirm_close: `You can make CoCalc always ask for confirmation before closing a browser tab viewing a project.7Enable this if you have issues with accidentally closing the CoCalc browser tab.8This shouldn't be necessary, since it's unlikely you will loose work if you close9the tab; also when you reopen CoCalc everything should be exactly as you left it.`,10katex: `11The default is to always attempt to render formulas with KaTeX if possible, but you can12uncheck the box below to use MathJax version 2 by default when possible. KaTeX is faster than13MathJax v2, but there are edge cases that MathJax supports but KaTeX doesn't,14often only for historical reasons; also, MathJax has a useful context menu.15(Some parts of CoCalc only support KaTeX no matter what you select here.)16`,17standby_timeout_m: `18If you are not active for several minutes, you may see the gray and blue CoCalc splash screen19and your browser will minimize resource usage. The time until the splash screen appears is the20standby timeout, which you can adjust below. We use it to conserve resources, mainly network21bandwidth and browser CPU cycles. Execution of your code is NOT paused during standby.22`,23show_global_info2: `24Sometimes there are important announcements about CoCalc, e.g., if there is a major25update available. You can hide these if you do not want to see them at the top of26the screen for some reason.27`,28};2930interface Data {31other_settings: {32standby_timeout_m: number;33katex: boolean;34confirm_close: boolean;35};36}3738register({39path: "system/behavior",40title: "Behavior",41icon: "circle",42desc: "Configure general behavior of CoCalc, including idle timeout, math rendering, and whether to ask for confirmation before closing the browser window.",43search: desc,44Component: () => {45const { edited, original, Save, EditBoolean, EditNumber } =46useEditTable<Data>({47accounts: { other_settings: null },48});49if (original == null || edited == null) {50return <Loading />;51}5253return (54<Space direction="vertical">55<Save />56<EditNumber57icon="ban"58path="other_settings.standby_timeout_m"59title="Standby Timeout"60desc={desc.standby_timeout_m}61min={1}62max={180}63units="minutes"64/>65<EditBoolean66path="other_settings.katex"67icon="tex"68title="Math Rendering: KaTeX versus MathJax"69desc={desc.katex}70label="Attempt to use KaTeX if at all possible"71/>72<EditBoolean73icon="times-circle"74path="other_settings.confirm_close"75title="Confirmation before closing browser tab"76desc={desc.confirm_close}77label="Ask for confirmation"78/>79</Space>80);81},82});838485