Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GitlabScanner
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Robin VAN DE MERGHEL
GitlabScanner
Commits
a7956025
Commit
a7956025
authored
1 year ago
by
ForkBench
Browse files
Options
Downloads
Patches
Plain Diff
Updating gitignore, js -> toLowerCase and blank, Connection -> Retry if error, 3 tries
parent
e04f79c6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+5
-1
5 additions, 1 deletion
.gitignore
src/public/js/index.js
+4
-4
4 additions, 4 deletions
src/public/js/index.js
src/util/Connection.js
+36
-4
36 additions, 4 deletions
src/util/Connection.js
with
45 additions
and
9 deletions
.gitignore
+
5
−
1
View file @
a7956025
node_modules
node_modules
**/*test*
**/*test*
src/data/config.json
src/data/config.json
src/data/projects.json
src/data/projects.json
\ No newline at end of file
# Temporary
src/code_analysis
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/public/js/index.js
+
4
−
4
View file @
a7956025
...
@@ -81,7 +81,7 @@ function addProjectToContainer(project, tested, vulnerable) {
...
@@ -81,7 +81,7 @@ function addProjectToContainer(project, tested, vulnerable) {
<td><a href="
${
project
.
namespace
.
web_url
}
">
${
<td><a href="
${
project
.
namespace
.
web_url
}
">
${
project
.
namespace
.
path
project
.
namespace
.
path
}
<a></td>
}
<a></td>
<td><a href="
${
project
.
web_url
}
">🔭</a></td>
<td><a href="
${
project
.
web_url
}
"
target="_blank"
>🔭</a></td>
${
${
tested
tested
?
`<td><a href="/test/
${
project
.
id
}
">✅</a></td>`
?
`<td><a href="/test/
${
project
.
id
}
">✅</a></td>`
...
@@ -122,9 +122,9 @@ function filterProjects() {
...
@@ -122,9 +122,9 @@ function filterProjects() {
// Search bar
// Search bar
if
(
if
(
project
.
data
.
name
.
includes
(
searchBarValue
)
||
project
.
data
.
name
.
toLowerCase
().
includes
(
searchBarValue
.
toLowerCase
()
)
||
project
.
data
.
description
.
includes
(
searchBarValue
)
||
project
.
data
.
description
.
toLowerCase
().
includes
(
searchBarValue
.
toLowerCase
()
)
||
project
.
data
.
namespace
.
path
.
includes
(
searchBarValue
)
project
.
data
.
namespace
.
path
.
toLowerCase
().
includes
(
searchBarValue
.
toLowerCase
()
)
)
{
)
{
return
true
;
return
true
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/util/Connection.js
+
36
−
4
View file @
a7956025
...
@@ -119,7 +119,7 @@ class Connection {
...
@@ -119,7 +119,7 @@ class Connection {
* @private
* @private
* @returns {void}
* @returns {void}
*/
*/
recursiveFetchAllProjects
(
options
,
store
)
{
recursiveFetchAllProjects
(
options
,
store
,
tries_left
=
3
)
{
console
.
log
(
`Fetching page
${
options
.
current_page
}
...`
);
console
.
log
(
`Fetching page
${
options
.
current_page
}
...`
);
if
(
options
.
current_page
>
options
.
end_page
)
return
;
if
(
options
.
current_page
>
options
.
end_page
)
return
;
...
@@ -156,7 +156,23 @@ class Connection {
...
@@ -156,7 +156,23 @@ class Connection {
}
}
})
})
.
catch
((
err
)
=>
{
.
catch
((
err
)
=>
{
throw
err
;
if
(
tries_left
>
0
)
{
console
.
log
(
"
🛑 Error fetching projects, retrying...
"
);
setTimeout
(()
=>
{
this
.
recursiveFetchAllProjects
(
{
per_page
:
options
.
per_page
,
current_page
:
options
.
current_page
,
end_page
:
options
.
end_page
,
display
:
options
.
display
,
},
store
,
tries_left
-
1
);
},
10000
+
Math
.
random
()
*
10000
);
}
else
{
throw
err
;
}
});
});
}
}
...
@@ -200,7 +216,7 @@ class Connection {
...
@@ -200,7 +216,7 @@ class Connection {
* @private
* @private
* @returns {void}
* @returns {void}
*/
*/
recursiveUpdateProjects
(
options
,
store
)
{
recursiveUpdateProjects
(
options
,
store
,
tries_left
=
3
)
{
console
.
log
(
`Updating page
${
options
.
current_page
}
...`
);
console
.
log
(
`Updating page
${
options
.
current_page
}
...`
);
if
(
options
.
current_page
>
options
.
end_page
)
return
;
if
(
options
.
current_page
>
options
.
end_page
)
return
;
...
@@ -249,7 +265,23 @@ class Connection {
...
@@ -249,7 +265,23 @@ class Connection {
}
}
})
})
.
catch
((
err
)
=>
{
.
catch
((
err
)
=>
{
throw
err
;
if
(
tries_left
>
0
)
{
console
.
log
(
"
🛑 Error updating projects, retrying...
"
);
setTimeout
(()
=>
{
this
.
recursiveUpdateProjects
(
{
per_page
:
options
.
per_page
,
current_page
:
options
.
current_page
,
end_page
:
options
.
end_page
,
display
:
options
.
display
,
},
store
,
tries_left
-
1
);
},
10000
+
Math
.
random
()
*
10000
);
}
else
{
throw
err
;
}
});
});
}
}
}
}
...
...
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