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
>
<v-row
no-gutters
class=
"justify-center"
>
<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()"
/>
</v-row>
</
template
>
<
script
setup
>
import
{
ref
,
computed
,
onMounted
}
from
'
vue
'
;
import
{
ref
,
computed
,
onMounted
,
inject
}
from
'
vue
'
;
import
{
VcsFormButton
,
VcsLabel
}
from
"
@vcmap/ui
"
;
import
{
VRow
}
from
"
vuetify/components
"
;
const
app
=
inject
(
'
vcsApp
'
);
const
isHealthy
=
ref
(
null
);
const
status
=
computed
(()
=>
{
...
...
@@ -20,8 +22,14 @@ const status = computed(() => {
async
function
checkHealth
()
{
try
{
const
res
=
await
fetch
(
'
/health
'
);
isHealthy
.
value
=
res
.
ok
;
if
(
app
){
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
{
isHealthy
.
value
=
false
;
}
...
...
@@ -30,3 +38,11 @@ async function checkHealth() {
onMounted
(
checkHealth
);
</
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