Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Anything Llm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
Mintplex Labs
Anything Llm
Commits
0935127f
Commit
0935127f
authored
10 months ago
by
timothycarambat
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of github.com:Mintplex-Labs/anything-llm
parents
fa99e53b
47056702
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/src/components/Modals/MangeWorkspace/DataConnectors/Connectors/Github/index.jsx
+78
-40
78 additions, 40 deletions
...MangeWorkspace/DataConnectors/Connectors/Github/index.jsx
with
78 additions
and
40 deletions
frontend/src/components/Modals/MangeWorkspace/DataConnectors/Connectors/Github/index.jsx
+
78
−
40
View file @
0935127f
...
@@ -3,7 +3,7 @@ import System from "@/models/system";
...
@@ -3,7 +3,7 @@ import System from "@/models/system";
import
showToast
from
"
@/utils/toast
"
;
import
showToast
from
"
@/utils/toast
"
;
import
pluralize
from
"
pluralize
"
;
import
pluralize
from
"
pluralize
"
;
import
{
TagsInput
}
from
"
react-tag-input-component
"
;
import
{
TagsInput
}
from
"
react-tag-input-component
"
;
import
{
Warning
}
from
"
@phosphor-icons/react
"
;
import
{
Info
,
Warning
}
from
"
@phosphor-icons/react
"
;
import
{
Tooltip
}
from
"
react-tooltip
"
;
import
{
Tooltip
}
from
"
react-tooltip
"
;
const
DEFAULT_BRANCHES
=
[
"
main
"
,
"
master
"
];
const
DEFAULT_BRANCHES
=
[
"
main
"
,
"
master
"
];
...
@@ -92,45 +92,7 @@ export default function GithubOptions() {
...
@@ -92,45 +92,7 @@ export default function GithubOptions() {
<
p
className
=
"font-bold text-white"
>
Github Access Token
</
p
>
{
"
"
}
<
p
className
=
"font-bold text-white"
>
Github Access Token
</
p
>
{
"
"
}
<
p
className
=
"text-xs text-white/50 font-light flex items-center"
>
<
p
className
=
"text-xs text-white/50 font-light flex items-center"
>
optional
optional
{
!
accessToken
&&
(
<
PATTooltip
accessToken
=
{
accessToken
}
/>
<
Warning
size
=
{
14
}
className
=
"ml-1 text-orange-500 cursor-pointer"
data-tooltip-id
=
"access-token-tooltip"
data-tooltip-place
=
"right"
/>
)
}
<
Tooltip
delayHide
=
{
300
}
id
=
"access-token-tooltip"
className
=
"max-w-xs"
clickable
=
{
true
}
>
<
p
className
=
"text-sm"
>
Without a
{
"
"
}
<
a
href
=
"https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens"
rel
=
"noreferrer"
target
=
"_blank"
className
=
"underline"
onClick
=
{
(
e
)
=>
e
.
stopPropagation
()
}
>
Personal Access Token
</
a
>
, the GitHub API may limit the number of files that
can be collected due to rate limits. You can
{
"
"
}
<
a
href
=
"https://github.com/settings/personal-access-tokens/new"
rel
=
"noreferrer"
target
=
"_blank"
className
=
"underline"
onClick
=
{
(
e
)
=>
e
.
stopPropagation
()
}
>
create a temporary Access Token
</
a
>
{
"
"
}
to avoid this issue.
</
p
>
</
Tooltip
>
</
p
>
</
p
>
</
label
>
</
label
>
<
p
className
=
"text-xs font-normal text-white/50"
>
<
p
className
=
"text-xs font-normal text-white/50"
>
...
@@ -180,6 +142,7 @@ export default function GithubOptions() {
...
@@ -180,6 +142,7 @@ export default function GithubOptions() {
</
div
>
</
div
>
<
div
className
=
"flex flex-col gap-y-2 w-full pr-10"
>
<
div
className
=
"flex flex-col gap-y-2 w-full pr-10"
>
<
PATAlert
accessToken
=
{
accessToken
}
/>
<
button
<
button
type
=
"submit"
type
=
"submit"
disabled
=
{
loading
}
disabled
=
{
loading
}
...
@@ -269,3 +232,78 @@ function GitHubBranchSelection({ repo, accessToken }) {
...
@@ -269,3 +232,78 @@ function GitHubBranchSelection({ repo, accessToken }) {
</
div
>
</
div
>
);
);
}
}
function
PATAlert
({
accessToken
})
{
if
(
!!
accessToken
)
return
null
;
return
(
<
div
className
=
"flex flex-col md:flex-row md:items-center gap-x-2 text-white mb-4 bg-blue-800/30 w-fit rounded-lg px-4 py-2"
>
<
div
className
=
"gap-x-2 flex items-center"
>
<
Info
className
=
"shrink-0"
size
=
{
25
}
/>
<
p
className
=
"text-sm"
>
Without filling out the
<
b
>
Github Access Token
</
b
>
this data connector
will only be able to collect the
<
b
>
top-level
</
b
>
files of the repo
due to GitHub's public API rate-limits.
<
br
/>
<
br
/>
<
a
href
=
"https://github.com/settings/personal-access-tokens/new"
rel
=
"noreferrer"
target
=
"_blank"
className
=
"underline"
onClick
=
{
(
e
)
=>
e
.
stopPropagation
()
}
>
{
"
"
}
Get a free Personal Access Token with a GitHub account here.
</
a
>
</
p
>
</
div
>
</
div
>
);
}
function
PATTooltip
({
accessToken
})
{
if
(
!!
accessToken
)
return
null
;
return
(
<>
{
!
accessToken
&&
(
<
Warning
size
=
{
14
}
className
=
"ml-1 text-orange-500 cursor-pointer"
data-tooltip-id
=
"access-token-tooltip"
data-tooltip-place
=
"right"
/>
)
}
<
Tooltip
delayHide
=
{
300
}
id
=
"access-token-tooltip"
className
=
"max-w-xs"
clickable
=
{
true
}
>
<
p
className
=
"text-sm"
>
Without a
{
"
"
}
<
a
href
=
"https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens"
rel
=
"noreferrer"
target
=
"_blank"
className
=
"underline"
onClick
=
{
(
e
)
=>
e
.
stopPropagation
()
}
>
Personal Access Token
</
a
>
, the GitHub API may limit the number of files that can be collected
due to rate limits. You can
{
"
"
}
<
a
href
=
"https://github.com/settings/personal-access-tokens/new"
rel
=
"noreferrer"
target
=
"_blank"
className
=
"underline"
onClick
=
{
(
e
)
=>
e
.
stopPropagation
()
}
>
create a temporary Access Token
</
a
>
{
"
"
}
to avoid this issue.
</
p
>
</
Tooltip
>
</>
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment