summaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
authorbtrepp <beautrepp@gmail.com>2016-12-24 09:37:35 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2016-12-24 09:37:35 +0800
commit25b5ffb6af390eac8d4a76c134379fd1ae88a423 (patch)
treee085f3f3af71ad81559ba8efeba05caceaa69fd2 /public
parentf2ff0ee846e8ef42e2f7ba960e86bd8e397f007f (diff)
downloadgitea-25b5ffb6af390eac8d4a76c134379fd1ae88a423.tar.gz
gitea-25b5ffb6af390eac8d4a76c134379fd1ae88a423.zip
Enables mssql support (#383)
* Enables mssql support Port of dlobs work in gogs. Enables options in index.js Enables MSSQL as a database option in go. Sets ID to 0 on initial migration. Required for MSSQL insert statements. Signed-off-by: Beau Trepp <beautrepp@gmail.com> * Vendors in denisenkom/go-mssqldb Includes golang.org/x/crypto/md4 as this is required by go-msssqldb Signed-off-by: Beau Trepp <beautrepp@gmail.com>
Diffstat (limited to 'public')
-rw-r--r--public/js/index.js24
1 files changed, 12 insertions, 12 deletions
diff --git a/public/js/index.js b/public/js/index.js
index 2cc7790983..214308ef43 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -228,22 +228,22 @@ function initInstall() {
return;
}
- var mysqlDefault = '127.0.0.1:3306';
- var postgresDefault = '127.0.0.1:5432';
+ var dbDefaults = {
+ "MySQL": "127.0.0.1:3306",
+ "PostgreSQL": "127.0.0.1:5432",
+ "MSSQL": "127.0.0.1:1433"
+ };
$('#sqlite_settings').hide();
$('#sql_settings').show();
- if (dbType === "PostgreSQL") {
- $('#pgsql_settings').show();
- if ($('#db_host').val() == mysqlDefault) {
- $('#db_host').val(postgresDefault);
- }
- } else {
- $('#pgsql_settings').hide();
- if ($('#db_host').val() == postgresDefault) {
- $('#db_host').val(mysqlDefault);
+
+ $('#pgsql_settings').toggle(dbType === "PostgreSQL");
+ $.each(dbDefaults, function(type, defaultHost) {
+ if ($('#db_host').val() == defaultHost) {
+ $('#db_host').val(dbDefaults[dbType]);
+ return false;
}
- }
+ });
});
// TODO: better handling of exclusive relations.