@@ -9,10 +9,11 @@ import { FormEvent, useEffect, useState } from "react";
99import  {  ConfigurationSettingsField  }  from  "../../repositories/detail/ConfigurationSettingsField" ; 
1010import  {  Heading3 ,  Subheading  }  from  "@podkit/typography/Headings" ; 
1111import  {  InputField  }  from  "../../components/forms/InputField" ; 
12- import  {  TextInput  }  from  "../../components/forms/TextInputField" ; 
12+ import  {  NumberInput  }  from  "../../components/forms/TextInputField" ; 
1313import  {  LoadingButton  }  from  "@podkit/buttons/LoadingButton" ; 
1414import  {  MAX_PARALLEL_WORKSPACES_FREE ,  MAX_PARALLEL_WORKSPACES_PAID  }  from  "@gitpod/gitpod-protocol" ; 
1515import  {  PlainMessage  }  from  "@bufbuild/protobuf" ; 
16+ import  {  useInstallationConfiguration  }  from  "../../data/installation/default-workspace-image-query" ; 
1617
1718type  Props  =  { 
1819    isOwner : boolean ; 
@@ -40,6 +41,8 @@ export const MaxParallelWorkspaces = ({
4041    ) ; 
4142
4243    const  organizationDefault  =  isPaidPlan  ? MAX_PARALLEL_WORKSPACES_PAID  : MAX_PARALLEL_WORKSPACES_FREE ; 
44+     const  {  data : installationConfig  }  =  useInstallationConfiguration ( ) ; 
45+     const  isDedicatedInstallation  =  ! ! installationConfig ?. isDedicatedInstallation ; 
4346
4447    const  handleSubmit  =  async  ( e : FormEvent )  =>  { 
4548        e . preventDefault ( ) ; 
@@ -66,13 +69,15 @@ export const MaxParallelWorkspaces = ({
6669            </ Subheading > 
6770            < form  onSubmit = { handleSubmit } > 
6871                < InputField  label = "Maximum parallel running workspaces"  error = { error }  className = "mb-4" > 
69-                     < TextInput 
72+                     < NumberInput 
7073                        value = { maxParallelWorkspaces  ??  "" } 
7174                        onChange = { ( newValue )  =>  { 
72-                             setMaxParallelWorkspaces ( parseInt ( newValue ) ) ; 
75+                             setMaxParallelWorkspaces ( newValue ) ; 
7376                            setError ( undefined ) ; 
7477                        } } 
7578                        disabled = { isLoading  ||  ! isOwner } 
79+                         min = { 0 } 
80+                         max = { isDedicatedInstallation  ? undefined  : organizationDefault } 
7681                    /> 
7782                </ InputField > 
7883                < LoadingButton  type = "submit"  loading = { isLoading }  disabled = { ! isOwner } > 
0 commit comments