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