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
94dfd15e
Commit
94dfd15e
authored
Aug 02, 2018
by
Luke Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
re-port
parent
56744742
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
55 additions
and
14 deletions
+55
-14
app/assets/javascripts/pages/projects/settings/repository/show/index.js
...ascripts/pages/projects/settings/repository/show/index.js
+3
-3
app/assets/javascripts/pages/projects/settings/repository/show/mirror_repos.js
...s/pages/projects/settings/repository/show/mirror_repos.js
+18
-4
app/assets/stylesheets/framework/buttons.scss
app/assets/stylesheets/framework/buttons.scss
+4
-0
app/assets/stylesheets/framework/forms.scss
app/assets/stylesheets/framework/forms.scss
+1
-1
app/assets/stylesheets/pages/settings.scss
app/assets/stylesheets/pages/settings.scss
+8
-0
app/views/projects/mirrors/_instructions.html.haml
app/views/projects/mirrors/_instructions.html.haml
+0
-1
app/views/projects/mirrors/_mirror_repos.html.haml
app/views/projects/mirrors/_mirror_repos.html.haml
+6
-4
app/views/projects/mirrors/_mirror_repos_form.html.haml
app/views/projects/mirrors/_mirror_repos_form.html.haml
+14
-0
app/views/projects/mirrors/_show.html.haml
app/views/projects/mirrors/_show.html.haml
+1
-1
No files found.
app/assets/javascripts/pages/projects/settings/repository/show/index.js
View file @
94dfd15e
import
initForm
from
'
../form
'
;
import
PushPull
from
'
./push_pull
'
;
import
MirrorRepos
from
'
./mirror_repos
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
initForm
();
const
pushPull
Container
=
document
.
querySelector
(
'
.js-mirror-settings
'
);
if
(
pushPullContainer
)
new
PushPull
(
pushPull
Container
).
init
();
const
mirrorRepos
Container
=
document
.
querySelector
(
'
.js-mirror-settings
'
);
if
(
mirrorReposContainer
)
new
MirrorRepos
(
mirrorRepos
Container
).
init
();
});
app/assets/javascripts/pages/projects/settings/repository/show/
push_pull
.js
→
app/assets/javascripts/pages/projects/settings/repository/show/
mirror_repos
.js
View file @
94dfd15e
...
...
@@ -4,24 +4,32 @@ import { __ } from '~/locale';
import
Flash
from
'
~/flash
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
export
default
class
PushPull
{
export
default
class
MirrorRepos
{
constructor
(
container
)
{
this
.
$container
=
$
(
container
);
this
.
$form
=
$
(
'
.js-mirror-form
'
,
this
.
$container
);
this
.
$urlInput
=
$
(
'
.js-mirror-url
'
,
this
.
$form
);
this
.
$protectedBranchesInput
=
$
(
'
.js-mirror-protected
'
,
this
.
$form
);
this
.
mirrorEndpoint
=
this
.
$form
.
data
(
'
projectMirrorEndpoint
'
);
this
.
$table
=
$
(
'
.js-mirrors-table-body
'
,
this
.
$container
);
this
.
mirrorEndpoint
=
this
.
$form
.
data
(
'
projectMirrorEndpoint
'
);
}
init
()
{
this
.
registerUpdateListeners
();
this
.
initMirrorPush
();
this
.
$table
.
on
(
'
click
'
,
'
.js-delete-mirror
'
,
this
.
deleteMirror
.
bind
(
this
));
}
updateUrl
()
{
$
(
'
.js-mirror-url-hidden
'
,
this
.
$form
).
val
(
this
.
$urlInput
.
val
());
let
val
=
this
.
$urlInput
.
val
();
if
(
this
.
$password
)
{
const
password
=
this
.
$password
.
val
();
if
(
password
)
val
=
val
.
replace
(
'
@
'
,
`:
${
password
}
@`
);
}
$
(
'
.js-mirror-url-hidden
'
,
this
.
$form
).
val
(
val
);
}
updateProtectedBranches
()
{
...
...
@@ -32,10 +40,16 @@ export default class PushPull {
}
registerUpdateListeners
()
{
this
.
$urlInput
.
on
(
'
change
'
,
()
=>
this
.
updateUrl
());
this
.
debouncedUpdateUrl
=
_
.
debounce
(()
=>
this
.
updateUrl
(),
200
);
this
.
$urlInput
.
on
(
'
input
'
,
()
=>
this
.
debouncedUpdateUrl
());
this
.
$protectedBranchesInput
.
on
(
'
change
'
,
()
=>
this
.
updateProtectedBranches
());
}
initMirrorPush
()
{
this
.
$password
=
$
(
'
.js-password
'
,
this
.
$form
);
this
.
$password
.
on
(
'
input.updateUrl
'
,
()
=>
this
.
debouncedUpdateUrl
());
}
deleteMirror
(
event
,
existingPayload
)
{
const
$target
=
$
(
event
.
currentTarget
);
let
payload
=
existingPayload
;
...
...
app/assets/stylesheets/framework/buttons.scss
View file @
94dfd15e
...
...
@@ -242,6 +242,10 @@
&
:not
(
:last-child
)
{
margin-right
:
5px
;
}
&
.hide
{
display
:
none
;
}
}
}
...
...
app/assets/stylesheets/framework/forms.scss
View file @
94dfd15e
...
...
@@ -201,7 +201,7 @@ label {
}
.gl-show-field-errors
{
.form-control
{
.form-control
:not
(
textarea
)
{
height
:
34px
;
}
...
...
app/assets/stylesheets/pages/settings.scss
View file @
94dfd15e
...
...
@@ -311,3 +311,11 @@
.push-pull-table
{
margin-top
:
1em
;
}
.push-pull-table
{
margin-top
:
1em
;
.mirror-action-buttons
{
padding-right
:
0
;
}
}
app/views/projects/mirrors/_instructions.html.haml
View file @
94dfd15e
...
...
@@ -8,4 +8,3 @@
%li
=
_
(
'
This
user
will
be
the
author
of
all
events
in
the
activity
feed
that
are
the
result
of
an
update
,
like
new
branches
being
created
or
new
commits
being
pushed
to
existing
branches
.
'
)
app/views/projects/mirrors/_
push_pull
.html.haml
→
app/views/projects/mirrors/_
mirror_repos
.html.haml
View file @
94dfd15e
...
...
@@ -29,9 +29,11 @@
=
render
'projects/mirrors/instructions'
=
render_if_exists
'projects/mirrors/direction_dropdown'
,
options:
options
.form-group
=
label_tag
:mirror_direction
,
_
(
'Mirror direction'
),
class:
'label-light'
=
select_tag
:mirror_direction
,
options_for_select
(
options
),
class:
'form-control js-mirror-direction'
=
render
'projects/mirrors/
push_pull
_form'
,
can_push:
can_push
,
can_pull:
can_pull
,
f:
f
=
render
'projects/mirrors/
mirror_repos
_form'
,
can_push:
can_push
,
can_pull:
can_pull
,
f:
f
.form-check.append-bottom-10
=
check_box_tag
:only_protected_branches
,
'1'
,
false
,
class:
'js-mirror-protected form-check-input'
...
...
@@ -64,7 +66,7 @@
%td
-
if
mirror
.
last_error
.
present?
.badge.mirror-error-badge
{
data:
{
toggle:
'tooltip'
,
html:
'true'
},
title:
html_escape
(
mirror
.
last_error
.
try
(
:strip
))
}=
_
(
'Error'
)
%td
.btn-group.mirror-actions-group
{
role:
'group'
}
%td
.mirror-action-buttons
.btn-group.mirror-actions-group
.pull-right
{
role:
'group'
}
=
render
'shared/remote_mirror_update_button'
,
remote_mirror:
mirror
%button
.js-delete-mirror.btn.btn-danger
{
type:
'button'
,
data:
{
mirror_id:
mirror
.
id
,
toggle:
'tooltip'
,
container:
'body'
},
title:
_
(
'Remove'
)
}=
icon
(
'trash-o'
)
app/views/projects/mirrors/_
push_pull
_form.html.haml
→
app/views/projects/mirrors/_
mirror_repos
_form.html.haml
View file @
94dfd15e
...
...
@@ -3,4 +3,12 @@
=
f
.
fields_for
:remote_mirrors
,
@remote_mirror
do
|
rm_f
|
=
rm_f
.
hidden_field
:enabled
,
value:
'1'
=
rm_f
.
hidden_field
:url
,
class:
'js-mirror-url-hidden'
,
required:
true
,
pattern:
"(
#{
protocols
}
):
\/\/
.+"
=
rm_f
.
hidden_field
:only_protected_branches
,
class:
'js-mirror-protected-hidden'
\ No newline at end of file
=
rm_f
.
hidden_field
:only_protected_branches
,
class:
'js-mirror-protected-hidden'
.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:
'disabled'
}
.form-group
=
label_tag
:password
,
_
(
'Password'
),
class:
'label-bold'
=
text_field_tag
:password
,
''
,
class:
'form-control js-password'
app/views/projects/mirrors/_show.html.haml
View file @
94dfd15e
=
render
'projects/mirrors/push_pull'
\ No newline at end of file
=
render
'projects/mirrors/mirror_repos'
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