mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
feat: Add name and type fields to Instance class in web UI
The `Instance` class has been updated to include a `name` field and a `type` field. The `name` field represents the name of the instance, and the `type` field indicates whether the instance is static, a container, or a pod. This change provides additional information about the instances being managed.
This commit is contained in:
parent
9713f9ba90
commit
9cee47392b
1 changed files with 10 additions and 0 deletions
|
|
@ -9,8 +9,10 @@ from ApiCaller import ApiCaller # type: ignore
|
|||
|
||||
class Instance:
|
||||
hostname: str
|
||||
name: str
|
||||
method: Literal["ui", "scheduler", "autoconf", "manual"]
|
||||
status: Literal["loading", "up", "down"]
|
||||
type: Literal["static", "container", "pod"]
|
||||
creation_date: datetime
|
||||
last_seen: datetime
|
||||
apiCaller: ApiCaller
|
||||
|
|
@ -18,15 +20,19 @@ class Instance:
|
|||
def __init__(
|
||||
self,
|
||||
hostname: str,
|
||||
name: str,
|
||||
method: Literal["ui", "scheduler", "autoconf", "manual"],
|
||||
status: Literal["loading", "up", "down"],
|
||||
type: Literal["static", "container", "pod"],
|
||||
creation_date: datetime,
|
||||
last_seen: datetime,
|
||||
apiCaller: ApiCaller,
|
||||
) -> None:
|
||||
self.hostname = hostname
|
||||
self.name = name
|
||||
self.method = method
|
||||
self.status = status
|
||||
self.type = type
|
||||
self.creation_date = creation_date
|
||||
self.last_seen = last_seen
|
||||
self.apiCaller = apiCaller or ApiCaller()
|
||||
|
|
@ -39,8 +45,10 @@ class Instance:
|
|||
|
||||
return Instance(
|
||||
instance["hostname"],
|
||||
instance["server_name"],
|
||||
instance["method"],
|
||||
instance["status"],
|
||||
instance["type"],
|
||||
instance["creation_date"],
|
||||
instance["last_seen"],
|
||||
ApiCaller(
|
||||
|
|
@ -152,8 +160,10 @@ class InstancesUtils:
|
|||
return [
|
||||
Instance(
|
||||
instance["hostname"],
|
||||
instance["name"],
|
||||
instance["method"],
|
||||
instance["status"],
|
||||
instance["type"],
|
||||
instance["creation_date"],
|
||||
instance["last_seen"],
|
||||
ApiCaller(
|
||||
|
|
|
|||
Loading…
Reference in a new issue