2017-07-08 18:43:42 +08:00
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
2017-12-25 07:42:25 +08:00
|
|
|
<h3 class="panel-title" i18n>Database settings</h3>
|
2017-07-08 18:43:42 +08:00
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<div [hidden]="!error" class="alert alert-danger" role="alert"><strong>Error: </strong>{{error}}</div>
|
|
|
|
<form #settingsForm="ngForm">
|
2017-12-25 07:42:25 +08:00
|
|
|
<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>
|
2017-07-21 05:37:10 +08:00
|
|
|
<span *ngIf="settings.type == DatabaseType.mysql"
|
2017-12-25 07:42:25 +08:00
|
|
|
class="help-block" i18n>Install manually mysql node module to use mysql (npm install mysql)</span>
|
2017-07-21 05:37:10 +08:00
|
|
|
|
2017-07-15 23:29:40 +08:00
|
|
|
<ng-container *ngIf="settings.type == DatabaseType.mysql">
|
2017-12-25 07:42:25 +08:00
|
|
|
<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>
|
2017-12-25 07:42:25 +08:00
|
|
|
<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>
|
2017-12-25 07:42:25 +08:00
|
|
|
<input type="text" class="form-control" i18n-placeholder placeholder="Username"
|
2017-07-15 23:29:40 +08:00
|
|
|
[(ngModel)]="settings.mysql.username" name="username">
|
2017-12-25 07:42:25 +08:00
|
|
|
<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>
|
2017-07-21 05:37:10 +08:00
|
|
|
<ng-container *ngIf="settings.type == DatabaseType.sqlite">
|
2017-12-25 07:42:25 +08:00
|
|
|
<p class="title" i18n>SQLie settings:</p>
|
2017-07-21 05:37:10 +08:00
|
|
|
<input type="text" class="form-control" placeholder="storage" autofocus
|
|
|
|
[(ngModel)]="settings.sqlite.storage" name="host" required>
|
|
|
|
</ng-container>
|
2017-07-08 18:43:42 +08:00
|
|
|
|
|
|
|
</form>
|
|
|
|
<button class="btn btn-success pull-right"
|
2017-07-13 00:31:19 +08:00
|
|
|
[disabled]="!settingsForm.form.valid || !changed || inProgress"
|
2017-12-25 07:42:25 +08:00
|
|
|
(click)="save()" i18n>Save
|
2017-07-08 18:43:42 +08:00
|
|
|
</button>
|
|
|
|
<button class="btn btn-default pull-right"
|
2017-12-25 07:42:25 +08:00
|
|
|
(click)="reset()" i18n>Reset
|
2017-07-08 18:43:42 +08:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|