diff --git a/public/js/index.js b/public/js/index.js index 487f812d1d..e700da29f8 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -1486,4 +1486,13 @@ $(function () { $('.list-search-style').html('.search-list li:not([data-title*="' + value + '"]) {display: none;}'); } }); + + // Parse SSH Key + $("#ssh-key-content").on('change paste keyup',function(){ + var value = $(this).val(); + var arrays = value.split(" "); + if (arrays.length === 3 && arrays[2] !== "") { + $("#ssh-key-title").val(arrays[2]); + } + }); }); diff --git a/templates/user/settings/sshkeys.tmpl b/templates/user/settings/sshkeys.tmpl index 33426fdc56..72344df3ed 100644 --- a/templates/user/settings/sshkeys.tmpl +++ b/templates/user/settings/sshkeys.tmpl @@ -53,11 +53,11 @@ {{.CsrfTokenHtml}}