Skip to content

Commit 1156e73

Browse files
authored
🔀 Merge pull request #52 from Lissy93/FEATURE_continious-status-checking
[FEATURE] Continuous status checking plus bug fixes Fixes #52 and #35
2 parents 88c48ec + b051c39 commit 1156e73

File tree

8 files changed

+127
-7
lines changed

8 files changed

+127
-7
lines changed

docs/status-indicators.md

+11
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,17 @@ sections:
3737
statusCheck: true
3838
```
3939

40+
## Continuous Checking
41+
By default, with status indicators enabled Dashy will check an applications status on page load, and will not keep indicators updated. This is usually desirable behavior. However, if you do want the status indicators to continue to poll your running services, this can be enabled by setting the `statusCheckInterval` attribute. Here you define an interval in seconds, and Dashy will poll your apps every x seconds. Note that if this number is very low (below 5 seconds), you may notice the app running slightly slower.
42+
43+
The following example, will instruct Dashy to continuously check the status of your services every 20 seconds
44+
45+
```
46+
appConfig:
47+
statusCheck: true
48+
statusCheckInterval: 20
49+
```
50+
4051
## How it Works
4152
4253
When Dashy is loaded, items with `statusCheck` enabled will make a request, to `https://[your-host-name]/ping?url=[address-or-servce]`, which in turn will ping that running service, and respond with a status code. Response time is calculated from the difference between start and end time of the request.

src/components/LinkItems/Item.vue

+5
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export default {
5353
},
5454
itemSize: String,
5555
enableStatusCheck: Boolean,
56+
statusCheckInterval: Number,
5657
},
5758
data() {
5859
return {
@@ -114,6 +115,7 @@ export default {
114115
}
115116
},
116117
checkWebsiteStatus() {
118+
this.statusResponse = undefined;
117119
const baseUrl = process.env.VUE_APP_DOMAIN || window.location.origin;
118120
const endpoint = `${baseUrl}/ping?url=${this.url}`;
119121
axios.get(endpoint)
@@ -131,6 +133,9 @@ export default {
131133
mounted() {
132134
this.manageTitleEllipse();
133135
if (this.enableStatusCheck) this.checkWebsiteStatus();
136+
if (this.statusCheckInterval > 0) {
137+
setInterval(this.checkWebsiteStatus, this.statusCheckInterval * 1000);
138+
}
134139
},
135140
};
136141
</script>

src/components/LinkItems/ItemGroup.vue

+8
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
:backgroundColor="item.backgroundColor"
3030
:itemSize="newItemSize"
3131
:enableStatusCheck="shouldEnableStatusCheck(item.statusCheck)"
32+
:statusCheckInterval="getStatusCheckInterval()"
3233
@itemClicked="$emit('itemClicked')"
3334
@triggerModal="triggerModal"
3435
/>
@@ -98,6 +99,13 @@ export default {
9899
const globalPreference = this.config.appConfig.statusCheck || false;
99100
return itemPreference !== undefined ? itemPreference : globalPreference;
100101
},
102+
getStatusCheckInterval() {
103+
let interval = this.config.appConfig.statusCheckInterval;
104+
if (!interval) return 0;
105+
if (interval > 60) interval = 60;
106+
if (interval < 1) interval = 0;
107+
return interval;
108+
},
101109
},
102110
};
103111
</script>

src/components/Settings/SettingsContainer.vue

