2017-07-15 18:47:11 +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 > Thumbnail settings< / ng-container > < ng-container * ngIf = "changed" > *< / ng-container >
2018-05-14 04:59:57 +08:00
< / h5 >
< div class = "card-body" >
2017-07-15 18:47:11 +08:00
< div [ hidden ] = " ! error " class = "alert alert-danger" role = "alert" > < strong > Error: < / strong > {{error}}< / div >
2017-07-15 23:29:40 +08:00
< div [ hidden ] = " settings . server . processingLibrary ! = ThumbnailProcessingLib . Jimp "
2017-07-15 20:27:12 +08:00
class="alert alert-warning"
2017-12-25 07:42:25 +08:00
role="alert" i18n>It is highly recommended to use hardware accelerated (sharp or gm) lib for thumbnail
generation
2017-07-15 18:47:11 +08:00
< / div >
< fieldset >
2018-05-14 04:59:57 +08:00
< div class = "form-group row" >
< label class = "col-md-2 control-label" for = "lib" i18n > Thumbnail generation library< / label >
< div class = "col-md-10" >
2017-07-15 23:29:40 +08:00
< select id = "lib" class = "form-control" [ ( ngModel ) ] = " settings . server . processingLibrary "
2017-07-15 20:27:12 +08:00
name="type" required>
2017-07-15 18:47:11 +08:00
< option * ngFor = "let type of types" [ ngValue ] = " type . key " > {{type.value}}
< / option >
< / select >
2018-05-14 04:59:57 +08:00
< small * ngIf = "settings.server.processingLibrary==ThumbnailProcessingLib.sharp"
class="form-text text-muted" i18n>Make sure that sharp node module is installed (npm install sharp).
< / small >
< small * ngIf = "settings.server.processingLibrary==ThumbnailProcessingLib.gm"
class="form-text text-muted">
< ng-container i18n > Make sure that gm node module and< / ng-container >
< a
href="http://www.graphicsmagick.org/" i18n>GraphicsMagick< / a >
< ng-container i18n > are installed (npm install sharp).< / ng-container >
< / small >
2017-07-15 18:47:11 +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 = "th_folder" i18n > Thumbnail folder< / label >
< div class = "col-md-10" >
2017-07-15 18:47:11 +08:00
< input type = "text" class = "form-control" placeholder = "path"
2017-12-20 07:20:37 +08:00
id="th_folder"
2017-07-15 23:29:40 +08:00
[(ngModel)]="settings.server.folder"
2017-07-15 18:47:11 +08:00
name="path" required>
2018-05-14 04:59:57 +08:00
< small class = "form-text text-muted" i18n > Thumbnails will be saved in this folder. Write access is required
< / small >
2017-07-15 18:47:11 +08:00
< / div >
< / div >
2018-05-14 04:59:57 +08:00
< div class = "form-group row" [ hidden ] = " simplifiedMode " >
< label class = "col-md-2 control-label" for = "quality" i18n > Thumbnail Quality< / label >
< div class = "col-md-10" >
2017-07-15 18:47:11 +08:00
< bSwitch
id="quality"
class="switch"
name="enabled"
[switch-on-color]="'primary'"
2019-07-21 17:23:08 +08:00
[switch-inverse]="true"
2018-03-30 08:30:23 +08:00
[switch-off-text]="text.Low"
[switch-on-text]="text.High"
2019-07-21 17:23:08 +08:00
[switch-handle-width]="100"
[switch-label-width]="20"
2017-07-15 23:29:40 +08:00
[(ngModel)]="settings.server.qualityPriority">
2017-07-15 18:47:11 +08:00
< / bSwitch >
2018-05-14 04:59:57 +08:00
< small class = "form-text text-muted" i18n > High quality may be slow. Especially with Jimp.< / small >
2017-07-15 18:47:11 +08:00
< / div >
< / div >
2018-05-14 04:59:57 +08:00
< div class = "form-group row" [ hidden ] = " simplifiedMode " >
< label class = "col-md-2 control-label" for = "icon" > Icon size< / label >
< div class = "col-md-10" >
2017-07-15 18:47:11 +08:00
< input type = "number" class = "form-control" placeholder = "30"
id="icon"
2017-07-15 23:29:40 +08:00
[(ngModel)]="settings.client.iconSize"
2017-07-15 18:47:11 +08:00
min="1"
max="100"
step="1"
name="icon" required>
2018-05-14 04:59:57 +08:00
< small class = "form-text text-muted" i18n > Icon size (used on maps)< / small >
2017-07-15 18:47:11 +08:00
< / div >
< / div >
2018-05-14 04:59:57 +08:00
< div class = "form-group row" [ hidden ] = " simplifiedMode " >
< label class = "col-md-2 control-label" for = "thumbnailSizes" i18n > Thumbnail sizes< / label >
< div class = "col-md-10" >
2017-07-15 18:47:11 +08:00
< input type = "text" class = "form-control" placeholder = "200; 400"
id="thumbnailSizes"
[(ngModel)]="ThumbnailSizes"
name="thumbnailSizes" required>
2018-05-14 04:59:57 +08:00
< small class = "form-text text-muted" >
2017-12-25 07:42:25 +08:00
< ng-container i18n > Size of the thumbnails.< / ng-container > < br / >
< ng-container i18n > The best matching size will be generated. (More size gives better quality, but use storage to store and CPU to render.)< / ng-container > < br / >
< ng-container
2018-07-29 01:58:17 +08:00
i18n>';' separated integers. If size is 200, that thumbnail will have 200^2 pixels.< / ng-container >
2018-05-14 04:59:57 +08:00
< / small >
2017-07-15 18:47:11 +08:00
< / div >
< / div >
< / fieldset >
2018-05-14 04:59:57 +08:00
< button class = "btn btn-success float-right"
2017-07-15 18:47:11 +08:00
[disabled]="!settingsForm.form.valid || !changed || inProgress"
2017-12-25 07:42:25 +08:00
(click)="save()" i18n>Save
2017-07-15 18:47:11 +08:00
< / button >
2019-02-23 07:29:35 +08:00
< button class = "btn btn-secondary float-right"
2019-12-08 01:16:37 +08:00
[disabled]=" !changed || inProgress"
2017-12-25 07:42:25 +08:00
(click)="reset()" i18n>Reset
2017-07-15 18:47:11 +08:00
< / button >
< / div >
< / div >
< / form >