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
4973d220
Commit
4973d220
authored
Mar 30, 2026
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update frontend/src/api.js via Son of Anton
parent
f8244a7a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
1 deletion
+25
-1
api.js
frontend/src/api.js
+25
-1
No files found.
frontend/src/api.js
View file @
4973d220
...
@@ -94,4 +94,28 @@ export async function exportDocx(token, markdown, title) {
...
@@ -94,4 +94,28 @@ export async function exportDocx(token, markdown, title) {
}
}
// Utilities
// Utilities
const
CODE_BLOCK_RE
=
/
const
CODE_BLOCK_RE
=
/```
(\S
*
?)(?:
:
(\S
+
?))?\s
*
?\n([\s\S]
*
?)
```/g
;
\ No newline at end of file
export
function
extractCodeBlocks
(
md
)
{
if
(
!
md
)
return
[];
const
blocks
=
[];
let
m
;
const
re
=
new
RegExp
(
CODE_BLOCK_RE
.
source
,
"g"
);
while
((
m
=
re
.
exec
(
md
))
!==
null
)
{
const
lang
=
(
m
[
1
]
||
"text"
).
toLowerCase
();
const
fn
=
m
[
2
]
||
null
;
const
code
=
(
m
[
3
]
||
""
).
trim
();
if
(
code
)
blocks
.
push
({
language
:
lang
,
filename
:
fn
,
code
});
}
return
blocks
;
}
// GitLab
export
const
gitlabGetSettings
=
(
t
)
=>
request
(
"GET"
,
"/gitlab/settings"
,
t
);
export
const
gitlabUpdateSettings
=
(
t
,
d
)
=>
request
(
"PUT"
,
"/gitlab/settings"
,
t
,
d
);
export
const
gitlabTestConnection
=
(
t
)
=>
request
(
"POST"
,
"/gitlab/test-connection"
,
t
);
export
const
gitlabSearchProjects
=
(
t
,
s
,
o
)
=>
request
(
"GET"
,
`/gitlab/projects?search=
${
encodeURIComponent
(
s
||
""
)}
&owned=
${
o
||
false
}
`
,
t
);
export
const
gitlabCreateProject
=
(
t
,
d
)
=>
request
(
"POST"
,
"/gitlab/projects"
,
t
,
d
);
export
const
gitlabListRepos
=
(
t
)
=>
request
(
"GET"
,
"/gitlab/repos"
,
t
);
export
const
gitlabLinkRepo
=
(
t
,
pid
)
=>
request
(
"POST"
,
"/gitlab/repos"
,
t
,
{
gitlab_project_id
:
pid
});
export
const
gitlabUnlinkRepo
=
(
t
,
id
)
=>
request
(
"DELETE"
,
`/gitlab/repos/
${
id
}
`
,
t
);
export
const
gitlabGetTree
=
(
t
,
id
,
p
,
r
)
=>
request
(
"GET"
,
`/gitlab/repos/
${
id
}
/tree?path=
${
encodeURIComponent
(
p
||
""
)}
&ref=
${
encodeURIComponent
(
r
||
""
)}
`
,
t
);
export
const
gitlabGetFile
=
(
t
,
id
,
p
,
r
)
=>
request
(
"GET"
,
`/gitlab/repos/
${
id
}
/file?path=
${
encodeURIComponent
(
p
)}
&ref=
${
encodeURIComponent
(
r
||
""
)}
`
,
t
);
export
const
gitlabGetBranches
=
(
t
,
id
)
=>
request
(
"GET"
,
`/gitlab/repos/
${
id
}
/branches`
,
t
);
export
const
gitlabCreateBranch
=
(
t
,
id
,
d
)
=>
request
(
"POST"
,
`/gitlab/repos/
${
id
}
/branches`
,
t
,
d
);
export
const
gitlabCommit
=
(
t
,
id
,
d
)
=>
request
(
"POST"
,
`/gitlab/repos/
${
id
}
/commit`
,
t
,
d
);
export
const
gitlabCommitSingle
=
(
t
,
id
,
d
)
=>
request
(
"POST"
,
`/gitlab/repos/
${
id
}
/commit-single`
,
t
,
d
);
export
const
gitlabCreateMR
=
(
t
,
id
,
d
)
=>
request
(
"POST"
,
`/gitlab/repos/
${
id
}
/merge-request`
,
t
,
d
);
export
const
gitlabReanalyzeRepo
=
(
t
,
id
)
=>
request
(
"POST"
,
`/gitlab/repos/
${
id
}
/analyze`
,
t
);
export
const
gitlabGetRepoMap
=
(
t
,
id
)
=>
request
(
"GET"
,
`/gitlab/repos/
${
id
}
/map`
,
t
);
export
const
gitlabListActions
=
(
t
,
s
)
=>
request
(
"GET"
,
`/gitlab/actions?status=
${
s
||
"pending"
}
`
,
t
);
export
const
gitlabCreateAction
=
(
t
,
d
)
=>
request
(
"POST"
,
"/gitlab/actions"
,
t
,
d
);
export
const
gitlabApproveAction
=
(
t
,
id
)
=>
request
(
"POST"
,
`/gitlab/actions/
${
id
}
/approve`
,
t
);
export
const
gitlabRejectAction
=
(
t
,
id
)
=>
request
(
"POST"
,
`/gitlab/actions/
${
id
}
/reject`
,
t
);
\ No newline at end of file
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