+1
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ export default {
136136
position: relative;
137137
flex: 1;
138138
background: var(--settings-background);
139+
border-radius: var(--curve-factor-navbar);
139140
}
140141
.options-container {
141142
display: flex;

src/styles/color-themes.scss

+89-1
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ html[data-theme='material-original'] {
178178
--heading-text-color: #fff;
179179
--status-check-tooltip-background: #f2f2f2;
180180
--status-check-tooltip-color: #01579b;
181+
--login-form-background: #fff;
181182
}
182183

183184
html[data-theme='material-dark-original'] {
@@ -250,7 +251,7 @@ html[data-theme='colorful'] {
250251
}
251252
}
252253

253-
html[data-theme='minimal-light'], html[data-theme='minimal-dark'] {
254+
html[data-theme='minimal-light'], html[data-theme='minimal-dark'], html[data-theme='vaporware'] {
254255
--font-body: 'PTMono-Regular', 'Courier New', monospace;
255256
--font-headings: 'PTMono-Regular', 'Courier New', monospace;
256257
label.lbl-toggle h3 {
@@ -443,6 +444,7 @@ html[data-theme='material'] {
443444
--search-container-background: #4285f4;
444445
--welcome-popup-text-color: #f5f5f5;
445446
--footer-text-color: #f5f5f5cc;
447+
// --login-form-background-secondary: #f5f5f5cc;
446448

447449
header {
448450
background: #4285f4;
@@ -504,6 +506,8 @@ html[data-theme='material-dark'] {
504506
--scroll-bar-color: #08B0BB;
505507
--scroll-bar-background: #131a1f;
506508
--status-check-tooltip-color: #131a1f;
509+
// --login-form-color: #131a1f;
510+
--login-form-background-secondary: #131a1f;
507511

508512
&::-webkit-scrollbar-thumb {
509513
border-left: 1px solid #131a1f;
@@ -536,6 +540,7 @@ html[data-theme='minimal-light'] {
536540
--curve-factor-navbar: 8px;
537541
--status-check-tooltip-background: #f2f2f2;
538542
--status-check-tooltip-color: #000;
543+
--login-form-color: #101931;
539544

540545
section.filter-container {
541546
background: #fff;
@@ -579,4 +584,87 @@ html[data-theme='minimal-dark'] {
579584
border: 1px solid #fff;
580585
}
581586
}
587+
}
588+
589+
html[data-theme='vaporware'] {
590+
--primary: #09bfe6;
591+
--background: #100e2c;
592+
--background-darker: #6c27ea;
593+
--background-darker: linear-gradient(0deg, rgba(108,39,234,1) 0%, rgba(132,76,235,1) 80%);
594+
--settings-text-color: #6c27ea;
595+
--item-group-outer-background: #096de6;
596+
--item-group-outer-background: linear-gradient(45deg, rgba(9,109,230,1) 0%, rgba(9,147,230,1) 50%, rgba(9,109,230,1) 100%);
597+
--item-group-background: #190e2c;
598+
--item-group-heading-text-color: var(--white);
599+
--item-group-heading-text-color-hover: #5118b9;
600+
--item-text-color: #5118b9;
601+
--item-background: #09bfe6;
602+
--item-background-hover: #9967f6;
603+
--footer-text-color: var(--white);
604+
--item-shadow: none;
605+
--curve-factor: 2px;
606+
--curve-factor-navbar: 6px;
607+
--login-form-color: #09bfe6;
608+
609+
.home {
610+
background: linear-gradient(180deg, rgba(16,14,44,1) 10%, rgba(27,24,79,1) 40%, rgba(16,14,44,1) 100%);
611+
}
612+
613+
div.item-group-container {
614+
gap: 0.3rem;
615+
margin: 1rem auto;
616+
}
617+
div.collapsable {
618+
margin: 0.2rem;
619+
padding: 0.2rem;
620+
}
621+
div.content-inner {
622+
padding: 0 !important;
623+
}
624+
a.item {
625+
margin: 0.1rem;
626+
border: 0;
627+
&.size-medium {
628+
min-height: 80px;
629+
}
630+
}
631+
section.filter-container {
632+
background: linear-gradient(0deg, var(--background) 25%, #6c27ea 100%);
633+
form {
634+
background: #6c27ea;
635+
height: 2.5rem;
636+
}
637+
form label, i.clear-search {
638+
color: #100e2c;
639+
border-color: #100e2c;
640+
font-weight: bold;
641+
}
642+
}
643+
.tile-title span.text {
644+
font-weight: normal;
645+
}
646+
label.lbl-toggle h3 {
647+
font-size: 1.4rem;
648+
}
649+
footer {
650+
color: var(--white);
651+
}
652+
a.item {
653+
background: linear-gradient(45deg, rgba(9,191,230,1) 0%, rgba(9,191,230,1) 80%, rgba(9,203,230,1) 100%);
654+
&:hover {
655+
background: #844ceb;
656+
color: #09bfe6;
657+
}
658+
.tile-title span.text { transition: none; }
659+
}
660+
661+
div.login-page {
662+
background: url('https://i.ibb.co/JqcJcGK/vaporwave-sunset-wallpaper.jpg');
663+
background-size: cover;
664+
}
665+
// body {
666+
// background: url('https://i.ibb.co/JqcJcGK/vaporwave-sunset-wallpaper.jpg');
667+
// background-size: cover;
668+
// div.home { background: none; }
669+
// }
582670
}

src/utils/ConfigSchema.json

+5
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@
131131
"default": false,
132132
"description": "Displays an online/ offline status for each of your services"
133133
},
134+
"statusCheckInterval": {
135+
"type": "number",
136+
"default": 0,
137+
"description": "How often to recheck statuses. If set to 0, status will only be checked on page load"
138+
},
134139
"auth": {
135140
"type": "array",
136141
"description": "Usernames and hashed credentials for frontend authentication",

src/utils/defaults.js

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ module.exports = {
3333
'tiger',
3434
'material-original',
3535
'material-dark-original',
36+
'vaporware',
3637
'high-contrast-dark',
3738
'high-contrast-light',
3839
],

src/views/Login.vue

+7-6
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,20 @@ export default {
9393
9494
.login-field input {
9595
color: var(--login-form-color);
96-
border-color: var(--login-form-background-secondary);
97-
background: var(--login-form-background-secondary);
96+
border-color: var(--login-form-color);
97+
background: var(--login-form-background);
9898
&:focus {
9999
100100
}
101101
}
102102
Button.login-button {
103-
background: var(--login-form-background-secondary);
104-
border-color: var(--login-form-background-secondary);
103+
background: var(--login-form-color);
104+
border-color: var(--login-form-background);
105+
color: var(--login-form-background);
105106
&:hover {
107+
color: var(--login-form-color);
106108
border-color: var(--login-form-color);
107-
color: var(--login-form-background-secondary);
108-
background: var(--login-form-color);
109+
background: var(--login-form-background);
109110
}
110111
&:active, &:focus {
111112
box-shadow: 1px 1px 6px var(--login-form-color);

0 commit comments

Comments
 (0)