mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-01-04 13:17:22 -06:00
Fixed import/export server issues reported while testing.
This commit is contained in:
parent
6528d086ba
commit
7cc76c7d2d
@ -107,8 +107,11 @@ def get_servers():
|
|||||||
for server in servers:
|
for server in servers:
|
||||||
children.append({'value': server.id, 'label': server.name})
|
children.append({'value': server.id, 'label': server.name})
|
||||||
|
|
||||||
all_servers.append(
|
# Add server group only when some servers are there.
|
||||||
{'value': group.name, 'label': group.name, 'children': children})
|
if len(children) > 0:
|
||||||
|
all_servers.append(
|
||||||
|
{'value': group.name, 'label': group.name,
|
||||||
|
'children': children})
|
||||||
|
|
||||||
return make_json_response(success=1, data=all_servers)
|
return make_json_response(success=1, data=all_servers)
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ export default function ImportExportServers() {
|
|||||||
Notify.alert(gettext('Export Servers'), gettext('The selected servers were exported successfully.'));
|
Notify.alert(gettext('Export Servers'), gettext('The selected servers were exported successfully.'));
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
Notify.alert(err.response.data.errormsg);
|
Notify.alert(gettext('Export Error'), err.response.data.errormsg);
|
||||||
});
|
});
|
||||||
} else if (selectionFormData.imp_exp == 'i') {
|
} else if (selectionFormData.imp_exp == 'i') {
|
||||||
// Remove the random number added to create unique tree item,
|
// Remove the random number added to create unique tree item,
|
||||||
@ -105,10 +105,10 @@ export default function ImportExportServers() {
|
|||||||
Notify.alert(gettext('Import Servers'), msg);
|
Notify.alert(gettext('Import Servers'), msg);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
Notify.alert(err.response.data.errormsg);
|
Notify.alert(gettext('Import error'), err.response.data.errormsg);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Alertify.importExportWizardDialog().close();
|
Alertify.importExportWizardDialog().close();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -174,6 +174,7 @@ export default function ImportExportServers() {
|
|||||||
api.get(get_servers_url)
|
api.get(get_servers_url)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
setLoaderText('');
|
setLoaderText('');
|
||||||
|
setErrMsg('');
|
||||||
setServerData(res.data.data);
|
setServerData(res.data.data);
|
||||||
resolve();
|
resolve();
|
||||||
})
|
})
|
||||||
@ -190,6 +191,7 @@ export default function ImportExportServers() {
|
|||||||
api.post(load_servers_url, post_data)
|
api.post(load_servers_url, post_data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
setLoaderText('');
|
setLoaderText('');
|
||||||
|
setErrMsg('');
|
||||||
setServerData(res.data.data);
|
setServerData(res.data.data);
|
||||||
resolve();
|
resolve();
|
||||||
})
|
})
|
||||||
@ -261,10 +263,10 @@ export default function ImportExportServers() {
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</Paper>
|
</Paper>
|
||||||
{selectionFormData.imp_exp == 'i' &&
|
{selectionFormData.imp_exp == 'i' &&
|
||||||
<FormNote className={classes.noteContainer} text={gettext(noteText)}/> }
|
<FormNote className={classes.noteContainer} text={gettext(noteText)}/> }
|
||||||
</WizardStep>
|
</WizardStep>
|
||||||
</Wizard>
|
</Wizard>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user