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

44 lines
2.0 KiB
HTML
Raw Normal View History

2018-05-14 04:59:57 +08:00
<div class="card mb-4">
<h5 class="card-header" i18n>
Database settings
</h5>
<div class="card-body">
2017-07-08 18:43:42 +08:00
<div [hidden]="!error" class="alert alert-danger" role="alert"><strong>Error: </strong>{{error}}</div>
<form #settingsForm="ngForm">
<p class="title" i18n>Type:</p>
2017-07-15 23:29:40 +08:00
<select class="form-control" [(ngModel)]="settings.type" name="type" required>
2017-07-13 00:31:19 +08:00
<option *ngFor="let type of types" [ngValue]="type.key">{{type.value}}
2017-07-08 18:43:42 +08:00
</option>
</select>
2018-05-14 04:59:57 +08:00
<small *ngIf="settings.type == DatabaseType.mysql"
class="form-text text-muted" i18n>Install manually mysql node module to use mysql (npm install mysql)
</small>
2017-07-15 23:29:40 +08:00
<ng-container *ngIf="settings.type == DatabaseType.mysql">
<p class="title" i18n>MySQL settings:</p>
<input type="text" class="form-control" i18n-placeholder placeholder="Host" autofocus
2017-07-15 23:29:40 +08:00
[(ngModel)]="settings.mysql.host" name="host" required>
<input type="text" class="form-control" i18n-placeholder placeholder="Database" autofocus
2017-07-15 23:29:40 +08:00
[(ngModel)]="settings.mysql.database" name="database" required>
<input type="text" class="form-control" i18n-placeholder placeholder="Username"
2017-07-15 23:29:40 +08:00
[(ngModel)]="settings.mysql.username" name="username">
<input type="password" class="form-control" i18n-placeholder placeholder="Password"
2017-07-15 23:29:40 +08:00
[(ngModel)]="settings.mysql.password" name="password">
2017-07-08 18:43:42 +08:00
</ng-container>
<ng-container *ngIf="settings.type == DatabaseType.sqlite">
<p class="title" i18n>SQLie settings:</p>
2018-05-14 04:59:57 +08:00
<input type="text" class="form-control" placeholder="storage"
[(ngModel)]="settings.sqlite.storage" name="host" required>
</ng-container>
2017-07-08 18:43:42 +08:00
</form>
2018-05-14 04:59:57 +08:00
<button class="btn btn-success float-right"
2017-07-13 00:31:19 +08:00
[disabled]="!settingsForm.form.valid || !changed || inProgress"
(click)="save()" i18n>Save
2017-07-08 18:43:42 +08:00
</button>
2018-05-14 04:59:57 +08:00
<button class="btn btn-default float-right"
(click)="reset()" i18n>Reset
2017-07-08 18:43:42 +08:00
</button>
</div>
</div>