Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ce-deploy-ui
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ccce
dev
ce-deploy-ui
Merge requests
!351
CE-2076
: Convert useHost to common
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
CE-2076
: Convert useHost to common
CE-2076-convert-useHost
into
develop
Overview
5
Commits
3
Pipelines
4
Changes
3
Merged
Alexander Madsen
requested to merge
CE-2076-convert-useHost
into
develop
1 year ago
Overview
5
Commits
3
Pipelines
4
Changes
3
Expand
Ticket:
CE-2076
Convert useHost hook to common and remove from SwaggerApi file
1
0
Merge request reports
Viewing commit
6f9dc8e4
Prev
Next
Show latest version
3 files
+
26
−
13
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
6f9dc8e4
Convert useHost hook to common and remove from SwaggerApi file
· 6f9dc8e4
Alexander Madsen
authored
1 year ago
src/components/common/Loki/LokiContainer.js
+
9
−
3
Options
import
React
from
"
react
"
;
import
React
,
{
useContext
,
useMemo
}
from
"
react
"
;
import
{
Container
}
from
"
@mui/material
"
;
import
{
Container
}
from
"
@mui/material
"
;
import
{
useHost
}
from
"
../../../api/SwaggerApi
"
;
import
{
LokiPanel
}
from
"
./LokiPanel
"
;
import
{
LokiPanel
}
from
"
./LokiPanel
"
;
import
{
apiContext
}
from
"
../../../api/DeployApi
"
;
import
{
useAPIMethod
}
from
"
@ess-ics/ce-ui-common
"
;
export
function
LokiContainer
({
csEntryId
,
iocName
,
isDeployed
})
{
export
function
LokiContainer
({
csEntryId
,
iocName
,
isDeployed
})
{
const
[
iocHost
]
=
useHost
(
csEntryId
);
const
client
=
useContext
(
apiContext
);
const
{
value
:
iocHost
}
=
useAPIMethod
({
fcn
:
client
.
apis
.
Hosts
.
findHostById
,
params
:
useMemo
(()
=>
({
host_csentry_id
:
csEntryId
}),
[
csEntryId
])
});
return
(
return
(
<>
<>
Loading