This commit is contained in:
Shane Harris
2020-08-17 13:31:48 +01:00
committed by Your Name
parent 98d137b963
commit 38a66bf43c
10 changed files with 66 additions and 40 deletions
@@ -1,6 +1,10 @@
.breadcrumb-wrapper{
position: fixed;
top: 200px;
top: 165px;
width: 100%;
height: auto;
z-index: 1;
line-height: 40px;
}
.drag-indicator{
@@ -1,15 +1,14 @@
<div *ngIf="isConnected()">
<br><br><br>
<div *ngIf="isConnected()" class="top-bar">
<nav class="pink lighten-2 breadcrumb-wrapper ">
<div class="nav-wrapper container">
<div class="col s12">
<a *ngFor="let breadcrumb of breadcrumbs" href="javascript:void(0)" class="breadcrumb"
(click)="open('/'+breadcrumb.path)">{{breadcrumb.name}}</a>
<a *ngFor="let breadcrumb of breadcrumbs; let i = index" href="javascript:void(0)" class="breadcrumb"
(click)="open('/'+breadcrumb.path)">{{breadcrumb.name}}<span *ngIf="i === breadcrumbs.length-1 && folderSize"> ({{folderSize}})</span> </a>
</div>
</div>
</nav>
</div>
<div class="container">
<div class="container files-section">
<div *ngIf="!isConnected()">
<h4
[ngClass]="{'text-dark-theme':appService.currentTheme === 'dark','text-light-theme':appService.currentTheme === 'light'}">
@@ -54,12 +53,13 @@
class="btn-floating blue"><i class="material-icons">folder</i></a></li>
<li mz-tooltip position="left" tooltip="Open current save location" (click)="openSaveLocation()"><a
class="btn-floating yellow darken-2"><i class="material-icons">folder</i></a></li>
<li *ngIf="selectedFiles.length > 0" mz-tooltip position="left" tooltip="Delete selected items"
(click)="filesToBeDeleted = selectedFiles; confirmModal.openModal()"><a class="btn-floating red darken-2"><i
class="material-icons">delete</i></a></li>
<li *ngIf="quickSaveSupported()" mz-tooltip position="left" tooltip="Save screenshots and recordings"
(click)="downloadMediaModal.openModal()"><a class="btn-floating green"><i class="material-icons">get_app</i></a>
</li>
<li *ngIf="selectedFiles.length > 0" class="divider"></li>
<li *ngIf="selectedFiles.length > 0" mz-tooltip position="left" tooltip="Delete selected items"
(click)="filesToBeDeleted = selectedFiles; confirmModal.openModal()"><a class="btn-floating red darken-2"><i
class="material-icons">delete</i></a></li>
<li *ngIf="selectedFiles.length > 0" mz-tooltip position="left" tooltip="Save selected items to computer"
(click)="filesToBeSaved = selectedFiles; filesModal.openModal()">
<a class="btn-floating orange"><i class="material-icons">get_app</i></a>
@@ -149,7 +149,7 @@
</div>
</div>
<br>
<h5><em>WARNING: This cannot be undone!!</em></h5>
WARNING: This cannot be undone!!
</mz-modal-content>
<mz-modal-footer>
<button mz-button [flat]="true" mz-modal-close>Close</button>
+12 -3
View File
@@ -33,6 +33,7 @@ export class FilesComponent implements OnInit {
isOpen: boolean = false;
currentPath: string;
folderName: string;
folderSize: string;
currentFile: FileFolderListing;
quickSaveModels: string[] = ['Quest', 'Go'];
constructor(
@@ -296,11 +297,10 @@ export class FilesComponent implements OnInit {
this.breadcrumbs.push({ path, name });
}
open(path: string) {
//this.spinnerService.showLoader();
//this.spinnerService.setMessage('Loading files...');
this.currentPath = path;
this.breadcrumbs = [];
this.selectedFiles.length = 0;
this.files.length = 0;
this.getCrumb(
this.currentPath
.split('/')
@@ -318,7 +318,6 @@ export class FilesComponent implements OnInit {
return textA < textB ? -1 : textA > textB ? 1 : 0;
});
this.files = this.files.filter(d => d.icon === 'folder').concat(this.files.filter(d => d.icon !== 'folder'));
//this.spinnerService.hideLoader();
});
}
openSaveLocation() {
@@ -326,6 +325,16 @@ export class FilesComponent implements OnInit {
}
async readdir(path: String) {
let dirContents: FileFolderListing[];
let isRoot = ['/sdcard/', 'sdcard', 'sdcard/', '/sdcard'].indexOf(path) > -1;
if (isRoot) {
this.folderSize = null;
} else {
this.folderSize = await this.adbService.adbCommand('shell', {
serial: this.adbService.deviceSerial,
command: 'du -sh "' + path + '"',
});
this.folderSize = this.folderSize.split('\t')[0];
}
await this.adbService.adbCommand('readdir', { serial: this.adbService.deviceSerial, path }).then(files => {
dirContents = files.map(file => {
const name = file.name;