Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/src/packages/next/components/store/run-limit.tsx
Views: 923
/*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 = 10000;1011export 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>39the run limit is typically 2 more than the number of students (one40for each student, one for the shared project and one for the41instructor project)42</i>43</b>44.45</div>46);47}4849return (50<>51<Divider plain>Simultaneous Project Upgrades</Divider>52<Form.Item53label="Run Limit"54name="run_limit"55initialValue={1}56extra={extra()}57>58<EditRunLimit59disabled={disabled}60onChange={(run_limit) => {61form.setFieldsValue({ run_limit });62onChange();63}}64/>65</Form.Item>66</>67);68}6970export function EditRunLimit({71value,72onChange,73disabled,74}: {75value?;76onChange?;77disabled?;78}) {79return (80<IntegerSlider81value={value}82min={1}83disabled={disabled}84max={300}85maxText={MAX_ALLOWED_RUN_LIMIT}86onChange={onChange}87units={"projects"}88presets={[1, 2, 10, 50, 100, 250, 500]}89/>90);91}929394