1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/frontend/app/settings/indexing/indexing.settings.component.html
2017-07-27 23:10:16 +02:00

98 lines
4.1 KiB
HTML

<form #settingsForm="ngForm" class="form-horizontal">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title col-xs-4">Folder indexing</h3>
</div>
<div class="panel-body">
<div [hidden]="!error" class="alert alert-danger" role="alert"><strong>Error: </strong>{{error}}</div>
<ng-container *ngIf="!simplifiedMode">
<div class="form-group">
<label class="col-sm-2 control-label" for="cachedFolderTimeout">Index cache timeout [ms]</label>
<div class="col-sm-10">
<input type="number" class="form-control" placeholder="36000"
id="cachedFolderTimeout"
min="0"
step="1"
[(ngModel)]="settings.cachedFolderTimeout"
name="cachedFolderTimeout" required>
<span class="help-block">If there was no indexing in this time, it reindexes. (skipped if indexen in DB and sensitivity is low)</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="folderPreviewSize">Sub folder preview size</label>
<div class="col-sm-10">
<input type="number" class="form-control" placeholder="1"
id="folderPreviewSize"
min="0"
step="1"
[(ngModel)]="settings.folderPreviewSize"
name="folderPreviewSize" required>
<span class="help-block">Reads this many photos from sub folders</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="reIndexingSensitivity">Folder reindexing sensitivity</label>
<div class="col-sm-10">
<select id="reIndexingSensitivity" class="form-control" [(ngModel)]="settings.reIndexingSensitivity"
name="reIndexingSensitivity" required>
<option *ngFor="let type of types" [ngValue]="type.key">{{type.value}}
</option>
</select>
<span
class="help-block">Set the reindexing sensitivity. High value check the folders for change more often</span>
</div>
</div>
<button class="btn btn-success pull-right"
[disabled]="!settingsForm.form.valid || !changed || inProgress"
(click)="save()">Save
</button>
<button class="btn btn-default pull-right"
(click)="reset()">Reset
</button>
<br/>
<hr/>
</ng-container>
If you add a new folder to your gallery, the site indexes it automatically.
If you would like to trigger indexing manually, click index button.<br/>
(Note: search ony searched among the indexed directories)<br/>
<div *ngIf="_settingsService.progress.value != null">
indexing: {{_settingsService.progress.value.current}}
<div class="progress">
<div class="progress-bar progress-bar-success"
role="progressbar"
aria-valuenow="2"
aria-valuemin="0"
aria-valuemax="100"
style="min-width: 2em;"
[style.width.%]="(_settingsService.progress.value.indexed/(_settingsService.progress.value.left+_settingsService.progress.value.indexed))*100">
{{_settingsService.progress.value.indexed}}/{{_settingsService.progress.value.indexed+_settingsService.progress.value.left}}
</div>
</div>
</div>
<div class="row buttons">
<button class="btn btn-success"
*ngIf="_settingsService.progress.value == null"
[disabled]="inProgress"
(click)="index()">Index
</button>
<button class="btn btn-default"
*ngIf="_settingsService.progress.value != null"
[disabled]="inProgress"
(click)="cancelIndexing()">Cancel
</button>
<button class="btn btn-danger"
[disabled]="inProgress"
(click)="resetDatabase()">Reset Indexes
</button>
</div>
</div>
</div>
</form>