-
-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust setup to support SQLite and PostgreSQL (#831)
- Loading branch information
Showing
14 changed files
with
146 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
export default class DatabaseSetup { | ||
|
||
constructor ($el) { | ||
this.$connection = $el.querySelector('#connection'); | ||
this.$dbPath = $el.querySelector('.db-path'); | ||
this.$dbHost = $el.querySelector('.db-host'); | ||
this.$dbPort = $el.querySelector('.db-port'); | ||
this.$dbName = $el.querySelector('.db-name'); | ||
this.$dbUser = $el.querySelector('.db-user'); | ||
this.$dbPass = $el.querySelector('.db-password'); | ||
this.$submit = $el.querySelector('.db-submit'); | ||
|
||
this.$connection.addEventListener('change', this.handleConnectionChange.bind(this)); | ||
this.handleConnectionChange(); | ||
|
||
$el.addEventListener('submit', () => { | ||
this.$submit.toggleAttribute('disabled'); | ||
}); | ||
} | ||
|
||
handleConnectionChange () { | ||
const connection = this.$connection.options[this.$connection.selectedIndex].value; | ||
this.$dbPath.classList.toggle('d-none', connection !== 'sqlite'); | ||
this.$dbHost.classList.toggle('d-none', connection === 'sqlite'); | ||
this.$dbPort.classList.toggle('d-none', connection === 'sqlite'); | ||
this.$dbName.classList.toggle('d-none', connection === 'sqlite'); | ||
this.$dbUser.classList.toggle('d-none', connection === 'sqlite'); | ||
this.$dbPass.classList.toggle('d-none', connection === 'sqlite'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<svg {{ $attributes->merge(['class' => 'icon', 'viewBox' =>'0 0 512 512', 'xmlns' => 'http://www.w3.org/2000/svg', 'aria-hidden' => 'true', 'focusable' => 'false']) }}><path d="M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"/></svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters