summaryrefslogtreecommitdiffstats
path: root/web_src/js/features/sshkey-helper.js
blob: bb3c8accf44d8a1a30e86176bb1070bb52f942b6 (plain)
1
2
3
4
5
6
7
8
9
10
export function initSshKeyFormParser() {
// Parse SSH Key
  $('#ssh-key-content').on('change paste keyup', function () {
    const arrays = $(this).val().split(' ');
    const $title = $('#ssh-key-title');
    if ($title.val() === '' && arrays.length === 3 && arrays[2] !== '') {
      $title.val(arrays[2]);
    }
  });
}