2017-07-08 18:43:42 +08:00
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
|
|
|
<h3 class="panel-title">Database settings</h3>
|
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<div [hidden]="!error" class="alert alert-danger" role="alert"><strong>Error: </strong>{{error}}</div>
|
|
|
|
<form #settingsForm="ngForm">
|
|
|
|
<p class="title">Type:</p>
|
2017-07-15 20:27:12 +08:00
|
|
|
<select class="form-control" [(ngModel)]="_settingsService.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-15 20:27:12 +08:00
|
|
|
<ng-container *ngIf="_settingsService.settings.type == DatabaseType.mysql">
|
2017-07-08 18:43:42 +08:00
|
|
|
<p class="title">MySQL settings:</p>
|
|
|
|
<input type="text" class="form-control" placeholder="Host" autofocus
|
2017-07-15 20:27:12 +08:00
|
|
|
[(ngModel)]="_settingsService.settings.mysql.host" name="host" required>
|
2017-07-08 18:43:42 +08:00
|
|
|
<input type="text" class="form-control" placeholder="Database" autofocus
|
2017-07-15 20:27:12 +08:00
|
|
|
[(ngModel)]="_settingsService.settings.mysql.database" name="database" required>
|
2017-07-08 18:43:42 +08:00
|
|
|
<input type="text" class="form-control" placeholder="Username"
|
2017-07-15 20:27:12 +08:00
|
|
|
[(ngModel)]="_settingsService.settings.mysql.username" name="username">
|
2017-07-08 18:43:42 +08:00
|
|
|
<input type="password" class="form-control" placeholder="Password"
|
2017-07-15 20:27:12 +08:00
|
|
|
[(ngModel)]="_settingsService.settings.mysql.password" name="password">
|
2017-07-08 18:43:42 +08:00
|
|
|
</ng-container>
|
|
|
|
|
|
|
|
</form>
|
|
|
|
<button class="btn btn-success pull-right"
|
2017-07-13 00:31:19 +08:00
|
|
|
[disabled]="!settingsForm.form.valid || !changed || inProgress"
|
2017-07-08 18:43:42 +08:00
|
|
|
(click)="save()">Save
|
|
|
|
</button>
|
|
|
|
<button class="btn btn-default pull-right"
|
|
|
|
(click)="reset()">Reset
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|