1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00

Merge pull request #133 from bpatrik/develop

adding mysql port to configs
This commit is contained in:
Patrik J. Braun 2020-01-29 16:15:58 +01:00 committed by GitHub
commit 697d61485b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 9 deletions

View File

@ -174,7 +174,7 @@ export class SQLConnection {
driver = {
type: 'mysql',
host: config.mysql.host,
port: 3306,
port: config.mysql.port,
username: config.mysql.username,
password: config.mysql.password,
database: config.mysql.database,

View File

@ -38,6 +38,8 @@ export module ServerConfig {
export class MySQLConfig {
@ConfigProperty({envAlias: 'MYSQL_HOST'})
host: string = '';
@ConfigProperty({envAlias: 'MYSQL_PORT'})
port: number = 3306;
@ConfigProperty({envAlias: 'MYSQL_DATABASE'})
database: string = '';
@ConfigProperty({envAlias: 'MYSQL_USERNAME'})

View File

@ -36,31 +36,39 @@
<ng-container *ngIf="settings.type == DatabaseType.mysql">
<div class="form-group row">
<label class="col-md-2 control-label" for="host" i18n>Host</label>
<label class="col-md-2 control-label" for="mysql_host" i18n>Host</label>
<div class="col-md-10">
<input type="text" class="form-control" placeholder="localhost"
[(ngModel)]="settings.mysql.host" id="host" name="host" required>
[(ngModel)]="settings.mysql.host" id="mysql_host" name="mysql_host" required>
</div>
</div>
<div class="form-group row">
<label class="col-md-2 control-label" for="database" i18n>Database</label>
<label class="col-md-2 control-label" for="mysql_port" i18n>Port</label>
<div class="col-md-10">
<input type="number" class="form-control" placeholder="3306" min="0" max="65535"
[(ngModel)]="settings.mysql.port" id="mysql_port" name="mysql_port" required>
</div>
</div>
<div class="form-group row">
<label class="col-md-2 control-label" for="mysql_database" i18n>Database</label>
<div class="col-md-10">
<input type="text" class="form-control" placeholder="pigallery2"
[(ngModel)]="settings.mysql.database" id="database" name="database" required>
[(ngModel)]="settings.mysql.database" id="mysql_database" name="mysql_database" required>
</div>
</div>
<div class="form-group row">
<label class="col-md-2 control-label" for="username" i18n>Username</label>
<label class="col-md-2 control-label" for="mysql_username" i18n>Username</label>
<div class="col-md-10">
<input type="text" class="form-control" placeholder="username"
[(ngModel)]="settings.mysql.username" id="username" name="username" required>
[(ngModel)]="settings.mysql.username" id="mysql_username" name="mysql_username" required>
</div>
</div>
<div class="form-group row">
<label class="col-md-2 control-label" for="password" i18n>Password</label>
<label class="col-md-2 control-label" for="mysql_password" i18n>Password</label>
<div class="col-md-10">
<input type="password" class="form-control" placeholder="password"
[(ngModel)]="settings.mysql.password" id="password" name="password" required>
[(ngModel)]="settings.mysql.password" id="mysql_password" name="mysql_password" required>
</div>
</div>
</ng-container>