aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js/features/sshkey-helper.ts
blob: 9234e3ec4462bc5c0918fff659f0f133a7cf59af (plain)
1
2
3
4
5
6
7
8
9
10
export function initSshKeyFormParser() {
  // Parse SSH Key
  document.querySelector('#ssh-key-content')?.addEventListener('input', function () {
    const arrays = this.value.split(' ');
    const title = document.querySelector<HTMLInputElement>('#ssh-key-title');
    if (!title.value && arrays.length === 3 && arrays[2] !== '') {
      title.value = arrays[2];
    }
  });
}