1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/frontend/app/ui/settings/indexing/indexing.settings.component.html

173 lines
7.4 KiB
HTML
Raw Normal View History

2017-07-26 03:09:37 +08:00
<form #settingsForm="ngForm" class="form-horizontal">
2018-05-14 04:59:57 +08:00
<div class="card mb-4">
<h5 class="card-header" i18n>
2019-08-20 18:54:45 +08:00
<ng-container i18n>Folder indexing</ng-container><ng-container *ngIf="changed">*</ng-container>
2018-05-14 04:59:57 +08:00
</h5>
<div class="card-body">
2017-07-26 03:09:37 +08:00
<div [hidden]="!error" class="alert alert-danger" role="alert"><strong>Error: </strong>{{error}}</div>
2017-07-28 05:10:16 +08:00
<ng-container *ngIf="!simplifiedMode">
2018-05-14 04:59:57 +08:00
<div class="form-group row">
<label class="col-md-2 control-label" for="cachedFolderTimeout" i18n>Index cache timeout [ms]</label>
<div class="col-md-10">
2017-07-28 05:10:16 +08:00
<input type="number" class="form-control" placeholder="36000"
id="cachedFolderTimeout"
min="0"
step="1"
[(ngModel)]="settings.cachedFolderTimeout"
name="cachedFolderTimeout" required>
2018-05-14 04:59:57 +08:00
<small class="form-text text-muted" i18n>If there was no indexing in this time, it reindexes. (skipped if
2018-05-28 01:02:20 +08:00
indexes are in DB and sensitivity is low)
2018-05-14 04:59:57 +08:00
</small>
2017-07-28 05:10:16 +08:00
</div>
</div>
2018-05-14 04:59:57 +08:00
<div class="form-group row">
<label class="col-md-2 control-label" for="folderPreviewSize" i18n>Sub folder preview size</label>
<div class="col-md-10">
2017-07-28 05:10:16 +08:00
<input type="number" class="form-control" placeholder="1"
id="folderPreviewSize"
min="0"
step="1"
[(ngModel)]="settings.folderPreviewSize"
name="folderPreviewSize" required>
2018-05-14 04:59:57 +08:00
<small class="form-text text-muted" i18n>Reads this many photos from sub folders</small>
2017-07-28 05:10:16 +08:00
</div>
</div>
2018-05-14 04:59:57 +08:00
<div class="form-group row">
<label class="col-md-2 control-label" for="reIndexingSensitivity" i18n>Folder reindexing sensitivity</label>
<div class="col-md-10">
2017-07-28 05:10:16 +08:00
<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>
2018-05-14 04:59:57 +08:00
<small
class="form-text text-muted"
i18n>Set the reindexing sensitivity. High value check the folders for change more often.
2018-05-14 04:59:57 +08:00
</small>
2017-07-28 05:10:16 +08:00
</div>
</div>
<div class="form-group row">
<label class="col-md-2 control-label" for="excludeFolderList" i18n>Exclude Folder List</label>
<div class="col-md-10">
<input type="text" class="form-control" placeholder=""
id="excludeFolderList"
[(ngModel)]="excludeFolderList"
name="excludeFolderList" required>
<small class="form-text text-muted">
<ng-container i18n>Folders to exclude from indexing</ng-container><br/>
<ng-container
i18n>';' separated strings. If an entry starts with '/' it is treated as an absolute path. If it doesn't start with '/' but contains a '/', the path is relative to the image directory. If it doesn't contain a '/', any folder with this name will be excluded.</ng-container>
</small>
</div>
</div>
<div class="form-group row">
<label class="col-md-2 control-label" for="excludeFileList" i18n>Exclude File List</label>
<div class="col-md-10">
<input type="text" class="form-control" placeholder=""
id="excludeFileList"
[(ngModel)]="excludeFileList"
name="excludeFileList" required>
<small class="form-text text-muted">
<ng-container i18n>FFiles that mark a folder to be excluded from indexing</ng-container><br/>
<ng-container
i18n>';' separated strings. Any folder that contains a file with this name will be excluded from indexing.</ng-container>
</small>
</div>
</div>
2017-07-28 05:10:16 +08:00
2018-05-14 04:59:57 +08:00
<button class="btn btn-success float-right"
2017-07-28 05:10:16 +08:00
[disabled]="!settingsForm.form.valid || !changed || inProgress"
(click)="save()" i18n>Save
2017-07-28 05:10:16 +08:00
</button>
2019-02-23 07:29:35 +08:00
<button class="btn btn-secondary float-right"
[disabled]=" !changed || inProgress"
(click)="reset()" i18n>Reset
2017-07-28 05:10:16 +08:00
</button>
<br/>
<hr/>
</ng-container>
2018-05-28 23:51:52 +08:00
<ng-container i18n>If you add a new folder to your gallery, the site indexes it automatically.</ng-container>&nbsp;
<ng-container i18n>If you would like to trigger indexing manually, click index button.</ng-container>
<br/>
(
2018-03-30 08:30:23 +08:00
<ng-container i18n>Note: search only works among the indexed directories</ng-container>
)<br/>
2017-07-26 03:09:37 +08:00
2019-07-28 04:56:12 +08:00
<div *ngIf="Progress != null">
<span class="progress-details" i18n>indexing</span>: {{Progress.comment}} <br/>
<span class="progress-details" i18n>elapsed</span>: {{TimeElapsed | duration}}<br/>
<span class="progress-details" i18n>left</span>: {{TimeLeft | duration}}
2017-07-26 03:09:37 +08:00
<div class="progress">
2018-05-14 04:59:57 +08:00
<div class="progress-bar progress-bar-success"
2017-07-26 03:09:37 +08:00
role="progressbar"
aria-valuenow="2"
aria-valuemin="0"
aria-valuemax="100"
style="min-width: 2em;"
2019-07-28 04:56:12 +08:00
[style.width.%]="(Progress.progress/(Progress.left+Progress.progress))*100">
{{Progress.progress}}
/{{Progress.progress + Progress.left}}
2017-07-26 03:09:37 +08:00
</div>
</div>
</div>
2018-12-10 06:25:39 +08:00
<div class="row justify-content-center buttons-row">
2017-07-26 03:09:37 +08:00
<button class="btn btn-success"
2019-07-28 04:56:12 +08:00
*ngIf="Progress == null"
2017-07-26 03:09:37 +08:00
[disabled]="inProgress"
2018-11-24 20:08:34 +08:00
title="Indexes the folders"
i18n-title
2018-12-10 06:25:39 +08:00
(click)="index(false)" i18n>Index
</button>
2018-11-24 20:08:34 +08:00
<button class="btn btn-primary"
title="Indexes the folders and also creates the thumbnails"
i18n-title
2019-07-28 04:56:12 +08:00
*ngIf="Progress == null"
2018-11-24 20:08:34 +08:00
[disabled]="inProgress"
2018-12-10 06:25:39 +08:00
(click)="index(true)" i18n>Index with Thumbnails
</button>
2019-02-23 07:29:35 +08:00
<button class="btn btn-secondary"
2019-07-28 04:56:12 +08:00
*ngIf="Progress != null"
2017-07-26 03:09:37 +08:00
[disabled]="inProgress"
2018-12-10 06:25:39 +08:00
(click)="cancelIndexing()" i18n>Cancel
</button>
2017-07-26 03:09:37 +08:00
<button class="btn btn-danger"
[disabled]="inProgress"
2018-12-10 06:25:39 +08:00
(click)="resetDatabase()" i18n>Reset Indexes
</button>
</div>
<hr/>
<div class="row statics">
<div class="col-md-4 col-12" i18n>
Statistic:
</div>
<div class="col-md-2 col-6">
<span class="oi oi-folder" title="Folders" i18n-title aria-hidden="true"> </span>
{{statistic ? statistic.directories : '...'}}
</div>
<div class="col-md-2 col-6">
<span class="oi oi-camera-slr" title="Photos" i18n-title aria-hidden="true"> </span>
{{statistic ? statistic.photos : '...'}}
</div>
<div class="col-md-2 col-6">
<span class="oi oi-video" title="Videos" i18n-title aria-hidden="true"> </span>
{{statistic ? statistic.videos : '...'}}
</div>
<div class="col-md-2 col-6">
<span class="oi oi-pie-chart" title="Size" i18n-title aria-hidden="true"> </span>
{{statistic ? (statistic.diskUsage | fileSize) : '...'}}
</div>
2017-07-26 03:09:37 +08:00
</div>
</div>
</div>
</form>