mirror of
				https://gitcode.com/gitea/gitea.git
				synced 2025-10-25 12:26:40 +08:00 
			
		
		
		
	feat: fill in ssh key title automatically. (#863)
This commit is contained in:
		| @ -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]); | ||||
|         } | ||||
|     }); | ||||
| }); | ||||
|  | ||||
| @ -53,11 +53,11 @@ | ||||
| 							{{.CsrfTokenHtml}} | ||||
| 							<div class="field {{if .Err_Title}}error{{end}}"> | ||||
| 								<label for="title">{{.i18n.Tr "settings.key_name"}}</label> | ||||
| 								<input id="title" name="title" value="{{.title}}" autofocus required> | ||||
| 								<input id="ssh-key-title" name="title" value="{{.title}}" autofocus required> | ||||
| 							</div> | ||||
| 							<div class="field {{if .Err_Content}}error{{end}}"> | ||||
| 								<label for="content">{{.i18n.Tr "settings.key_content"}}</label> | ||||
| 								<textarea id="content" name="content" required>{{.content}}</textarea> | ||||
| 								<textarea id="ssh-key-content" name="content" required>{{.content}}</textarea> | ||||
| 							</div> | ||||
| 							<button class="ui green button"> | ||||
| 								{{.i18n.Tr "settings.add_key"}} | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Bo-Yi Wu
					Bo-Yi Wu