Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
DCSG2900-ThreatTotal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Johannes Barstad
DCSG2900-ThreatTotal
Commits
d369bd26
Commit
d369bd26
authored
3 years ago
by
Jonas Kjærandsen
Browse files
Options
Downloads
Patches
Plain Diff
Frontend now able to display new struct data
parent
8deffbee
No related branches found
No related tags found
1 merge request
!2
Merge react-branch into main.
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
api/url-intelligence.go
+4
-5
4 additions, 5 deletions
api/url-intelligence.go
threat-total/src/components/sources.js
+1
-1
1 addition, 1 deletion
threat-total/src/components/sources.js
threat-total/src/pages/result.js
+1
-1
1 addition, 1 deletion
threat-total/src/pages/result.js
with
6 additions
and
7 deletions
api/url-intelligence.go
+
4
−
5
View file @
d369bd26
...
...
@@ -29,7 +29,7 @@ func UrlIntelligence(c *gin.Context) {
}
// Add the data to the redis backend.
response
,
err
:=
utils
.
Conn
.
Do
(
"SETEX"
,
url
,
6
0
,
URLint
)
response
,
err
:=
utils
.
Conn
.
Do
(
"SETEX"
,
url
,
30
0
,
URLint
)
if
err
!=
nil
{
fmt
.
Println
(
"Error adding data to redis:"
+
err
.
Error
())
}
...
...
@@ -84,8 +84,7 @@ func urlSearch(url string) (data []byte, err error) {
resultResponse
.
FrontendResponse
=
responseData
[
:
]
var
setResults
*
utils
.
ResultFrontendResponse
setResults
=
&
resultResponse
setResults
:=
&
resultResponse
utils
.
SetResultURL
(
setResults
,
len
(
responseData
))
...
...
This diff is collapsed.
Click to expand it.
threat-total/src/components/sources.js
+
1
−
1
View file @
d369bd26
...
...
@@ -23,7 +23,7 @@ export default function Sources(props) {
<
h1
className
=
"
text-2xl font-bold
"
>
{
t
(
"
sourceTitle
"
)}
<
/h1
>
<
div
className
=
'
bg-yellow-500 bg-red-600 bg-green-600
'
><
/div
>
<
div
className
=
'
grid grid-cols-1 p-2 md:grid-cols-2 xl:grid-cols-3
'
>
{
props
.
sourceData
.
Response
Data
.
map
((
Data
,
index
)
=>
{
{
props
.
sourceData
.
Frontend
Response
.
map
((
Data
,
index
)
=>
{
if
(
Data
.
en
.
status
===
"
Safe
"
)
{
BG
=
"
bg-green-600
"
}
else
if
(
Data
.
en
.
status
===
"
Risk
"
)
{
...
...
This diff is collapsed.
Click to expand it.
threat-total/src/pages/result.js
+
1
−
1
View file @
d369bd26
...
...
@@ -39,7 +39,7 @@ function Result() {
}
else
if
(
url
!=
null
){
setIsLoading
(
true
);
// Send an api request to the backend with url data
fetch
(
'
http://localhost:8081/url-
testing
?url=
'
+
url
,
{
fetch
(
'
http://localhost:8081/url-
intelligence
?url=
'
+
url
,
{
method
:
'
GET
'
,
headers
:
{
Accept
:
'
application/json
'
,
...
...
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