Skip to content

Commit 93a531a

Browse files
authored
🔀 Merge pull request #557 from Lissy93/FEATURE/user-suggestions
[FEATURE] Implementing user suggestions This PR resolves loads of tickets... Fixes #492, fixes #494, fixes #497, fixes #505, fixes #522, fixes #524, fixes #546, fixes #552, fixes #554, fixes #560, fixes #564, fixes #568, fixes #570, fixes #575 and fixes #576 - Yay 🥳 Celebrating getting out of hospital with 15 bug fixes 🐛 and a beer 🍺
2 parents b51935f + 45583ae commit 93a531a

26 files changed

+237
-64
lines changed

.github/CHANGELOG.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,35 @@
11
# Changelog
22

3-
## 2.0.5 - Bug Fixes and a few New Features
4-
5-
### Partially revert 2.0.4, fixing several issues caused by `conf.yml` not being loaded at startup.
3+
## 🐛 2.0.6 Fixes user requested issues [PR #557](https://github.com/Lissy93/dashy/pull/557)
4+
- Allows middle click open new tab, Re: #492
5+
- Implements Max redirects for status checks, Re: #494
6+
- Adds Gitpod config for cloud-ready IDE, Re: #497
7+
- Adss new screenshots to showcase, Re: #505
8+
- Fixes excess space below footer, Re: #522
9+
- Allows iframe content to be viewed full-screen, Re: #524
10+
- Fixes Glances widgets with Authorization headers, Re: #546
11+
- Adds target attribute to nav links, Re: #552
12+
- Removes fixed max-width on wide-screens, Re: #554
13+
- Adds missing type attribute to external CSS, Re: #560
14+
- Updates path to Keycloak API, Re: #564
15+
- Fixes link to @walkxhub homelab icons, Re #568
16+
- Fixes local image path on sub-page, Re: #570
17+
- Adds typecheck on edit item tags, Re: #575
18+
- Fixes item size in config not honored, Re: #576
19+
20+
## ✨ 2.0.5 - Bug Fixes and a few New Features
21+
22+
#### Partially revert 2.0.4, fixing several issues caused by `conf.yml` not being loaded at startup.
623
This change requires a rebuild of the application when several options under `appConfig` are changed.
724
Fixes #544 #555
825

9-
### Several other changes since 2.0.4, including:
26+
#### Several other changes since 2.0.4, including:
1027
The `Add New Section` button on the UI editor now displays if no sections are present. #536
1128
When using SSL, the server can now redirect from HTTP to HTTPS. This is enabled by default when using SSL. #538
1229
Section context menus are now accessible on mobile, and will no longer clip off the screen. #541
1330
Italian translations have been added. #556
1431

15-
## :sparkles: 2.0.4 - Dynamic Config Loading [PR #528](https://github.com/Lissy93/dashy/pull/528)
32+
## 2.0.4 - Dynamic Config Loading [PR #528](https://github.com/Lissy93/dashy/pull/528)
1633
- `conf.yml` is now loaded dynamically and the app now only needs a browser refresh on config change, not a full rebuild!
1734

1835
## 🐛 2.0.3 - Bug Fixes [PR #488](https://github.com/Lissy93/dashy/pull/488)

