Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tacc-frontend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Wen Wei Li
tacc-frontend
Commits
be080e89
Commit
be080e89
authored
May 07, 2024
by
Wen Wei Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update agent view
parent
bb3afdd2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
12 deletions
+34
-12
src/components/AgentDetail.vue
src/components/AgentDetail.vue
+23
-11
src/components/Form.vue
src/components/Form.vue
+1
-0
src/components/Rules.vue
src/components/Rules.vue
+10
-1
No files found.
src/components/AgentDetail.vue
View file @
be080e89
...
@@ -6,16 +6,26 @@
...
@@ -6,16 +6,26 @@
<CTable
hover
>
<CTable
hover
>
<CTableHead>
<CTableHead>
<CTableRow>
<CTableRow>
<CTableHeaderCell
scope=
"col"
>
#
</CTableHeaderCell>
<CTableHeaderCell
scope=
"col"
>
#
</CTableHeaderCell>
<CTableHeaderCell
scope=
"col"
>
Name
</CTableHeaderCell>
<CTableHeaderCell
scope=
"col"
>
Name
</CTableHeaderCell>
<CTableHeaderCell
scope=
"col"
>
OS
</CTableHeaderCell>
<CTableHeaderCell
scope=
"col"
>
Status
</CTableHeaderCell>
<CTableHeaderCell
scope=
"col"
>
SCA Score
</CTableHeaderCell>
<CTableHeaderCell
scope=
"col"
>
Healthy Check
</CTableHeaderCell>
</CTableRow>
</CTableRow>
</CTableHead>
</CTableHead>
<CTableBody>
<CTableBody>
<CTableRow
v-for=
"(data, index) in agent_data"
:key=
"index"
>
<CTableRow
v-for=
"(data, index) in agent_data"
:key=
"index"
>
<CTableDataCell>
{{
data
.
id
}}
</CTableDataCell>
<CTableDataCell>
{{
data
.
id
}}
</CTableDataCell>
<CTableDataCell>
{{
data
.
name
}}
</CTableDataCell>
<CTableDataCell>
{{
data
.
node_name
}}
</CTableDataCell>
<CTableDataCell>
{{
data
.
OS
}}
</CTableDataCell>
<CTableDataCell>
{{
data
.
status
}}
</CTableDataCell>
<CTableDataCell>
{{
data
.
sca_score
}}
</CTableDataCell>
<CTableDataCell
v-if=
"healthy === 'true'"
>
<CIcon
icon=
"cilCheckAlt"
/></CTableDataCell>
<CTableDataCell
v-else
>
<CIcon
icon=
"cilX"
/></CTableDataCell>
</CTableRow>
</CTableRow>
</CTableBody>
</CTableBody>
</CTable>
</CTable>
...
@@ -25,14 +35,16 @@
...
@@ -25,14 +35,16 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
onMounted
}
from
'
vue
'
;
import
{
onMounted
}
from
'
vue
'
;
import
{
useRoute
}
from
'
vue-router
'
import
{
useRoute
}
from
'
vue-router
'
export
default
{
export
default
{
name
:
"
AgentDetail
"
,
name
:
"
AgentDetail
"
,
data
()
{
data
()
{
return
{
return
{
agentId
:
"
000
"
,
agentId
:
"
000
"
,
agent_data
:
[]
agent_data
:
[],
healthy
:
'
true
'
};
};
},
},
mounted
()
{
mounted
()
{
...
@@ -41,18 +53,18 @@ import { useRoute } from 'vue-router'
...
@@ -41,18 +53,18 @@ import { useRoute } from 'vue-router'
methods
:
{
methods
:
{
async
fetchAgentData
()
{
async
fetchAgentData
()
{
this
.
agent_data
=
[{
"
id
"
:
this
.
$route
.
params
.
id
,
"
name
"
:
"
test
"
}]
this
.
agent_data
=
[{
"
id
"
:
this
.
$route
.
params
.
id
,
"
name
"
:
"
test
"
}]
this
.
agentId
=
this
.
$route
.
params
.
id
this
.
agentId
=
this
.
$route
.
params
.
id
/*
try
{
try
{
console.log("
`http://192.168.88.238:8080/api/v1/agent/${this.agentId}`"
);
console
.
log
(
"
http://192.168.88.238:8080/api/v1/agent/
"
+
this
.
agentId
);
const response = await fetch("
`http://192.168.88.238:8080/api/v1/agent/${this.agentId}`"
);
const
response
=
await
fetch
(
"
http://192.168.88.238:8080/api/v1/agent/
"
+
this
.
agentId
);
if
(
!
response
.
ok
)
throw
new
Error
(
'
Failed to fetch
'
);
if
(
!
response
.
ok
)
throw
new
Error
(
'
Failed to fetch
'
);
this
.
agent_data
=
await
response
.
json
();
this
.
agent_data
=
await
response
.
json
();
this
.
healthy
=
this
.
agent_data
[
0
].
healthy
console
.
log
(
this
.
agent_data
);
console
.
log
(
this
.
agent_data
);
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
'
Error fetching products:
'
,
error
);
console
.
error
(
'
Error fetching products:
'
,
error
);
}
}
*/
}
}
},
},
...
...
src/components/Form.vue
View file @
be080e89
...
@@ -37,6 +37,7 @@ export default {
...
@@ -37,6 +37,7 @@ export default {
methods
:{
methods
:{
updateParent
()
{
updateParent
()
{
this
.
$emit
(
'
update-data
'
,
{
attribute
:
this
.
attribute
,
threshold
:
this
.
threshold
});
this
.
$emit
(
'
update-data
'
,
{
attribute
:
this
.
attribute
,
threshold
:
this
.
threshold
});
console
.
log
(
this
.
threshold
)
}
}
}
}
...
...
src/components/Rules.vue
View file @
be080e89
...
@@ -37,7 +37,16 @@ export default {
...
@@ -37,7 +37,16 @@ export default {
},
},
methods
:
{
methods
:
{
async
fetchAgentsData
()
{
async
fetchAgentsData
()
{
this
.
rules
=
[{
"
attribute
"
:
"
SCA
"
,
"
threshold
"
:
"
60
"
}]
//this.rules = [{"attribute": "SCA", "threshold":"60"}]
try
{
const
response
=
await
fetch
(
"
http://192.168.88.238:8080/api/v1/rules
"
);
if
(
!
response
.
ok
)
throw
new
Error
(
'
Failed to fetch
'
);
this
.
rules
=
await
response
.
json
();
console
.
log
(
this
.
rules
);
}
catch
(
error
)
{
console
.
error
(
'
Error fetching products:
'
,
error
);
}
}
}
}
}
}
}
...
...
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