Commit ff3de503 authored by Luke Bennett's avatar Luke Bennett

Change regenerate key to button

parent 652bc1c0
......@@ -24,6 +24,7 @@ export default class MirrorPull {
this.$wellPasswordAuth = this.$form.find('.js-well-password-auth');
this.$wellSSHAuth = this.$form.find('.js-well-ssh-auth');
this.$sshPublicKeyWrap = this.$form.find('.js-ssh-public-key-wrap');
this.$regeneratePublicSshKeyButton = this.$wellSSHAuth.find('.js-btn-regenerate-ssh-key');
}
init() {
......@@ -213,7 +214,7 @@ export default class MirrorPull {
toggleSSHAuthWellMessage(sshKeyPresent) {
this.$sshPublicKeyWrap.collapse(sshKeyPresent ? 'show' : 'hide');
this.$wellSSHAuth.find('.js-ssh-public-key-present').collapse(sshKeyPresent ? 'show' : 'hide');
this.$wellSSHAuth.find('.js-btn-regenerate-ssh-key').collapse(sshKeyPresent ? 'show' : 'hide');
this.$regeneratePublicSshKeyButton.collapse(sshKeyPresent ? 'show' : 'hide');
this.$wellSSHAuth.find('.js-ssh-public-key-pending').collapse(sshKeyPresent ? 'hide' : 'show');
}
......
......@@ -26,7 +26,8 @@
= import_data.ssh_public_key
= clipboard_button(text: import_data.ssh_public_key, title: _("Copy SSH public key to clipboard"), class: 'prepend-top-10 btn-copy-ssh-public-key')
= link_to _('Regenerate key'), project_mirror_path(@project, project: { import_data_attributes: regen_data }),
method: :patch,
data: { confirm: _('Are you sure you want to regenerate public key? You will have to update the public key on the remote server before mirroring will work again.') },
class: "btn btn-inverted btn-warning prepend-top-10 js-btn-regenerate-ssh-key #{ 'collapse' unless ssh_public_key_present }"
= button_tag _('Regenerate key'),
type: 'button',
data: { endpoint: project_mirror_path(@project, project: { import_data_attributes: regen_data }),
confirm: _('Are you sure you want to regenerate public key? You will have to update the public key on the remote server before mirroring will work again.') },
class: "btn btn-inverted btn-warning prepend-top-10 js-btn-regenerate-ssh-key#{ ' collapse' unless ssh_public_key_present }"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment