diff options
author | Unknwon <u@gogs.io> | 2015-09-10 17:11:41 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-09-10 17:11:41 -0400 |
commit | 06174482826e81fb7c4675efff092e2986c4dac0 (patch) | |
tree | dda3e0393111ab21789784316e2463bd920430e9 /public | |
parent | fa728d8dff2ddb8039efc2767f4fefb2d2f62004 (diff) | |
download | gitea-06174482826e81fb7c4675efff092e2986c4dac0.tar.gz gitea-06174482826e81fb7c4675efff092e2986c4dac0.zip |
finish new add auth UI
Diffstat (limited to 'public')
-rw-r--r-- | public/js/gogs.js | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/public/js/gogs.js b/public/js/gogs.js index 39826f9097..e9e9ba5b95 100644 --- a/public/js/gogs.js +++ b/public/js/gogs.js @@ -147,7 +147,7 @@ function initInstall() { // Database type change detection. $("#db_type").change(function () { - var db_type = $('#db_type').val(); + var db_type = $(this).val(); if (db_type === "SQLite3" || db_type === "TiDB") { $('#sql_settings').hide(); $('#pgsql_settings').hide(); @@ -442,6 +442,44 @@ function initWebhook() { }); } + +function initAdmin() { + if ($('.admin').length == 0) { + return; + } + + // New authentication + if ($('.admin.new.authentication').length > 0) { + $('#auth_type').change(function () { + var auth_type = $(this).val(); + switch (auth_type) { + case '2': // LDAP + $('.dldap').hide(); + $('.smtp').hide(); + $('.pam').hide(); + $('.ldap').show(); + break; + case '3': // SMTP + $('.ldap').hide(); + $('.pam').hide(); + $('.smtp').show(); + break; + case '4': // PAM + $('.ldap').hide(); + $('.smtp').hide(); + $('.pam').show(); + break; + case '5': // LDAP + $('.ldap').hide(); + $('.smtp').hide(); + $('.pam').hide(); + $('.dldap').show(); + break; + } + }); + } +} + $(document).ready(function () { csrf = $('meta[name=_csrf]').attr("content"); suburl = $('meta[name=_suburl]').attr("content"); @@ -563,4 +601,5 @@ $(document).ready(function () { initOrganization(); initUser(); initWebhook(); + initAdmin(); });
\ No newline at end of file |