This commit is contained in:
Phil 2023-07-30 16:45:34 +02:00
parent 2dc248e16a
commit dd6d68c3ed
76 changed files with 563 additions and 0 deletions

View file

@ -0,0 +1,35 @@
---
# Additional page configuration
# Additional configurations are loaded using its file name, minus the extension, as an anchor (https://<mydashboad>#<config>).
# `config.yml` is still used as a base configuration, and all values here will overwrite it, so you don't have to re-defined everything
subtitle: "this is another dashboard page"
# This overwrites message config. Setting it to empty to remove message from this page and keep it only in the main one:
message: ~
# as we want to include a differente link here (so we can get back to home page), we need to replicate all links or they will be revome when overwriting the links field:
links:
- name: "Home"
icon: "fas fa-home"
url: "#"
- name: "Contribute"
icon: "fab fa-github"
url: "https://github.com/bastienwirtz/homer"
target: "_blank" # optional html a tag target attribute
- name: "Wiki"
icon: "fas fa-book"
url: "https://www.wikipedia.org/"
services:
- name: "More applications on another page!"
icon: "fas fa-cloud"
items:
- name: "Awesome app on a second page!"
logo: "assets/tools/sample.png"
subtitle: "Bookmark example"
tag: "app"
url: "https://www.reddit.com/r/selfhosted/"
target: "_blank"

106
assets/config.yml Normal file
View file

@ -0,0 +1,106 @@
---
# Homepage configuration
# See https://fontawesome.com/v5/search for icons options
title: "hackmi.ch Services"
subtitle: "All the apps."
#logo: "logo.png"
icon: "fas fa-server" # Optional icon
header: true
footer: '<p><a target="_blank" href="https://git.hackmi.ch/Phil/about/src/branch/main/impressum.md">Imprint / Impressum</a></p>' # set false if you want to hide it.
stylesheet:
- "assets/custom.css"
theme: default
colors:
light:
highlight-primary: "#3367d6"
highlight-secondary: "#4285f4"
highlight-hover: "#5a95f5"
background: "#f5f5f5"
card-background: "#ffffff"
text: "#363636"
text-header: "#ffffff"
text-title: "#303030"
text-subtitle: "#424242"
card-shadow: rgba(0, 0, 0, 0.1)
link: "#3273dc"
link-hover: "#363636"
dark:
highlight-primary: "#3367d6"
highlight-secondary: "#4285f4"
highlight-hover: "#5a95f5"
background: "#131313"
card-background: "#2b2b2b"
text: "#eaeaea"
text-header: "#ffffff"
text-title: "#fafafa"
text-subtitle: "#f5f5f5"
card-shadow: rgba(0, 0, 0, 0.4)
link: "#3273dc"
link-hover: "#ffdd57"
#message:
# style: "is-dark"
# title: "Demo !"
# icon: "fa fa-grin"
# content: "This is a dummy homepage demo. <br /> Find more information on <a href='https://github.com/bastienwirtz/homer'>github.com/bastienwirtz/homer</a>"
links:
- name: "Discord"
icon: "fab fa-discord"
url: "https://discord.gg/dm9AqSHFnN"
target: "_blank"
- name: "Status Page"
icon: "fas fa-globe-europe"
url: "https://status.hackmi.ch"
services:
- name: "Public Services"
icon: "fas fa-users"
items:
- name: "Gitserver"
icon: "fas fa-code-branch"
subtitle: "Selfhosted instance of gitea"
url: "https://git.hackmi.ch"
target: "_blank"
- name: "VIP Services"
icon: "fas fa-user-plus"
items:
- name: "Passwordsafe"
icon: "fas fa-key"
subtitle: "Selfhosted instance of vaultwarden"
url: "https://bw.hackmi.ch"
target: "_blank"
- name: "Webmail"
icon: "fas fa-envelope"
subtitle: "Webmail client"
url: "https://webmail.hackmi.ch"
target: "_blank"
- name: "Cloud"
icon: "fas fa-cloud"
subtitle: "Selfhosted nextcloud"
url: "https://cloud.hackmi.ch"
target: "_blank"
- name: "VIP+ Services"
icon: "fas fa-user-check"
items:
- name: "Wiki"
icon: "fas fa-file-medical-alt"
subtitle: "Selfhosted bookstack"
url: "https://wiki.hackmi.ch"
target: "_blank"
- name: "Netbox"
icon: "fas fa-project-diagram"
subtitle: "Selfhosted Netbox"
url: "https://netbox.hackmi.ch"
target: "_blank"
- name: "Gaming panel"
icon: "fas fa-dungeon"
subtitle: "Selfhosted pterodactyl"
url: "https://panel.hackmi.ch"
target: "_blank"

154
assets/custom.css Normal file
View file

@ -0,0 +1,154 @@
@charset "UTF-8";
#app.theme-default.is-dark {
--dracula-background: #282a36;
--dracula-current-line: #44475a;
--dracula-foreground: #f8f8f2;
--dracula-comment: #6272a4;
--dracula-cyan: #8be9fd;
--dracula-green: #50fa7b;
--dracula-orange: #ffb86c;
--dracula-pink: #ff79c6;
--dracula-purple: #bd93f9;
--dracula-red: #ff5555;
--dracula-yellow: #f1fa8c;
--highlight-primary: transparent;
--highlight-secondary: var(--dracula-current-line);
--highlight-hover: var(--dracula-current-line);
--background: var(--dracula-background);
--highlight-hover: var(--dracula-current-line);
--card-background: var(--dracula-current-line);
--text: var(--dracula-foreground);
--text-header: var(--dracula-foreground);
--text-title: var(--dracula-foreground);
--text-subtitle: var(--dracula-cyan);
--link: var(--dracula-green);
--link-hover: var(--dracula-green);
}
/* Header */
/* Comment the following section out if you want no header image. Also, set --highlight-primary to var(--dracula-current-line). */
#app.theme-default.is-dark #bighead {
background-image: url("../assets/dracula-background.png");
background-size: cover;
background-position: center;
}
#app.theme-default.is-dark .logo {
color: var(--dracula-purple);
}
#app.theme-default.is-dark .first-line .headline {
color: var(--dracula-yellow);
}
#app.theme-default.is-dark .navbar-start i {
color: var(--dracula-cyan);
}
#app.theme-default.is-dark [title="Auto-switch"] {
color: var(--dracula-purple);
}
#app.theme-default.is-dark [title="Dark theme"] {
color: var(--dracula-orange);
}
#app.theme-default.is-dark .navbar-item .fa-columns {
color: var(--dracula-green);
}
#app.theme-default.is-dark .navbar-item .fa-list {
color: var(--dracula-cyan);
}
#app.theme-default.is-dark .search-bar .search-label:before {
color: var(--dracula-yellow);
}
#app.theme-default.is-dark .search-bar input {
background-color: var(--dracula-background);
}
#app.theme-default.is-dark .search-bar>input:nth-child(2) {
color: var(--dracula-foreground);
}
#app.theme-default.is-dark .search-bar input:focus-visible {
outline: none;
}
/* Message */
#app.theme-default.is-dark .message-header {
color: var(--dracula-foreground);
background-color: var(--dracula-current-line);
border-style: none none solid none;
border-width: thin;
}
#app.theme-default.is-dark .is-info .message-header {
border-color: var(--dracula-cyan);
}
#app.theme-default.is-dark .is-info .message-header i {
color: var(--dracula-cyan);
}
#app.theme-default.is-dark .is-success .message-header {
border-color: var(--dracula-green);
}
#app.theme-default.is-dark .is-success .message-header i {
color: var(--dracula-green);
}
#app.theme-default.is-dark .is-warning .message-header {
border-color: var(--dracula-orange);
}
#app.theme-default.is-dark .is-warning .message-header i {
color: var(--dracula-orange);
}
#app.theme-default.is-dark .is-danger .message-header {
border-color: var(--dracula-red);
}
#app.theme-default.is-dark .is-danger .message-header i {
color: var(--dracula-red);
}
/* Cards */
#app.theme-default.is-dark .tag {
background-color: var(--dracula-pink);
color: var(--dracula-foreground);
}
#app.theme-default.is-dark .status.unknown::before {
background-color: var(--dracula-yellow);
border-color: var(--dracula-yellow);
box-shadow: 0 0 5px 1px var(--dracula-yellow);
}
#app.theme-default.is-dark .status.bad::before {
background-color: var(--dracula-red);
border-color: var(--dracula-red);
box-shadow: 0 0 5px 1px var(--dracula-red);
}
#app.theme-default.is-dark .status.running::before {
background-color: var(--dracula-green);
border-color: var(--dracula-green);
box-shadow: 0 0 5px 1px var(--dracula-green);
}
/* Footer */
#app.theme-default.is-dark .footer {
color: var(--dracula-foreground);
}

12
assets/icons/README.md Normal file
View file

