Skip to content

armgit / dashy

Public Imported from GitHub
0

πŸš€ A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!

πŸ₯… Catch all error cases for healthchecks widget

Alicia Sykes5b11e6cb3ff8
diff --git a/src/components/Widgets/HealthChecks.vue b/src/components/Widgets/HealthChecks.vue
index ae99ae42..31e61332 100644
--- a/src/components/Widgets/HealthChecks.vue
+++ b/src/components/Widgets/HealthChecks.vue
@@ -5,7 +5,7 @@
:key="cron.id"
>
<div class="status">
- <p :class="cron.status">{{ formatStatus(cron.status) }}</p>
+ <p :class="cron.status || 'unknown'">{{ formatStatus(cron.status) }}</p>
</div>
<div
class="info"
@@ -47,14 +47,12 @@ export default {
},
},
methods: {
+ /* Make status summary (emoji + name) */
formatStatus(status) {
- let symbol = '';
- if (status === 'up') symbol = 'βœ”';
- if (status === 'down') symbol = '✘';
- if (status === 'new') symbol = '❖';
- if (status === 'paused') symbol = '⏸';
- if (status === 'running') symbol = 'β–Ά';
- return `${symbol} ${capitalize(status)}`;
+ const symbols = {
+ up: 'βœ”', down: '✘', new: '❖', paused: '⏸', grace: '⚠', started: 'β–Ά',
+ };
+ return `${symbols[status] || '❔'} ${capitalize(status || 'unknown')}`;
},
formatDate(timestamp) {
return timestampToDateTime(timestamp);
@@ -133,7 +131,9 @@ export default {
&.up { color: var(--success); }
&.down { color: var(--danger); }
&.new { color: var(--widget-text-color); }
- &.running { color: var(--warning); }
+ &.grace { color: var(--warning); }
+ &.unknown { color: var(--warning); }
+ &.started { color: var(--info); }
&.paused { color: var(--info); }
}
}