mirror of
https://github.com/azukaar/Cosmos-Server.git
synced 2026-05-03 17:59:32 -05:00
[release] v0.14.0-unstable16
This commit is contained in:
@@ -22,6 +22,7 @@ import * as API from '../../api';
|
||||
|
||||
const Migrate014 = ({ config }) => {
|
||||
const [isOpened, setIsOpened] = useState(false);
|
||||
const [isSubmitted, setIsSubmitted] = useState(false);
|
||||
|
||||
const formik = useFormik({
|
||||
initialValues: {
|
||||
@@ -38,9 +39,9 @@ const Migrate014 = ({ config }) => {
|
||||
setSubmitting(true);
|
||||
return API.docker.migrateHost(values)
|
||||
.then((res) => {
|
||||
isSubmitted(true);
|
||||
setStatus({ success: true });
|
||||
setSubmitting(false);
|
||||
setIsOpened(false);
|
||||
}).catch((err) => {
|
||||
setStatus({ success: false });
|
||||
setErrors({ submit: err.message });
|
||||
@@ -54,6 +55,15 @@ const Migrate014 = ({ config }) => {
|
||||
<Dialog open={isOpened} onClose={() => setIsOpened(false)}>
|
||||
<FormikProvider value={formik}>
|
||||
<DialogTitle>Migrate to Host Mode</DialogTitle>
|
||||
{isSubmitted ?
|
||||
<DialogContent>
|
||||
<DialogContentText>
|
||||
Migration successful! Your Cosmos instance will now restart in Host Mode.
|
||||
Refresh the page to see the changes (it might take a minute!).
|
||||
if you are experiencing issues, please check the logs for more information.
|
||||
</DialogContentText>
|
||||
</DialogContent>
|
||||
:
|
||||
<DialogContent>
|
||||
<DialogContentText>
|
||||
In order to continue to improve your experience, Cosmos now supports the Host Mode of networking.
|
||||
@@ -99,8 +109,8 @@ const Migrate014 = ({ config }) => {
|
||||
<FormHelperText error>{formik.errors.submit}</FormHelperText>
|
||||
</Grid>
|
||||
)}
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
</DialogContent>}
|
||||
{!isSubmitted && <DialogActions>
|
||||
<Button onClick={() => setIsOpened(false)}>Cancel</Button>
|
||||
<LoadingButton
|
||||
onClick={formik.handleSubmit}
|
||||
@@ -108,7 +118,7 @@ const Migrate014 = ({ config }) => {
|
||||
>
|
||||
Migrate
|
||||
</LoadingButton>
|
||||
</DialogActions>
|
||||
</DialogActions>}
|
||||
</FormikProvider>
|
||||
</Dialog>
|
||||
<div style={{ display: 'inline-block'}}>
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cosmos-server",
|
||||
"version": "0.14.0-unstable15",
|
||||
"version": "0.14.0-unstable16",
|
||||
"description": "",
|
||||
"main": "test-server.js",
|
||||
"bugs": {
|
||||
|
||||
@@ -46,7 +46,14 @@ func MigrateToHostModeRoute(w http.ResponseWriter, req *http.Request) {
|
||||
map[string]interface{}{
|
||||
})
|
||||
|
||||
SelfAction("host")
|
||||
err = SelfAction("host")
|
||||
if err != nil {
|
||||
utils.Error("MigrateToHostMode: Error migrating to host mode", err)
|
||||
utils.HTTPError(w, "Error migrating to host mode: "+err.Error(), http.StatusInternalServerError, "CN003")
|
||||
return
|
||||
}
|
||||
|
||||
utils.SetBaseMainConfig(config)
|
||||
|
||||
json.NewEncoder(w).Encode(map[string]interface{}{
|
||||
"status": "OK",
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ func RunDB(db utils.DatabaseConfig) (DockerServiceCreateRequest, error) {
|
||||
Name: db.Hostname,
|
||||
Image: imageName,
|
||||
RestartPolicy: "always",
|
||||
// Command: "--wiredTigerCacheSizeGB 0.25",
|
||||
Command: "--wiredTigerCacheSizeGB 0.25",
|
||||
Environment: []string{
|
||||
"MONGO_INITDB_ROOT_USERNAME=" + db.Username,
|
||||
"MONGO_INITDB_ROOT_PASSWORD=" + db.Password,
|
||||
|
||||
Reference in New Issue
Block a user