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:
|
||||
children.append({'value': server.id, 'label': server.name})
|
||||
|
||||
all_servers.append(
|
||||
{'value': group.name, 'label': group.name, 'children': children})
|
||||
# Add server group only when some servers are there.
|
||||
if len(children) > 0:
|
||||
all_servers.append(
|
||||
{'value': group.name, 'label': group.name,
|
||||
'children': children})
|
||||
|
||||
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.'));
|
||||
})
|
||||
.catch((err) => {
|
||||
Notify.alert(err.response.data.errormsg);
|
||||
Notify.alert(gettext('Export Error'), err.response.data.errormsg);
|
||||
});
|
||||
} else if (selectionFormData.imp_exp == 'i') {
|
||||
// Remove the random number added to create unique tree item,
|
||||
@ -105,7 +105,7 @@ export default function ImportExportServers() {
|
||||
Notify.alert(gettext('Import Servers'), msg);
|
||||
})
|
||||
.catch((err) => {
|
||||
Notify.alert(err.response.data.errormsg);
|
||||
Notify.alert(gettext('Import error'), err.response.data.errormsg);
|
||||
});
|
||||
}
|
||||
|
||||
@ -174,6 +174,7 @@ export default function ImportExportServers() {
|
||||
api.get(get_servers_url)
|
||||
.then(res => {
|
||||
setLoaderText('');
|
||||
setErrMsg('');
|
||||
setServerData(res.data.data);
|
||||
resolve();
|
||||
})
|
||||
@ -190,6 +191,7 @@ export default function ImportExportServers() {
|
||||
api.post(load_servers_url, post_data)
|
||||
.then(res => {
|
||||
setLoaderText('');
|
||||
setErrMsg('');
|
||||
setServerData(res.data.data);
|
||||
resolve();
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user