Skip to content

Instantly share code, notes, and snippets.

@wKoza
Created March 5, 2019 10:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wKoza/8e2c1981a3a80720aeee5bbccc7e065f to your computer and use it in GitHub Desktop.
Save wKoza/8e2c1981a3a80720aeee5bbccc7e065f to your computer and use it in GitHub Desktop.
<div class="col-md-9" style="margin-bottom: 40px">
<h3>Upload queue <span *ngIf="uploader.queue.length>0"> - {{ uploader.queue.length }} item(s)</span></h3>
<div class="card text-right">
<div style="margin: 15px">
<ngb-progressbar showValue="true" type="success" [striped]="true" [animated]="true"
[value]="uploader.progressTotal"></ngb-progressbar>
</div>
<div class="card-block">
<button type="button" class="btn btn-outline-success btn-s" (click)="uploader.uploadAll({method: 'POST', url: 'my_url'})"
[disabled]="!activeUploadAllBtn()">
Upload all
</button>
<button type="button" class="btn btn-outline-warning btn-s" (click)="uploader.cancelAll()"
[disabled]="!activeCancelAllBtn()">
Cancel all
</button>
<button type="button" class="btn btn-outline-danger btn-s" (click)="uploader.removeAllFromQueue()"
[disabled]="!activeRemoveAllBtn()">
Remove all
</button>
</div>
</div>
<div class="card" style="margin-top: 20px">
<table class="table" style="font-size: 14px">
<thead>
<tr>
<th></th>
<th width="50%">Name</th>
<th>Size</th>
<th>Progress</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let itemFile of uploader.queue"
[ngClass]="{'table-success' : itemFile.isSuccess, 'table-danger' : itemFile.isError, 'table-warning' : itemFile.isUploading }">
<td>
<div [ngxThumbnail]="itemFile"></div>
</td>
<td>{{ itemFile.file.name }}</td>
<td>{{ itemFile.file.size/1024/1024 | number:'1.0-2' }} MB</td>
<td>
<div>
<ngb-progressbar type="success" showValue="true"
[striped]="true" [animated]="true"
[value]="itemFile.progress">
</ngb-progressbar>
</div>
</td>
<td style="text-align: center">
<button type="button" class="btn btn-outline-success btn-sm" (click)="itemFile.upload({method: 'POST', url: 'my_url'})"
[disabled]="!itemFile.isReady">
Upload
</button>
<button type="button" class="btn btn-outline-warning btn-sm" (click)="itemFile.cancel()"
[disabled]="!itemFile.uploadInProgress || itemFile.isCancel">
Cancel
</button>
<button type="button" class="btn btn-outline-danger btn-sm" (click)="itemFile.remove()"
[disabled]="itemFile.isSuccess || itemFile.uploadInProgress">
Remove
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment