Handling merging multiple pbf files in map importing.

This commit is contained in:
Roland 2022-10-27 20:22:11 -06:00
parent 2b84831205
commit 6854fa3692
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
5 changed files with 201 additions and 101 deletions

View file

@ -21,7 +21,7 @@ class ManageMap extends React.Component {
super(props);
this.state = {
files: null,
importing: null,
pending: null,
import_running: false,
selectedPaths: [],
dockerized: null,
@ -42,7 +42,7 @@ class ManageMap extends React.Component {
const importStatus = await getMapImportStatus();
this.setState({
files: importStatus['files'],
importing: importStatus['importing'],
pending: importStatus['pending'],
import_running: importStatus['import_running'],
dockerized: importStatus['dockerized'],
});
@ -102,7 +102,7 @@ class ManageMap extends React.Component {
<a href={`/media/${path}`}>{path}</a>
</TableCell>
<TableCell>
{path === this.state.importing ?
{this.state.pending && this.state.pending.indexOf(path) >= 0 ?
<SLoader active inline size='mini'/> :
imported ? 'yes' : 'no'}
</TableCell>
@ -111,7 +111,7 @@ class ManageMap extends React.Component {
}
render() {
const {files, selectedPaths, import_running, importing, dockerized} = this.state;
const {files, selectedPaths, import_running, pending, dockerized} = this.state;
let dockerWarning;
if (dockerized === true) {
@ -164,9 +164,9 @@ class ManageMap extends React.Component {
</Message.Content>
</Message>
let importingLoader = (
<Loader size='large' active={import_running} inline='centered'>Importing: {importing}</Loader>
);
const importingMessage = pending ?
pending.length > 1 ? 'Importing...' : `Importing ${pending[0]}`
: null;
let disabled = dockerized || !files || files.length === 0 || import_running;
let importButton = <Button
@ -205,7 +205,9 @@ class ManageMap extends React.Component {
<WROLModeMessage content='Cannot modify Map'/>
{dockerWarning}
{downloadMessage}
{importingLoader}
<Loader size='large' active={import_running} inline='centered'>
{importingMessage}
</Loader>
<Table>
<TableHeader>
<TableRow>