Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
4f77634a
Commit
4f77634a
authored
Aug 04, 2018
by
Luke Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add destroy and improve init for mirror_pull
parent
3d2d1be2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
6 deletions
+20
-6
ee/app/assets/javascripts/mirrors/mirror_pull.js
ee/app/assets/javascripts/mirrors/mirror_pull.js
+17
-2
ee/app/assets/javascripts/pages/projects/settings/repository/show/ee_mirror_repos.js
...ages/projects/settings/repository/show/ee_mirror_repos.js
+3
-4
No files found.
ee/app/assets/javascripts/mirrors/mirror_pull.js
View file @
4f77634a
...
...
@@ -50,18 +50,22 @@ export default class MirrorPull {
// Validate URL and verify if it consists only supported protocols
if
(
forceMatch
||
this
.
$form
.
get
(
0
).
checkValidity
())
{
const
isSsh
=
protocol
===
'
ssh
'
;
// Hide/Show SSH Host keys section only for SSH URLs
this
.
$sectionSSHHostKeys
.
collapse
(
protocol
===
'
ssh
'
?
'
show
'
:
'
hide
'
);
this
.
$sectionSSHHostKeys
.
collapse
(
isSsh
?
'
show
'
:
'
hide
'
);
this
.
$btnDetectHostKeys
.
enable
();
// Verify if URL is http, https or git and hide/show Auth type dropdown
// as we don't support auth type SSH for non-SSH URLs
const
matchesProtocol
=
forceMatch
||
protRegEx
.
test
(
protocol
);
const
matchesProtocol
=
protRegEx
.
test
(
protocol
);
this
.
$dropdownAuthType
.
attr
(
'
disabled
'
,
matchesProtocol
);
if
(
matchesProtocol
)
{
this
.
$dropdownAuthType
.
val
(
AUTH_METHOD
.
PASSWORD
);
this
.
toggleAuthWell
(
AUTH_METHOD
.
PASSWORD
);
}
else
if
(
forceMatch
&&
isSsh
)
{
this
.
$dropdownAuthType
.
val
(
AUTH_METHOD
.
SSH
);
this
.
toggleAuthWell
(
AUTH_METHOD
.
SSH
);
}
}
}
...
...
@@ -261,4 +265,15 @@ export default class MirrorPull {
Flash
(
_
(
'
Unable to regenerate public ssh key.
'
));
});
}
destroy
()
{
this
.
$repositoryUrl
.
off
(
'
keyup
'
);
this
.
$form
.
find
(
'
.js-known-hosts
'
).
off
(
'
keyup
'
);
this
.
$dropdownAuthType
.
off
(
'
change
'
);
this
.
$btnDetectHostKeys
.
off
(
'
click
'
);
this
.
$btnSSHHostsShowAdvanced
.
off
(
'
click
'
);
this
.
$regeneratePublicSshKeyButton
.
off
(
'
click
'
);
$
(
'
.js-confirm
'
,
this
.
$regeneratePublicSshKeyModal
).
off
(
'
click
'
);
$
(
'
.js-cancel
'
,
this
.
$regeneratePublicSshKeyModal
).
off
(
'
click
'
);
}
}
ee/app/assets/javascripts/pages/projects/settings/repository/show/ee_mirror_repos.js
View file @
4f77634a
...
...
@@ -68,6 +68,7 @@ export default class EEMirrorRepos extends MirrorRepos {
this
.
updateProtectedBranches
();
if
(
direction
===
'
pull
'
)
return
this
.
initMirrorPull
();
this
.
mirrorPull
.
destroy
();
return
this
.
initMirrorPush
();
}
...
...
@@ -75,10 +76,8 @@ export default class EEMirrorRepos extends MirrorRepos {
this
.
$password
.
off
(
'
input.updateUrl
'
);
this
.
$password
=
undefined
;
const
mirrorPull
=
new
MirrorPull
(
'
.js-mirror-form
'
);
if
(
this
.
$urlInput
.
val
()
!==
''
)
mirrorPull
.
handleRepositoryUrlInput
();
mirrorPull
.
init
();
this
.
mirrorPull
=
new
MirrorPull
(
'
.js-mirror-form
'
);
this
.
mirrorPull
.
init
();
this
.
initSelect2
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment