mirror of
https://github.com/Lissy93/dashy.git
synced 2024-12-03 03:33:22 +03:00
🔀 Merge pull request #263 from Lissy93/REFACTOR/add-missed-changes
[REFACTOR] Small changes I missed in the previous PR
This commit is contained in:
commit
ff64f711d9
1558
.github/LEGAL.md
vendored
1558
.github/LEGAL.md
vendored
File diff suppressed because it is too large
Load Diff
1
.github/workflows/docs-link-checker.yml
vendored
1
.github/workflows/docs-link-checker.yml
vendored
@ -22,6 +22,7 @@ jobs:
|
||||
- name: Raise an Issue with Results
|
||||
uses: peter-evans/create-issue-from-file@v3
|
||||
with:
|
||||
token: ${{secrets.BOT_GITHUB_TOKEN}}
|
||||
title: '[DOCS] Broken Links found in Documentation'
|
||||
content-filepath: .github/broken-link-report.md
|
||||
labels: '📕 Docs, 👩💻 Good First Issue, 💤 Low Priority, 🤖 Auto'
|
@ -1,32 +1,56 @@
|
||||
# Icons
|
||||
|
||||
Both sections and items can have an icon, which is specified using the `icon` attribute. Using icons improves the aesthetics of your UI and makes the app more intuitive to use. There are several options when it comes to setting icons, and this article outlines each of them
|
||||
Both sections and items can have an icon, which is specified using the `icon` attribute. Using icons improves the aesthetics of your UI and makes the app more intuitive to use. Dashy supports multiple different icon providers, usage instructions for which are explained here.
|
||||
|
||||
- [Auto-Fetched Favicons](#favicons)
|
||||
- [Font Awesome Icons](#font-awesome)
|
||||
- [Simple Icons](#simple-icons)
|
||||
- [Auto-Fetched Favicons](#favicons)
|
||||
- [Generative Icons](#generative-icons)
|
||||
- [Emoji Icons](#emoji-icons)
|
||||
- [Home-Lab Icons](#home-lab-icons)
|
||||
- [Icons by URL](#icons-by-url)
|
||||
- [Local Icons](#local-icons)
|
||||
- [Material Design Icons](#material-design-icons)
|
||||
- [Material Icons](#material-design-icons)
|
||||
- [No Icon](#no-icon)
|
||||
|
||||
<p align="center">
|
||||
<img width="500" src="https://i.ibb.co/GTVmZnc/dashy-example-icons.png" />
|
||||
</p>
|
||||
|
||||
Note that, if you are using icons from an external source (like font-awesome or material-design-icons), then the relevant font file will be loaded in automatically if and when needed, but combining icons from multiple services may have a negative impact on performance.
|
||||
---
|
||||
|
||||
## Favicons
|
||||
Dashy can auto-fetch an icon for a given service, using it's favicon. Just set `icon: favicon` to use this feature.
|
||||
|
||||
<p align="center">
|
||||
<img width="580" src="https://i.ibb.co/k6wyhnB/favicon-icons.png" />
|
||||
</p>
|
||||
|
||||
If the service is hosted under a local IP, then Dashy will attempt to find the favicon from `http://[ip]/favicon.ico`. This has two issues, favicons are not always hosted at the same location for every service, and often the default favicon is sometimes low resolution. Therefore for remote services, by default an API is used to return a high-quality icon for almost any online service.
|
||||
|
||||
The default favicon API is [Favicon Kit](https://faviconkit.com/), a free and reliable service for returning images from any given URL. However several other API's are supported. To change the API used, under `appConfig`, set `faviconApi` to one of the following values:
|
||||
|
||||
- `faviconkit` - [faviconkit.com](https://faviconkit.com/) (Recommend)
|
||||
- `google` - Official Google favicon API service, good support for all sites, but poor quality
|
||||
- `clearbit` - [Clearbit](https://clearbit.com/logo) returns high-quality logos from mainstream websites
|
||||
- `webmasterapi` - [WebMasterAPI](https://www.webmasterapi.com/get-favicons)
|
||||
- `allesedv` - [allesedv.com](https://favicon.allesedv.com/) is a highly efficient IPv6-enabled service
|
||||
|
||||
You can also force Dashy to always get favicons from the root of the domain, and not use an external service, by setting `appConfig.faviconApi` to `local`, although you may face the issue explained above.
|
||||
|
||||
To use a different favicon API for certain items, then set `icon: favicon-[api]`, e.g. `favicon-clearbit`
|
||||
|
||||
If for a given service none of the APIs work in your situation, and nor does local, then the best option is to find the path of the services logo or favicon, and set the icon to the URL of the raw image. For example, `icon: https://monitoring.local/faviconx128.png`- you can find this path using the browser dev tools.
|
||||
|
||||
---
|
||||
|
||||
## Font Awesome
|
||||
You can use any [Font Awesome Icon](https://fontawesome.com/icons) simply by specifying it's identifier. This is in the format of `[category] [name]` and can be found on the page for any given icon on the Font Awesome site. For example: `fas fa-rocket`, `fab fa-monero` or `fas fa-unicorn`.
|
||||
You can use any [Font Awesome Icon](https://fontawesome.com/icons) simply by specifying it's identifier. This is in the format of `[category] [name]` and can be found on the page for that icon on the Font Awesome site. For example: `fas fa-rocket`, `fab fa-monero` or `fas fa-unicorn`.
|
||||
|
||||
Font-Awesome has a wide variety of free icons, but you can also use their pro icons if you have a membership. To do so, you need to specify your license key under: `appConfig.fontAwesomeKey`. This is usually a 10-digit string, for example `13014ae648`.
|
||||
|
||||
<p align="center">
|
||||
<img width="580" src="https://i.ibb.co/pdrw8J4/fontawesome-icons2.png" />
|
||||
<img width="500" src="https://i.ibb.co/tMtwNYZ/fontawesome-icons3.png" />
|
||||
</p>
|
||||
|
||||
---
|
||||
@ -34,6 +58,10 @@ Font-Awesome has a wide variety of free icons, but you can also use their pro ic
|
||||
## Simple Icons
|
||||
[SimpleIcons.org](https://simpleicons.org/) is a collection of 2000+ high quality, free and open source brand and logo SVG icons. Usage of which is very similar to font-awesome icons. First find the glyph you want to use on the [website](https://simpleicons.org/), then just set your icon the the simple icon slug, prefixed with `si-`.
|
||||
|
||||
<p align="center">
|
||||
<img width="580" src="https://i.ibb.co/MVhkXfC/simple-icons-example.png" />
|
||||
</p>
|
||||
|
||||
For example:
|
||||
```yaml
|
||||
sections:
|
||||
@ -51,31 +79,8 @@ sections:
|
||||
|
||||
---
|
||||
|
||||
## Favicons
|
||||
Dashy can auto-fetch the favicon for a given service using it's URL. Just set `icon: favicon` to use this feature. If the services URL is a local IP, then Dashy will attempt to find the favicon from `http://[ip]/favicon.ico`. This has two issues, favicons are not always hosted at the same location for every service, and often the default favicon is a low resolution. Therefore to fix this, for remote services an API is used to return a high-quality icon for any online service.
|
||||
|
||||
<p align="center">
|
||||
<img width="580" src="https://i.ibb.co/k6wyhnB/favicon-icons.png" />
|
||||
</p>
|
||||
|
||||
The default favicon API is [Favicon Kit](https://faviconkit.com/), a free and reliable service for returning images from any given URL. However several other API's are supported. To change the API used, under `appConfig`, set `faviconApi` to one of the following values:
|
||||
|
||||
- `faviconkit` - [faviconkit.com](https://faviconkit.com/) (Recommend)
|
||||
- `google` - Official Google favicon API service, good support for all sites, but poor quality
|
||||
- `clearbit` - [Clearbit](https://clearbit.com/logo) returns high-quality logos from mainstream websites
|
||||
- `webmasterapi` - [WebMasterAPI](https://www.webmasterapi.com/get-favicons)
|
||||
- `allesedv` - [allesedv.com](https://favicon.allesedv.com/) is a highly efficient IPv6-enabled service
|
||||
|
||||
You can also force Dashy to always get favicons from the root of the domain, and not use an external service, by setting `appConfig.faviconApi` to `local`.
|
||||
|
||||
To use a different favicon API for certain items, then set `icon: favicon-[api]`, e.g. `favicon-clearbit`
|
||||
|
||||
If for a given service none of the APIs work in your situation, and nor does local, then the best option is to find the path of the services logo or favicon, and set the icon to the URL of the raw image.
|
||||
|
||||
---
|
||||
|
||||
## Generative Icons
|
||||
Uses a unique and programmatically generated icon for a given service. This is particularly useful when you have a lot of similar services with a different IP or port, and no specific icon. These icons are generated with [DiceBear](https://avatars.dicebear.com/), and use a hash of the services domain/ ip for entropy, so each domain will always have the same icon. To use this option, just set an item's to: `icon: generative`.
|
||||
To uses a unique and programmatically generated icon for a given service just set `icon: generative`. This is particularly useful when you have a lot of similar services with a different IP or port, and no specific icon. These icons are generated with [DiceBear](https://avatars.dicebear.com/), and use a hash of the services domain/ ip for entropy, so each domain will always have the same icon.
|
||||
|
||||
<p align="center">
|
||||
<img width="500" src="https://i.ibb.co/b2pC2CL/generative-icons-2.png" />
|
||||
@ -96,7 +101,7 @@ For example, these will all render the same rocket (🚀) emoji: `icon: ':rocket
|
||||
|
||||
## Home-Lab Icons
|
||||
|
||||
The [dashboard-icons](https://github.com/WalkxCode/dashboard-icons) repo by [@WalkxCode](https://github.com/WalkxCode) provides a comprehensive collection of 360+ high-quality PNG icons for commonly self-hosted services. Dashy natively supports these icons, and you can use them just by specifying the icon name (without extension) preceded by `hl-`. You can see a full list of all available icons [here](https://github.com/WalkxCode/dashboard-icons/tree/master/png).
|
||||
The [dashboard-icons](https://github.com/WalkxCode/dashboard-icons) repo by [@WalkxCode](https://github.com/WalkxCode) provides a comprehensive collection of 360+ high-quality PNG icons for commonly self-hosted services. Dashy natively supports these icons, and you can use them just by specifying the icon name (without extension) preceded by `hl-`. See [here](https://github.com/WalkxCode/dashboard-icons/tree/master/png) for a full list of all available icons. Note that these are fetched and cached strait from GitHub, so if you require offline access, the [Local Icons](#local-icons) method may be a better option for you.
|
||||
|
||||
For example:
|
||||
```yaml
|
||||
@ -121,14 +126,14 @@ sections:
|
||||
---
|
||||
|
||||
## Icons by URL
|
||||
You can also set an icon by passing in a valid URL pointing to the icons location. For example `icon: https://i.ibb.co/710B3Yc/space-invader-x256.png`, this can be in .png, .jpg or .svg format, and hosted anywhere- so long as it's accessible from where you are hosting Dashy. The icon will be automatically scaled to fit, however loading in a lot of large icons may have a negative impact on performance, especially if you visit Dashy from new devices often.
|
||||
You can also set an icon by passing in a valid URL pointing to the icons location. For example `icon: https://i.ibb.co/710B3Yc/space-invader-x256.png`, this can be in .png, .jpg or .svg format, and hosted anywhere (local or remote) - so long as it's accessible from where you are hosting Dashy. The icon will be automatically scaled to fit, however loading in a lot of large icons may have a negative impact on performance, especially if you visit Dashy from new devices often.
|
||||
|
||||
---
|
||||
|
||||
## Local Icons
|
||||
You may also want to store your icons locally, bundled within Dashy so that there is no reliance on outside services. This can be done by putting the icons within Dashy's `./public/item-icons/` directory. If you are using Docker, then the easiest option is to map a volume from your host system, for example: `-v /local/image/directory:/app/public/item-icons/`. To reference an icon stored locally, just specify it's name and extension. For example, if my icon was stored in `/app/public/item-icons/maltrail.png`, then I would just set `icon: maltrail.png`.
|
||||
|
||||
You can also use sub-folders within the `item-icons` directory to keep things organised. You would then specify an icon with it's folder name slash image name. For example: `networking/monit.png`
|
||||
You can also use sub-folders within the `item-icons` directory to keep things organized. You would then specify an icon with it's folder name slash image name. For example: `networking/monit.png`
|
||||
|
||||
---
|
||||
|
||||
@ -154,19 +159,29 @@ sections:
|
||||
## No Icon
|
||||
If you don't wish for a given item or section to have an icon, just leave out the `icon` attribute.
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Icon Collections and Resources
|
||||
|
||||
The following website provide good-quality, free icon sets. To use any of these icons, just copy the link to the raw icon (it should end in `.svg` or `.png`) and paste it as your `icon`, or download and save the icons in `/public/item-icons` or pass through with a Docker volume as described above.
|
||||
Full credit to the authors, please see the licenses for each service for usage and copyright information.
|
||||
The following websites provide good-quality, free icon sets. To use any of these icons, either copy the link to the raw icon (it should end in `.svg` or `.png`) and paste it as your `icon`, or download and save the icons in `/public/item-icons` / mapped Docker volume. Full credit to the authors, please see the licenses for each service for usage and copyright information.
|
||||
|
||||
- [dashboard-icons](https://github.com/WalkxCode/dashboard-icons) - 350+ high-quality icons for commonly self-hosted services, maintained by [@WalkxCode](https://github.com/WalkxCode)
|
||||
- [Icons for Self-Hosted Apps](https://thehomelab.wiki/books/helpful-tools-resources/page/icons-for-self-hosted-dashboards) - 350+ high-quality icons for commonly self-hosted services
|
||||
- [SVG Box](https://svgbox.net/iconsets/) - Cryptocurrency, social media apps and flag icons
|
||||
- [Simple Icons](https://simpleicons.org/) - Free SVG brand icons, with easy API access
|
||||
- [Icons8](https://icons8.com/icons) - Thousands of icons, all with free 64x64 versions
|
||||
- [Flat Icon](https://www.flaticon.com/) - Wide variety of icon sets, almost all free to use
|
||||
- [Material Design Icons](https://github.com/google/material-design-icons/) - Hundreds of Open source PNG + SVG icons by Google
|
||||
- [Icons8](https://icons8.com/icons) - Thousands of icons, all with free versions at 64x64
|
||||
- [Flat Icon](https://www.flaticon.com/) - Wide variety of icon sets, most of which are free to use
|
||||
- [SVG Repo](https://www.svgrepo.com/) - 300,000+ Vector Icons
|
||||
|
||||
If you are a student, then you can get free access to premium icons on [Icon Scout](https://education.github.com/pack/redeem/iconscout-student) or [Icons8](https://icons8.com/github-students) using the GitHub Student Pack.
|
||||
If you are a student, then you can get free access to premium icons on [Icon Scout](https://education.github.com/pack/redeem/iconscout-student) or [Icons8](https://icons8.com/github-students) using the [GitHub Student Pack](https://education.github.com/pack).
|
||||
|
||||
---
|
||||
|
||||
## Notes
|
||||
|
||||
If you are using icons from an external source, these will be fetched on initial page load automatically, if and when needed. But combining icons from multiple services may have a negative impact on performance.
|
||||
|
||||
You can improve load speeds, by downloading your required icons, and serving them locally. Scaling icons to the minimum required dimensions (e.g. 128x128 or 64x64) will also greatly improve application load times.
|
||||
|
||||
For icons from external sources, please see the Privacy Policies and Licenses for that provider.
|
||||
|
||||
|
@ -1,5 +1,9 @@
|
||||
<template>
|
||||
<button @click="click()" :disabled="disabled" :class="disallow ? 'disallowed': ''">
|
||||
<button
|
||||
@click="click ? click() : () => null"
|
||||
:disabled="disabled"
|
||||
:class="disallow ? 'disallowed': ''"
|
||||
>
|
||||
<slot></slot>
|
||||
<slot name="text"></slot>
|
||||
<slot name="icon"></slot>
|
||||
|
@ -273,8 +273,9 @@ export default {
|
||||
&:focus {
|
||||
outline: 2px solid var(--primary);
|
||||
}
|
||||
&.short {
|
||||
height: 18px;
|
||||
&.short:not(.size-large) {
|
||||
height: 2rem;
|
||||
.tile-title { overflow: visible; }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,3 +11,17 @@ export const asciiHash = (input) => {
|
||||
const shortened = asciiSum.slice(0, 30) + asciiSum.slice(asciiSum.length - 30);
|
||||
return window.btoa(shortened);
|
||||
};
|
||||
|
||||
/* Encode potentially malicious characters from string */
|
||||
export const sanitize = (string) => {
|
||||
const map = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
"'": ''',
|
||||
'/': '/',
|
||||
};
|
||||
const reg = /[&<>"'/]/ig;
|
||||
return string.replace(reg, (match) => (map[match]));
|
||||
};
|
||||
|
@ -266,6 +266,15 @@ export default {
|
||||
flex-direction: row;
|
||||
}
|
||||
}
|
||||
&.orientation-horizontal, &.orientation-vertical {
|
||||
@include phone { --content-max-width: 100%; }
|
||||
@include tablet { --content-max-width: 98%; }
|
||||
@include laptop { --content-max-width: 90%; }
|
||||
@include monitor { --content-max-width: 85%; }
|
||||
@include big-screen { --content-max-width: 80%; }
|
||||
@include big-screen-up { --content-max-width: 60%; }
|
||||
max-width: var(--content-max-width, 90%);
|
||||
}
|
||||
|
||||
/* Specify number of columns, based on screen size or user preference */
|
||||
@include phone { --col-count: 1; }
|
||||
|
Loading…
Reference in New Issue
Block a user