Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Son Of Anton
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Son Of Anton
Commits
2dd589eb
Commit
2dd589eb
authored
Mar 29, 2026
by
Mahmoud Aglan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixgitlabConn
parent
e9fb4382
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
7 deletions
+13
-7
gitlab_routes.py
backend/routes/gitlab_routes.py
+11
-5
api.js
frontend/src/api.js
+1
-1
GitLabPage.jsx
frontend/src/pages/GitLabPage.jsx
+1
-1
No files found.
backend/routes/gitlab_routes.py
View file @
2dd589eb
...
@@ -109,12 +109,18 @@ def update_settings(body: SettingsBody, admin: User = Depends(require_superadmin
...
@@ -109,12 +109,18 @@ def update_settings(body: SettingsBody, admin: User = Depends(require_superadmin
@
router
.
post
(
"/test-connection"
)
@
router
.
post
(
"/test-connection"
)
async
def
test_connection
(
admin
:
User
=
Depends
(
require_superadmin
),
db
:
Session
=
Depends
(
get_db
)):
async
def
test_connection
(
body
:
SettingsBody
,
admin
:
User
=
Depends
(
require_superadmin
),
db
:
Session
=
Depends
(
get_db
)):
s
=
db
.
query
(
GitLabSettings
)
.
first
()
url
=
body
.
gitlab_url
.
rstrip
(
"/"
)
if
not
s
or
not
s
.
gitlab_url
or
not
s
.
gitlab_token
:
if
not
body
.
gitlab_token
or
body
.
gitlab_token
==
"UNCHANGED"
:
raise
HTTPException
(
400
,
"GitLab URL and token not configured"
)
s
=
db
.
query
(
GitLabSettings
)
.
first
()
token
=
s
.
gitlab_token
if
s
else
""
else
:
token
=
body
.
gitlab_token
if
not
url
or
not
token
:
raise
HTTPException
(
400
,
"GitLab URL and token not provided"
)
try
:
try
:
result
=
await
gitlab_service
.
test_connection
(
s
.
gitlab_url
,
s
.
gitlab_
token
)
result
=
await
gitlab_service
.
test_connection
(
url
,
token
)
return
result
return
result
except
gitlab_service
.
GitLabError
as
e
:
except
gitlab_service
.
GitLabError
as
e
:
raise
HTTPException
(
e
.
status_code
,
f
"Connection failed: {e.detail}"
)
raise
HTTPException
(
e
.
status_code
,
f
"Connection failed: {e.detail}"
)
...
...
frontend/src/api.js
View file @
2dd589eb
...
@@ -139,7 +139,7 @@ export async function downloadZip(token, markdown, chatTitle) {
...
@@ -139,7 +139,7 @@ export async function downloadZip(token, markdown, chatTitle) {
export
const
gitlabGetSettings
=
(
token
)
=>
request
(
"GET"
,
"/gitlab/settings"
,
token
);
export
const
gitlabGetSettings
=
(
token
)
=>
request
(
"GET"
,
"/gitlab/settings"
,
token
);
export
const
gitlabUpdateSettings
=
(
token
,
data
)
=>
request
(
"PUT"
,
"/gitlab/settings"
,
token
,
data
);
export
const
gitlabUpdateSettings
=
(
token
,
data
)
=>
request
(
"PUT"
,
"/gitlab/settings"
,
token
,
data
);
export
const
gitlabTestConnection
=
(
token
)
=>
request
(
"POST"
,
"/gitlab/test-connection"
,
token
);
export
const
gitlabTestConnection
=
(
token
,
data
)
=>
request
(
"POST"
,
"/gitlab/test-connection"
,
token
,
data
);
export
const
gitlabSearchProjects
=
(
token
,
search
,
owned
)
=>
export
const
gitlabSearchProjects
=
(
token
,
search
,
owned
)
=>
request
(
"GET"
,
`/gitlab/projects?search=
${
encodeURIComponent
(
search
||
""
)}
&owned=
${
owned
||
false
}
`
,
token
);
request
(
"GET"
,
`/gitlab/projects?search=
${
encodeURIComponent
(
search
||
""
)}
&owned=
${
owned
||
false
}
`
,
token
);
export
const
gitlabCreateProject
=
(
token
,
data
)
=>
request
(
"POST"
,
"/gitlab/projects"
,
token
,
data
);
export
const
gitlabCreateProject
=
(
token
,
data
)
=>
request
(
"POST"
,
"/gitlab/projects"
,
token
,
data
);
...
...
frontend/src/pages/GitLabPage.jsx
View file @
2dd589eb
...
@@ -70,7 +70,7 @@ export default function GitLabPage() {
...
@@ -70,7 +70,7 @@ export default function GitLabPage() {
async
function
handleTest
()
{
async
function
handleTest
()
{
setTesting
(
true
);
setTestResult
(
null
);
setTesting
(
true
);
setTestResult
(
null
);
try
{
try
{
const
r
=
await
gitlabTestConnection
(
t
);
const
r
=
await
gitlabTestConnection
(
t
,
{
gitlab_url
:
url
,
gitlab_token
:
token
||
"UNCHANGED"
}
);
setTestResult
({
ok
:
true
,
msg
:
`Connected as
${
r
.
name
}
(@
${
r
.
username
}
)`
});
setTestResult
({
ok
:
true
,
msg
:
`Connected as
${
r
.
name
}
(@
${
r
.
username
}
)`
});
}
catch
(
e
)
{
setTestResult
({
ok
:
false
,
msg
:
e
.
message
});
}
}
catch
(
e
)
{
setTestResult
({
ok
:
false
,
msg
:
e
.
message
});
}
setTesting
(
false
);
setTesting
(
false
);
...
...
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