Skynet export fixes

This commit is contained in:
2020-06-23 15:18:13 -05:00
parent e7978e335b
commit d1ed8706fd
3 changed files with 25 additions and 2 deletions

View File

@@ -2,3 +2,20 @@
text-align: center; text-align: center;
padding-bottom: var(--default_spacing); padding-bottom: var(--default_spacing);
} }
.SkynetExportList {
display: inline-block;
width: 100%;
overflow-x: auto;
overflow-y: auto;
height: calc(90vh - 80px);
}
.SkynetExportTree {
display: inline-flex;
overflow-x: scroll;
overflow-y: scroll;
white-space: nowrap;
height: calc(90vh - 80px);
width: 100%;
}

View File

@@ -155,7 +155,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(class extends IPCCon
</div> </div>
<h1 <h1
className={'SkynetExportHeading'}>{this.state.second_stage ? 'Verify Exports' : 'Export Files'}</h1> className={'SkynetExportHeading'}>{this.state.second_stage ? 'Verify Exports' : 'Export Files'}</h1>
<div style={{overflowX: 'auto', overflowY: 'auto', height: 'calc(90vh - 80px)'}}> <div className={this.state.second_stage ? 'SkynetExportList' : 'SkynetExportTree'}>
{ {
this.state.second_stage ? this.state.second_stage ?
this.state.checked.map(path => { this.state.checked.map(path => {

View File

@@ -70,7 +70,13 @@ const _createTreeNodes = fileList => {
}; };
const addNode = obj => { const addNode = obj => {
const fullPath = path.join(obj.directory, obj.filename).replace(/\\/g, '/'); let fullPath;
const idx = obj.skylink.indexOf('/');
if (idx > -1) {
fullPath = path.join(obj.directory, obj.skylink.substr(idx + 1)).replace(/\\/g, '/');
} else {
fullPath = path.join(obj.directory, obj.filename).replace(/\\/g, '/');
}
const pathParts = fullPath.replace(/^\/|\/$/g, '').split('/'); const pathParts = fullPath.replace(/^\/|\/$/g, '').split('/');
let ptr = tree; let ptr = tree;
for (let i = 0; i < pathParts.length; i++) { for (let i = 0; i < pathParts.length; i++) {