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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
4457d98e
Commit
4457d98e
authored
Aug 03, 2018
by
Luke Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Review changes
parent
afca4f6a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
7 deletions
+20
-7
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
No files found.
app/assets/javascripts/pages/projects/settings/repository/show/mirror_repos.js
View file @
4457d98e
...
@@ -15,10 +15,17 @@ export default class MirrorRepos {
...
@@ -15,10 +15,17 @@ export default class MirrorRepos {
}
}
init
()
{
init
()
{
this
.
registerUpdateListeners
();
this
.
initMirrorPush
();
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
()
{
updateUrl
()
{
...
@@ -43,11 +50,17 @@ export default class MirrorRepos {
...
@@ -43,11 +50,17 @@ export default class MirrorRepos {
this
.
debouncedUpdateUrl
=
_
.
debounce
(()
=>
this
.
updateUrl
(),
200
);
this
.
debouncedUpdateUrl
=
_
.
debounce
(()
=>
this
.
updateUrl
(),
200
);
this
.
$urlInput
.
on
(
'
input
'
,
()
=>
this
.
debouncedUpdateUrl
());
this
.
$urlInput
.
on
(
'
input
'
,
()
=>
this
.
debouncedUpdateUrl
());
this
.
$protectedBranchesInput
.
on
(
'
change
'
,
()
=>
this
.
updateProtectedBranches
());
this
.
$protectedBranchesInput
.
on
(
'
change
'
,
()
=>
this
.
updateProtectedBranches
());
this
.
$table
.
on
(
'
click
'
,
'
.js-delete-mirror
'
,
this
.
deleteMirror
.
bind
(
this
));
}
}
initMirrorPush
()
{
togglePassword
()
{
this
.
$password
=
$
(
'
.js-password
'
,
this
.
$form
);
const
isPassword
=
this
.
$authMethod
.
val
()
===
'
password
'
;
this
.
$password
.
on
(
'
input.updateUrl
'
,
()
=>
this
.
debouncedUpdateUrl
());
if
(
!
isPassword
)
{
this
.
$password
.
val
(
''
);
this
.
updateUrl
();
}
this
.
$passwordGroup
.
collapse
(
isPassword
?
'
show
'
:
'
hide
'
);
}
}
deleteMirror
(
event
,
existingPayload
)
{
deleteMirror
(
event
,
existingPayload
)
{
...
...
app/views/projects/mirrors/_mirror_repos_form.html.haml
View file @
4457d98e
...
@@ -11,8 +11,8 @@
...
@@ -11,8 +11,8 @@
.form-group
.form-group
=
label_tag
:auth_method
,
_
(
'Authentication method'
),
class:
'label-bold'
=
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'
=
label_tag
:password
,
_
(
'Password'
),
class:
'label-bold'
=
text_field_tag
:password
,
''
,
class:
'form-control js-password'
=
text_field_tag
: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