v0.1.12 Quick fix
This commit is contained in:
parent
405e7f30e5
commit
c47ef80aac
|
@ -31,7 +31,7 @@ import CircularProgress from '@mui/material/CircularProgress';
|
||||||
|
|
||||||
import * as API from '../../../api';
|
import * as API from '../../../api';
|
||||||
|
|
||||||
export function CosmosContainerPicker({formik, lockTarget, TargetContainer}) {
|
export function CosmosContainerPicker({formik, lockTarget, TargetContainer, onTargetChange}) {
|
||||||
const [open, setOpen] = React.useState(false);
|
const [open, setOpen] = React.useState(false);
|
||||||
const [containers, setContainers] = React.useState([]);
|
const [containers, setContainers] = React.useState([]);
|
||||||
const [hasPublicPorts, setHasPublicPorts] = React.useState(false);
|
const [hasPublicPorts, setHasPublicPorts] = React.useState(false);
|
||||||
|
@ -134,6 +134,13 @@ export function CosmosContainerPicker({formik, lockTarget, TargetContainer}) {
|
||||||
}
|
}
|
||||||
}, [open]);
|
}, [open]);
|
||||||
|
|
||||||
|
const newTarget = formik.values[name];
|
||||||
|
React.useEffect(() => {
|
||||||
|
if(onTargetChange) {
|
||||||
|
onTargetChange(newTarget)
|
||||||
|
}
|
||||||
|
}, [newTarget])
|
||||||
|
|
||||||
return ( <Grid item xs={12}>
|
return ( <Grid item xs={12}>
|
||||||
<Stack spacing={1}>
|
<Stack spacing={1}>
|
||||||
<InputLabel htmlFor={name + "-autocomplete"}>{label}</InputLabel>
|
<InputLabel htmlFor={name + "-autocomplete"}>{label}</InputLabel>
|
||||||
|
|
|
@ -143,6 +143,7 @@ const ProxyManagement = () => {
|
||||||
{routes && routes.map((route,key) => (<>
|
{routes && routes.map((route,key) => (<>
|
||||||
<RouteManagement key={key} routeConfig={route}
|
<RouteManagement key={key} routeConfig={route}
|
||||||
setRouteConfig={(newRoute) => {
|
setRouteConfig={(newRoute) => {
|
||||||
|
console.log(newRoute)
|
||||||
routes[key] = newRoute;
|
routes[key] = newRoute;
|
||||||
setNeedSave(true);
|
setNeedSave(true);
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -150,6 +150,9 @@ const RouteManagement = ({ routeConfig, TargetContainer, noControls=false, lockT
|
||||||
formik={formik}
|
formik={formik}
|
||||||
lockTarget={lockTarget}
|
lockTarget={lockTarget}
|
||||||
TargetContainer={TargetContainer}
|
TargetContainer={TargetContainer}
|
||||||
|
onTargetChange={() => {
|
||||||
|
setRouteConfig(formik.values);
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
: <CosmosInputText
|
: <CosmosInputText
|
||||||
name="Target"
|
name="Target"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "cosmos-server",
|
"name": "cosmos-server",
|
||||||
"version": "0.1.11",
|
"version": "0.1.12",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "test-server.js",
|
"main": "test-server.js",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
|
|
@ -97,7 +97,7 @@ type ProxyConfig struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type ProxyRouteConfig struct {
|
type ProxyRouteConfig struct {
|
||||||
Name string
|
Name string `validate:"required"`
|
||||||
Description string
|
Description string
|
||||||
UseHost bool
|
UseHost bool
|
||||||
Host string
|
Host string
|
||||||
|
|
Loading…
Reference in a new issue