[release] v0.4.0-unstable9
This commit is contained in:
parent
925070d0a3
commit
1f97b7bf29
|
@ -17,6 +17,8 @@ const GetActions = ({
|
||||||
setIsUpdatingId(Id, true);
|
setIsUpdatingId(Id, true);
|
||||||
API.docker.manageContainer(Id, action).then((res) => {
|
API.docker.manageContainer(Id, action).then((res) => {
|
||||||
refreshServeApps();
|
refreshServeApps();
|
||||||
|
}).catch((err) => {
|
||||||
|
refreshServeApps();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@ const ContainerOverview = ({ containerInfo, config, refresh }) => {
|
||||||
<Stack spacing={2} style={{ width: '100%' }} >
|
<Stack spacing={2} style={{ width: '100%' }} >
|
||||||
<Stack spacing={2} direction={'row'} >
|
<Stack spacing={2} direction={'row'} >
|
||||||
<GetActions
|
<GetActions
|
||||||
Id={containerInfo.Id}
|
Id={containerInfo.Name}
|
||||||
state={State.Status}
|
state={State.Status}
|
||||||
refreshServeApps={() => {
|
refreshServeApps={() => {
|
||||||
refreshAll()
|
refreshAll()
|
||||||
|
|
|
@ -59,11 +59,11 @@ const VolumeContainerSetup = ({ config, containerInfo, refresh }) => {
|
||||||
const errors = {};
|
const errors = {};
|
||||||
// check unique
|
// check unique
|
||||||
const volumes = values.volumes.map((volume) => {
|
const volumes = values.volumes.map((volume) => {
|
||||||
return `${volume.Destination}`;
|
return `${volume.Target}`;
|
||||||
});
|
});
|
||||||
const unique = [...new Set(volumes)];
|
const unique = [...new Set(volumes)];
|
||||||
if (unique.length !== volumes.length) {
|
if (unique.length !== volumes.length) {
|
||||||
errors.submit = 'Mounts must have unique destinations';
|
errors.submit = 'Mounts must have unique targets';
|
||||||
}
|
}
|
||||||
return errors;
|
return errors;
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -190,7 +190,7 @@ const ServeApps = () => {
|
||||||
{/* <Button variant="contained" size="small" onClick={() => {}}>
|
{/* <Button variant="contained" size="small" onClick={() => {}}>
|
||||||
Update
|
Update
|
||||||
</Button> */}
|
</Button> */}
|
||||||
<GetActions Id={app.Id} state={app.State} setIsUpdatingId={setIsUpdatingId} refreshServeApps={refreshServeApps} />
|
<GetActions Id={app.Names[0].replace('/', '')} state={app.State} setIsUpdatingId={setIsUpdatingId} refreshServeApps={refreshServeApps} />
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack margin={1} direction="column" spacing={1} alignItems="flex-start">
|
<Stack margin={1} direction="column" spacing={1} alignItems="flex-start">
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "cosmos-server",
|
"name": "cosmos-server",
|
||||||
"version": "0.4.0-unstable8",
|
"version": "0.4.0-unstable9",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "test-server.js",
|
"main": "test-server.js",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
|
|
@ -32,9 +32,9 @@ func ManageContainerRoute(w http.ResponseWriter, req *http.Request) {
|
||||||
// stop, start, restart, kill, remove, pause, unpause, recreate
|
// stop, start, restart, kill, remove, pause, unpause, recreate
|
||||||
action := utils.Sanitize(vars["action"])
|
action := utils.Sanitize(vars["action"])
|
||||||
|
|
||||||
if os.Getenv("HOSTNAME") != "" && (action == "recreate" || action == "update") && containerName == os.Getenv("HOSTNAME") {
|
if os.Getenv("HOSTNAME") != "" && containerName == os.Getenv("HOSTNAME") {
|
||||||
utils.Error("ManageContainer - cannot recreate/update self", nil)
|
utils.Error("ManageContainer - Container cannot update itself", nil)
|
||||||
utils.HTTPError(w, "Cannot recreate/update self", http.StatusBadRequest, "DS003")
|
utils.HTTPError(w, "Container cannot update itself", http.StatusBadRequest, "DS003")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,8 @@ func SecureContainerRoute(w http.ResponseWriter, req *http.Request) {
|
||||||
status := utils.Sanitize(vars["status"])
|
status := utils.Sanitize(vars["status"])
|
||||||
|
|
||||||
if os.Getenv("HOSTNAME") != "" && containerName == os.Getenv("HOSTNAME") {
|
if os.Getenv("HOSTNAME") != "" && containerName == os.Getenv("HOSTNAME") {
|
||||||
utils.Error("SecureContainerRoute - Cannot force secure self", nil)
|
utils.Error("SecureContainerRoute - Container cannot update itself", nil)
|
||||||
utils.HTTPError(w, "Cannot force secure self", http.StatusBadRequest, "DS003")
|
utils.HTTPError(w, "Container cannot update itself", http.StatusBadRequest, "DS003")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,8 +40,8 @@ func UpdateContainerRoute(w http.ResponseWriter, req *http.Request) {
|
||||||
containerName := utils.Sanitize(vars["containerId"])
|
containerName := utils.Sanitize(vars["containerId"])
|
||||||
|
|
||||||
if os.Getenv("HOSTNAME") != "" && containerName == os.Getenv("HOSTNAME") {
|
if os.Getenv("HOSTNAME") != "" && containerName == os.Getenv("HOSTNAME") {
|
||||||
utils.Error("SecureContainerRoute - Cannot update self", nil)
|
utils.Error("SecureContainerRoute - Container cannot update itself", nil)
|
||||||
utils.HTTPError(w, "Cannot update self", http.StatusBadRequest, "DS003")
|
utils.HTTPError(w, "Container cannot update itself", http.StatusBadRequest, "DS003")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue