Update setup utility with mysql db flavor

master
Ionut Filip 6 years ago
parent 2b0a2d561b
commit 37a07e3297

@ -165,7 +165,10 @@ REJECT_UNLISTED_RECIPIENT={{ reject_unlisted_recipient }}
# Database settings
###################################
DB_FLAVOR={{ db_flavor }}
{% if postgresql == 'external' %}
{% if db_flavor == 'postgresql' and postgresql == 'internal' %}
DB_PW={{ secret(16) }}
{% endif %}
{% if postgresql == 'external' or db_flavor == 'mysql' %}
DB_USER={{ db_user }}
DB_PW={{ db_pw }}
DB_URL={{ db_url }}

@ -36,8 +36,10 @@ $(document).ready(function() {
$(document).ready(function() {
if ($("#database").val() == 'sqlite') {
$("#postgres_db").hide();
} else {
} else if ($("#database").val() == 'postgresql') {
$("#postgres_db").show();
} else if ($("#database").val() == 'mysql') {
$("#external_db").show();
}
if ($('#external_psql').prop('checked')) {
$("#external_db").show();
@ -45,8 +47,18 @@ $(document).ready(function() {
$("#database").click(function() {
if (this.value == 'sqlite') {
$("#postgres_db").hide();
} else {
$("#external_db").hide();
} else if (this.value == 'postgresql') {
$("#postgres_db").show();
$("#external_db").hide();
$("#external_db").prop('checked', false);
} else if (this.value == 'mysql') {
$("#postgres_db").hide();
$("#external_db").show();
$("#db_user").prop('required',true);
$("#db_pw").prop('required',true);
$("#db_url").prop('required',true);
$("#db_name").prop('required',true);
}
});
$("#external_psql").change(function() {

@ -4,7 +4,7 @@
<label>Which database back end would you like to use?</label>
<br/>
<select class="btn btn-primary dropdown-toggle" name="db_flavor" id="database">
{% for dbflavor in ["sqlite", "postgresql"] %}
{% for dbflavor in ["sqlite", "postgresql", "mysql"] %}
<option value="{{ dbflavor }}" >{{ dbflavor }}</option>
{% endfor %}
</select>
@ -23,7 +23,9 @@
</label>
</div>
<br/>
</div>
<div class="form-group" id="external_db" style="display: none">
<p>Set external database parameters</p>
<label>DB User</label>
<input class="form-control" type="text" name="db_user" placeholder="Username" id="db_user">
<label>Db Password</label>
@ -34,6 +36,5 @@
<input class="form-control" type="text" name="db_name" placeholder="Database Name" id="db_name">
</div>
</div>
</div>
{% endcall %}
Loading…
Cancel
Save