2021-10-17 01:28:04 +08:00
|
|
|
export function initSshKeyFormParser() {
|
2024-02-16 15:34:29 +02:00
|
|
|
// Parse SSH Key
|
2025-01-15 21:26:17 +01:00
|
|
|
document.querySelector<HTMLTextAreaElement>('#ssh-key-content')?.addEventListener('input', function () {
|
2024-02-16 15:34:29 +02:00
|
|
|
const arrays = this.value.split(' ');
|
2025-12-03 03:13:16 +01:00
|
|
|
const title = document.querySelector<HTMLInputElement>('#ssh-key-title')!;
|
2024-02-16 15:34:29 +02:00
|
|
|
if (!title.value && arrays.length === 3 && arrays[2] !== '') {
|
|
|
|
|
title.value = arrays[2];
|
2021-10-17 01:28:04 +08:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|