mirror of
https://github.com/StefBuwalda/dashboard_test.git
synced 2025-10-30 11:19:58 +00:00
Added icon filetype so icons can be saved as [id].[icon_filetype]
This commit is contained in:
@@ -2,19 +2,24 @@ from typing import Any, Optional
|
|||||||
|
|
||||||
|
|
||||||
class service:
|
class service:
|
||||||
|
id = int
|
||||||
url: str
|
url: str
|
||||||
status: Optional[int]
|
status: Optional[int]
|
||||||
online: bool
|
online: bool
|
||||||
public: bool
|
public: bool
|
||||||
error: Optional[str]
|
error: Optional[str]
|
||||||
ping: Optional[int]
|
ping: Optional[int]
|
||||||
|
icon_filetype: Optional[str]
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
|
id: int,
|
||||||
url: str = "",
|
url: str = "",
|
||||||
label: str = "",
|
label: str = "",
|
||||||
public: bool = True,
|
public: bool = True,
|
||||||
|
icon_filetype: Optional[str] = None,
|
||||||
):
|
):
|
||||||
|
self.id = id
|
||||||
self.url = url
|
self.url = url
|
||||||
self.public = public
|
self.public = public
|
||||||
self.label = label
|
self.label = label
|
||||||
@@ -23,6 +28,7 @@ class service:
|
|||||||
self.status = None
|
self.status = None
|
||||||
self.error = None
|
self.error = None
|
||||||
self.ping = None
|
self.ping = None
|
||||||
|
self.icon_filetype = icon_filetype
|
||||||
|
|
||||||
def to_dict(self) -> dict[str, Any]:
|
def to_dict(self) -> dict[str, Any]:
|
||||||
return {
|
return {
|
||||||
@@ -33,6 +39,7 @@ class service:
|
|||||||
"error": self.error,
|
"error": self.error,
|
||||||
"ping": self.ping,
|
"ping": self.ping,
|
||||||
"label": self.label,
|
"label": self.label,
|
||||||
|
"icon_filetype": self.icon_filetype,
|
||||||
}
|
}
|
||||||
|
|
||||||
def set_status(self, status: Optional[int]):
|
def set_status(self, status: Optional[int]):
|
||||||
@@ -49,14 +56,14 @@ class service:
|
|||||||
|
|
||||||
|
|
||||||
services: list[service] = [
|
services: list[service] = [
|
||||||
service("https://git.ihatemen.uk/", "Gitea"),
|
service(0, "https://git.ihatemen.uk/", "Gitea"),
|
||||||
service("https://plex.ihatemen.uk/", "Plex"),
|
service(1, "https://plex.ihatemen.uk/", "Plex"),
|
||||||
service("https://truenas.local/", "TrueNAS", False),
|
service(2, "https://truenas.local/", "TrueNAS", False),
|
||||||
service("https://cloud.ihatemen.uk/", "NextCloud"),
|
service(3, "https://cloud.ihatemen.uk/", "NextCloud"),
|
||||||
service("https://request.ihatemen.uk/", "Overseerr"),
|
service(4, "https://request.ihatemen.uk/", "Overseerr"),
|
||||||
service("https://id.ihatemen.uk/", "PocketID"),
|
service(5, "https://id.ihatemen.uk/", "PocketID"),
|
||||||
service("http://tautulli.local", "Tautulli", False),
|
service(6, "http://tautulli.local", "Tautulli", False),
|
||||||
service("https://transmission.local", "Transmission", False),
|
service(7, "https://transmission.local", "Transmission", False),
|
||||||
service("https://vault.ihatemen.uk", "Vault Warden"),
|
service(8, "https://vault.ihatemen.uk", "Vault Warden"),
|
||||||
service("https://nginx.local", "Nginx (NPM)", False),
|
service(9, "https://nginx.local", "Nginx (NPM)", False),
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user