π A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!
Vue awesomedashboarddockerhomelabhomepagemitnodejsorganizationproductivitypwaself-hostedstartpagevue
Adds extensions to conf, so that img type can be determined
Alicia Sykesdfdef736e251
diff --git a/src/components/Item.vue b/src/components/Item.vueindex dca35540..4996ba07 100644--- a/src/components/Item.vue+++ b/src/components/Item.vue@@ -7,15 +7,15 @@<div class="overflow-dots">...</div></div><img- v-if="iconType === 'img' && icon"- :src="`/img/item-icons/tile-icons/${icon}.png`"+ v-if="icon"+ :src="getAppropriateImgPath(icon)"class="tile-icon"/>- <img+ <!-- <imgv-else-if="iconType === 'svg' && icon":src="`/img/item-icons/tile-svgs/${icon}.svg`"class="tile-svg"- />+ /> --><!-- <imgv-else-if="fontAwesome":src="`/img/tile-svgs/${svg}.svg`"@@ -35,7 +35,6 @@ export default {subtitle: String, // Optional sub-textdescription: String, // Optional tooltip hover texticon: String, // Optional path to icon, within public/img/tile-icons- iconType: String, // 'img' | 'svg' | 'fa' | undefined, // Type of iconsvg: String, // Optional vector graphic, that is then dynamically filledcolor: String, // Optional background color, specified in hex codeurl: String, // URL to the resource, optional but recommended@@ -50,6 +49,46 @@ export default {getId: this.id,};},+ methods: {+ isUrl(str) {+ const pattern = new RegExp(/(http|https):\/\/(\w+:{0,1}\w*)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%!\-/]))?/);+ return pattern.test(str);+ },+ /* Checks if the icon is from a local image, remote URL, SVG or font-awesome */+ getAppropriateImgPath(img) {+ const imageType = this.determineImageType(img);+ switch (imageType) {+ case 'url':+ return img;+ case 'img':+ return `/img/item-icons/tile-icons/${img}`;+ case 'svg':+ return img;+ case 'fas':+ return img;+ default:+ return '';+ }+ },+ /* Checks if the icon is from a local image, remote URL, SVG or font-awesome */+ determineImageType(img) {+ const fileExtRegex = /(?:\.([^.]+))?$/;+ const validImgExtensions = ['png', 'jpg'];+ let imgType = '';+ if (this.isUrl(img)) {+ imgType = 'url';+ } else if (validImgExtensions.includes(fileExtRegex.exec(img)[1])) {+ imgType = 'img';+ } else if (fileExtRegex.exec(img)[1] === 'svg') {+ imgType = 'svg';+ } else if (img.include('fas')) {+ imgType = 'fas';+ } else {+ imgType = 'none';+ }+ return imgType;+ },+ },mounted() {// Detects overflowing text, and allows is to marguee on hover// The below code is horifically bad, it is embarassing that I wrote it...@@ -60,7 +99,7 @@ export default {if (isOverflowing) {tileElem.className += ' is-overflowing';}- } // Not from present me to past me: WTF?!+ } // Note from present me to past me: WTF?!},};</script>diff --git a/src/data/conf.yml b/src/data/conf.ymlindex 7e45d1b3..23a86408 100644--- a/src/data/conf.yml+++ b/src/data/conf.yml@@ -7,162 +7,136 @@ sections:items:- title: OPNsensedescription: Firewall Central Management- icon: networking/opnsense+ icon: networking/opnsense.pngiconType: imgurl: https://192.168.1.1- title: NetDatadescription: System resource usage on firewall- icon: networking/netdata- iconType: img+ icon: networking/netdata.pngurl: http://192.168.1.1:19999/- title: MalTraildescription: Malicious traffic detection system- icon: networking/maltrail+ icon: networking/maltrail.pngiconType: imgurl: 192.168.1.1:8338- title: Ntopngdescription: Network traffic probe and network use monitor- icon: networking/ntop+ icon: networking/ntop.pngiconType: imgurl: 192.168.1.1:3001- title: Senseidescription: Additional data features- icon: networking/sensei+ icon: networking/sensei.pngiconType: imgurl: https://192.168.1.1/ui/sensei/- title: Monitdescription: Status of firewall system alerts- icon: networking/monit+ icon: networking/monit.pngiconType: imgurl: https://192.168.1.1/ui/monit/status- title: Firewall Logsdescription: Real-time view of firewall data and logs- icon: networking/logs+ icon: networking/logs.pngiconType: imgurl: https://192.168.1.1/ui/diagnostics/firewall/log- title: WireGuarddescription: Manage WireGuard client and server on firewall- icon: networking/wireguard- iconType: img+ icon: networking/wireguard.pngurl: https://192.168.1.1/ui/wireguard/general- name: DNS Deviceitems:- title: Pi-Holedescription: DNS settings for ad & tracker blocking- provider: Cockpit- iconType: img- icon: networking/pihole+ icon: networking/pihole.pngurl: http://192.168.130.2/admin- title: PiAlertdescription: Presence monitoring and ARP scanning- provider: GoAccess- iconType: img- icon: networking/pialert+ icon: networking/pialert.pngurl: http://192.168.130.2/pialert/- title: SmokePingdescription: Network latency monitoring- iconType: img- icon: networking/smokeping+ icon: networking/smokeping.pngurl: http://192.168.130.2:8086/- title: StatPingdescription: Up-time monitoring for local service- iconType: img- icon: networking/statping+ icon: networking/statping.pngurl: http://192.168.130.2:8083/- title: LibreSpeeddescription: Local network speed and latency test- iconType: img- icon: networking/librespeed+ icon: networking/librespeed.pngurl: http://192.168.130.2:49154/- title: NetDatadescription: Real-time system resource usage- iconType: img- icon: networking/netdata+ icon: networking/netdata.pngurl: http://192.168.130.2:19999- title: Portainerdescription: Docker container management- iconType: img- icon: networking/portainer+ icon: networking/portainer.pngurl: http://192.168.130.2:9000/- title: cAdvisordescription: Container monitoring- iconType: img- icon: networking/cadvisor+ icon: networking/cadvisor.pngurl: http://192.168.130.2:8084/- title: Glancesdescription: Simple resource usage- iconType: img- icon: networking/glances+ icon: networking/glances.pngurl: http://192.168.130.2:61208- title: Dozzledescription: Docker container web log viewer- iconType: img- icon: networking/dozzle+ icon: networking/dozzle.pngurl: http://192.168.130.2:8093- title: Prometheusdescription: System Statistics Aggregation with PromQL- iconType: img- icon: networking/prometheus+ icon: networking/prometheus.pngurl: http://192.168.130.2:8090/- title: Grafanadescription: Data visualised on dashboards- iconType: img- icon: networking/grafana+ icon: networking/grafana.pngurl: http://192.168.130.2:8091/- name: Other Devicesitems:- title: Modemdescription: ISP Router Modem Combo- iconType: imgicon: ''url: http://192.168.1.5- title: Wireless Access Pointdescription: View clients connected to WiFiicon: ''- iconType: imgurl: http://192.168.1.109/info.php- title: Fingdescription: Monitor connectivity issues, ISP quality, health checks and troubleshootingprovider: Fingicon: ''- iconType: imgurl: https://app.fing.com/- title: Switchdescription: Manage VLANs on Ubiquity Ethernet switchicon: ''- iconType: imgurl: "/"- name: External Servicesitems:- title: DuckDNSdescription: Dynamic DNS for fixed public IP- icon: networking/duckdns- iconType: img+ icon: networking/duckdns.pngurl: https://www.duckdns.org/- title: BorgBasedescription: Off-site system Borg backups- icon: networking/borgbase- iconType: img+ icon: networking/borgbase.pngurl: https://www.borgbase.com/repositories- title: Mullvaddescription: Hosted VPN provider- icon: networking/mullvad- iconType: img+ icon: networking/mullvad.pngurl: https://mullvad.net/en/account/- title: ZeroTierdescription: Secure networks between devices- icon: networking/zeroteir- iconType: img+ icon: networking/zeroteir.pngurl: https://my.zerotier.com/- title: HealthChecksdescription: Cron Job Monitoring- icon: networking/healthchecks- iconType: img+ icon: networking/healthchecks.pngurl: https://healthchecks.io/checks/- title: ISP - Vodafonedescription: Broadband internet provider- icon: networking/vodafone- iconType: img+ icon: networking/vodafone.pngurl: https://myaccount.vodafone.co.uk/- name: External UtilitiesdisplayData:@@ -171,20 +145,16 @@ sections:- title: Public IPdescription: Check public IP and associated dataicon: ''- iconType: imgurl: https://www.whatismyip.com/- title: Who Is Lookupdescription: Check ICAN info for a given IP address or domainicon: ''- iconType: imgurl: https://whois.domaintools.com/- title: Speed Testdescription: Upload + download speeds and latencyicon: ''- iconType: imgurl: https://speed.cloudflare.com/- title: Mullvad Checkdescription: Confirms a secure connection to Mullvad's WireGuard serversicon: ''- iconType: imgurl: https://mullvad.net/check