Change port start developping

This commit is contained in:
DomySh
2022-06-30 17:48:04 +02:00
parent 2dacd49623
commit c6fe46cdfa
11 changed files with 60 additions and 91 deletions

View File

@@ -7,7 +7,9 @@ import { ImCross } from "react-icons/im"
type ServiceAddForm = {
name:string,
port:number,
autostart: boolean
autostart: boolean,
chosenInternalPort: boolean,
internalPort: number
}
function AddNewService({ opened, onClose }:{ opened:boolean, onClose:()=>void }) {
@@ -36,9 +38,9 @@ function AddNewService({ opened, onClose }:{ opened:boolean, onClose:()=>void })
const [submitLoading, setSubmitLoading] = useState(false)
const [error, setError] = useState<string|null>(null)
const submitRequest = ({ name, port, autostart }:ServiceAddForm) =>{
const submitRequest = ({ name, port, autostart, chosenInternalPort, internalPort }:ServiceAddForm) =>{
setSubmitLoading(true)
addservice({ name, port }).then( res => {
addservice(chosenInternalPort?{ internalPort, name, port }:{ name, port }).then( res => {
if (res.status === "ok"){
setSubmitLoading(false)
close();