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
4d216110
Commit
4d216110
authored
Aug 03, 2018
by
Luke Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Review changes
parent
f7874323
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
15 deletions
+30
-15
app/assets/javascripts/pages/projects/settings/repository/show/mirror_repos.js
...s/pages/projects/settings/repository/show/mirror_repos.js
+18
-5
app/views/projects/mirrors/_mirror_repos_form.html.haml
app/views/projects/mirrors/_mirror_repos_form.html.haml
+2
-2
ee/app/assets/javascripts/mirrors/mirror_pull.js
ee/app/assets/javascripts/mirrors/mirror_pull.js
+6
-6
ee/app/assets/javascripts/pages/projects/settings/repository/show/ee_mirror_repos.js
...ages/projects/settings/repository/show/ee_mirror_repos.js
+2
-0
ee/app/views/projects/mirrors/_mirror_repos_form.html.haml
ee/app/views/projects/mirrors/_mirror_repos_form.html.haml
+2
-2
No files found.
app/assets/javascripts/pages/projects/settings/repository/show/mirror_repos.js
View file @
4d216110
...
...
@@ -15,10 +15,17 @@ export default class MirrorRepos {
}
init
()
{
this
.
registerUpdateListeners
();
this
.
initMirrorPush
();
this
.
registerUpdateListeners
();
}
this
.
$table
.
on
(
'
click
'
,
'
.js-delete-mirror
'
,
this
.
deleteMirror
.
bind
(
this
));
initMirrorPush
()
{
this
.
$passwordGroup
=
$
(
'
.js-password-group
'
,
this
.
$container
);
this
.
$password
=
$
(
'
.js-password
'
,
this
.
$passwordGroup
);
this
.
$authMethod
=
$
(
'
.js-auth-method
'
,
this
.
$form
);
this
.
$authMethod
.
on
(
'
change
'
,
()
=>
this
.
togglePassword
());
this
.
$password
.
on
(
'
input.updateUrl
'
,
()
=>
this
.
debouncedUpdateUrl
());
}
updateUrl
()
{
...
...
@@ -43,11 +50,17 @@ export default class MirrorRepos {
this
.
debouncedUpdateUrl
=
_
.
debounce
(()
=>
this
.
updateUrl
(),
200
);
this
.
$urlInput
.
on
(
'
input
'
,
()
=>
this
.
debouncedUpdateUrl
());
this
.
$protectedBranchesInput
.
on
(
'
change
'
,
()
=>
this
.
updateProtectedBranches
());
this
.
$table
.
on
(
'
click
'
,
'
.js-delete-mirror
'
,
this
.
deleteMirror
.
bind
(
this
));
}
initMirrorPush
()
{
this
.
$password
=
$
(
'
.js-password
'
,
this
.
$form
);
this
.
$password
.
on
(
'
input.updateUrl
'
,
()
=>
this
.
debouncedUpdateUrl
());
togglePassword
()
{
const
isPassword
=
this
.
$authMethod
.
val
()
===
'
password
'
;
if
(
!
isPassword
)
{
this
.
$password
.
val
(
''
);
this
.
updateUrl
();
}
this
.
$passwordGroup
.
collapse
(
isPassword
?
'
show
'
:
'
hide
'
);
}
deleteMirror
(
event
,
existingPayload
)
{
...
...
app/views/projects/mirrors/_mirror_repos_form.html.haml
View file @
4d216110
...
...
@@ -11,8 +11,8 @@
.form-group
=
label_tag
:auth_method
,
_
(
'Authentication method'
),
class:
'label-bold'
=
select_tag
:auth_method
,
options_for_select
([[
_
(
'Password'
),
'password'
]],
'password
'
),
{
class:
"form-control js-auth-method"
,
disabled:
true
}
=
select_tag
:auth_method
,
options_for_select
([[
[
_
(
'None'
),
'none'
],
[
_
(
'Password'
),
'password'
]],
'none
'
),
{
class:
"form-control js-auth-method"
,
disabled:
true
}
.form-group
.form-group
.js-password-group.collapse
=
label_tag
:password
,
_
(
'Password'
),
class:
'label-bold'
=
text_field_tag
:password
,
''
,
class:
'form-control js-password'
ee/app/assets/javascripts/mirrors/mirror_pull.js
View file @
4d216110
...
...
@@ -29,9 +29,9 @@ export default class MirrorPull {
}
init
()
{
this
.
toggleAuthWell
(
this
.
$dropdownAuthType
.
val
()
);
this
.
handleRepositoryUrlInput
(
true
);
this
.
$repositoryUrl
.
on
(
'
keyup
'
,
e
=>
this
.
handleRepositoryUrlInput
(
e
));
this
.
$repositoryUrl
.
on
(
'
keyup
'
,
()
=>
this
.
handleRepositoryUrlInput
(
));
this
.
$form
.
find
(
'
.js-known-hosts
'
).
on
(
'
keyup
'
,
e
=>
this
.
handleSSHKnownHostsInput
(
e
));
this
.
$dropdownAuthType
.
on
(
'
change
'
,
e
=>
this
.
handleAuthTypeChange
(
e
));
this
.
$btnDetectHostKeys
.
on
(
'
click
'
,
e
=>
this
.
handleDetectHostKeys
(
e
));
...
...
@@ -44,19 +44,19 @@ export default class MirrorPull {
/**
* Method to monitor Git Repository URL input
*/
handleRepositoryUrlInput
()
{
handleRepositoryUrlInput
(
forceMatch
)
{
const
protocol
=
this
.
$repositoryUrl
.
val
().
split
(
'
://
'
)[
0
];
const
protRegEx
=
/http|git/
;
// Validate URL and verify if it consists only supported protocols
if
(
this
.
$form
.
get
(
0
).
checkValidity
())
{
if
(
forceMatch
||
this
.
$form
.
get
(
0
).
checkValidity
())
{
// Hide/Show SSH Host keys section only for SSH URLs
this
.
$sectionSSHHostKeys
.
collapse
(
protocol
===
'
ssh
'
?
'
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
=
protRegEx
.
test
(
protocol
);
const
matchesProtocol
=
forceMatch
||
protRegEx
.
test
(
protocol
);
this
.
$dropdownAuthType
.
attr
(
'
disabled
'
,
matchesProtocol
);
if
(
matchesProtocol
)
{
...
...
@@ -214,7 +214,7 @@ export default class MirrorPull {
*/
toggleAuthWell
(
authType
)
{
this
.
$wellPasswordAuth
.
collapse
(
authType
===
AUTH_METHOD
.
PASSWORD
?
'
show
'
:
'
hide
'
);
this
.
$wellSSHAuth
.
collapse
(
authType
===
AUTH_METHOD
.
PASSWORD
?
'
hide
'
:
'
show
'
);
this
.
$wellSSHAuth
.
collapse
(
authType
===
AUTH_METHOD
.
SSH
?
'
show
'
:
'
hide
'
);
}
/**
...
...
ee/app/assets/javascripts/pages/projects/settings/repository/show/ee_mirror_repos.js
View file @
4d216110
...
...
@@ -60,7 +60,9 @@ export default class EEMirrorRepos extends MirrorRepos {
updateForm
()
{
const
direction
=
this
.
$mirrorDirectionSelect
.
val
();
this
.
$insertionPoint
.
collapse
(
'
hide
'
);
this
.
$insertionPoint
.
html
(
this
.
directionFormMap
[
direction
]);
this
.
$insertionPoint
.
collapse
(
'
show
'
);
this
.
updateUrl
();
this
.
updateProtectedBranches
();
...
...
ee/app/views/projects/mirrors/_mirror_repos_form.html.haml
View file @
4d216110
...
...
@@ -22,9 +22,9 @@
.form-group
=
label_tag
:auth_method
,
_
(
'Authentication method'
),
class:
'label-bold'
=
select_tag
:auth_method
,
options_for_select
([[
_
(
'
Password'
),
'password'
]],
'password'
),
{
class:
"form-control js-auth-method"
,
disabled:
true
}
=
select_tag
:auth_method
,
options_for_select
([[
_
(
'
None'
),
'none'
],
[
_
(
'Password'
),
'password'
]],
'none'
),
{
class:
"form-control js-auth-method"
}
.form-group
.form-group
.js-password-group.collapse
=
label_tag
:password
,
_
(
'Password'
),
class:
'label-bold'
=
text_field_tag
:password
,
''
,
type:
'password'
,
class:
'form-control js-password'
...
...
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