2021-01-03 14:25:43 +05:30
|
|
|
import initConfirmModal from '~/confirm_modal';
|
2018-11-08 19:23:39 +05:30
|
|
|
import AddSshKeyValidation from '~/profile/add_ssh_key_validation';
|
2022-10-11 01:57:18 +05:30
|
|
|
import { initExpiresAtField } from '~/access_tokens/index';
|
2018-11-08 19:23:39 +05:30
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
initConfirmModal();
|
2021-01-03 14:25:43 +05:30
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
function initSshKeyValidation() {
|
2018-11-08 19:23:39 +05:30
|
|
|
const input = document.querySelector('.js-add-ssh-key-validation-input');
|
2019-07-31 22:56:46 +05:30
|
|
|
if (!input) return;
|
|
|
|
|
2022-03-02 08:16:31 +05:30
|
|
|
const supportedAlgorithms = JSON.parse(input.dataset.supportedAlgorithms);
|
2018-11-08 19:23:39 +05:30
|
|
|
const warning = document.querySelector('.js-add-ssh-key-validation-warning');
|
|
|
|
const originalSubmit = input.form.querySelector('.js-add-ssh-key-validation-original-submit');
|
|
|
|
const confirmSubmit = warning.querySelector('.js-add-ssh-key-validation-confirm-submit');
|
|
|
|
|
|
|
|
const addSshKeyValidation = new AddSshKeyValidation(
|
2022-03-02 08:16:31 +05:30
|
|
|
supportedAlgorithms,
|
2018-11-08 19:23:39 +05:30
|
|
|
input,
|
|
|
|
warning,
|
|
|
|
originalSubmit,
|
|
|
|
confirmSubmit,
|
|
|
|
);
|
|
|
|
addSshKeyValidation.register();
|
2021-10-27 15:23:28 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
initSshKeyValidation();
|
2022-10-11 01:57:18 +05:30
|
|
|
|
|
|
|
initExpiresAtField();
|