1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/frontend/app/ui/settings/database/database.settings.component.html
Patrik J. Braun 1ddc73d461 improving tasks settings
updating settings
version bump
2019-12-07 18:16:37 +01:00

45 lines
2.1 KiB
HTML

<div class="card mb-4">
<h5 class="card-header" i18n>
<ng-container i18n>Database settings</ng-container><ng-container *ngIf="changed">*</ng-container>
</h5>
<div class="card-body">
<div [hidden]="!error" class="alert alert-danger" role="alert"><strong>Error: </strong>{{error}}</div>
<form #settingsForm="ngForm">
<p class="title" i18n>Type:</p>
<select class="form-control" [(ngModel)]="settings.type" name="type" required>
<option *ngFor="let type of types" [ngValue]="type.key">{{type.value}}
</option>
</select>
<small *ngIf="settings.type == DatabaseType.mysql"
class="form-text text-muted" i18n>Install manually mysql node module to use mysql (npm install mysql)
</small>
<ng-container *ngIf="settings.type == DatabaseType.mysql">
<p class="title" i18n>MySQL settings:</p>
<input type="text" class="form-control" i18n-placeholder placeholder="Host"
[(ngModel)]="settings.mysql.host" name="host" required>
<input type="text" class="form-control" i18n-placeholder placeholder="Database"
[(ngModel)]="settings.mysql.database" name="database" required>
<input type="text" class="form-control" i18n-placeholder placeholder="Username"
[(ngModel)]="settings.mysql.username" name="username">
<input type="password" class="form-control" i18n-placeholder placeholder="Password"
[(ngModel)]="settings.mysql.password" name="password">
</ng-container>
<ng-container *ngIf="settings.type == DatabaseType.sqlite">
<p class="title" i18n>SQLite settings:</p>
<input type="text" class="form-control" placeholder="storage"
[(ngModel)]="settings.sqlite.storage" name="host" required>
</ng-container>
</form>
<button class="btn btn-success float-right"
[disabled]="!settingsForm.form.valid || !changed || inProgress"
(click)="save()" i18n>Save
</button>
<button class="btn btn-secondary float-right"
[disabled]=" !changed || inProgress"
(click)="reset()" i18n>Reset
</button>
</div>
</div>