.github/LATEST_CHANGELOG.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
### Partially revert 2.0.4, fixing several issues caused by `conf.yml` not being loaded at startup.
2-
This change requires a rebuild of the application when several options under `appConfig` are changed.
3-
Fixes #544 #555
4-
5-
### Several other changes since 2.0.4, including:
6-
The `Add New Section` button on the UI editor now displays if no sections are present. #536
7-
When using SSL, the server can now redirect from HTTP to HTTPS. This is enabled by default when using SSL. #538
8-
Section context menus are now accessible on mobile, and will no longer clip off the screen. #541
9-
Italian translations have been added. #556
1+
## 🐛 Fixes user requested issues [PR #557](https://github.com/Lissy93/dashy/pull/557)
2+
- Allows middle click open new tab, Re: #492
3+
- Implements Max redirects for status checks, Re: #494
4+
- Adds Gitpod config for cloud-ready IDE, Re: #497
5+
- Adss new screenshots to showcase, Re: #505
6+
- Fixes excess space below footer, Re: #522
7+
- Allows iframe content to be viewed full-screen, Re: #524
8+
- Fixes Glances widgets with Authorization headers, Re: #546
9+
- Adds target attribute to nav links, Re: #552
10+
- Removes fixed max-width on wide-screens, Re: #554
11+
- Adds missing type attribute to external CSS, Re: #560
12+
- Updates path to Keycloak API, Re: #564
13+
- Fixes link to @walkxhub homelab icons, Re #568
14+
- Fixes local image path on sub-page, Re: #570
15+
- Adds typecheck on edit item tags, Re: #575
16+
- Fixes item size in config not honored, Re: #576

.gitpod.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Config for running Dashy in GitPod's cloud dev environment
2+
# Docs: https://www.gitpod.io/docs/references/gitpod-yml
3+
4+
# Commands to start on workspace startup
5+
tasks:
6+
- init: yarn install
7+
command: yarn dev
8+
# Ports to expose on workspace startup
9+
ports:
10+
- port: 8080 # Default dev server
11+
visibility: private
12+
onOpen: open-preview
13+
- port: 4000 # Default prod server
14+
visibility: public
15+
onOpen: open-preview
16+
prebuilds:
17+
# Adds 'Open in GitPod' to PRs
18+
addBadge: true
19+
addComment: false
20+
vscode:
21+
# Adds Vue.js and formatting extensions
22+
extensions:
23+
- octref.vetur
24+
- dbaeumer.vscode-eslint
25+
- streetsidesoftware.code-spell-checker
26+
- PKief.material-icon-theme
27+
- wix.vscode-import-cost
28+
- oderwat.indent-rainbow
29+
- eamodio.gitlens

docs/configuring.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ The following file provides a reference of all supported configuration options.
7777
--- | --- | --- | ---
7878
**`title`** | `string` | Required | The text to display on the link button
7979
**`path`** | `string` | Required | The URL to navigate to when clicked. Can be relative (e.g. `/about`) or absolute (e.g. `https://example.com` or `http://192.168.1.1`)
80+
**`target`** | `string` | _Optional_ | The opening method (external links only). Can be either `newtab`, `sametab`, `top` or `parent`. Defaults to `newtab`
8081

