Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
lgl
SmartVillages2
Commits
ce996edd
Commit
ce996edd
authored
Jul 29, 2025
by
Luna Riegel
Browse files
Add dynamic color for converter status
parent
d9be535d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/converterStatus.vue
View file @
ce996edd
<
template
>
<
template
>
<v-row
no-gutters
class=
"justify-center"
>
<v-row
no-gutters
class=
"justify-center"
>
<VcsLabel>
Konverterservice Status:
</VcsLabel>
<VcsLabel>
Konverterservice Status:
</VcsLabel>
<VcsLabel
class=
"status"
v-text=
"status"
/>
<VcsLabel
class=
"status"
:class=
"status"
v-text=
"status"
/>
<VcsFormButton
id=
"refreshBtn"
icon=
"mdi-refresh"
@
click=
"checkHealth()"
/>
<VcsFormButton
id=
"refreshBtn"
icon=
"mdi-refresh"
@
click=
"checkHealth()"
/>
</v-row>
</v-row>
</
template
>
</
template
>
<
script
setup
>
<
script
setup
>
import
{
ref
,
computed
,
onMounted
}
from
'
vue
'
;
import
{
ref
,
computed
,
onMounted
,
inject
}
from
'
vue
'
;
import
{
VcsFormButton
,
VcsLabel
}
from
"
@vcmap/ui
"
;
import
{
VcsFormButton
,
VcsLabel
}
from
"
@vcmap/ui
"
;
import
{
VRow
}
from
"
vuetify/components
"
;
import
{
VRow
}
from
"
vuetify/components
"
;
const
app
=
inject
(
'
vcsApp
'
);
const
isHealthy
=
ref
(
null
);
const
isHealthy
=
ref
(
null
);
const
status
=
computed
(()
=>
{
const
status
=
computed
(()
=>
{
...
@@ -20,8 +22,14 @@ const status = computed(() => {
...
@@ -20,8 +22,14 @@ const status = computed(() => {
async
function
checkHealth
()
{
async
function
checkHealth
()
{
try
{
try
{
const
res
=
await
fetch
(
'
/health
'
);
if
(
app
){
isHealthy
.
value
=
res
.
ok
;
const
{
config
}
=
app
.
plugins
.
getByKey
(
name
);
const
res
=
await
fetch
(
config
.
convertLink
+
'
/health
'
);
isHealthy
.
value
=
res
.
ok
;
}
else
{
isHealthy
.
value
=
null
;
console
.
warn
(
"
Plugin config couldn't be loaded
"
);
}
}
catch
{
}
catch
{
isHealthy
.
value
=
false
;
isHealthy
.
value
=
false
;
}
}
...
@@ -30,3 +38,11 @@ async function checkHealth() {
...
@@ -30,3 +38,11 @@ async function checkHealth() {
onMounted
(
checkHealth
);
onMounted
(
checkHealth
);
</
script
>
</
script
>
<
style
scoped
>
.status.Online
{
color
:
green
;
}
.status.Offline
{
color
:
red
;
}
</
style
>
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment