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
1cd1b7d6
Commit
1cd1b7d6
authored
Apr 10, 2026
by
AGLANPC\aglan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dfhgkfghkhtdg
parent
13e4cefa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
235 additions
and
172 deletions
+235
-172
package.json
frontend/package.json
+5
-0
api.js
frontend/src/api.js
+230
-172
No files found.
frontend/package.json
View file @
1cd1b7d6
{
"scripts"
:
{
"dev"
:
"vite"
,
"build"
:
"vite build"
,
"preview"
:
"vite preview"
},
"dependencies"
:
{
"lucide-react"
:
"^0.469.0"
,
"react"
:
"^18.3.1"
,
...
...
frontend/src/api.js
View file @
1cd1b7d6
...
...
@@ -170,3 +170,61 @@ export const listRepoBranches = (token, repoId) =>
export
const
createKBFromRepo
=
(
token
,
repoId
,
data
)
=>
request
(
"POST"
,
`/gitlab/user/repos/
${
repoId
}
/create-kb`
,
token
,
data
);
// ═══════════════════════════════════════════════════
// Utilities & New Exports
// ═══════════════════════════════════════════════════
export
function
extractCodeBlocks
(
text
)
{
if
(
!
text
)
return
[];
const
blocks
=
[];
const
regex
=
/```
([\w
:.-
]
+
)?\n([\s\S]
*
?)
```/g
;
let
match
;
while
((
match
=
regex
.
exec
(
text
))
!==
null
)
{
const
rawLang
=
match
[
1
]
||
""
;
let
language
=
rawLang
;
let
filename
=
null
;
if
(
rawLang
.
includes
(
":"
))
{
const
parts
=
rawLang
.
split
(
":"
);
language
=
parts
[
0
];
filename
=
parts
.
slice
(
1
).
join
(
":"
);
}
blocks
.
push
({
language
,
filename
,
code
:
match
[
2
].
trim
()
});
}
return
blocks
;
}
export
const
commitFromChat
=
(
token
,
chatId
,
data
)
=>
request
(
"POST"
,
`/chats/
${
chatId
}
/commit`
,
token
,
data
);
export
const
exportPptx
=
async
(
token
,
markdown
,
title
)
=>
{
const
res
=
await
fetch
(
`
${
BASE
}
/export/pptx`
,
{
method
:
"POST"
,
headers
:
headers
(
token
),
body
:
JSON
.
stringify
({
markdown
,
title
})
});
if
(
!
res
.
ok
)
throw
new
Error
(
"PPTX export failed"
);
const
blob
=
await
res
.
blob
();
const
url
=
URL
.
createObjectURL
(
blob
);
const
a
=
document
.
createElement
(
"a"
);
a
.
href
=
url
;
a
.
download
=
`
${
title
||
"Presentation"
}
.pptx`
;
a
.
click
();
URL
.
revokeObjectURL
(
url
);
};
export
const
exportDocx
=
async
(
token
,
markdown
,
title
)
=>
{
const
res
=
await
fetch
(
`
${
BASE
}
/export/docx`
,
{
method
:
"POST"
,
headers
:
headers
(
token
),
body
:
JSON
.
stringify
({
markdown
,
title
})
});
if
(
!
res
.
ok
)
throw
new
Error
(
"DOCX export failed"
);
const
blob
=
await
res
.
blob
();
const
url
=
URL
.
createObjectURL
(
blob
);
const
a
=
document
.
createElement
(
"a"
);
a
.
href
=
url
;
a
.
download
=
`
${
title
||
"Document"
}
.docx`
;
a
.
click
();
URL
.
revokeObjectURL
(
url
);
};
\ 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