Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
play
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
Container 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
AURA
play
Commits
f963aaeb
Commit
f963aaeb
authored
2 years ago
by
David Trattnig
Browse files
Options
Downloads
Patches
Plain Diff
refact: settings for hosts
parent
0d14189b
No related branches found
No related tags found
1 merge request
!1
Local settings via JSON and initial use of Context API
Pipeline
#2677
passed
2 years ago
Stage: test
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/HostDetail.svelte
+5
-5
5 additions, 5 deletions
src/components/HostDetail.svelte
src/components/HostList.svelte
+5
-5
5 additions, 5 deletions
src/components/HostList.svelte
with
10 additions
and
10 deletions
src/components/HostDetail.svelte
+
5
−
5
View file @
f963aaeb
<script>
import
{
onMount
}
from
'
svelte
'
import
Spinner
from
'
../common/Spinner.svelte
'
import
{
fetchApi
}
from
'
../common/Common.svelte
'
import
{
settings
,
fetchApi
}
from
'
../common/Common.svelte
'
import
HostCardBig
from
'
../cards/HostCardBig.svelte
'
export
let
api
=
'
https://prog-info.o94.at/api.php
'
export
let
endpoint_hosts
=
'
hosts/
'
export
let
endpoint_shows
=
'
shows?host=
'
export
let
hostid
=
undefined
/* Nested Component Props */
export
let
renderhtml
=
false
// Attention: to avoid XSS attack vectors use with trusted API sources only
...
...
@@ -23,9 +21,11 @@
let
urlHostId
=
parseInt
(
url
.
searchParams
.
get
(
'
id
'
))
if
(
urlHostId
)
hostid
=
urlHostId
let
hostUrl
=
`
${
api
}
/
${
endpoint_hosts
}${
hostid
}
`
let
endpoint_host
=
settings
.
api
.
endpoints
.
host
let
hostUrl
=
`
${
settings
.
api
.
url
}
/
${
endpoint_host
}
/
${
hostid
}
`
fetchApi
(
hostUrl
,
processHostResponse
)
let
showsUrl
=
`
${
api
}
/
${
endpoint_shows
}${
hostid
}
`
let
endpoint_host_shows
=
settings
.
api
.
endpoints
.
show
+
`?host=
${
hostid
}
`
let
showsUrl
=
`
${
settings
.
api
.
url
}
/
${
endpoint_host_shows
}
`
fetchApi
(
showsUrl
,
processShowsResponse
)
})
...
...
This diff is collapsed.
Click to expand it.
src/components/HostList.svelte
+
5
−
5
View file @
f963aaeb
...
...
@@ -2,12 +2,12 @@
import
{
onMount
}
from
'
svelte
'
import
Spinner
from
'
../common/Spinner.svelte
'
import
Button
,
{
Label
}
from
'
@smui/button
'
import
{
fetchApi
}
from
'
../common/Common.svelte
'
import
{
settings
,
fetchApi
}
from
'
../common/Common.svelte
'
import
HostCardAvatar
from
'
../cards/HostCardAvatar.svelte
'
// import Pagination from '../Pagination.svelte'
export
let
api
=
'
https://prog-info.o94.at/api.php
'
export
let
endpoint
=
'
hosts
'
//
export let api = 'https://prog-info.o94.at/api.php'
//
export let endpoint = 'hosts'
export
let
urlHostDetail
=
undefined
export
let
page
=
0
export
let
limit
=
300
...
...
@@ -30,8 +30,8 @@
active_hosts
=
'
?
'
if
(
activeonly
)
active_hosts
=
'
?active=true&
'
let
pagination
=
initPagination
()
let
url
=
`
${
api
}
/
${
endpoint
}${
active_hosts
}${
pagination
}
`
let
endpoint
=
settings
.
api
.
endpoints
.
host
let
url
=
`
${
settings
.
api
.
url
}
/
${
endpoint
}${
active_hosts
}${
pagination
}
`
fetchApi
(
url
,
processResponse
)
})
...
...
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