8182
**[⬆️ Back to Top](#configuring)**
8283

@@ -206,6 +207,7 @@ For more info, see the **[Authentication Docs](/docs/authentication.md)**
206207
**`statusCheckHeaders`** | `object` | _Optional_ | If you're endpoint requires any specific headers for the status checking, then define them here
207208
**`statusCheckAllowInsecure`** | `boolean` | _Optional_ | By default, any request to insecure content will be blocked. Setting this option to `true` will disable the `rejectUnauthorized` option, enabling you to ping non-HTTPS services for the current item. Defaults to `false`
208209
**`statusCheckAcceptCodes`** | `string` | _Optional_ | If your service's response code is anything other than 2xx, then you can opt to specify an alternative success code. E.g. if you expect your server to return 403, but still want the status indicator to be green, set this value to `403`
210+
**`statusCheckMaxRedirects`** | `number` | _Optional_ | If your service redirects to another page, and you would like status checks to follow redirects, then specify the maximum number of redirects here. Defaults to `0` / will not follow redirects
209211
**`color`** | `string` | _Optional_ | An optional color for the text and font-awesome icon to be displayed in. Note that this will override the current theme and so may not display well
210212
**`backgroundColor`** | `string` | _Optional_ | An optional background fill color for the that given item. Again, this will override the current theme and so might not display well against the background
211213
**`provider`** | `string` | _Optional_ | The name of the provider for a given service, useful for when including hosted apps. In some themes, this is visible under the item name
@@ -220,6 +222,7 @@ For more info, see the **[Authentication Docs](/docs/authentication.md)**
220222
**`options`** | `object` | _Optional_ | Some widgets accept either optional or required additional options. Again, see the [Widget Docs](/docs/widgets.md) for full list of options
221223
**`updateInterval`** | `number` | _Optional_ | You can keep a widget constantly updated by specifying an update interval, in seconds. See [Continuous Updates Docs](/docs/widgets.md#continuous-updates) for more info
222224
**`useProxy`** | `boolean` | _Optional_ | Some widgets make API requests to services that are not CORS-enabled. For these instances, you will need to route requests through a proxy, Dashy has a built in CORS-proxy, which you can use by setting this option to `true`. Defaults to `false`. See the [Proxying Requests Docs](/docs/widgets.md#proxying-requests) for more info
225+
**`timeout`** | `number` | _Optional_ | Request timeout in milliseconds, defaults to ½ a second (`500`)
223226

224227
**[⬆️ Back to Top](#configuring)**
225228

docs/showcase.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@
1616

1717
---
1818

19+
### Hugalafutro Dashy
20+
> By [@hugalafutro](https://github.com/hugalafutro) <sup>[#505](https://github.com/Lissy93/dashy/discussions/505)</sup>
21+
22+
[![hugalafutro-dashy-screenshot](https://i.ibb.co/PDpLDKS/hugalafutro-dashy.gif)](https://i.ibb.co/PDpLDKS/hugalafutro-dashy.gif)
23+
24+
---
25+
1926
### Networking Services
2027
> By [@Lissy93](https://github.com/lissy93)
2128
@@ -126,6 +133,13 @@
126133

127134
---
128135

136+
### Croco_Grievous
137+
> By [u/Croco_Grievous](https://www.reddit.com/user/Croco_Grievous/) <sup>via [reddit](https://www.reddit.com/r/selfhosted/comments/t4xk3z/everything_started_with_pihole_on_a_raspberry_pi/)</sup>
138+
139+
![screenshot-croco-grievous-dashy](https://i.ibb.co/59XR8KL/dashy-Croco-Grievous.png)
140+
141+
---
142+
129143
### Crypto Dash
130144
> Example usage of widgets to monitor cryptocurrencies news, prices and data. Config is [available here](https://gist.github.com/Lissy93/000f712a5ce98f212817d20bc16bab10#file-example-8-dashy-crypto-widgets-conf-yml)
131145
@@ -134,6 +148,13 @@
134148

135149
---
136150

151+
### Stefantigro
152+
> By [u/stefantigro](https://www.reddit.com/user/stefantigro/) <sup>via [reddit](https://www.reddit.com/r/selfhosted/comments/t5oril/been_selfhosting_close_to_half_a_year_now_all/)</sup>
153+
154+
![screenshot-stefantigro-dashy](https://i.ibb.co/1Kb43Yy/dashy-stefantigro.png)
155+
156+
---
157+
137158
### Yet Another Homelab
138159

139160
![screenshot-yet-another-homelab](https://raw.githubusercontent.com/Lissy93/dashy/master/docs/showcase/9-home-lab-oblivion.png)

docs/widgets.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,6 +1289,7 @@ All Glance's based widgets require a `hostname`. All other parameters are option
12891289
**`apiVersion`** | `string` | _Optional_ | Specify an API version, defaults to V `3`. Note that support for older versions is limited
12901290
**`limit`** | `number` | _Optional_ | For widgets that show a time-series chart, optionally limit the number of data points returned. A higher number will show more historical results, but will take longer to load. A value between 300 - 800 is usually optimal
12911291

1292+
Note that if auth is configured, requests must be proxied with `useProxy: true`
12921293
##### Info
12931294
- **CORS**: 🟢 Enabled
12941295
- **Auth**: 🟠 Optional
@@ -1726,6 +1727,12 @@ Vary: Origin
17261727

17271728
---
17281729

1730+
### Setting Timeout
1731+
1732+
Default timeout is ½ a second. This can be overridden with the `timeout` attribute on a widget, specified as an integer in milliseconds.
1733+
1734+
---
1735+
17291736
### Widget Styling
17301737

17311738
Like elsewhere in Dashy, all colours can be easily modified with CSS variables.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Dashy",
3-
"version": "2.0.5",
3+
"version": "2.0.6",
44
"license": "MIT",
55
"main": "server",
66
"author": "Alicia Sykes <[email protected]> (https://aliciasykes.com)",

services/status-check.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,23 @@ const makeErrorMessage2 = (data) => '❌ Service Error - '
2828
+ `${data.status} - ${data.statusText}`;
2929

3030
/* Kicks of a HTTP request, then formats and renders results */
31-
const makeRequest = (url, headers, insecure, acceptCodes, render) => {
31+
const makeRequest = (url, options, render) => {
32+
console.log(options);
33+
const {
34+
headers, enableInsecure, acceptCodes, maxRedirects,
35+
} = options;
3236
const validCodes = acceptCodes && acceptCodes !== 'null' ? acceptCodes : null;
3337
const startTime = new Date();
3438
const requestMaker = axios.create({
3539
httpsAgent: new https.Agent({
36-
rejectUnauthorized: !insecure,
40+
rejectUnauthorized: !enableInsecure,
3741
}),
3842
});
39-
requestMaker.get(url, { headers })
43+
requestMaker.request({
44+
url,
45+
headers,
46+
maxRedirects,
47+
})
4048
.then((response) => {
4149
const statusCode = response.status;
4250
const { statusText } = response;
@@ -100,9 +108,13 @@ module.exports = (paramStr, render) => {
100108
const params = new URLSearchParams(paramStr);
101109
const url = decodeURIComponent(params.get('url'));
102110
const acceptCodes = decodeURIComponent(params.get('acceptCodes'));
111+
const maxRedirects = decodeURIComponent(params.get('maxRedirects')) || 0;
103112
const headers = decodeHeaders(params.get('headers'));
104113
const enableInsecure = !!params.get('enableInsecure');
105114
if (!url || url === 'undefined') immediateError(render);
106-
makeRequest(url, headers, enableInsecure, acceptCodes, render);
115+
const options = {
116+
headers, enableInsecure, acceptCodes, maxRedirects,
117+
};
118+
makeRequest(url, options, render);
107119
}
108120
};

src/App.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div id="dashy">
2+
<div id="dashy" :style="topLevelStyleModifications">
33
<EditModeTopBanner v-if="isEditMode" />
44
<LoadingScreen :isLoading="isLoading" v-if="shouldShowSplash" />
55
<Header :pageInfo="pageInfo" />
@@ -72,6 +72,17 @@ export default {
7272
isEditMode() {
7373
return this.$store.state.editMode;
7474
},
75+
topLevelStyleModifications() {
76+
const vc = this.visibleComponents;
77+
if (!vc.footer && !vc.pageTitle) {
78+
return '--footer-height: 1rem;';
79+
} else if (!vc.footer) {
80+
return '--footer-height: 5rem;';
81+
} else if (!vc.pageTitle) {
82+
return '--footer-height: 4rem;';
83+
}
84+
return '';
85+
},
7586
},
7687
methods: {
7788
/* Injects the users custom CSS as a style tag */

src/components/InteractiveEditor/EditItem.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ export default {
231231
const newItem = item;
232232
newItem.id = this.itemId;
233233
if (newItem.hotkey) newItem.hotkey = parseInt(newItem.hotkey, 10);
234-
const strToTags = (str) => {
235-
const tagArr = str.split(',');
234+
const strToTags = (tags) => {
235+
const tagArr = (typeof tags === 'string') ? tags.split(',') : tags;
236236
return tagArr.map((tag) => tag.trim().toLowerCase().replace(/[^a-z0-9]+/, ''));
237237
};
238238
const strToBool = (str) => {

0 commit comments

Comments
 (0)