@ -0,0 +1,12 @@
# PWA Icons / Images
We suggest you to create a svg or png icon (if it is a png icon, with the maximum resolution possible) for your application and use it to generate a favicon package in [Favicon Generator](https://realfavicongenerator.net/).
Once generated, download the ZIP and use android-* icons for pwa-*:
- use `android-chrome-192x192.png` for `pwa-192x192.png`
- use `android-chrome-512x512.png` for `pwa-512x512.png`
- `apple-touch-icon.png` is `apple-touch-icon.png`
- `favicon.ico` is `favicon.ico`
`

BIN
assets/icons/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 B

1
assets/manifest.json Normal file
View file

@ -0,0 +1 @@
{"name":"Homer dashboard","short_name":"Homer","start_url":"../","display":"standalone","background_color":"#ffffff","lang":"en","scope":"../","description":"Home Server Dashboard","theme_color":"#3367D6","icons":[{"src":"./icons/pwa-192x192.png","sizes":"192x192","type":"image/png"},{"src":"./icons/pwa-512x512.png","sizes":"512x512","type":"image/png"}]}

BIN
assets/tools/sample.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
assets/tools/sample2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4 KiB

17
index.html Normal file
View file

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="assets/icons/favicon.ico" />
<link rel="apple-touch-icon" href="assets/icons/apple-touch-icon.png" sizes="180x180">
<link rel="mask-icon" href="assets/icons/logo.svg">
<meta name="viewport" content="width=device-width,initial-scale=1.0,viewport-fit=cover">
<title>Homer</title>
<script type="module" crossorigin src="./resources/index.868de8fa.js"></script>
<link rel="stylesheet" href="./resources/index.8b54b14d.css">
<link rel="manifest" href="./assets/manifest.json" crossorigin="use-credentials"><script id="vite-plugin-pwa:register-sw" src="./registerSW.js"></script></head>
<body>
<div id="app-mount"></div>
</body>
</html>

1
registerSW.js Normal file
View file

@ -0,0 +1 @@
if('serviceWorker' in navigator) {window.addEventListener('load', () => {navigator.serviceWorker.register('./sw.js', { scope: './' })})}

View file

@ -0,0 +1 @@
import{s as l}from"./service.541fc1e6.js";import{_ as m,G as _,r as h,o as n,c as f,w as i,a as c,t as s,b as o,F as r,d,e as p,n as b}from"./index.868de8fa.js";const g={name:"AdGuardHome",mixins:[l],props:{item:Object},components:{Generic:_},data:()=>({status:null,stats:null}),computed:{percentage:function(){return this.stats?(this.stats.num_blocked_filtering*100/this.stats.num_dns_queries).toFixed(2):""},protection:function(){return this.status?this.status.protection_enabled?"enabled":"disabled":"unknown"}},created:function(){this.fetchStatus(),this.item.subtitle||this.fetchStats()},methods:{fetchStatus:async function(){this.status=await this.fetch("/control/status").catch(t=>console.log(t))},fetchStats:async function(){this.stats=await this.fetch("/control/stats").catch(t=>console.log(t))}}},k={class:"title is-4"},x={class:"subtitle is-6"};function y(t,G,e,v,w,a){const u=h("Generic");return n(),f(u,{item:e.item},{content:i(()=>[c("p",k,s(e.item.name),1),c("p",x,[e.item.subtitle?(n(),o(r,{key:0},[d(s(e.item.subtitle),1)],64)):t.stats?(n(),o(r,{key:1},[d(s(a.percentage)+"% blocked ",1)],64)):p("",!0)])]),indicator:i(()=>[c("div",{class:b(["status",a.protection])},s(a.protection),3)]),_:1},8,["item"])}const C=m(g,[["render",y],["__scopeId","data-v-dcd042da"]]);export{C as default};

View file

@ -0,0 +1 @@
.status[data-v-dcd042da]{font-size:.8rem;color:var(--text-title)}.status.enabled[data-v-dcd042da]:before{background-color:#94e185;border-color:#78d965;box-shadow:0 0 4px 1px #94e185}.status.disabled[data-v-dcd042da]:before{background-color:#c9404d;border-color:#c42c3b;box-shadow:0 0 4px 1px #c9404d}.status.unknown[data-v-dcd042da]:before{background-color:#c9c740;border-color:#ccc935;box-shadow:0 0 4px 1px #c9c740}.status[data-v-dcd042da]:before{content:" ";display:inline-block;width:7px;height:7px;margin-right:10px;border:1px solid #000;border-radius:7px}

View file

@ -0,0 +1 @@
.scale[data-v-48b1d4c0]{-webkit-animation:scale-up-48b1d4c0 .3s cubic-bezier(.25,.46,.45,.94) both;animation:scale-up-48b1d4c0 .3s cubic-bezier(.25,.46,.45,.94) both}.is-light i[data-v-48b1d4c0]{color:#000}.is-dark i[data-v-48b1d4c0]{color:#fff}@-webkit-keyframes scale-up-48b1d4c0{0%{-webkit-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.25);transform:scale(1.25)}to{-webkit-transform:scale(1);transform:scale(1)}}@keyframes scale-up-48b1d4c0{0%{-webkit-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.25);transform:scale(1.25)}to{-webkit-transform:scale(1);transform:scale(1)}}

View file

@ -0,0 +1 @@
import{s as r}from"./service.541fc1e6.js";import{_ as c,G as p,r as l,o as d,c as m,w as _,a as o,n as f}from"./index.868de8fa.js";const u={name:"CopyToClipboard",mixins:[r],props:{item:Object},components:{Generic:p},data:()=>({animate:!1}),methods:{copy(){navigator.clipboard.writeText(this.item.clipboard),this.animate=!0}}},C={class:"status"};function v(a,e,t,b,y,s){const n=l("Generic");return d(),m(n,{item:t.item},{indicator:_(()=>[o("div",C,[o("i",{class:f(["fa-regular fa-copy fa-xl",{scale:a.animate}]),onClick:e[0]||(e[0]=i=>s.copy()),onAnimationend:e[1]||(e[1]=i=>a.animate=!1)},null,34)])]),_:1},8,["item"])}const T=c(u,[["render",v],["__scopeId","data-v-48b1d4c0"]]);export{T as default};

View file

@ -0,0 +1 @@
.status[data-v-951da6b7]{font-size:.8rem;color:var(--text-title)}.status.running[data-v-951da6b7]:before{background-color:#94e185;border-color:#78d965;box-shadow:0 0 5px 1px #94e185}.status.dead[data-v-951da6b7]:before{background-color:#c9404d;border-color:#c42c3b;box-shadow:0 0 5px 1px #c9404d}.status[data-v-951da6b7]:before{content:" ";display:inline-block;width:7px;height:7px;margin-right:10px;border:1px solid #000;border-radius:7px}

View file

@ -0,0 +1 @@
import{s as l}from"./service.541fc1e6.js";import{_ as d,G as C,r as b,o as i,c as y,w as a,a as r,t as o,b as n,F as u,d as c,n as _,e as p}from"./index.868de8fa.js";const f={name:"Emby",mixins:[l],props:{item:Object},components:{Generic:C},data:()=>({status:"",albumCount:0,songCount:0,movieCount:0,seriesCount:0,episodeCount:0}),computed:{embyCount:function(){return this.item.libraryType==="music"?`${this.songCount} songs, ${this.albumCount} albums`:this.item.libraryType==="movies"?`${this.movieCount} movies`:this.item.libraryType==="series"?`${this.episodeCount} eps, ${this.seriesCount} series`:"wrong library type \u{1F480}"}},created(){this.fetchServerStatus(),!this.item.subtitle&&this.status!=="dead"&&this.fetchServerMediaStats()},methods:{fetchServerStatus:async function(){this.fetch("/System/info/public").then(t=>{if(t.Id)this.status="running";else throw new Error}).catch(t=>{console.log(t),this.status="dead"})},fetchServerMediaStats:async function(){const t={"X-Emby-Token":this.item.apikey};var e=await this.fetch("/items/counts",{headers:t}).catch(s=>{console.log(s)});this.albumCount=e.AlbumCount,this.songCount=e.SongCount,this.movieCount=e.MovieCount,this.seriesCount=e.SeriesCount,this.episodeCount=e.EpisodeCount}}},v={class:"title is-4"},g={class:"subtitle is-6"};function S(t,e,s,k,E,m){const h=b("Generic");return i(),y(h,{item:s.item},{content:a(()=>[r("p",v,o(s.item.name),1),r("p",g,[s.item.subtitle?(i(),n(u,{key:0},[c(o(s.item.subtitle),1)],64)):(i(),n(u,{key:1},[c(o(m.embyCount),1)],64))])]),indicator:a(()=>[t.status?(i(),n("div",{key:0,class:_(["status",t.status])},o(t.status),3)):p("",!0)]),_:1},8,["item"])}const x=d(f,[["render",S],["__scopeId","data-v-951da6b7"]]);export{x as default};

View file

@ -0,0 +1 @@
import{s as h}from"./service.541fc1e6.js";import{_ as u,G as p,r as l,o as c,c as _,w as f,a as d,b as a,t as n,e as i}from"./index.868de8fa.js";const m={name:"Healthchecks",mixins:[h],props:{item:Object},components:{Generic:p},data:()=>({api:null}),computed:{up:function(){var e;return this.api?(e=this.api.checks)==null?void 0:e.filter(t=>t.status.toLowerCase()==="up").length:""},down:function(){var e;return this.api?(e=this.api.checks)==null?void 0:e.filter(t=>t.status.toLowerCase()==="down").length:""},grace:function(){var e;return this.api?(e=this.api.checks)==null?void 0:e.filter(t=>t.status.toLowerCase()==="grace").length:""}},created(){this.fetchStatus()},methods:{fetchStatus:async function(){if(!this.item.apikey){console.error("apikey is not present in config.yml for the Healthchecks entry!");return}const t={"X-Api-Key":this.item.apikey};this.api=await this.fetch("/api/v1/checks/",{headers:t}).catch(r=>{console.error(r)})}}},k={class:"notifs"},y={key:0,class:"notif up",title:"Up"},g={key:1,class:"notif down",title:"Down"},w={key:2,class:"notif grace",title:"Grace"};function v(e,t,r,x,C,s){const o=l("Generic");return c(),_(o,{item:r.item},{indicator:f(()=>[d("div",k,[s.up>0?(c(),a("strong",y,n(s.up),1)):i("",!0),s.down>0?(c(),a("strong",g,n(s.down),1)):i("",!0),s.grace>0?(c(),a("strong",w,n(s.grace),1)):i("",!0)])]),_:1},8,["item"])}const B=u(m,[["render",v],["__scopeId","data-v-68bdf36c"]]);export{B as default};

View file

@ -0,0 +1 @@
.notifs[data-v-68bdf36c]{position:absolute;color:#fff;font-family:sans-serif;top:.3em;right:.5em}.notifs .notif[data-v-68bdf36c]{display:inline-block;padding:.2em .35em;border-radius:.25em;position:relative;margin-left:.3em;font-size:.8em}.notifs .notif.up[data-v-68bdf36c]{background-color:#4fd671}.notifs .notif.down[data-v-68bdf36c]{background-color:#e51111}.notifs .notif.grace[data-v-68bdf36c]{background-color:#cdd02e}

View file

@ -0,0 +1 @@
import{s as c}from"./service.541fc1e6.js";import{_ as l,G as h,r as d,o as t,c as _,w as f,a as p,b as s,t as o,e as i}from"./index.868de8fa.js";const u={name:"Lidarr",mixins:[c],props:{item:Object},components:{Generic:h},data:()=>({activity:null,warnings:null,errors:null,serverError:!1}),created:function(){this.fetchConfig()},methods:{fetchConfig:function(){this.fetch(`/api/v1/health?apikey=${this.item.apikey}`).then(e=>{this.warnings=0,this.errors=0;for(var r=0;r<e.length;r++)e[r].type=="warning"?this.warnings++:e[r].type=="error"&&this.errors++}).catch(e=>{console.error(e),this.serverError=!0}),this.fetch(`/api/v1/queue/status?apikey=${this.item.apikey}`).then(e=>{this.activity=e.totalCount}).catch(e=>{console.error(e),this.serverError=!0})}}},m={class:"notifs"},y={key:0,class:"notif activity",title:"Activity"},v={key:1,class:"notif warnings",title:"Warning"},g={key:2,class:"notif errors",title:"Error"},k={key:3,class:"notif errors",title:"Connection error to Lidarr API, check url and apikey in config.yml"};function w(e,r,n,C,E,$){const a=d("Generic");return t(),_(a,{item:n.item},{indicator:f(()=>[p("div",m,[e.activity>0?(t(),s("strong",y,o(e.activity),1)):i("",!0),e.warnings>0?(t(),s("strong",v,o(e.warnings),1)):i("",!0),e.errors>0?(t(),s("strong",g,o(e.errors),1)):i("",!0),e.serverError?(t(),s("strong",k,"?")):i("",!0)])]),_:1},8,["item"])}const L=l(u,[["render",w],["__scopeId","data-v-59d968a0"]]);export{L as default};

View file

@ -0,0 +1 @@
.notifs[data-v-59d968a0]{position:absolute;color:#fff;font-family:sans-serif;top:.3em;right:.5em}.notifs .notif[data-v-59d968a0]{display:inline-block;padding:.2em .35em;border-radius:.25em;position:relative;margin-left:.3em;font-size:.8em}.notifs .notif.activity[data-v-59d968a0]{background-color:#4fb5d6}.notifs .notif.warnings[data-v-59d968a0]{background-color:#d08d2e}.notifs .notif.errors[data-v-59d968a0]{background-color:#e51111}

View file

@ -0,0 +1 @@
import{s as m}from"./service.541fc1e6.js";import{_ as h,G as p,r as d,o as s,c as u,w as f,a as l,t as i,b as o,F as n,d as c,e as _}from"./index.868de8fa.js";const y={name:"Mealie",mixins:[m],props:{item:Object},components:{Generic:p},data:()=>({stats:null,meal:null}),created(){this.fetchStatus()},methods:{fetchStatus:async function(){const e={Authorization:"Bearer "+this.item.apikey,Accept:"application/json"};this.item.subtitle==null&&(this.meal=await this.fetch("/api/meal-plans/today/",{headers:e}).catch(t=>console.log(t)),this.stats=await this.fetch("/api/debug/statistics/",{headers:e}).catch(t=>console.log(t)))}}},k={class:"title is-4"},b={class:"subtitle is-6"};function g(e,t,a,B,w,G){const r=d("Generic");return s(),u(r,{item:a.item},{content:f(()=>[l("p",k,i(a.item.name),1),l("p",b,[a.item.subtitle?(s(),o(n,{key:0},[c(i(a.item.subtitle),1)],64)):e.meal?(s(),o(n,{key:1},[c(" Today: "+i(e.meal.name),1)],64)):e.stats?(s(),o(n,{key:2},[c(" happily keeping "+i(e.stats.totalRecipes)+" recipes organized ",1)],64)):_("",!0)])]),_:1},8,["item"])}const S=h(y,[["render",g]]);export{S as default};

View file

@ -0,0 +1 @@
import{s as a}from"./service.541fc1e6.js";import{_ as c,G as l,r as f,o as n,c as d,w as g,a as m,b as s,t,e as o}from"./index.868de8fa.js";const u={name:"Medusa",mixins:[a],props:{item:Object},components:{Generic:l},data:()=>({config:null,serverError:!1}),created:function(){this.fetchConfig()},methods:{fetchConfig:function(){this.fetch("/api/v2/config",{headers:{"X-Api-Key":this.item.apikey}}).then(e=>{this.config=e}).catch(e=>{console.log(e),this.serverError=!0})}}},_={class:"notifs"},h={key:0,class:"notif news",title:"News"},p={key:1,class:"notif warnings",title:"Warning"},y={key:2,class:"notif errors",title:"Error"},k={key:3,class:"notif errors",title:"Connection error to Medusa API, check url and apikey in config.yml"};function v(e,w,r,E,C,B){const i=f("Generic");return n(),d(i,{item:r.item},{indicator:g(()=>[m("div",_,[e.config!==null&&e.config.system.news.unread>0?(n(),s("strong",h,t(e.config.system.news.unread),1)):o("",!0),e.config!==null&&e.config.main.logs.numWarnings>0?(n(),s("strong",p,t(e.config.main.logs.numWarnings),1)):o("",!0),e.config!==null&&e.config.main.logs.numErrors>0?(n(),s("strong",y,t(e.config.main.logs.numErrors),1)):o("",!0),e.serverError?(n(),s("strong",k,"?")):o("",!0)])]),_:1},8,["item"])}const N=c(u,[["render",v],["__scopeId","data-v-0ade670a"]]);export{N as default};

View file

@ -0,0 +1 @@
.notifs[data-v-0ade670a]{position:absolute;color:#fff;font-family:sans-serif;top:.3em;right:.5em}.notifs .notif[data-v-0ade670a]{padding:.2em .35em;border-radius:.25em;position:relative;margin-left:.3em;font-size:.8em}.notifs .notif.news[data-v-0ade670a]{background-color:#777}.notifs .notif.warnings[data-v-0ade670a]{background-color:#d08d2e}.notifs .notif.errors[data-v-0ade670a]{background-color:#e51111}

View file

@ -0,0 +1 @@
.fa-triangle-exclamation[data-v-a18dcc40]:before{color:#d65c68}.progress[data-v-a18dcc40]{height:8px;width:90%}

View file

@ -0,0 +1 @@
import{s as d}from"./service.541fc1e6.js";import{_ as h,G as f,r as y,o as t,c as _,w as p,a,t as i,b as s,F as c,d as m,e as r,n as g,p as k,f as T}from"./index.868de8fa.js";const b={name:"OctoPrint",mixins:[d],props:{item:Object},components:{Generic:f},data:()=>({printTime:null,printTimeLeft:null,completion:null,state:null,printer:null,error:null}),computed:{statusClass:function(){switch(this.state){case"Operational":return"ready";case"Offline":return"offline";case"Printing":return"in-progress";default:return"pending"}}},created(){this.display=this.item.display=="bar"?this.item.display:"text",this.fetchPrinterStatus(),this.fetchStatus()},methods:{fetchStatus:async function(){try{const e=await this.fetch(`api/job?apikey=${this.item.apikey}`);this.printTime=e.progress.printTime,this.printTimeLeft=e.progress.printTimeLeft,this.completion=e.progress.completion,this.state=e.state,this.error=e.error}catch(e){this.error=`Fail to fetch octoprint data (${e.message})`,console.error(e)}},fetchPrinterStatus:async function(){try{const e=await this.fetch(`api/printer?apikey=${this.item.apikey}`);this.printer=e,this.error=e.error}catch(e){this.error=`Fail to fetch octoprint data (${e.message})`,console.error(e)}},toTime:function(e){return new Date(e*1e3).toTimeString().substring(0,5)}}},n=e=>(k("data-v-a18dcc40"),e=e(),T(),e),C={class:"title is-4"},S={class:"subtitle is-6"},v=n(()=>a("i",{class:"fa-solid fa-gear mr-1"},null,-1)),w={key:0},F=n(()=>a("span",{class:"separator mx-1"}," | ",-1)),O=["title"],P=n(()=>a("i",{class:"fa-solid fa-stopwatch mr-1"},null,-1)),L=n(()=>a("i",{class:"fa-solid fa-temperature-half mr-1"},null,-1)),B={key:0},G=n(()=>a("span",{class:"separator mx-1"}," | ",-1)),I={key:1},N=["value","title"],V=["title"],j=["title"];function D(e,$,l,z,E,o){const u=y("Generic");return t(),_(u,{item:l.item,title:e.state},{content:p(()=>[a("p",C,i(l.item.name),1),a("p",S,[l.item.subtitle&&!e.state?(t(),s(c,{key:0},[m(i(l.item.subtitle),1)],64)):r("",!0),!e.error&&e.display=="text"&&o.statusClass=="in-progress"?(t(),s(c,{key:1},[v,e.completion?(t(),s("b",w,i(e.completion.toFixed())+"%",1)):r("",!0),F,e.printTime?(t(),s("span",{key:1,title:`${o.toTime(e.printTimeLeft)} left`},[P,m(" "+i(o.toTime(e.printTime)),1)],8,O)):r("",!0)],64)):r("",!0),!e.error&&e.display=="text"&&o.statusClass=="ready"?(t(),s(c,{key:2},[L,e.printer.temperature.bed?(t(),s("b",B,i(e.printer.temperature.bed.actual.toFixed())+" C",1)):r("",!0),G,e.printer.temperature.tool0?(t(),s("b",I,i(e.printer.temperature.tool0.actual.toFixed())+" C",1)):r("",!0)],64)):r("",!0),!e.error&&e.display=="bar"?(t(),s(c,{key:3},[e.completion?(t(),s("progress",{key:0,class:"progress is-primary",value:e.completion,max:"100",title:`${e.state} - ${e.completion.toFixed()}%, ${o.toTime(e.printTimeLeft)} left`},i(e.completion)+"% ",9,N)):r("",!0)],64)):r("",!0),e.error?(t(),s("span",{key:4,title:e.error},i(e.error),9,V)):r("",!0)])]),indicator:p(()=>[a("i",{class:g(["status",o.statusClass]),title:e.state},null,10,j)]),_:1},8,["item","title"])}const H=h(b,[["render",D],["__scopeId","data-v-a18dcc40"]]);export{H as default};

View file

@ -0,0 +1 @@
.media-left.circle[data-v-4f5d46b6],.media-left.square[data-v-4f5d46b6]{background-color:#e4e4e4}.media-left.circle[data-v-4f5d46b6]{border-radius:90%}.media-left img[data-v-4f5d46b6]{max-height:100%}.error[data-v-4f5d46b6]{color:#de0000}.is-dark .media-left.circle[data-v-4f5d46b6],.is-dark .media-left.square[data-v-4f5d46b6]{background-color:#909090}.location-time[data-v-4f5d46b6]{margin-left:20px}

View file

@ -0,0 +1 @@
import{_ as d,o as a,b as o,a as i,n as r,e as m,t as c}from"./index.868de8fa.js";const h={name:"OpenWeather",props:{item:Object},data:()=>({id:null,icon:null,name:null,temp:null,conditions:null,error:!1,timezoneOffset:0}),computed:{temperature:function(){if(!this.temp)return"";let t="K";return this.item.units==="metric"?t="\xB0C":this.item.units==="imperial"&&(t="\xB0F"),`${this.temp} ${t}`},locationTime:function(){return this.calcTime(this.timezoneOffset)}},created(){this.fetchWeather()},methods:{fetchWeather:async function(){let t;this.item.locationId?t=`id=${this.item.locationId}`:t=`q=${this.item.location}`;const n=this.item.apikey||this.item.apiKey;let s=`https://api.openweathermap.org/data/2.5/weather?${t}&appid=${n}&units=${this.item.units}`;this.item.endpoint&&(s=this.item.endpoint),fetch(s).then(e=>{if(!e.ok)throw Error(e.statusText);return e.json()}).then(e=>{this.id=e.id,this.name=e.name,this.temp=parseInt(e.main.temp).toFixed(1),this.icon=e.weather[0].icon,this.conditions=e.weather[0].description,this.timezoneOffset=e.timezone}).catch(e=>{console.log(e),this.error=!0})},calcTime:t=>{const n=new Date,s=n.getTime()+n.getTimezoneOffset()*6e4;return new Date(s+1e3*t).toLocaleString([],{hour:"2-digit",minute:"2-digit"})}}},u=["href","target"],_={class:"card-content"},p={class:"media"},f={class:"image is-48x48"},g=["src","alt","title"],y={class:"media-content"},v={key:0,class:"error"},T={key:1},k={class:"title is-4"},O={class:"subtitle is-6"},b={class:"location-time"},z={class:"tag-text"};function w(t,n,s,e,W,l){return a(),o("div",null,[i("div",{class:r(["card",s.item.class])},[i("a",{href:`https://openweathermap.org/city/${t.id}`,target:s.item.target,rel:"noreferrer"},[i("div",_,[i("div",p,[t.icon?(a(),o("div",{key:0,class:r(["media-left",s.item.background])},[i("figure",f,[i("img",{src:`https://openweathermap.org/img/wn/${t.icon}@2x.png`,alt:t.conditions,title:t.conditions},null,8,g)])],2)):m("",!0),i("div",y,[t.error?(a(),o("p",v,"Data could not be retrieved")):(a(),o("div",T,[i("p",k,c(t.name),1),i("p",O,[i("span",null,c(l.temperature),1),i("span",b,c(l.locationTime),1)])]))])]),s.item.tag?(a(),o("div",{key:0,class:r(["tag",s.item.tagstyle])},[i("strong",z,"#"+c(s.item.tag),1)],2)):m("",!0)])],8,u)],2)])}const D=d(h,[["render",w],["__scopeId","data-v-4f5d46b6"]]);export{D as default};

View file

@ -0,0 +1 @@
import{s as l}from"./service.541fc1e6.js";import{_ as p,G as u,r as h,o as s,c as d,w as f,a as n,t as i,b as o,F as c,d as r,e as _}from"./index.868de8fa.js";const y={name:"Paperless",mixins:[l],props:{item:Object},components:{Generic:u},data:()=>({api:null}),created(){this.fetchStatus()},methods:{fetchStatus:async function(){if(this.item.subtitle!=null)return;if(!this.item.apikey){console.error("apikey is not present in config.yml for the paperless entry!");return}this.api=await this.fetch("/api/documents/",{headers:{Authorization:"Token "+this.item.apikey}}).catch(a=>console.log(a))}}},k={class:"title is-4"},b={class:"subtitle is-6"};function g(t,a,e,G,x,B){const m=h("Generic");return s(),d(m,{item:e.item},{content:f(()=>[n("p",k,i(e.item.name),1),n("p",b,[e.item.subtitle?(s(),o(c,{key:0},[r(i(e.item.subtitle),1)],64)):t.api?(s(),o(c,{key:1},[r(" happily storing "+i(t.api.count)+" documents ",1)],64)):_("",!0)])]),_:1},8,["item"])}const C=p(y,[["render",g]]);export{C as default};

View file

@ -0,0 +1 @@
import{s as l}from"./service.541fc1e6.js";import{_ as p,G as h,r as y,o as s,c as f,w as o,a as r,t as a,b as i,F as d,d as _,e as m,n as g}from"./index.868de8fa.js";const k={name:"PiHole",mixins:[l],props:{item:Object},components:{Generic:h},data:()=>({status:"",ads_percentage_today:0}),computed:{percentage:function(){return this.ads_percentage_today?this.ads_percentage_today.toFixed(1):""}},created(){this.fetchStatus()},methods:{fetchStatus:async function(){const t=this.item.apikey?`?summaryRaw&auth=${this.item.apikey}`:"",c=await this.fetch(`/api.php${t}`).catch(e=>console.log(e));this.status=c.status,this.ads_percentage_today=c.ads_percentage_today}}},b={class:"title is-4"},v={class:"subtitle is-6"};function x(t,c,e,w,B,n){const u=y("Generic");return s(),f(u,{item:e.item},{content:o(()=>[r("p",b,a(e.item.name),1),r("p",v,[e.item.subtitle?(s(),i(d,{key:0},[_(a(e.item.subtitle),1)],64)):n.percentage?(s(),i(d,{key:1},[_(a(n.percentage)+"% blocked ",1)],64)):m("",!0)])]),indicator:o(()=>[t.status?(s(),i("div",{key:0,class:g(["status",t.status])},a(t.status),3)):m("",!0)]),_:1},8,["item"])}const P=p(k,[["render",x],["__scopeId","data-v-7e5d4f57"]]);export{P as default};

View file

@ -0,0 +1 @@
.status[data-v-7e5d4f57]{font-size:.8rem;color:var(--text-title)}.status.enabled[data-v-7e5d4f57]:before{background-color:#94e185;border-color:#78d965;box-shadow:0 0 5px 1px #94e185}.status.disabled[data-v-7e5d4f57]:before{background-color:#c9404d;border-color:#c42c3b;box-shadow:0 0 5px 1px #c9404d}.status[data-v-7e5d4f57]:before{content:" ";display:inline-block;width:7px;height:7px;margin-right:10px;border:1px solid #000;border-radius:7px}

View file

@ -0,0 +1 @@
import{s as o}from"./service.541fc1e6.js";import{_ as a,G as c,r as i,o as e,c as r,w as m,b as p,n as u,t as d,e as h}from"./index.868de8fa.js";const _={name:"Ping",mixins:[o],props:{item:Object},components:{Generic:c},data:()=>({status:null}),created(){this.fetchStatus()},methods:{fetchStatus:async function(){const t=typeof this.item.method=="string"?this.item.method.toUpperCase():"HEAD";if(!["GET","HEAD","OPTION"].includes(t)){console.error(`Ping: ${t} is not a supported HTTP method`);return}this.fetch("/",{method:t,cache:"no-cache"},!1).then(()=>{this.status="online"}).catch(()=>{this.status="offline"})}}};function l(t,f,s,g,v,y){const n=i("Generic");return e(),r(n,{item:s.item},{indicator:m(()=>[t.status?(e(),p("div",{key:0,class:u(["status",t.status])},d(t.status),3)):h("",!0)]),_:1},8,["item"])}const G=a(_,[["render",l],["__scopeId","data-v-25516c40"]]);export{G as default};

View file

@ -0,0 +1 @@
.status[data-v-25516c40]{font-size:.8rem;color:var(--text-title);white-space:nowrap;margin-left:.25rem}.status.online[data-v-25516c40]:before{background-color:#94e185;border-color:#78d965;box-shadow:0 0 5px 1px #94e185}.status.offline[data-v-25516c40]:before{background-color:#c9404d;border-color:#c42c3b;box-shadow:0 0 5px 1px #c9404d}.status[data-v-25516c40]:before{content:" ";display:inline-block;width:7px;height:7px;margin-right:10px;border:1px solid #000;border-radius:7px}

View file

@ -0,0 +1 @@
import{s as h}from"./service.541fc1e6.js";import{_ as l,G as _,r as f,o as s,c as m,w as p,a as g,b as o,t as a,e as c}from"./index.868de8fa.js";const y={name:"Portainer",mixins:[h],props:{item:Object},components:{Generic:_},data:()=>({endpoints:null,containers:null}),computed:{running:function(){return this.containers?this.containers.filter(e=>e.State.toLowerCase()==="running").length:""},dead:function(){return this.containers?this.containers.filter(e=>e.State.toLowerCase()==="dead").length:""},misc:function(){return this.containers?this.containers.filter(e=>e.State.toLowerCase()!=="running"&&e.State.toLowerCase()!=="dead").length:""}},created(){this.fetchStatus()},methods:{fetchStatus:async function(){const e={"X-Api-Key":this.item.apikey};this.endpoints=await this.fetch("/api/endpoints",{headers:e}).catch(n=>{console.error(n)});let i=[];for(let n of this.endpoints){if(this.item.environments&&!this.item.environments.includes(n.Name))continue;const d=`/api/endpoints/${n.Id}/docker/containers/json?all=1`,r=await this.fetch(d,{headers:e}).catch(t=>{console.error(t)});r&&(i=i.concat(r))}this.containers=i}}},k={class:"notifs"},v={key:0,class:"notif running",title:"Running"},w={key:1,class:"notif dead",title:"Dead"},C={key:2,class:"notif misc",title:"Other (creating, paused, exited, etc.)"};function x(e,i,n,d,r,t){const u=f("Generic");return s(),m(u,{item:n.item},{indicator:p(()=>[g("div",k,[t.running>0?(s(),o("strong",v,a(t.running),1)):c("",!0),t.dead>0?(s(),o("strong",w,a(t.dead),1)):c("",!0),t.misc>0?(s(),o("strong",C,a(t.misc),1)):c("",!0)])]),_:1},8,["item"])}const G=l(y,[["render",x],["__scopeId","data-v-36a39228"]]);export{G as default};

View file

@ -0,0 +1 @@
.notifs[data-v-36a39228]{position:absolute;color:#fff;font-family:sans-serif;top:.3em;right:.5em}.notifs .notif[data-v-36a39228]{display:inline-block;padding:.2em .35em;border-radius:.25em;position:relative;margin-left:.3em;font-size:.8em}.notifs .notif.running[data-v-36a39228]{background-color:#4fd671}.notifs .notif.dead[data-v-36a39228]{background-color:#e51111}.notifs .notif.misc[data-v-36a39228]{background-color:#2ed0c8}

View file

@ -0,0 +1 @@
.media-left .image[data-v-f5b9c928]{display:flex;align-items:center}.media-left img[data-v-f5b9c928]{max-height:100%}.status[data-v-f5b9c928]{font-size:.8rem;color:var(--text-title)}.status.firing[data-v-f5b9c928]:before{background-color:#d65c68;border-color:#e87d88;box-shadow:0 0 5px 1px #d65c68}.status.pending[data-v-f5b9c928]:before{background-color:#e8bb7d;border-color:#d6a35c;box-shadow:0 0 5px 1px #e8bb7d}.status.inactive[data-v-f5b9c928]:before{background-color:#8fe87d;border-color:#70d65c;box-shadow:0 0 5px 1px #8fe87d}.status[data-v-f5b9c928]:before{content:" ";display:inline-block;width:7px;height:7px;margin-right:10px;border:1px solid #000;border-radius:7px}

View file

@ -0,0 +1 @@
import{s as m}from"./service.541fc1e6.js";import{_ as p,G as _,r as g,o as c,c as v,w as o,a as u,t as a,b as r,F as l,d,e as f,n as b}from"./index.868de8fa.js";const n=Object.freeze({firing:"firing",pending:"pending",inactive:"inactive"}),y={name:"Prometheus",mixins:[m],props:{item:Object},components:{Generic:_},data:()=>({api:{status:"",count:0,alerts:{firing:0,inactive:0,pending:0}}}),computed:{count:function(){return this.countFiring()||this.countPending()||this.countInactive()||0},level:function(){return this.countFiring()?n.firing:this.countPending()?n.pending:n.inactive}},created(){this.fetchStatus()},methods:{fetchStatus:async function(){this.api=await this.fetch("api/v1/alerts").catch(t=>console.log(t))},countFiring:function(){var t,i;return this.api?(i=(t=this.api.data)==null?void 0:t.alerts)==null?void 0:i.filter(e=>e.state===n.firing).length:0},countPending:function(){var t,i;return this.api?(i=(t=this.api.data)==null?void 0:t.alerts)==null?void 0:i.filter(e=>e.state===n.pending).length:0},countInactive:function(){var t,i;return this.api?(i=(t=this.api.data)==null?void 0:t.alerts)==null?void 0:i.filter(e=>e.state===n.pending).length:0}}},k={class:"title is-4"},P={class:"subtitle is-6"};function x(t,i,e,F,B,s){const h=g("Generic");return c(),v(h,{item:e.item},{content:o(()=>[u("p",k,a(e.item.name),1),u("p",P,[e.item.subtitle?(c(),r(l,{key:0},[d(a(e.item.subtitle),1)],64)):t.api?(c(),r(l,{key:1},[d(a(s.count)+" "+a(s.level)+" alerts ",1)],64)):f("",!0)])]),indicator:o(()=>[t.api?(c(),r("div",{key:0,class:b(["status",s.level])},a(s.count),3)):f("",!0)]),_:1},8,["item"])}const S=p(y,[["render",x],["__scopeId","data-v-f5b9c928"]]);export{S as default};

View file

@ -0,0 +1 @@
.notifs[data-v-d43ad11a]{position:absolute;color:#fff;font-family:sans-serif;top:.3em;right:.5em}.notifs .notif[data-v-d43ad11a]{display:inline-block;padding:.2em .35em;border-radius:.25em;position:relative;margin-left:.3em;font-size:.8em}.notifs .notif.warnings[data-v-d43ad11a]{background-color:#d08d2e}.notifs .notif.errors[data-v-d43ad11a]{background-color:#e51111}

View file

@ -0,0 +1 @@
import{s as c}from"./service.541fc1e6.js";import{_ as l,G as _,r as d,o as t,c as f,w as p,a as h,b as s,t as n,e as o}from"./index.868de8fa.js";const m={name:"Prowlarr",mixins:[c],props:{item:Object},components:{Generic:_},data:()=>({warnings:null,errors:null,serverError:!1}),created:function(){this.fetchConfig()},methods:{fetchConfig:function(){this.fetch(`/api/v1/health?apikey=${this.item.apikey}`).then(r=>{this.warnings=0,this.errors=0;for(var e=0;e<r.length;e++)r[e].type=="warning"?this.warnings++:r[e].type=="error"&&this.errors++}).catch(r=>{console.error(r),this.serverError=!0})}}},g={class:"notifs"},u={key:0,class:"notif warnings",title:"Warning"},w={key:1,class:"notif errors",title:"Error"},y={key:2,class:"notif errors",title:"Connection error to Prowlarr API, check url and apikey in config.yml"};function v(r,e,i,k,C,E){const a=d("Generic");return t(),f(a,{item:i.item},{indicator:p(()=>[h("div",g,[r.warnings>0?(t(),s("strong",u,n(r.warnings),1)):o("",!0),r.errors>0?(t(),s("strong",w,n(r.errors),1)):o("",!0),r.serverError?(t(),s("strong",y," ? ")):o("",!0)])]),_:1},8,["item"])}const G=l(m,[["render",v],["__scopeId","data-v-d43ad11a"]]);export{G as default};

View file

@ -0,0 +1 @@
.is-number[data-v-527b8e5d]{font-family:Lato}.healthy[data-v-527b8e5d]{color:green}.warning[data-v-527b8e5d]{color:orange}.danger[data-v-527b8e5d]{color:red}.metrics .margined[data-v-527b8e5d]:not(:first-child){margin-left:.3rem}.is-small[data-v-527b8e5d]{font-size:small}

View file

@ -0,0 +1 @@
import{s as g}from"./service.541fc1e6.js";import{_ as p,G as y,r as k,o as e,c as w,w as m,a as i,t as r,b as t,F as u,d as l,n as h,e as d,p as x,f as b}from"./index.868de8fa.js";const v={name:"Proxmox",mixins:[g],props:{item:Object},components:{Generic:y},data:()=>({vms:{total:0,running:0},lxcs:{total:0,running:0},memoryUsed:0,diskUsed:0,cpuUsed:0,hide:[],error:!1,loading:!0}),created(){this.item.hide&&(this.hide=this.item.hide),this.fetchStatus()},methods:{statusClass(s){return s>this.item.danger_value?"danger":s>this.item.warning_value?"warning":"healthy"},fetchStatus:async function(){try{const s={headers:{Authorization:this.item.api_token}},n=await this.fetch(`/api2/json/nodes/${this.item.node}/status`,s),a=this.item.hide_decimals?0:1;if(this.memoryUsed=(n.data.memory.used*100/n.data.memory.total).toFixed(a),this.diskUsed=(n.data.rootfs.used*100/n.data.rootfs.total).toFixed(a),this.cpuUsed=(n.data.cpu*100).toFixed(a),this.isValueShown("vms")){const c=await this.fetch(`/api2/json/nodes/${this.item.node}/qemu`,s);this.parseVMsAndLXCs(c,this.vms)}if(this.isValueShown("lxcs")){const c=await this.fetch(`/api2/json/nodes/${this.item.node}/lxc`,s);this.parseVMsAndLXCs(c,this.lxcs)}this.error=!1}catch(s){console.log(s),this.error=!0}this.loading=!1},parseVMsAndLXCs(s,n){n.total+=s.data.length,n.running+=s.data.filter(a=>a.status==="running").length,n.total==0&&this.hide.push("lxcs")},isValueShown(s){return this.hide.indexOf(s)==-1}}},_=s=>(x("data-v-527b8e5d"),s=s(),b(),s),S={class:"title is-4"},V={class:"subtitle is-6"},C={key:0},U=_(()=>i("strong",null,"Loading...",-1)),F=[U],L={key:1},M=_(()=>i("strong",{class:"danger"},"Error loading info",-1)),j=[M],A={key:0,class:"margined"},B={class:"is-number"},G={class:"has-text-weight-bold"},I={key:0},P={key:1,class:"margined"},X={class:"is-number"},z={class:"has-text-weight-bold"},N={key:0},D={key:2,class:"margined"},E={key:3,class:"margined"},O={key:4,class:"margined"},T={key:0,class:"fa fa-circle-notch fa-spin fa-2xl"},q={key:1,class:"fa fa-exclamation-circle fa-2xl danger"};function H(s,n,a,c,J,o){const f=k("Generic");return e(),w(f,{item:a.item},{content:m(()=>[i("p",S,r(a.item.name),1),i("p",V,[a.item.subtitle?(e(),t(u,{key:0},[l(r(a.item.subtitle),1)],64)):s.vms?(e(),t(u,{key:1},[s.loading?(e(),t("div",C,F)):s.error?(e(),t("div",L,j)):(e(),t("div",{key:2,class:h(["metrics",{"is-size-7-mobile":a.item.small_font_on_small_screens,"is-small":a.item.small_font_on_desktop}])},[o.isValueShown("vms")?(e(),t("span",A,[l("VMs: "),i("span",B,[i("span",G,r(s.vms.running),1),o.isValueShown("vms_total")?(e(),t("span",I,"/"+r(s.vms.total),1)):d("",!0)])])):d("",!0),o.isValueShown("lxcs")?(e(),t("span",P,[l("LXCs: "),i("span",X,[i("span",z,r(s.lxcs.running),1),o.isValueShown("lxcs_total")?(e(),t("span",N,"/"+r(s.lxcs.total),1)):d("",!0)])])):d("",!0),o.isValueShown("disk")?(e(),t("span",D,[l("Disk: "),i("span",{class:h(["has-text-weight-bold is-number",o.statusClass(s.diskUsed)])},r(s.diskUsed)+"%",3)])):d("",!0),o.isValueShown("mem")?(e(),t("span",E,[l("Mem: "),i("span",{class:h(["has-text-weight-bold is-number",o.statusClass(s.memoryUsed)])},r(s.memoryUsed)+"%",3)])):d("",!0),o.isValueShown("cpu")?(e(),t("span",O,[l("CPU: "),i("span",{class:h(["has-text-weight-bold is-number",o.statusClass(s.cpuUsed)])},r(s.cpuUsed)+"%",3)])):d("",!0)],2))],64)):d("",!0)])]),indicator:m(()=>[s.loading?(e(),t("i",T)):d("",!0),s.error?(e(),t("i",q)):d("",!0)]),_:1},8,["item"])}const R=p(v,[["render",H],["__scopeId","data-v-527b8e5d"]]);export{R as default};

View file

@ -0,0 +1 @@
.notifs[data-v-f98dd4f0]{position:absolute;color:#fff;font-family:sans-serif;top:.3em;right:.5em}.notifs .notif[data-v-f98dd4f0]{display:inline-block;padding:.2em .35em;border-radius:.25em;position:relative;margin-left:.3em;font-size:.8em}.notifs .notif.activity[data-v-f98dd4f0]{background-color:#4fb5d6}.notifs .notif.warnings[data-v-f98dd4f0]{background-color:#d08d2e}.notifs .notif.errors[data-v-f98dd4f0]{background-color:#e51111}

View file

@ -0,0 +1 @@
import{s as c}from"./service.541fc1e6.js";import{_ as h,G as l,r as f,o as r,c as d,w as p,a as _,b as i,t as o,e as s}from"./index.868de8fa.js";const m="/api/v3",y="/api",v={name:"Radarr",mixins:[c],props:{item:Object},components:{Generic:l},data:()=>({activity:null,warnings:null,errors:null,serverError:!1}),created:function(){this.fetchConfig()},computed:{apiPath(){return this.item.legacyApi?y:m}},methods:{fetchConfig:function(){this.fetch(`${this.apiPath}/health?apikey=${this.item.apikey}`).then(t=>{this.warnings=0,this.errors=0;for(var e=0;e<t.length;e++)t[e].type=="warning"?this.warnings++:t[e].type=="error"&&this.errors++}).catch(t=>{console.error(t),this.serverError=!0}),this.fetch(`${this.apiPath}/queue?apikey=${this.item.apikey}`).then(t=>{if(this.activity=0,this.item.legacyApi)for(var e=0;e<t.length;e++)t[e].movie&&this.activity++;else this.activity=t.totalRecords}).catch(t=>{console.error(t),this.serverError=!0})}}},g={class:"notifs"},u={key:0,class:"notif activity",title:"Activity"},k={key:1,class:"notif warnings",title:"Warning"},w={key:2,class:"notif errors",title:"Error"},A={key:3,class:"notif errors",title:"Connection error to Radarr API, check url and apikey in config.yml"};function C(t,e,n,E,$,P){const a=f("Generic");return r(),d(a,{item:n.item},{indicator:p(()=>[_("div",g,[t.activity>0?(r(),i("strong",u,o(t.activity),1)):s("",!0),t.warnings>0?(r(),i("strong",k,o(t.warnings),1)):s("",!0),t.errors>0?(r(),i("strong",w,o(t.errors),1)):s("",!0),t.serverError?(r(),i("strong",A,"?")):s("",!0)])]),_:1},8,["item"])}const B=h(v,[["render",C],["__scopeId","data-v-f98dd4f0"]]);export{B as default};

View file

@ -0,0 +1 @@
import{_ as p,G as f,r as g,o as n,c as y,w as h,a,t as i,b as o,F as c,d as r,e as v,p as w,f as C}from"./index.868de8fa.js";const u=["B","kiB","MiB","GiB"],d=t=>{let e=0;for(;t>1e3&&e<u.length;)t/=1e3,e++;return Intl.NumberFormat(void 0,{maximumFractionDigits:2}).format(t||0)+` ${u[e]}/s`},I={name:"rTorrent",props:{item:Object},components:{Generic:f},data:()=>({dl:null,ul:null,count:null,error:null}),computed:{downRate:function(){return d(this.dl)},upRate:function(){return d(this.ul)}},created(){const t=parseInt(this.item.rateInterval,10)||0,e=parseInt(this.item.torrentInterval,10)||0;t>0&&setInterval(()=>this.fetchRates(),t),e>0&&setInterval(()=>this.fetchCount(),e),this.fetchRates(),this.fetchCount()},methods:{fetchRates:async function(){this.getRate("throttle.global_up.rate").then(t=>this.ul=t).catch(()=>this.error=!0),this.getRate("throttle.global_down.rate").then(t=>this.dl=t).catch(()=>this.error=!0)},fetchCount:async function(){this.getCount().catch(()=>this.error=!0)},getRate:async function(t){return this.getXml(t).then(e=>parseInt(e.getElementsByTagName("value")[0].firstChild.textContent,10))},getCount:async function(){return this.getXml("download_list").then(t=>{const e=t.getElementsByTagName("array");this.count=e?e[0].getElementsByTagName("value").length:0})},getXml:async function(t){const e={"Content-Type":"text/xml"};return this.item.username&&this.item.password&&(e.Authorization=`${this.item.username}:${this.item.password}`),fetch(`${this.item.xmlrpc.replace(/\/$/,"")}/RPC2`,{method:"POST",headers:e,body:`<methodCall><methodName>${t}</methodName></methodCall>`}).then(s=>{if(!s.ok)throw Error(s.statusText);return s.text()}).then(s=>Promise.resolve(new DOMParser().parseFromString(s,"text/xml")))}}},m=t=>(w("data-v-da29e937"),t=t(),C(),t),R={class:"title is-4"},x={class:"subtitle is-6"},B={key:0,class:"error"},k={class:"down"},N=m(()=>a("i",{class:"fas fa-download"},null,-1)),T={class:"up"},b=m(()=>a("i",{class:"fas fa-upload"},null,-1)),E={key:0,class:"count"};function S(t,e,s,$,F,l){const _=g("Generic");return n(),y(_,{item:s.item},{content:h(()=>[a("p",R,i(s.item.name),1),a("p",x,[t.error?(n(),o("span",B,"An error has occurred.")):(n(),o(c,{key:1},[a("span",k,[N,r(" "+i(l.downRate),1)]),a("span",T,[b,r(" "+i(l.upRate),1)])],64))])]),indicator:h(()=>[t.error?v("",!0):(n(),o("span",E,[r(i(t.count)+" ",1),t.count===1?(n(),o(c,{key:0},[r("torrent")],64)):(n(),o(c,{key:1},[r("torrents")],64))]))]),_:1},8,["item"])}const P=p(I,[["render",S],["__scopeId","data-v-da29e937"]]);export{P as default};

View file

@ -0,0 +1 @@
.error[data-v-da29e937]{color:#e51111!important}.down[data-v-da29e937]{margin-right:1em}.count[data-v-da29e937]{color:var(--text);font-size:.8em}

View file

@ -0,0 +1 @@
import{s as i}from"./service.541fc1e6.js";import{_ as c,G as d,r as l,o as s,c as _,w as f,a as u,b as o,t as m,e as a}from"./index.868de8fa.js";const h={name:"SABnzbd",mixins:[i],props:{item:Object},components:{Generic:d},data:()=>({stats:null,error:!1}),computed:{downloads:function(){return this.stats?this.stats.noofslots:""}},created(){const t=parseInt(this.item.downloadInterval,10)||0;t>0&&setInterval(()=>this.fetchStatus(),t),this.fetchStatus()},methods:{fetchStatus:async function(){try{const t=await this.fetch(`/api?output=json&apikey=${this.item.apikey}&mode=queue`);this.error=!1,this.stats=t.queue}catch(t){this.error=!0,console.error(t)}}}},p={class:"notifs"},w=["title"],v={key:1,class:"notif error fa-solid fa-triangle-exclamation",title:"Unable to fetch current status"};function y(t,k,n,B,S,e){const r=l("Generic");return s(),_(r,{item:n.item},{indicator:f(()=>[u("div",p,[e.downloads>0?(s(),o("strong",{key:0,class:"notif downloading",title:`${e.downloads} active download${e.downloads>1?"s":""}`},m(e.downloads),9,w)):a("",!0),t.error?(s(),o("i",v)):a("",!0)])]),_:1},8,["item"])}const g=c(h,[["render",y],["__scopeId","data-v-f2083280"]]);export{g as default};

View file

@ -0,0 +1 @@
.notifs[data-v-f2083280]{position:absolute;color:#fff;font-family:sans-serif;top:.3em;right:.5em}.notifs .notif[data-v-f2083280]{display:inline-block;padding:.2em .35em;border-radius:.25em;position:relative;margin-left:.3em;font-size:.8em}.notifs .notif.downloading[data-v-f2083280]{background-color:#4fb5d6}.notifs .notif.error[data-v-f2083280]{border-radius:50%;aspect-ratio:1;background-color:#e51111}

View file

@ -0,0 +1 @@
.notifs[data-v-6eb7a9ad]{position:absolute;color:#fff;font-family:sans-serif;top:.3em;right:.5em}.notifs .notif[data-v-6eb7a9ad]{display:inline-block;padding:.2em .35em;border-radius:.25em;position:relative;margin-left:.3em;font-size:.8em}.notifs .notif.activity[data-v-6eb7a9ad]{background-color:#4fb5d6}.notifs .notif.warnings[data-v-6eb7a9ad]{background-color:#d08d2e}.notifs .notif.errors[data-v-6eb7a9ad]{background-color:#e51111}

View file

@ -0,0 +1 @@
import{s as c}from"./service.541fc1e6.js";import{_ as h,G as l,r as p,o as r,c as f,w as _,a as d,b as s,t as o,e as i}from"./index.868de8fa.js";const y="/api/v3",m="/api",g={name:"Sonarr",mixins:[c],props:{item:Object},components:{Generic:l},computed:{apiPath(){return this.item.legacyApi?m:y}},data:()=>({activity:null,warnings:null,errors:null,serverError:!1}),created:function(){this.fetchConfig()},methods:{fetchConfig:function(){this.fetch(`${this.apiPath}/health?apikey=${this.item.apikey}`).then(t=>{this.warnings=0,this.errors=0;for(var e=0;e<t.length;e++)t[e].type=="warning"?this.warnings++:t[e].type=="error"&&this.errors++}).catch(t=>{console.error(t),this.serverError=!0}),this.fetch(`${this.apiPath}/queue?apikey=${this.item.apikey}`).then(t=>{if(this.activity=0,this.item.legacyApi)for(var e=0;e<t.length;e++)t[e].series&&this.activity++;else this.activity=t.totalRecords}).catch(t=>{console.error(t),this.serverError=!0})}}},v={class:"notifs"},u={key:0,class:"notif activity",title:"Activity"},k={key:1,class:"notif warnings",title:"Warning"},w={key:2,class:"notif errors",title:"Error"},A={key:3,class:"notif errors",title:"Connection error to Sonarr API, check url and apikey in config.yml"};function C(t,e,n,E,$,P){const a=p("Generic");return r(),f(a,{item:n.item},{indicator:_(()=>[d("div",v,[t.activity>0?(r(),s("strong",u,o(t.activity),1)):i("",!0),t.warnings>0?(r(),s("strong",k,o(t.warnings),1)):i("",!0),t.errors>0?(r(),s("strong",w,o(t.errors),1)):i("",!0),t.serverError?(r(),s("strong",A," ? ")):i("",!0)])]),_:1},8,["item"])}const b=h(g,[["render",C],["__scopeId","data-v-6eb7a9ad"]]);export{b as default};

View file

@ -0,0 +1 @@
import{s as r}from"./service.541fc1e6.js";import{_ as d,G as l,r as p,o as c,c as m,w as f,a as e,t as s,b as u,F as h,d as o,e as _}from"./index.868de8fa.js";const w={name:"SpeedtestTracker",mixins:[r],props:{item:Object},components:{Generic:l},data:()=>({speedtest:null}),computed:{download:function(){var t;return this.format((t=this.speedtest)==null?void 0:t.download)},upload:function(){var t;return this.format((t=this.speedtest)==null?void 0:t.upload)},ping:function(){var t;return this.format((t=this.speedtest)==null?void 0:t.ping)}},created(){this.fetchStatus()},methods:{fetchStatus:async function(){this.fetch("/api/speedtest/latest").then(t=>{this.speedtest=t.data}).catch(t=>console.log(t))},format:function(t){return t?parseFloat(t).toFixed(2):"n/a"}}},g={class:"title is-4"},k={class:"subtitle is-6"},x=e("i",{class:"fas fa-arrow-down"},null,-1),b=e("i",{class:"fas fa-arrow-up"},null,-1),S=e("i",{class:"fas fa-stopwatch"},null,-1);function B(t,F,n,G,y,a){const i=p("Generic");return c(),m(i,{item:n.item},{content:f(()=>[e("p",g,s(n.item.name),1),e("p",k,[t.speedtest?(c(),u(h,{key:0},[x,o(" "+s(a.download)+" Mbit/s | ",1),b,o(" "+s(a.upload)+" Mbit/s | ",1),S,o(" "+s(a.ping)+" ms ",1)],64)):_("",!0)])]),_:1},8,["item"])}const T=d(w,[["render",B]]);export{T as default};

View file

@ -0,0 +1 @@
import{s as o}from"./service.541fc1e6.js";import{_ as n,G as l,r as _,o as s,c as m,w as u,a as d,b as a,t as f,e as r}from"./index.868de8fa.js";const h={name:"Tautulli",mixins:[o],props:{item:Object},components:{Generic:l},data:()=>({stats:null,error:!1}),computed:{streams:function(){return this.stats?this.stats.stream_count:""}},created(){this.fetchStatus()},methods:{fetchStatus:async function(){try{const t=await this.fetch(`/api/v2?apikey=${this.item.apikey}&cmd=get_activity`);this.error=!1,this.stats=t.response.data}catch(t){this.error=!0,console.error(t)}}}},p={class:"notifs"},y=["title"],v={key:1,class:"notif error fa-solid fa-triangle-exclamation",title:"Unable to fetch current status"};function k(t,g,c,x,b,e){const i=_("Generic");return s(),m(i,{item:c.item},{indicator:u(()=>[d("div",p,[e.streams>0?(s(),a("strong",{key:0,class:"notif playing",title:`${e.streams} active stream${e.streams>1?"s":""}`},f(e.streams),9,y)):r("",!0),t.error?(s(),a("i",v)):r("",!0)])]),_:1},8,["item"])}const w=n(h,[["render",k],["__scopeId","data-v-7da71bac"]]);export{w as default};

View file

@ -0,0 +1 @@
.notifs[data-v-7da71bac]{position:absolute;color:#fff;font-family:sans-serif;top:.3em;right:.5em}.notifs .notif[data-v-7da71bac]{display:inline-block;padding:.2em .35em;border-radius:.25em;position:relative;margin-left:.3em;font-size:.8em}.notifs .notif.playing[data-v-7da71bac]{background-color:#28a9a3}.notifs .notif.error[data-v-7da71bac]{border-radius:50%;aspect-ratio:1;background-color:#e51111}

View file

@ -0,0 +1 @@
import{s as d}from"./service.541fc1e6.js";import{_ as u,G as l,r as _,o as s,c as h,w as f,a as m,b as r,t as n,e as a}from"./index.868de8fa.js";const p={name:"Tdarr",mixins:[d],props:{item:Object},components:{Generic:l},data:()=>({stats:null,error:!1}),computed:{queue:function(){return this.stats?this.stats.table1Count:""},errored:function(){return this.stats?this.stats.table6Count:""}},created(){const t=parseInt(this.item.checkInterval,10)||0;t>0&&setInterval(()=>this.fetchStatus(),t),this.fetchStatus()},methods:{fetchStatus:async function(){try{const t={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({headers:{"content-Type":"application/json"},data:{collection:"StatisticsJSONDB",mode:"getById",docID:"statistics",obj:{}},timeout:1e3})},o=await this.fetch("/api/v2/cruddb",t);this.error=!1,this.stats=o}catch(t){this.error=!0,console.error(t)}}}},y={class:"notifs"},v=["title"],b=["title"],k={key:2,class:"notif error fa-solid fa-triangle-exclamation",title:"Unable to fetch current status"};function S(t,o,c,g,I,e){const i=_("Generic");return s(),h(i,{item:c.item},{indicator:f(()=>[m("div",y,[e.queue>0?(s(),r("strong",{key:0,class:"notif queue",title:`${e.queue} items queued`},n(e.queue),9,v)):a("",!0),e.errored>0?(s(),r("strong",{key:1,class:"notif errored",title:`${e.errored} items`},n(e.errored),9,b)):a("",!0),t.error?(s(),r("i",k)):a("",!0)])]),_:1},8,["item"])}const B=u(p,[["render",S],["__scopeId","data-v-320ae0d6"]]);export{B as default};

View file

@ -0,0 +1 @@
.notifs[data-v-320ae0d6]{position:absolute;color:#fff;font-family:sans-serif;top:.3em;right:.5em}.notifs .notif[data-v-320ae0d6]{display:inline-block;padding:.2em .35em;border-radius:.25em;position:relative;margin-left:.3em;font-size:.8em}.notifs .notif.queue[data-v-320ae0d6]{background-color:#28a9a3}.notifs .notif.errored[data-v-320ae0d6]{background-color:#e51111}.notifs .notif.error[data-v-320ae0d6]{border-radius:50%;aspect-ratio:1;background-color:#e51111}

View file

@ -0,0 +1 @@
.status[data-v-efff3716]{font-size:.8rem;color:var(--text-title)}.status.good[data-v-efff3716]:before{background-color:#94e185;border-color:#78d965;box-shadow:0 0 5px 1px #94e185}.status.warn[data-v-efff3716]:before{background-color:#f8a306;border-color:#e1b35e;box-shadow:0 0 5px 1px #f8a306}.status.bad[data-v-efff3716]:before{background-color:#c9404d;border-color:#c42c3b;box-shadow:0 0 5px 1px #c9404d}.status[data-v-efff3716]:before{content:" ";display:inline-block;width:7px;height:7px;margin-right:10px;border:1px solid #000;border-radius:7px}

View file

@ -0,0 +1 @@
import{s as f}from"./service.541fc1e6.js";import{_ as b,G as _,r as p,o as i,c as g,w as u,a as h,t as n,b as c,F as o,d as l,e as d,n as k}from"./index.868de8fa.js";const v={name:"UptimeKuma",mixins:[f],props:{item:Object},components:{Generic:_},data:()=>({incident:null,heartbeat:null}),computed:{dashboard:function(){return this.item.slug?this.item.slug:"default"},status:function(){return this.incident?this.incident.incident==null?this.pageStatus:"bad":""},lastHeartBeatList:function(){let t={};for(let e in this.heartbeat.heartbeatList){let a=this.heartbeat.heartbeatList[e].length-1;t[e]=this.heartbeat.heartbeatList[e][a]}return t},pageStatus:function(){if(!this.heartbeat||Object.keys(this.heartbeat.heartbeatList).length===0)return"";let t="good",e=!1;for(let a in this.lastHeartBeatList)this.lastHeartBeatList[a].status==1?e=!0:t="warn";return e||(t="bad"),t},statusMessage:function(){if(!this.incident)return"";if(this.incident.incident)return this.incident.incident.title;let t="";switch(this.pageStatus){case"good":t="All Systems Operational";break;case"warn":t="Partially Degraded Service";break;case"bad":t="Degraded Service";break;default:t="Unknown service status"}return t},uptime:function(){if(!this.heartbeat)return 0;const t=Object.values(this.heartbeat.uptimeList);return((t.reduce((a,r)=>a+r,0)/t.length||0)*100).toFixed(1)}},created(){this.item.url=`${this.item.url}/status/${this.dashboard}`,this.fetchStatus()},methods:{fetchStatus:function(){const t=Date.now();this.fetch(`/api/status-page/${this.dashboard}?cachebust=${t}`).catch(e=>console.error(e)).then(e=>this.incident=e),this.fetch(`/api/status-page/heartbeat/${this.dashboard}?cachebust=${t}`).catch(e=>console.error(e)).then(e=>this.heartbeat=e)}}},x={class:"title is-4"},y={class:"subtitle is-6"};function S(t,e,a,r,w,s){const m=p("Generic");return i(),g(m,{item:a.item},{content:u(()=>[h("p",x,n(a.item.name),1),h("p",y,[a.item.subtitle?(i(),c(o,{key:0},[l(n(a.item.subtitle),1)],64)):s.status?(i(),c(o,{key:1},[l(n(s.statusMessage),1)],64)):d("",!0)])]),indicator:u(()=>[s.status?(i(),c("div",{key:0,class:k(["status",s.status])},n(s.uptime)+"% ",3)):d("",!0)]),_:1},8,["item"])}const U=b(v,[["render",S],["__scopeId","data-v-efff3716"]]);export{U as default};

View file

@ -0,0 +1 @@
.notifs[data-v-cc6fa3de]{position:absolute;color:#fff;font-family:sans-serif;top:.3em;right:.5em}.notifs .notif[data-v-cc6fa3de]{display:inline-block;padding:.2em .35em;border-radius:.25em;position:relative;margin-left:.3em;font-size:.8em}.notifs .notif.warnings[data-v-cc6fa3de]{background-color:#d08d2e}.notifs .notif.errors[data-v-cc6fa3de]{background-color:#e51111}

View file

@ -0,0 +1 @@
import{s as c}from"./service.541fc1e6.js";import{_ as d,G as u,r as l,o as n,c as _,w as f,a as p,b as r,t as o,e as s}from"./index.868de8fa.js";const h={name:"WUD",mixins:[c],props:{item:Object},components:{Generic:u},data:()=>({running:null,update:null,serverError:!1}),created:function(){this.fetchConfig()},methods:{fetchConfig:function(){this.fetch("/api/containers").then(e=>{this.running=0,this.update=0;for(var t=0;t<e.length;t++)this.running++,e[t].updateAvailable&&this.update++}).catch(()=>{this.serverError=!0})}}},m={class:"notifs"},g={key:0,class:"notif warnings",title:"Running"},v={key:1,class:"notif errors",title:"Update"},k={key:2,class:"notif errors",title:"Connection error to WUD API, check url in config.yml"};function y(e,t,i,C,D,U){const a=l("Generic");return n(),_(a,{item:i.item},{indicator:f(()=>[p("div",m,[e.running>0?(n(),r("strong",g,o(e.running),1)):s("",!0),e.update>0?(n(),r("strong",v,o(e.update),1)):s("",!0),e.serverError?(n(),r("strong",k," ? ")):s("",!0)])]),_:1},8,["item"])}const G=d(h,[["render",y],["__scopeId","data-v-cc6fa3de"]]);export{G as default};

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

180
resources/index.868de8fa.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1 @@
import{s as f}from"./service.541fc1e6.js";import{_ as m,G as y,r as v,o as s,c as I,w as d,a as o,t as a,b as n,F as c,d as r,e as B,p as w,f as b}from"./index.868de8fa.js";const u=["B","KB","MB","GB"],p=t=>{let e=0;for(;t>1e3&&e<u.length;)t/=1e3,e++;return Intl.NumberFormat(void 0,{maximumFractionDigits:2}).format(t||0)+` ${u[e]}/s`},g={name:"qBittorrent",mixins:[f],props:{item:Object},components:{Generic:y},data:()=>({dl:null,ul:null,count:null,error:null}),computed:{downRate:function(){return p(this.dl)},upRate:function(){return p(this.ul)}},created(){const t=parseInt(this.item.rateInterval,10)||0,e=parseInt(this.item.torrentInterval,10)||0;t>0&&setInterval(()=>this.getRate(),t),e>0&&setInterval(()=>this.fetchCount(),e),this.getRate(),this.fetchCount()},methods:{fetchCount:async function(){try{const t=await this.fetch("/api/v2/torrents/info");this.error=!1,this.count=t.length}catch(t){this.error=!0,console.error(t)}},getRate:async function(){try{const t=await this.fetch("/api/v2/transfer/info");this.error=!1,this.dl=t.dl_info_speed,this.ul=t.up_info_speed}catch(t){this.error=!0,console.error(t)}}}},h=t=>(w("data-v-6a41f8ba"),t=t(),b(),t),k={class:"title is-4"},R={class:"subtitle is-6"},C={key:0,class:"error"},G={class:"down monospace"},x=h(()=>o("p",{class:"fas fa-download"},null,-1)),F={class:"up monospace"},N=h(()=>o("p",{class:"fas fa-upload"},null,-1)),S={key:0,class:"count"};function q(t,e,i,V,D,l){const _=v("Generic");return s(),I(_,{item:i.item},{content:d(()=>[o("p",k,a(i.item.name),1),o("p",R,[t.error?(s(),n("span",C,"An error has occurred.")):(s(),n(c,{key:1},[o("span",G,[x,r(" "+a(l.downRate),1)]),o("span",F,[N,r(" "+a(l.upRate),1)])],64))])]),indicator:d(()=>[t.error?B("",!0):(s(),n("span",S,[r(a(t.count)+" ",1),t.count===1?(s(),n(c,{key:0},[r("torrent")],64)):(s(),n(c,{key:1},[r("torrents")],64))]))]),_:1},8,["item"])}const E=m(g,[["render",q],["__scopeId","data-v-6a41f8ba"]]);export{E as default};

View file

@ -0,0 +1 @@
.error[data-v-6a41f8ba]{color:#e51111!important}.down[data-v-6a41f8ba]{margin-right:1em}.count[data-v-6a41f8ba]{color:var(--text);font-size:.8em}.monospace[data-v-6a41f8ba]{font-weight:300;font-family:monospace}

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1 @@
const d={props:{proxy:Object},created:function(){this.endpoint=this.item.endpoint||this.item.url,this.endpoint.endsWith("/")&&(this.endpoint=this.endpoint.slice(0,-1))},methods:{fetch:function(t,r,o=!0){var s;let e={};(s=this.proxy)!=null&&s.useCredentials&&(e.credentials="include"),this.item.useCredentials!==void 0&&(e.credentials=this.item.useCredentials===!0?"include":"omit"),e=Object.assign(e,r),t.startsWith("/")&&(t=t.slice(1));let n=this.endpoint;return t&&(n=`${this.endpoint}/${t}`),fetch(n,e).then(i=>{if(!i.ok)throw new Error("Not 2xx response");return o?i.json():i})}}};export{d as s};

1
sw.js Normal file
View file

@ -0,0 +1 @@
if(!self.define){let r,s={};const e=(e,l)=>(e=new URL(e+".js",l).href,s[e]||new Promise((s=>{if("document"in self){const r=document.createElement("script");r.src=e,r.onload=s,document.head.appendChild(r)}else r=e,importScripts(e),s()})).then((()=>{let r=s[e];if(!r)throw new Error(`Module ${e} didnt register its module`);return r})));self.define=(l,u)=>{const o=r||("document"in self?document.currentScript.src:"")||location.href;if(s[o])return;let i={};const n=r=>e(r,o),c={module:{uri:o},exports:i,require:n};s[o]=Promise.all(l.map((r=>c[r]||n(r)))).then((r=>(u(...r),i)))}}define(["./workbox-e4df0f2a"],(function(r){"use strict";self.skipWaiting(),r.clientsClaim(),r.precacheAndRoute([{url:"index.html",revision:"9d1378ca48c91243ee09a1c31141136c"},{url:"registerSW.js",revision:"402b66900e731ca748771b6fc5e7a068"},{url:"resources/AdGuardHome.1d0e702b.js",revision:null},{url:"resources/AdGuardHome.58ee6c83.css",revision:null},{url:"resources/CopyToClipboard.a17573c3.css",revision:null},{url:"resources/CopyToClipboard.b3bb62c3.js",revision:null},{url:"resources/Emby.1c49ce56.css",revision:null},{url:"resources/Emby.774b2d69.js",revision:null},{url:"resources/Healthchecks.52385485.js",revision:null},{url:"resources/Healthchecks.c88f2822.css",revision:null},{url:"resources/index.868de8fa.js",revision:null},{url:"resources/index.8b54b14d.css",revision:null},{url:"resources/Lidarr.14af5f72.js",revision:null},{url:"resources/Lidarr.f62c6a04.css",revision:null},{url:"resources/Mealie.7d08fd6d.js",revision:null},{url:"resources/Medusa.c8786ae6.js",revision:null},{url:"resources/Medusa.e73e6d80.css",revision:null},{url:"resources/OctoPrint.4b446c51.css",revision:null},{url:"resources/OctoPrint.78837a04.js",revision:null},{url:"resources/OpenWeather.c3a274b3.css",revision:null},{url:"resources/OpenWeather.ef672564.js",revision:null},{url:"resources/PaperlessNG.e5ae8f5d.js",revision:null},{url:"resources/PiHole.05678db2.js",revision:null},{url:"resources/PiHole.eb737172.css",revision:null},{url:"resources/Ping.97b4391d.js",revision:null},{url:"resources/Ping.f54b6bba.css",revision:null},{url:"resources/Portainer.2f776cbf.js",revision:null},{url:"resources/Portainer.8fec3428.css",revision:null},{url:"resources/Prometheus.33bec39c.css",revision:null},{url:"resources/Prometheus.c72d7c41.js",revision:null},{url:"resources/Prowlarr.2c1ae3fa.css",revision:null},{url:"resources/Prowlarr.87d4f896.js",revision:null},{url:"resources/Proxmox.04b227e5.css",revision:null},{url:"resources/Proxmox.5626d857.js",revision:null},{url:"resources/qBittorrent.70f91624.js",revision:null},{url:"resources/qBittorrent.dc942469.css",revision:null},{url:"resources/Radarr.eb9f7ff0.css",revision:null},{url:"resources/Radarr.edc85f6c.js",revision:null},{url:"resources/Rtorrent.071d65d7.js",revision:null},{url:"resources/Rtorrent.a1b7781a.css",revision:null},{url:"resources/SABnzbd.556c2ce6.js",revision:null},{url:"resources/SABnzbd.f94c9543.css",revision:null},{url:"resources/service.541fc1e6.js",revision:null},{url:"resources/Sonarr.1dfb8d14.css",revision:null},{url:"resources/Sonarr.f6e010b1.js",revision:null},{url:"resources/SpeedtestTracker.2eb3df74.js",revision:null},{url:"resources/Tautulli.8e62748f.js",revision:null},{url:"resources/Tautulli.d3f86925.css",revision:null},{url:"resources/Tdarr.411225c5.js",revision:null},{url:"resources/Tdarr.beb4fb95.css",revision:null},{url:"resources/UptimeKuma.29705488.css",revision:null},{url:"resources/UptimeKuma.5195bf2a.js",revision:null},{url:"resources/WUD.5673736c.css",revision:null},{url:"resources/WUD.cf7de712.js",revision:null},{url:"assets/manifest.json",revision:"32b26ee6e51fb4c94ac9a6398aded962"}],{}),r.cleanupOutdatedCaches()}));

1
workbox-e4df0f2a.js Normal file

File diff suppressed because one or more lines are too long