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
a761d201
Commit
a761d201
authored
Feb 13, 2018
by
Clement Ho
Committed by
Jacob Schatz
Feb 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace $.ajax with axios in mirror pull
parent
4ca5b238
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
11 deletions
+15
-11
app/assets/javascripts/mirrors/mirror_pull.js
app/assets/javascripts/mirrors/mirror_pull.js
+15
-11
No files found.
app/assets/javascripts/mirrors/mirror_pull.js
View file @
a761d201
import
_
from
'
underscore
'
;
import
{
__
}
from
'
~/locale
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
Flash
from
'
../flash
'
;
import
AUTH_METHOD
from
'
./constants
'
;
import
{
backOff
}
from
'
../lib/utils/common_utils
'
;
...
...
@@ -145,22 +147,24 @@ export default class MirrorPull {
if
(
selectedAuthType
===
AUTH_METHOD
.
SSH
&&
!
$sshPublicKey
.
text
().
trim
())
{
this
.
$dropdownAuthType
.
disable
();
$
.
ajax
({
type
:
'
PUT
'
,
url
:
projectMirrorAuthTypeEndpoint
,
contentType
:
'
application/json; charset=utf-8
'
,
data
:
JSON
.
stringify
(
authTypeData
)
,
axios
.
put
(
projectMirrorAuthTypeEndpoint
,
JSON
.
stringify
(
authTypeData
),
{
headers
:
{
'
Content-Type
'
:
'
application/json; charset=utf-8
'
,
}
,
})
.
done
((
res
)
=>
{
.
then
(({
data
}
)
=>
{
// Show SSH public key container and fill in public key
this
.
toggleAuthWell
(
selectedAuthType
);
this
.
toggleSSHAuthWellMessage
(
true
);
this
.
setSSHPublicKey
(
res
.
import_data_attributes
.
ssh_public_key
);
})
.
fail
(()
=>
{
Flash
(
'
Something went wrong on our end.
'
);
this
.
setSSHPublicKey
(
data
.
import_data_attributes
.
ssh_public_key
);
this
.
$wellAuthTypeChanging
.
addClass
(
'
hidden
'
);
this
.
$dropdownAuthType
.
enable
(
);
})
.
always
(()
=>
{
.
catch
(()
=>
{
Flash
(
__
(
'
Something went wrong on our end.
'
));
this
.
$wellAuthTypeChanging
.
addClass
(
'
hidden
'
);
this
.
$dropdownAuthType
.
enable
();
});
...
...
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