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/store/run-limit.tsx
Views: 687
/*1* This file is part of CoCalc: Copyright © 2022 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { Divider, Form } from "antd";6import A from "components/misc/A";7import IntegerSlider from "components/misc/integer-slider";89export const MAX_ALLOWED_RUN_LIMIT = 100001011export function RunLimit({12showExplanations,13form,14onChange,15disabled = false,16boost = false,17}) {18function extra() {19if (!showExplanations) return;2021return (22<div style={{ marginTop: "5px" }}>23{boost ? (24<div style={{ fontWeight: "bold" }}>25It's not necessary to match the run limit of the license you want to26boost!27</div>28) : undefined}29Simultaneously run this many projects using this license. You, and30anyone you share the license code with, can apply the license to an31unlimited number of projects, but it will only be used up to the run32limit. When{" "}33<A href="https://doc.cocalc.com/teaching-instructors.html">34teaching a course35</A>36,{" "}37<b>38<i>the run limit is typically 2 more than the number of students</i>39</b>40.41</div>42);43}4445return (46<>47<Divider plain>48Simultaneous Project Upgrades49</Divider>50<Form.Item51label="Run Limit"52name="run_limit"53initialValue={1}54extra={extra()}55>56<EditRunLimit57disabled={disabled}58onChange={(run_limit) => {59form.setFieldsValue({ run_limit });60onChange();61}}62/>63</Form.Item>64</>65);66}6768export function EditRunLimit({69value,70onChange,71disabled,72}: {73value?;74onChange?;75disabled?;76}) {77return (78<IntegerSlider79value={value}80min={1}81disabled={disabled}82max={300}83maxText={MAX_ALLOWED_RUN_LIMIT}84onChange={onChange}85units={"projects"}86presets={[1, 2, 10, 50, 100, 250, 500]}87/>88);89}909192