From e48aaf5e014348df88c593b6db7b08f58c64142e Mon Sep 17 00:00:00 2001 From: emersonfelipesp Date: Tue, 10 Oct 2023 12:54:46 +0000 Subject: [PATCH 01/34] 'proxbox.service' systemd running into port 8800 --- contrib/proxbox.service | 10 +++--- netbox_proxbox/backend/__init__.py | 0 netbox_proxbox/fastapi/main.py | 15 -------- netbox_proxbox/main.py | 55 +++++++++++++++++++++--------- requirements.txt | 3 ++ 5 files changed, 47 insertions(+), 36 deletions(-) create mode 100644 netbox_proxbox/backend/__init__.py delete mode 100644 netbox_proxbox/fastapi/main.py diff --git a/contrib/proxbox.service b/contrib/proxbox.service index 031d340c..93ae8a2d 100644 --- a/contrib/proxbox.service +++ b/contrib/proxbox.service @@ -1,6 +1,6 @@ [Unit] -Description=Proxbox Service -Documentation=https://docs.netbox.dev.br/ +Description=Proxbox Backend Service (FastAPI) +Documentation=https://github.com/netdevopsbr/netbox-proxbox After=network-online.target Wants=network-online.target @@ -9,10 +9,10 @@ Type=simple User=netbox Group=netbox -#PIDFile=/var/tmp/netbox.pid -WorkingDirectory=/opt/netbox +PIDFile=/var/tmp/proxbox.pid +WorkingDirectory=/opt/netbox/netbox/netbox-proxbox -ExecStart=/opt/netbox/venv/bin/uvicorn opt.netboxnetbox.netbox-proxbox.netbox_proxbox.main:app --reload --port 10000 +ExecStart=/opt/netbox/venv/bin/uvicorn netbox-proxbox.netbox_proxbox.main:app --host 0.0.0.0 --port 8800 --app-dir /opt/netbox/netbox Restart=on-failure RestartSec=30 diff --git a/netbox_proxbox/backend/__init__.py b/netbox_proxbox/backend/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/netbox_proxbox/fastapi/main.py b/netbox_proxbox/fastapi/main.py deleted file mode 100644 index cc12f9cb..00000000 --- a/netbox_proxbox/fastapi/main.py +++ /dev/null @@ -1,15 +0,0 @@ -from fastapi import FastAPI - -from netbox_proxbox.plugins_config import ( - NETBOX, - NETBOX_TOKEN, - PROXMOX_SESSIONS as proxmox_sessions, - NETBOX_SESSION as nb, -) - -app = FastAPI() - - -@app.get("/") -async def root(): - return {"message": "Proxbox Backend"} diff --git a/netbox_proxbox/main.py b/netbox_proxbox/main.py index 6104b4a6..283af5cb 100644 --- a/netbox_proxbox/main.py +++ b/netbox_proxbox/main.py @@ -1,24 +1,35 @@ # Python Framework +""" from typing import Annotated +from typing import Callable + from fastapi import Depends, FastAPI, Request from fastapi.responses import HTMLResponse from fastapi.staticfiles import StaticFiles from fastapi.templating import Jinja2Templates +from fastapi import APIRouter, FastAPI, Request, Response +from fastapi.routing import APIRoute # NP import to use 'copy' array method import numpy as np +import json +import time +""" + # Proxmoxer lib (https://proxmoxer.github.io/) -from proxmoxer import ProxmoxAPI, ResourceException +# from proxmoxer import ProxmoxAPI, ResourceException + # HTTP SSL handling -import requests -import urllib3 -urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) +# import requests +# import urllib3 +# urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) -TOPLEVEL_ENDPOINTS = ["access", "cluster", "nodes", "pools", "storage", "version"] +# TOPLEVEL_ENDPOINTS = ["access", "cluster", "nodes", "pools", "storage", "version"] +""" # Proxbox from netbox_proxbox.proxbox_api.plugins_config import PROXMOX_SESSIONS, PROXMOX_SETTING @@ -41,21 +52,24 @@ FASTAPI_HOST = "127.0.0.1" FASTAPI_PORT = "9000" - +""" + +from fastapi import FastAPI + # Init FastAPI app = FastAPI() -app.mount("/static", StaticFiles(directory="/opt/netbox/netbox/netbox-proxbox/netbox_proxbox/static"), name="static") -templates = Jinja2Templates(directory="/opt/netbox/netbox/netbox-proxbox/netbox_proxbox/templates/netbox_proxbox") +@app.get("/") +async def root(): + return {"message": "Hello World"} -import time -from typing import Callable -from fastapi import APIRouter, FastAPI, Request, Response -from fastapi.routing import APIRoute +# app.mount("/static", StaticFiles(directory="/opt/netbox/netbox/netbox-proxbox/netbox_proxbox/static"), name="static") + +# templates = Jinja2Templates(directory="/opt/netbox/netbox/netbox-proxbox/netbox_proxbox/templates/netbox_proxbox") + -import json @app.get("/standalone-info") async def standalone_info(): @@ -72,6 +86,7 @@ async def standalone_info(): } } +""" @app.get("/proxmox") async def proxmox(): @@ -110,8 +125,9 @@ def minimize_result(endpoint_name): }, "base_endpoints": api_hierarchy } +""" - +""" @app.get("/", response_class=HTMLResponse) async def root( request: Request, @@ -125,7 +141,10 @@ async def root( "proxmox_str": json.dumps(proxmox_output, indent=4), } ) +""" + +""" @app.get("/netbox", response_class=HTMLResponse) async def netbox( request: Request, @@ -136,8 +155,9 @@ async def netbox( "json_content": proxmox } ) - +""" +""" @app.get("/proxmox/{top_level}") async def top_level_endpoint( top_level: str | None = None, @@ -156,8 +176,10 @@ async def top_level_endpoint( f"{top_level}": px(top_level).get(), "other_endpoints": other_endpoints, } +""" +""" @app.get("/proxmox/{top_level}/{second_level}") async def second_level_endpoint( top_level: str | None = None, @@ -191,4 +213,5 @@ async def second_level_endpoint( "error": error } - return json_obj \ No newline at end of file + return json_obj +""" \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 6159f8a1..d41e0f08 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,8 +5,11 @@ pynetbox>=5 paramiko>=2 proxmoxer>=1 fastapi[all] +typing starlette uvicorn[standard] +pydantic +anyio websockets jinja2 ujson>=5.7.0 From 6dd0027479235deca700a22a820288586444efcc Mon Sep 17 00:00:00 2001 From: emersonfelipesp Date: Tue, 10 Oct 2023 13:45:09 +0000 Subject: [PATCH 02/34] Add FastAPI paths related to plugin settings --- netbox_proxbox/main.py | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/netbox_proxbox/main.py b/netbox_proxbox/main.py index 283af5cb..0c94fde0 100644 --- a/netbox_proxbox/main.py +++ b/netbox_proxbox/main.py @@ -1,6 +1,6 @@ # Python Framework """ -from typing import Annotated + from typing import Callable @@ -54,7 +54,9 @@ FASTAPI_PORT = "9000" """ -from fastapi import FastAPI +from typing import Annotated + +from fastapi import Depends, FastAPI # Init FastAPI app = FastAPI() @@ -69,7 +71,34 @@ async def root(): # templates = Jinja2Templates(directory="/opt/netbox/netbox/netbox-proxbox/netbox_proxbox/templates/netbox_proxbox") +@app.get("/netbox/plugins-config") +async def netbox_plugins_config(): + """ + PLUGIN_CONFIG variable defined by user in Netbox 'configuration.py' file + """ + + from netbox.settings import PLUGINS_CONFIG + return PLUGINS_CONFIG +@app.get("/proxbox/netbox/default-settings") +async def proxbox_netbox_default(): + """ + Default Plugins settings + """ + + from netbox_proxbox import ProxboxConfig + return ProxboxConfig.default_settings + +@app.get("/proxbox/settings") +async def proxbox_settings( + plugins_config: Annotated[dict, Depends(netbox_plugins_config)], + default_settings: Annotated[dict, Depends(proxbox_netbox_default)] +): + return { + "plugins_config": plugins_config, + "default_settings": default_settings + } + @app.get("/standalone-info") async def standalone_info(): From a69e990d3e67593e2dbf16e319fd449d99243eef Mon Sep 17 00:00:00 2001 From: emersonfelipesp Date: Tue, 10 Oct 2023 15:18:52 +0000 Subject: [PATCH 03/34] Add BaseModels for Netbox and Proxmox sessions & add query paramters to /netbox/plugins-config/ path --- netbox_proxbox/main.py | 60 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 55 insertions(+), 5 deletions(-) diff --git a/netbox_proxbox/main.py b/netbox_proxbox/main.py index 0c94fde0..3e5d4b20 100644 --- a/netbox_proxbox/main.py +++ b/netbox_proxbox/main.py @@ -56,7 +56,11 @@ from typing import Annotated -from fastapi import Depends, FastAPI +from fastapi import Depends, FastAPI, Query + +from pydantic import BaseModel + +PROXBOX_PLUGIN_NAME = "netbox_proxbox" # Init FastAPI app = FastAPI() @@ -67,19 +71,65 @@ async def root(): return {"message": "Hello World"} +class ProxmoxToken(BaseModel): + name: str + value: str + +class ProxmoxSession(BaseModel): + domain: str + http_port: int + user: str + password: str + token: ProxmoxToken + +class ProxmoxSessions(BaseModel): + sessions: list[ProxmoxSession] + +class NetboxSessionSettings(BaseModel): + virtualmachine_role_id: int + node_role_id: int + site_id: int + +class NetboxSession(BaseModel): + domain: str + http_port: int + token: str + ssl: bool + settings: NetboxSessionSettings | None = None + # app.mount("/static", StaticFiles(directory="/opt/netbox/netbox/netbox-proxbox/netbox_proxbox/static"), name="static") # templates = Jinja2Templates(directory="/opt/netbox/netbox/netbox-proxbox/netbox_proxbox/templates/netbox_proxbox") @app.get("/netbox/plugins-config") -async def netbox_plugins_config(): +async def netbox_plugins_config( + plugin_name: str | None = PROXBOX_PLUGIN_NAME, + list_all: bool | None = None + ): """ PLUGIN_CONFIG variable defined by user in Netbox 'configuration.py' file """ - from netbox.settings import PLUGINS_CONFIG - return PLUGINS_CONFIG - + try: + from netbox.settings import PLUGINS_CONFIG + except Exception as e: + return { + "error": { + "message": "Could not import PLUGINS CONFIG from configuration.py", + "python_exception": e + } + } + + if list_all: + return PLUGINS_CONFIG + + return PLUGINS_CONFIG.get(plugin_name, { + "error": { + "message": f"Could not get '{plugin_name}' plugin config from 'PLUGINS_CONFIG' variable located at Netbox 'configuration.py'" + } + } + ) + @app.get("/proxbox/netbox/default-settings") async def proxbox_netbox_default(): """ From 99692bd765a03fc9206c5897782a72e2c536fd5c Mon Sep 17 00:00:00 2001 From: emersonfelipesp Date: Tue, 10 Oct 2023 16:34:07 +0000 Subject: [PATCH 04/34] Finish 'PluginConfig' pydantic model to validate 'netbox_proxbox' plugin config at PLUGINS_CONFIG variable --- netbox_proxbox/__init__.py | 10 +++----- netbox_proxbox/main.py | 48 ++++++++++++++++++++++++++++++++------ 2 files changed, 44 insertions(+), 14 deletions(-) diff --git a/netbox_proxbox/__init__.py b/netbox_proxbox/__init__.py index f8438e97..4c885b2c 100755 --- a/netbox_proxbox/__init__.py +++ b/netbox_proxbox/__init__.py @@ -19,7 +19,7 @@ class ProxboxConfig(PluginConfig): 'password': 'Strong@P4ssword', 'token': { 'name': 'proxbox', - 'value': '039az154-23b2-4be0-8d20-b66abc8c4686' + 'value': 'PASTE_YOUR_TOKEN_HERE' }, 'ssl': False } @@ -27,18 +27,14 @@ class ProxboxConfig(PluginConfig): 'netbox': { 'domain': 'netbox.example.com', # May also be IP address 'http_port': 80, - 'token': '0dd7cddfaee3b38bbffbd2937d44c4a03f9c9d38', + 'token': 'PASTE_YOUR_TOKEN_HERE', 'ssl': False, 'settings': { 'virtualmachine_role_id' : 0, 'node_role_id' : 0, 'site_id': 0 } - }, - 'fastapi': { - 'uvicorn_host' : '0.0.0.0', - 'uvicorn_port' : '8002', - }, + } } config = ProxboxConfig diff --git a/netbox_proxbox/main.py b/netbox_proxbox/main.py index 3e5d4b20..dad75a8b 100644 --- a/netbox_proxbox/main.py +++ b/netbox_proxbox/main.py @@ -82,9 +82,6 @@ class ProxmoxSession(BaseModel): password: str token: ProxmoxToken -class ProxmoxSessions(BaseModel): - sessions: list[ProxmoxSession] - class NetboxSessionSettings(BaseModel): virtualmachine_role_id: int node_role_id: int @@ -97,6 +94,10 @@ class NetboxSession(BaseModel): ssl: bool settings: NetboxSessionSettings | None = None +class PluginConfig(BaseModel): + proxmox: list[ProxmoxSession] + netbox: NetboxSession + # app.mount("/static", StaticFiles(directory="/opt/netbox/netbox/netbox-proxbox/netbox_proxbox/static"), name="static") # templates = Jinja2Templates(directory="/opt/netbox/netbox/netbox-proxbox/netbox_proxbox/templates/netbox_proxbox") @@ -116,13 +117,46 @@ async def netbox_plugins_config( return { "error": { "message": "Could not import PLUGINS CONFIG from configuration.py", - "python_exception": e + "python_exception": f"{e}" } } - + + # If ?list=all=True + # Return complete PLUGINS_CONFIG (including other plugins) if list_all: return PLUGINS_CONFIG + # Message error to not found plugins. + plugin_not_found = f"Could not get '{plugin_name}' plugin config from 'PLUGINS_CONFIG' variable located at Netbox 'configuration.py'" + + # Search for configuration of another plugin. This feature is not recommended and may cause security issues, use at your own risk. + if plugin_name != PROXBOX_PLUGIN_NAME: + return PLUGINS_CONFIG.get(plugin_name, { + "error": { + "message": plugin_not_found + } + } + ) + + try: + return PluginConfig(**PLUGINS_CONFIG.get(plugin_name, { + "error": { + "message": plugin_not_found + } + } + ) + ) + + except Exception as e: + return { + "error": { + "message": "Plugin configuration at PLUGINS_CONFIG (configuration.py) is probably incorrect.", + "detail": "Could not feed 'PluginConfig' pydantic model with config provided from 'PLUGINS_CONFIG'.", + "python_exception": f"{e}", + } + } + + return PLUGINS_CONFIG.get(plugin_name, { "error": { "message": f"Could not get '{plugin_name}' plugin config from 'PLUGINS_CONFIG' variable located at Netbox 'configuration.py'" @@ -141,8 +175,8 @@ async def proxbox_netbox_default(): @app.get("/proxbox/settings") async def proxbox_settings( - plugins_config: Annotated[dict, Depends(netbox_plugins_config)], - default_settings: Annotated[dict, Depends(proxbox_netbox_default)] + plugins_config: Annotated[PluginConfig, Depends(netbox_plugins_config)], + default_settings: Annotated[PluginConfig, Depends(proxbox_netbox_default)] ): return { "plugins_config": plugins_config, From cafcad5a521ece5783a4fd096511c2e758a242d6 Mon Sep 17 00:00:00 2001 From: emersonfelipesp Date: Tue, 10 Oct 2023 17:50:50 +0000 Subject: [PATCH 05/34] Move pydantic models from main to 'backend.schemas' subpackage --- netbox_proxbox/backend/schemas/__init__.py | 28 +++++++++++++++++++++ netbox_proxbox/main.py | 29 +--------------------- 2 files changed, 29 insertions(+), 28 deletions(-) create mode 100644 netbox_proxbox/backend/schemas/__init__.py diff --git a/netbox_proxbox/backend/schemas/__init__.py b/netbox_proxbox/backend/schemas/__init__.py new file mode 100644 index 00000000..8a843afa --- /dev/null +++ b/netbox_proxbox/backend/schemas/__init__.py @@ -0,0 +1,28 @@ +from pydantic import BaseModel + +class ProxmoxToken(BaseModel): + name: str + value: str + +class ProxmoxSession(BaseModel): + domain: str + http_port: int + user: str + password: str + token: ProxmoxToken + +class NetboxSessionSettings(BaseModel): + virtualmachine_role_id: int + node_role_id: int + site_id: int + +class NetboxSession(BaseModel): + domain: str + http_port: int + token: str + ssl: bool + settings: NetboxSessionSettings | None = None + +class PluginConfig(BaseModel): + proxmox: list[ProxmoxSession] + netbox: NetboxSession \ No newline at end of file diff --git a/netbox_proxbox/main.py b/netbox_proxbox/main.py index dad75a8b..375bd1d6 100644 --- a/netbox_proxbox/main.py +++ b/netbox_proxbox/main.py @@ -58,7 +58,7 @@ from fastapi import Depends, FastAPI, Query -from pydantic import BaseModel +from .backend.schemas import * PROXBOX_PLUGIN_NAME = "netbox_proxbox" @@ -71,33 +71,6 @@ async def root(): return {"message": "Hello World"} -class ProxmoxToken(BaseModel): - name: str - value: str - -class ProxmoxSession(BaseModel): - domain: str - http_port: int - user: str - password: str - token: ProxmoxToken - -class NetboxSessionSettings(BaseModel): - virtualmachine_role_id: int - node_role_id: int - site_id: int - -class NetboxSession(BaseModel): - domain: str - http_port: int - token: str - ssl: bool - settings: NetboxSessionSettings | None = None - -class PluginConfig(BaseModel): - proxmox: list[ProxmoxSession] - netbox: NetboxSession - # app.mount("/static", StaticFiles(directory="/opt/netbox/netbox/netbox-proxbox/netbox_proxbox/static"), name="static") # templates = Jinja2Templates(directory="/opt/netbox/netbox/netbox-proxbox/netbox_proxbox/templates/netbox_proxbox") From ae58c7c2f40e7abe0718e91d97b88131fa54f2cc Mon Sep 17 00:00:00 2001 From: emersonfelipesp Date: Tue, 10 Oct 2023 18:38:43 +0000 Subject: [PATCH 06/34] Add routes and schemas packages to better structure the project --- netbox_proxbox/backend/routes/__init__.py | 0 netbox_proxbox/backend/routes/netbox.py | 70 ++++++++++++++++++++++ netbox_proxbox/backend/routes/proxbox.py | 0 netbox_proxbox/backend/routes/proxmox.py | 0 netbox_proxbox/backend/schemas/__init__.py | 25 +------- netbox_proxbox/backend/schemas/netbox.py | 13 ++++ netbox_proxbox/backend/schemas/proxmox.py | 12 ++++ netbox_proxbox/main.py | 66 ++------------------ 8 files changed, 102 insertions(+), 84 deletions(-) create mode 100644 netbox_proxbox/backend/routes/__init__.py create mode 100644 netbox_proxbox/backend/routes/netbox.py create mode 100644 netbox_proxbox/backend/routes/proxbox.py create mode 100644 netbox_proxbox/backend/routes/proxmox.py create mode 100644 netbox_proxbox/backend/schemas/netbox.py create mode 100644 netbox_proxbox/backend/schemas/proxmox.py diff --git a/netbox_proxbox/backend/routes/__init__.py b/netbox_proxbox/backend/routes/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/netbox_proxbox/backend/routes/netbox.py b/netbox_proxbox/backend/routes/netbox.py new file mode 100644 index 00000000..0a2faabe --- /dev/null +++ b/netbox_proxbox/backend/routes/netbox.py @@ -0,0 +1,70 @@ +from fastapi import APIRouter + +from netbox_proxbox.backend.schemas import PluginConfig +from netbox_proxbox.backend.schemas.netbox import * + +router = APIRouter() + +PROXBOX_PLUGIN_NAME = "netbox_proxbox" + +@router.get("/plugins-config") +async def netbox_plugins_config( + plugin_name: str | None = PROXBOX_PLUGIN_NAME, + list_all: bool | None = None + ): + """ + PLUGIN_CONFIG variable defined by user in Netbox 'configuration.py' file + """ + + try: + from netbox.settings import PLUGINS_CONFIG + except Exception as e: + return { + "error": { + "message": "Could not import PLUGINS CONFIG from configuration.py", + "python_exception": f"{e}" + } + } + + # If ?list=all=True + # Return complete PLUGINS_CONFIG (including other plugins) + if list_all: + return PLUGINS_CONFIG + + # Message error to not found plugins. + plugin_not_found = f"Could not get '{plugin_name}' plugin config from 'PLUGINS_CONFIG' variable located at Netbox 'configuration.py'" + + # Search for configuration of another plugin. This feature is not recommended and may cause security issues, use at your own risk. + if plugin_name != PROXBOX_PLUGIN_NAME: + return PLUGINS_CONFIG.get(plugin_name, { + "error": { + "message": plugin_not_found + } + } + ) + + try: + return PluginConfig(**PLUGINS_CONFIG.get(plugin_name, { + "error": { + "message": plugin_not_found + } + } + ) + ) + + except Exception as e: + return { + "error": { + "message": "Plugin configuration at PLUGINS_CONFIG (configuration.py) is probably incorrect.", + "detail": "Could not feed 'PluginConfig' pydantic model with config provided from 'PLUGINS_CONFIG'.", + "python_exception": f"{e}", + } + } + + + return PLUGINS_CONFIG.get(plugin_name, { + "error": { + "message": f"Could not get '{plugin_name}' plugin config from 'PLUGINS_CONFIG' variable located at Netbox 'configuration.py'" + } + } + ) \ No newline at end of file diff --git a/netbox_proxbox/backend/routes/proxbox.py b/netbox_proxbox/backend/routes/proxbox.py new file mode 100644 index 00000000..e69de29b diff --git a/netbox_proxbox/backend/routes/proxmox.py b/netbox_proxbox/backend/routes/proxmox.py new file mode 100644 index 00000000..e69de29b diff --git a/netbox_proxbox/backend/schemas/__init__.py b/netbox_proxbox/backend/schemas/__init__.py index 8a843afa..57e7ba03 100644 --- a/netbox_proxbox/backend/schemas/__init__.py +++ b/netbox_proxbox/backend/schemas/__init__.py @@ -1,27 +1,6 @@ from pydantic import BaseModel - -class ProxmoxToken(BaseModel): - name: str - value: str - -class ProxmoxSession(BaseModel): - domain: str - http_port: int - user: str - password: str - token: ProxmoxToken - -class NetboxSessionSettings(BaseModel): - virtualmachine_role_id: int - node_role_id: int - site_id: int - -class NetboxSession(BaseModel): - domain: str - http_port: int - token: str - ssl: bool - settings: NetboxSessionSettings | None = None +from .netbox import * +from .proxmox import * class PluginConfig(BaseModel): proxmox: list[ProxmoxSession] diff --git a/netbox_proxbox/backend/schemas/netbox.py b/netbox_proxbox/backend/schemas/netbox.py new file mode 100644 index 00000000..0d94915f --- /dev/null +++ b/netbox_proxbox/backend/schemas/netbox.py @@ -0,0 +1,13 @@ +from pydantic import BaseModel + +class NetboxSessionSettings(BaseModel): + virtualmachine_role_id: int + node_role_id: int + site_id: int + +class NetboxSession(BaseModel): + domain: str + http_port: int + token: str + ssl: bool + settings: NetboxSessionSettings | None = None \ No newline at end of file diff --git a/netbox_proxbox/backend/schemas/proxmox.py b/netbox_proxbox/backend/schemas/proxmox.py new file mode 100644 index 00000000..2529a150 --- /dev/null +++ b/netbox_proxbox/backend/schemas/proxmox.py @@ -0,0 +1,12 @@ +from pydantic import BaseModel + +class ProxmoxToken(BaseModel): + name: str + value: str + +class ProxmoxSession(BaseModel): + domain: str + http_port: int + user: str + password: str + token: ProxmoxToken \ No newline at end of file diff --git a/netbox_proxbox/main.py b/netbox_proxbox/main.py index 375bd1d6..01398bf3 100644 --- a/netbox_proxbox/main.py +++ b/netbox_proxbox/main.py @@ -57,6 +57,10 @@ from typing import Annotated from fastapi import Depends, FastAPI, Query +from .backend.routes.netbox import ( + router as netbox_router, + netbox_plugins_config +) from .backend.schemas import * @@ -65,6 +69,7 @@ # Init FastAPI app = FastAPI() +app.include_router(netbox_router, prefix="/netbox", tags=["netbox"]) @app.get("/") async def root(): @@ -75,67 +80,6 @@ async def root(): # templates = Jinja2Templates(directory="/opt/netbox/netbox/netbox-proxbox/netbox_proxbox/templates/netbox_proxbox") -@app.get("/netbox/plugins-config") -async def netbox_plugins_config( - plugin_name: str | None = PROXBOX_PLUGIN_NAME, - list_all: bool | None = None - ): - """ - PLUGIN_CONFIG variable defined by user in Netbox 'configuration.py' file - """ - - try: - from netbox.settings import PLUGINS_CONFIG - except Exception as e: - return { - "error": { - "message": "Could not import PLUGINS CONFIG from configuration.py", - "python_exception": f"{e}" - } - } - - # If ?list=all=True - # Return complete PLUGINS_CONFIG (including other plugins) - if list_all: - return PLUGINS_CONFIG - - # Message error to not found plugins. - plugin_not_found = f"Could not get '{plugin_name}' plugin config from 'PLUGINS_CONFIG' variable located at Netbox 'configuration.py'" - - # Search for configuration of another plugin. This feature is not recommended and may cause security issues, use at your own risk. - if plugin_name != PROXBOX_PLUGIN_NAME: - return PLUGINS_CONFIG.get(plugin_name, { - "error": { - "message": plugin_not_found - } - } - ) - - try: - return PluginConfig(**PLUGINS_CONFIG.get(plugin_name, { - "error": { - "message": plugin_not_found - } - } - ) - ) - - except Exception as e: - return { - "error": { - "message": "Plugin configuration at PLUGINS_CONFIG (configuration.py) is probably incorrect.", - "detail": "Could not feed 'PluginConfig' pydantic model with config provided from 'PLUGINS_CONFIG'.", - "python_exception": f"{e}", - } - } - - - return PLUGINS_CONFIG.get(plugin_name, { - "error": { - "message": f"Could not get '{plugin_name}' plugin config from 'PLUGINS_CONFIG' variable located at Netbox 'configuration.py'" - } - } - ) @app.get("/proxbox/netbox/default-settings") async def proxbox_netbox_default(): From 9cfe19c705f360a74f53deaebfe7edca343a24f2 Mon Sep 17 00:00:00 2001 From: emersonfelipesp Date: Tue, 10 Oct 2023 19:05:21 +0000 Subject: [PATCH 07/34] Add /proxbox/settings/{app} path to retrieve both Proxmox and Netbox config from PLUGINS_CONFIG variable --- netbox_proxbox/backend/routes/netbox.py | 2 +- netbox_proxbox/main.py | 29 ++++++++++++++++++++----- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/netbox_proxbox/backend/routes/netbox.py b/netbox_proxbox/backend/routes/netbox.py index 0a2faabe..17414b48 100644 --- a/netbox_proxbox/backend/routes/netbox.py +++ b/netbox_proxbox/backend/routes/netbox.py @@ -10,7 +10,7 @@ @router.get("/plugins-config") async def netbox_plugins_config( plugin_name: str | None = PROXBOX_PLUGIN_NAME, - list_all: bool | None = None + list_all: bool | None = False ): """ PLUGIN_CONFIG variable defined by user in Netbox 'configuration.py' file diff --git a/netbox_proxbox/main.py b/netbox_proxbox/main.py index 01398bf3..da4a7a8e 100644 --- a/netbox_proxbox/main.py +++ b/netbox_proxbox/main.py @@ -93,13 +93,30 @@ async def proxbox_netbox_default(): @app.get("/proxbox/settings") async def proxbox_settings( plugins_config: Annotated[PluginConfig, Depends(netbox_plugins_config)], - default_settings: Annotated[PluginConfig, Depends(proxbox_netbox_default)] + default_settings: Annotated[PluginConfig, Depends(proxbox_netbox_default)], + list_all: bool | None = False ): - return { - "plugins_config": plugins_config, - "default_settings": default_settings - } - + if list_all: + return { + "plugins_config": plugins_config, + "default_settings": default_settings + } + print(plugins_config) + return plugins_config + +@app.get("/proxbox/settings/{app}") +async def proxbox_settings( + proxbox_config: Annotated[PluginConfig, Depends(proxbox_settings)], + app: str +): + """ + Get user configuration for each application (Netbox or Proxmox) + """ + + if app == "netbox": return proxbox_config.netbox + elif app == "proxmox": return proxbox_config.proxmox + else: return {"error": {"message": f"Query parameter '{app}' is invalid. Must be string 'proxmox' or 'netbox'. e.g. /proxbox/settings/netbox"}} + @app.get("/standalone-info") async def standalone_info(): From cbfd99baf665ab7c41d12b01ba1b1964d8b46c42 Mon Sep 17 00:00:00 2001 From: emersonfelipesp Date: Tue, 10 Oct 2023 19:08:14 +0000 Subject: [PATCH 08/34] Rename 'proxbox_settings' function to 'app_settings' --- netbox_proxbox/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox_proxbox/main.py b/netbox_proxbox/main.py index da4a7a8e..62ce5266 100644 --- a/netbox_proxbox/main.py +++ b/netbox_proxbox/main.py @@ -105,7 +105,7 @@ async def proxbox_settings( return plugins_config @app.get("/proxbox/settings/{app}") -async def proxbox_settings( +async def app_settings( proxbox_config: Annotated[PluginConfig, Depends(proxbox_settings)], app: str ): From a923054342279273a90fc903c01c4fe31772f4b9 Mon Sep 17 00:00:00 2001 From: emersonfelipesp Date: Tue, 17 Oct 2023 21:36:28 +0000 Subject: [PATCH 09/34] NetboxSession working, example endpoint: /netbox/status --- netbox_proxbox/backend/routes/netbox.py | 87 +++------- netbox_proxbox/backend/routes/proxbox.py | 108 ++++++++++++ netbox_proxbox/backend/routes/proxmox.py | 151 +++++++++++++++++ netbox_proxbox/backend/schemas/__init__.py | 8 +- netbox_proxbox/backend/schemas/netbox.py | 6 +- netbox_proxbox/backend/schemas/proxmox.py | 27 ++- netbox_proxbox/backend/session/netbox.py | 50 ++++++ netbox_proxbox/backend/session/proxmox.py | 2 + netbox_proxbox/main.py | 187 ++------------------- 9 files changed, 380 insertions(+), 246 deletions(-) create mode 100644 netbox_proxbox/backend/session/netbox.py create mode 100644 netbox_proxbox/backend/session/proxmox.py diff --git a/netbox_proxbox/backend/routes/netbox.py b/netbox_proxbox/backend/routes/netbox.py index 17414b48..dee75ca3 100644 --- a/netbox_proxbox/backend/routes/netbox.py +++ b/netbox_proxbox/backend/routes/netbox.py @@ -1,70 +1,35 @@ -from fastapi import APIRouter +from fastapi import APIRouter, Depends + +from typing import Annotated, Any from netbox_proxbox.backend.schemas import PluginConfig -from netbox_proxbox.backend.schemas.netbox import * +from netbox_proxbox.backend.schemas.netbox import NetboxSessionSchema +from netbox_proxbox.backend.session.netbox import NetboxSession +from netbox_proxbox.backend.routes.proxbox import netbox_settings router = APIRouter() -PROXBOX_PLUGIN_NAME = "netbox_proxbox" - -@router.get("/plugins-config") -async def netbox_plugins_config( - plugin_name: str | None = PROXBOX_PLUGIN_NAME, - list_all: bool | None = False - ): - """ - PLUGIN_CONFIG variable defined by user in Netbox 'configuration.py' file - """ +@router.get("/") +async def netbox( + netbox_settings: Annotated[NetboxSessionSchema, Depends(netbox_settings)], +): + + return NetboxSession(netbox_settings) - try: - from netbox.settings import PLUGINS_CONFIG - except Exception as e: - return { - "error": { - "message": "Could not import PLUGINS CONFIG from configuration.py", - "python_exception": f"{e}" - } - } +@router.get("/status") +async def netbox_status( + nb: Annotated[Any, Depends(netbox)] +): + return nb.nb_session.status() - # If ?list=all=True - # Return complete PLUGINS_CONFIG (including other plugins) - if list_all: - return PLUGINS_CONFIG +@router.get("/devices") +async def netbox_devices(nb: Annotated[Any, Depends(netbox)]): + "Return a list of all devices registered on Netbox." + raw_list = [] - # Message error to not found plugins. - plugin_not_found = f"Could not get '{plugin_name}' plugin config from 'PLUGINS_CONFIG' variable located at Netbox 'configuration.py'" + device_list = nb.nb_session.dcim.device_roles.all() + for device in device_list: + raw_list.append(device) - # Search for configuration of another plugin. This feature is not recommended and may cause security issues, use at your own risk. - if plugin_name != PROXBOX_PLUGIN_NAME: - return PLUGINS_CONFIG.get(plugin_name, { - "error": { - "message": plugin_not_found - } - } - ) - - try: - return PluginConfig(**PLUGINS_CONFIG.get(plugin_name, { - "error": { - "message": plugin_not_found - } - } - ) - ) - - except Exception as e: - return { - "error": { - "message": "Plugin configuration at PLUGINS_CONFIG (configuration.py) is probably incorrect.", - "detail": "Could not feed 'PluginConfig' pydantic model with config provided from 'PLUGINS_CONFIG'.", - "python_exception": f"{e}", - } - } - - - return PLUGINS_CONFIG.get(plugin_name, { - "error": { - "message": f"Could not get '{plugin_name}' plugin config from 'PLUGINS_CONFIG' variable located at Netbox 'configuration.py'" - } - } - ) \ No newline at end of file + return raw_list + \ No newline at end of file diff --git a/netbox_proxbox/backend/routes/proxbox.py b/netbox_proxbox/backend/routes/proxbox.py index e69de29b..87735572 100644 --- a/netbox_proxbox/backend/routes/proxbox.py +++ b/netbox_proxbox/backend/routes/proxbox.py @@ -0,0 +1,108 @@ +from typing import Annotated + +from fastapi import APIRouter, Depends + +from netbox_proxbox.backend.schemas import PluginConfig +from netbox_proxbox.backend.schemas.netbox import NetboxSessionSchema +router = APIRouter() + +PROXBOX_PLUGIN_NAME = "netbox_proxbox" + +@router.get("/netbox/plugins-config") +async def netbox_plugins_config( + plugin_name: str | None = PROXBOX_PLUGIN_NAME, + list_all: bool | None = False + ): + """ + PLUGIN_CONFIG variable defined by user in Netbox 'configuration.py' file + """ + + try: + from netbox.settings import PLUGINS_CONFIG + except Exception as e: + return { + "error": { + "message": "Could not import PLUGINS CONFIG from configuration.py", + "python_exception": f"{e}" + } + } + + # If ?list=all=True + # Return complete PLUGINS_CONFIG (including other plugins) + if list_all: + return PLUGINS_CONFIG + + # Message error to not found plugins. + plugin_not_found = f"Could not get '{plugin_name}' plugin config from 'PLUGINS_CONFIG' variable located at Netbox 'configuration.py'" + + # Search for configuration of another plugin. This feature is not recommended and may cause security issues, use at your own risk. + if plugin_name != PROXBOX_PLUGIN_NAME: + return PLUGINS_CONFIG.get(plugin_name, { + "error": { + "message": plugin_not_found + } + } + ) + + try: + return PluginConfig(**PLUGINS_CONFIG.get(plugin_name, { + "error": { + "message": plugin_not_found + } + } + ) + ) + + except Exception as e: + return { + "error": { + "message": "Plugin configuration at PLUGINS_CONFIG (configuration.py) is probably incorrect.", + "detail": "Could not feed 'PluginConfig' pydantic model with config provided from 'PLUGINS_CONFIG'.", + "python_exception": f"{e}", + } + } + + +@router.get("/netbox/default-settings") +async def proxbox_netbox_default(): + """ + Default Plugins settings + """ + + from netbox_proxbox import ProxboxConfig + return ProxboxConfig.default_settings + + +@router.get("/settings") +async def proxbox_settings( + plugins_config: Annotated[PluginConfig, Depends(netbox_plugins_config)], + default_settings: Annotated[PluginConfig, Depends(proxbox_netbox_default)], + list_all: bool | None = False +): + if list_all: + return { + "plugins_config": plugins_config, + "default_settings": default_settings + } + return plugins_config + + +@router.get("/settings/netbox") +async def netbox_settings( + proxbox_config: Annotated[PluginConfig, Depends(proxbox_settings)], +): + """ + Get user configuration for Netbox from PLUGINS_CONFIG + """ + return proxbox_config.netbox + + + +@router.get("/settings/proxmox") +async def proxmox_settings( + proxbox_config: Annotated[PluginConfig, Depends(proxbox_settings)], +): + """ + Get user configuration for Proxmox from PLUGINS_CONFIG + """ + return proxbox_config.proxmox \ No newline at end of file diff --git a/netbox_proxbox/backend/routes/proxmox.py b/netbox_proxbox/backend/routes/proxmox.py index e69de29b..9b865435 100644 --- a/netbox_proxbox/backend/routes/proxmox.py +++ b/netbox_proxbox/backend/routes/proxmox.py @@ -0,0 +1,151 @@ + +from fastapi import APIRouter, Depends + + + +#from netbox_proxbox.backend.schemas import PluginConfig +#from netbox_proxbox.backend.schemas.netbox import * + +router = APIRouter() + +@router.get("/") +async def proxmox(): + + def minimize_result(endpoint_name): + endpoint_list = [] + result = px(endpoint_name).get() + + match endpoint_name: + case "access": + for obj in result: + endpoint_list.append(obj.get("subdir")) + + case "cluster": + for obj in result: + endpoint_list.append(obj.get("name")) + + return endpoint_list + + api_hierarchy = { + "access": minimize_result("access"), + "cluster": minimize_result("cluster"), + "nodes": px.nodes.get(), + "pools": px.pools.get(), + "storage": px.storage.get(), + "version": px.version.get(), + } + + return { + "message": "Proxmox API", + "proxmox_api_viewer": "https://pve.proxmox.com/pve-docs/api-viewer/", + "github": { + "netbox": "https://github.com/netbox-community/netbox", + "pynetbox": "https://github.com/netbox-community/pynetbox", + "proxmoxer": "https://github.com/proxmoxer/proxmoxer", + "proxbox": "https://github.com/netdevopsbr/netbox-proxbox" + }, + "base_endpoints": api_hierarchy + } + +""" +# Import Proxmox Session Config +from .proxbox import app_settings + +@router.get("/session") +async def proxmox_session( + app: str = "proxmox", + PROXMOX_CONFIG = Depends(app_settings), +): + print(app) + # Import lib to run Proxmox communication + from proxmoxer import ProxmoxAPI + + return PROXMOX_CONFIG +""" + +""" +@router.get("/{top_level}") +async def top_level_endpoint( + top_level: str | None = None, +): + if top_level not in TOPLEVEL_ENDPOINTS: + return { + "message": f"'{top_level}' is not a valid endpoint/path name.", + "valid_names": TOPLEVEL_ENDPOINTS, + } + + current_index = TOPLEVEL_ENDPOINTS.index(top_level) + other_endpoints = TOPLEVEL_ENDPOINTS.copy() + other_endpoints.pop(current_index) + + return { + f"{top_level}": px(top_level).get(), + "other_endpoints": other_endpoints, + } + + +@router.get("/{top_level}/{second_level}") +async def second_level_endpoint( + top_level: str | None = None, + second_level: str | None = None, + type: str | None = None, + id: str | None = None, +): + if top_level not in TOPLEVEL_ENDPOINTS: + return { + "message": f"'{top_level}' is not a valid endpoint/path name.", + "valid_names": TOPLEVEL_ENDPOINTS, + } + + json_obj = {f"{top_level}": {}} + + try: + path = f"{top_level}/{second_level}" + + # HTTP request through proxmoxer lib + if path == "cluster/resources" and type != None: + result = px(path).get(type = type) + else: + result = px(path).get() + + # Feed JSON result + json_obj[top_level][second_level] = result + + except ResourceException as error: + return { + "message": f"Path {path} does not exist.", + "error": error + } + + return json_obj +""" + +""" +@app.get("/netbox", response_class=HTMLResponse) +async def netbox( + request: Request, + proxmox: Annotated[dict, Depends(root)] +): + return templates.TemplateResponse("fastapi/home.html", { + "request": request, + "json_content": proxmox + } + ) +""" + + +""" +@app.get("/", response_class=HTMLResponse) +async def root( + request: Request, + json_content: Annotated[dict, Depends(standalone_info)], + proxmox_output: Annotated[dict, Depends(proxmox)] +): + return templates.TemplateResponse("fastapi/home.html", { + "request": request, + "json_content": json_content, + "proxmox": proxmox_output, + "proxmox_str": json.dumps(proxmox_output, indent=4), + } + ) +""" \ No newline at end of file diff --git a/netbox_proxbox/backend/schemas/__init__.py b/netbox_proxbox/backend/schemas/__init__.py index 57e7ba03..1ff27635 100644 --- a/netbox_proxbox/backend/schemas/__init__.py +++ b/netbox_proxbox/backend/schemas/__init__.py @@ -1,7 +1,7 @@ from pydantic import BaseModel -from .netbox import * -from .proxmox import * +from .netbox import NetboxSessionSchema +from .proxmox import ProxmoxSessionSchema class PluginConfig(BaseModel): - proxmox: list[ProxmoxSession] - netbox: NetboxSession \ No newline at end of file + proxmox: list[ProxmoxSessionSchema] + netbox: NetboxSessionSchema \ No newline at end of file diff --git a/netbox_proxbox/backend/schemas/netbox.py b/netbox_proxbox/backend/schemas/netbox.py index 0d94915f..468b0f35 100644 --- a/netbox_proxbox/backend/schemas/netbox.py +++ b/netbox_proxbox/backend/schemas/netbox.py @@ -1,13 +1,13 @@ from pydantic import BaseModel -class NetboxSessionSettings(BaseModel): +class NetboxSessionSettingsSchema(BaseModel): virtualmachine_role_id: int node_role_id: int site_id: int -class NetboxSession(BaseModel): +class NetboxSessionSchema(BaseModel): domain: str http_port: int token: str ssl: bool - settings: NetboxSessionSettings | None = None \ No newline at end of file + settings: NetboxSessionSettingsSchema | None = None \ No newline at end of file diff --git a/netbox_proxbox/backend/schemas/proxmox.py b/netbox_proxbox/backend/schemas/proxmox.py index 2529a150..1d7d8007 100644 --- a/netbox_proxbox/backend/schemas/proxmox.py +++ b/netbox_proxbox/backend/schemas/proxmox.py @@ -1,12 +1,33 @@ from pydantic import BaseModel -class ProxmoxToken(BaseModel): +class ProxmoxTokenSchema(BaseModel): name: str value: str -class ProxmoxSession(BaseModel): +class ProxmoxSessionSchema(BaseModel): domain: str http_port: int user: str password: str - token: ProxmoxToken \ No newline at end of file + token: ProxmoxTokenSchema + ssl: bool + + """ + model_config = { + "json_schema_extra": { + "examples": [ + { + 'domain': 'proxbox2.example.com', + 'http_port': 8006, + 'user': 'root@pam', + 'password': 'Strong@P4ssword', + 'token': { + 'name': 'tokenID', + 'value': '039az154-23b2-4be0-8d20-b66abc8c4686' + }, + 'ssl': False + } + ] + } + } + """ \ No newline at end of file diff --git a/netbox_proxbox/backend/session/netbox.py b/netbox_proxbox/backend/session/netbox.py new file mode 100644 index 00000000..55cf1ad6 --- /dev/null +++ b/netbox_proxbox/backend/session/netbox.py @@ -0,0 +1,50 @@ +import requests +# Netbox +import pynetbox + +try: + from netbox.settings import BASE_PATH + DEFAULT_BASE_PATH = '/' + BASE_PATH +except ImportError: + DEFAULT_BASE_PATH = '' + +# +# NETBOX SESSION +# +# TODO: CREATES SSL VERIFICATION - Issue #32 +class NetboxSession: + def __init__(self, netbox_settings): + self.domain = netbox_settings.domain + self.http_port = netbox_settings.http_port + self.token = netbox_settings.token + self.ssl = netbox_settings.ssl + self.settings = netbox_settings.settings + + self.nb_session = self.connection() + + def connection(self): + print("Establish Netbox connection...") + try: + # CHANGE SSL VERIFICATION TO FALSE + session = requests.Session() + session.verify = False + + netbox_session = pynetbox.api( + f'http://{self.domain}:{self.http_port}{DEFAULT_BASE_PATH}', + token=self.token, + threading=True, + ) + # DISABLES SSL VERIFICATION + netbox_session.http_session = session + + devices = netbox_session.dcim.devices.all() + for device in devices: + print(device) + + print(netbox_session) + return netbox_session + + except Exception as error: + raise RuntimeError(f"Error trying to initialize Netbox Session using TOKEN {self.token} provided.\nPython Error: {error}") + + \ No newline at end of file diff --git a/netbox_proxbox/backend/session/proxmox.py b/netbox_proxbox/backend/session/proxmox.py new file mode 100644 index 00000000..e56dd477 --- /dev/null +++ b/netbox_proxbox/backend/session/proxmox.py @@ -0,0 +1,2 @@ +# Proxmox +from proxmoxer import ProxmoxAPI diff --git a/netbox_proxbox/main.py b/netbox_proxbox/main.py index 62ce5266..95713c8b 100644 --- a/netbox_proxbox/main.py +++ b/netbox_proxbox/main.py @@ -56,10 +56,15 @@ from typing import Annotated -from fastapi import Depends, FastAPI, Query +from fastapi import FastAPI from .backend.routes.netbox import ( - router as netbox_router, - netbox_plugins_config + router as netbox_router +) +from .backend.routes.proxbox import ( + router as proxbox_router +) +from .backend.routes.proxmox import ( + router as proxmox_router ) from .backend.schemas import * @@ -69,56 +74,17 @@ # Init FastAPI app = FastAPI() +# Routes (Endpoints) app.include_router(netbox_router, prefix="/netbox", tags=["netbox"]) - -@app.get("/") -async def root(): - return {"message": "Hello World"} - +app.include_router(proxbox_router, prefix="/proxbox", tags=["proxbox"]) +app.include_router(proxmox_router, prefix="/proxmox", tags=["proxmox"]) # app.mount("/static", StaticFiles(directory="/opt/netbox/netbox/netbox-proxbox/netbox_proxbox/static"), name="static") # templates = Jinja2Templates(directory="/opt/netbox/netbox/netbox-proxbox/netbox_proxbox/templates/netbox_proxbox") - -@app.get("/proxbox/netbox/default-settings") -async def proxbox_netbox_default(): - """ - Default Plugins settings - """ - - from netbox_proxbox import ProxboxConfig - return ProxboxConfig.default_settings - -@app.get("/proxbox/settings") -async def proxbox_settings( - plugins_config: Annotated[PluginConfig, Depends(netbox_plugins_config)], - default_settings: Annotated[PluginConfig, Depends(proxbox_netbox_default)], - list_all: bool | None = False -): - if list_all: - return { - "plugins_config": plugins_config, - "default_settings": default_settings - } - print(plugins_config) - return plugins_config - -@app.get("/proxbox/settings/{app}") -async def app_settings( - proxbox_config: Annotated[PluginConfig, Depends(proxbox_settings)], - app: str -): - """ - Get user configuration for each application (Netbox or Proxmox) - """ - - if app == "netbox": return proxbox_config.netbox - elif app == "proxmox": return proxbox_config.proxmox - else: return {"error": {"message": f"Query parameter '{app}' is invalid. Must be string 'proxmox' or 'netbox'. e.g. /proxbox/settings/netbox"}} - -@app.get("/standalone-info") +@app.get("/") async def standalone_info(): return { "message": "Proxbox Backend made in FastAPI framework", @@ -133,132 +99,3 @@ async def standalone_info(): } } -""" -@app.get("/proxmox") -async def proxmox(): - - def minimize_result(endpoint_name): - endpoint_list = [] - result = px(endpoint_name).get() - - match endpoint_name: - case "access": - for obj in result: - endpoint_list.append(obj.get("subdir")) - - case "cluster": - for obj in result: - endpoint_list.append(obj.get("name")) - - return endpoint_list - - api_hierarchy = { - "access": minimize_result("access"), - "cluster": minimize_result("cluster"), - "nodes": px.nodes.get(), - "pools": px.pools.get(), - "storage": px.storage.get(), - "version": px.version.get(), - } - - return { - "message": "Proxmox API", - "proxmox_api_viewer": "https://pve.proxmox.com/pve-docs/api-viewer/", - "github": { - "netbox": "https://github.com/netbox-community/netbox", - "pynetbox": "https://github.com/netbox-community/pynetbox", - "proxmoxer": "https://github.com/proxmoxer/proxmoxer", - "proxbox": "https://github.com/netdevopsbr/netbox-proxbox" - }, - "base_endpoints": api_hierarchy - } -""" - -""" -@app.get("/", response_class=HTMLResponse) -async def root( - request: Request, - json_content: Annotated[dict, Depends(standalone_info)], - proxmox_output: Annotated[dict, Depends(proxmox)] -): - return templates.TemplateResponse("fastapi/home.html", { - "request": request, - "json_content": json_content, - "proxmox": proxmox_output, - "proxmox_str": json.dumps(proxmox_output, indent=4), - } - ) -""" - - -""" -@app.get("/netbox", response_class=HTMLResponse) -async def netbox( - request: Request, - proxmox: Annotated[dict, Depends(root)] -): - return templates.TemplateResponse("fastapi/home.html", { - "request": request, - "json_content": proxmox - } - ) -""" - -""" -@app.get("/proxmox/{top_level}") -async def top_level_endpoint( - top_level: str | None = None, -): - if top_level not in TOPLEVEL_ENDPOINTS: - return { - "message": f"'{top_level}' is not a valid endpoint/path name.", - "valid_names": TOPLEVEL_ENDPOINTS, - } - - current_index = TOPLEVEL_ENDPOINTS.index(top_level) - other_endpoints = TOPLEVEL_ENDPOINTS.copy() - other_endpoints.pop(current_index) - - return { - f"{top_level}": px(top_level).get(), - "other_endpoints": other_endpoints, - } -""" - - -""" -@app.get("/proxmox/{top_level}/{second_level}") -async def second_level_endpoint( - top_level: str | None = None, - second_level: str | None = None, - type: str | None = None, - id: str | None = None, -): - if top_level not in TOPLEVEL_ENDPOINTS: - return { - "message": f"'{top_level}' is not a valid endpoint/path name.", - "valid_names": TOPLEVEL_ENDPOINTS, - } - - json_obj = {f"{top_level}": {}} - - try: - path = f"{top_level}/{second_level}" - - # HTTP request through proxmoxer lib - if path == "cluster/resources" and type != None: - result = px(path).get(type = type) - else: - result = px(path).get() - - # Feed JSON result - json_obj[top_level][second_level] = result - - except ResourceException as error: - return { - "message": f"Path {path} does not exist.", - "error": error - } - - return json_obj -""" \ No newline at end of file From 7eb1fa9a18af473cc5995627db71165262908a97 Mon Sep 17 00:00:00 2001 From: emersonfelipesp Date: Wed, 18 Oct 2023 19:29:56 +0000 Subject: [PATCH 10/34] Add '/netbox/openapi' HTTP path and create Annotated var 'NetboxSessionDep' for pynetbox session --- netbox_proxbox/backend/routes/netbox.py | 32 ++++++++++++++++++------ netbox_proxbox/backend/session/netbox.py | 7 +----- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/netbox_proxbox/backend/routes/netbox.py b/netbox_proxbox/backend/routes/netbox.py index dee75ca3..6abd4e6b 100644 --- a/netbox_proxbox/backend/routes/netbox.py +++ b/netbox_proxbox/backend/routes/netbox.py @@ -9,21 +9,24 @@ router = APIRouter() -@router.get("/") -async def netbox( + + +async def netbox_session( netbox_settings: Annotated[NetboxSessionSchema, Depends(netbox_settings)], ): - - return NetboxSession(netbox_settings) + """Instantiate 'NetboxSession' class with user parameters and return Netbox HTTP connection to make API calls""" + return NetboxSession(netbox_settings).session + +NetboxSessionDep = Annotated[Any, Depends(netbox_session)] @router.get("/status") async def netbox_status( - nb: Annotated[Any, Depends(netbox)] + nb: NetboxSessionDep ): - return nb.nb_session.status() + return nb.status() @router.get("/devices") -async def netbox_devices(nb: Annotated[Any, Depends(netbox)]): +async def netbox_devices(nb: NetboxSessionDep): "Return a list of all devices registered on Netbox." raw_list = [] @@ -32,4 +35,17 @@ async def netbox_devices(nb: Annotated[Any, Depends(netbox)]): raw_list.append(device) return raw_list - \ No newline at end of file + +@router.get("/openapi") +async def netbox_devices(nb: NetboxSessionDep): + return nb.openapi() + +@router.get("/") +async def netbox( + status: Annotated[Any, Depends(netbox_status)], + config: Annotated[Any, Depends(netbox_settings)] +): + return { + "config": config, + "status": status + } \ No newline at end of file diff --git a/netbox_proxbox/backend/session/netbox.py b/netbox_proxbox/backend/session/netbox.py index 55cf1ad6..732f3ed7 100644 --- a/netbox_proxbox/backend/session/netbox.py +++ b/netbox_proxbox/backend/session/netbox.py @@ -20,7 +20,7 @@ def __init__(self, netbox_settings): self.ssl = netbox_settings.ssl self.settings = netbox_settings.settings - self.nb_session = self.connection() + self.session = self.connection() def connection(self): print("Establish Netbox connection...") @@ -37,11 +37,6 @@ def connection(self): # DISABLES SSL VERIFICATION netbox_session.http_session = session - devices = netbox_session.dcim.devices.all() - for device in devices: - print(device) - - print(netbox_session) return netbox_session except Exception as error: From 805844c60506d48d70a5a76207b302bbb8992982 Mon Sep 17 00:00:00 2001 From: emersonfelipesp Date: Wed, 18 Oct 2023 20:25:06 +0000 Subject: [PATCH 11/34] Make pynetbox() assync remove pynetbox attribute from NetboxSession class --- netbox_proxbox/backend/routes/netbox.py | 2 +- netbox_proxbox/backend/routes/proxmox.py | 2 +- netbox_proxbox/backend/session/netbox.py | 11 +++++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/netbox_proxbox/backend/routes/netbox.py b/netbox_proxbox/backend/routes/netbox.py index 6abd4e6b..ca6e5aa9 100644 --- a/netbox_proxbox/backend/routes/netbox.py +++ b/netbox_proxbox/backend/routes/netbox.py @@ -15,7 +15,7 @@ async def netbox_session( netbox_settings: Annotated[NetboxSessionSchema, Depends(netbox_settings)], ): """Instantiate 'NetboxSession' class with user parameters and return Netbox HTTP connection to make API calls""" - return NetboxSession(netbox_settings).session + return await NetboxSession(netbox_settings).pynetbox() NetboxSessionDep = Annotated[Any, Depends(netbox_session)] diff --git a/netbox_proxbox/backend/routes/proxmox.py b/netbox_proxbox/backend/routes/proxmox.py index 9b865435..98d08ab2 100644 --- a/netbox_proxbox/backend/routes/proxmox.py +++ b/netbox_proxbox/backend/routes/proxmox.py @@ -24,7 +24,7 @@ def minimize_result(endpoint_name): for obj in result: endpoint_list.append(obj.get("name")) - return endpoint_list + return endpoint_listp api_hierarchy = { "access": minimize_result("access"), diff --git a/netbox_proxbox/backend/session/netbox.py b/netbox_proxbox/backend/session/netbox.py index 732f3ed7..7f6771b6 100644 --- a/netbox_proxbox/backend/session/netbox.py +++ b/netbox_proxbox/backend/session/netbox.py @@ -1,4 +1,6 @@ +import aiohttp import requests + # Netbox import pynetbox @@ -20,9 +22,7 @@ def __init__(self, netbox_settings): self.ssl = netbox_settings.ssl self.settings = netbox_settings.settings - self.session = self.connection() - - def connection(self): + async def pynetbox(self): print("Establish Netbox connection...") try: # CHANGE SSL VERIFICATION TO FALSE @@ -42,4 +42,7 @@ def connection(self): except Exception as error: raise RuntimeError(f"Error trying to initialize Netbox Session using TOKEN {self.token} provided.\nPython Error: {error}") - \ No newline at end of file + async def aiohttp(self): + # Future Development. We're currently use pynetbox. + pass + \ No newline at end of file From fb716119a21ef5f22e73cafc95689865b5b4f28f Mon Sep 17 00:00:00 2001 From: emersonfelipesp Date: Wed, 18 Oct 2023 20:46:37 +0000 Subject: [PATCH 12/34] Start ProxmoxSession class, not tested yet. --- netbox_proxbox/backend/routes/netbox.py | 3 +- netbox_proxbox/backend/routes/proxmox.py | 4 +- netbox_proxbox/backend/session/proxmox.py | 52 +++++++++++++++++++++++ 3 files changed, 54 insertions(+), 5 deletions(-) diff --git a/netbox_proxbox/backend/routes/netbox.py b/netbox_proxbox/backend/routes/netbox.py index ca6e5aa9..1bfaf435 100644 --- a/netbox_proxbox/backend/routes/netbox.py +++ b/netbox_proxbox/backend/routes/netbox.py @@ -9,14 +9,13 @@ router = APIRouter() - - async def netbox_session( netbox_settings: Annotated[NetboxSessionSchema, Depends(netbox_settings)], ): """Instantiate 'NetboxSession' class with user parameters and return Netbox HTTP connection to make API calls""" return await NetboxSession(netbox_settings).pynetbox() +# Make Session reusable NetboxSessionDep = Annotated[Any, Depends(netbox_session)] @router.get("/status") diff --git a/netbox_proxbox/backend/routes/proxmox.py b/netbox_proxbox/backend/routes/proxmox.py index 98d08ab2..b3c1c8a6 100644 --- a/netbox_proxbox/backend/routes/proxmox.py +++ b/netbox_proxbox/backend/routes/proxmox.py @@ -2,9 +2,7 @@ from fastapi import APIRouter, Depends - -#from netbox_proxbox.backend.schemas import PluginConfig -#from netbox_proxbox.backend.schemas.netbox import * +from netbox_proxbox.backend.session.netbox import ProxmoxSession router = APIRouter() diff --git a/netbox_proxbox/backend/session/proxmox.py b/netbox_proxbox/backend/session/proxmox.py index e56dd477..36a25ed2 100644 --- a/netbox_proxbox/backend/session/proxmox.py +++ b/netbox_proxbox/backend/session/proxmox.py @@ -1,2 +1,54 @@ # Proxmox from proxmoxer import ProxmoxAPI + +# +# PROXMOX SESSION +# +class ProxmoxSession: + def __init__(self, proxmox_settings): + self.domain = proxmox_settings.domain + self.http_port = proxmox_settings.http_port + self.user = proxmox_settings.user + self.password = proxmox_settings.password + self.token_name = proxmox_settings.token.name + self.token_value = proxmox_settings.token.value + self.ssl = proxmox_settings.ssl + + async def proxmoxer(self): + print("Establish Proxmox connection...") + + # Check if token was provided + if self.ssl == False: + # DISABLE SSL WARNING + import urllib3 + urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) + + if self.token_name and self.token_value: + # Establish Proxmox Session with Token + try: + proxmox_session = ProxmoxAPI( + self.domain, + port=self.http_port, + token_name=self.token_name, + token_value=self.token_value, + verify_ssl=self.ssl + ) + + return proxmox_session + + except Exception as error: + raise RuntimeError(f'Error trying to initialize Proxmox Session using TOKEN (token_name: {self.token_name} and token_value: {self.token_value} provided') + else: + try: + # Start PROXMOX session using USER CREDENTIALS + PROXMOX_SESSION = ProxmoxAPI( + self.domain, + port=self.http_port, + user=self.user, + password=self.password, + verify_ssl=self.ssl + ) + + return proxmox_session + except Exception as error: + raise RuntimeError(f'Error trying to initialize Proxmox Session using USER {self.user} and PASSWORD provided') \ No newline at end of file From ce1b1999e560963e770252bb707fc009eff451a9 Mon Sep 17 00:00:00 2001 From: emersonfelipesp Date: Mon, 23 Oct 2023 19:01:11 +0000 Subject: [PATCH 13/34] Saves work. ProxboxException created, making error handling better --- netbox_proxbox/backend/exception.py | 10 ++ netbox_proxbox/backend/routes/proxbox.py | 1 + netbox_proxbox/backend/routes/proxmox.py | 46 ++++++- netbox_proxbox/backend/session/proxmox.py | 140 ++++++++++++++++------ netbox_proxbox/main.py | 17 ++- 5 files changed, 174 insertions(+), 40 deletions(-) create mode 100644 netbox_proxbox/backend/exception.py diff --git a/netbox_proxbox/backend/exception.py b/netbox_proxbox/backend/exception.py new file mode 100644 index 00000000..1b2613ac --- /dev/null +++ b/netbox_proxbox/backend/exception.py @@ -0,0 +1,10 @@ +class ProxboxException(Exception): + def __init__( + self, + message: str, + detail: str | None = None, + python_exception: str | None = None, + ): + self.message = message + self.detail = detail + self.python_exception = python_exception \ No newline at end of file diff --git a/netbox_proxbox/backend/routes/proxbox.py b/netbox_proxbox/backend/routes/proxbox.py index 87735572..f95bbbd3 100644 --- a/netbox_proxbox/backend/routes/proxbox.py +++ b/netbox_proxbox/backend/routes/proxbox.py @@ -4,6 +4,7 @@ from netbox_proxbox.backend.schemas import PluginConfig from netbox_proxbox.backend.schemas.netbox import NetboxSessionSchema +from netbox_proxbox.backend.schemas.proxmox import ProxmoxSessionSchema router = APIRouter() PROXBOX_PLUGIN_NAME = "netbox_proxbox" diff --git a/netbox_proxbox/backend/routes/proxmox.py b/netbox_proxbox/backend/routes/proxmox.py index b3c1c8a6..ac33d59a 100644 --- a/netbox_proxbox/backend/routes/proxmox.py +++ b/netbox_proxbox/backend/routes/proxmox.py @@ -1,11 +1,53 @@ from fastapi import APIRouter, Depends +from typing import Annotated, Any -from netbox_proxbox.backend.session.netbox import ProxmoxSession +from netbox_proxbox.backend.schemas.proxmox import ProxmoxSessionSchema +from netbox_proxbox.backend.routes.proxbox import proxmox_settings +from netbox_proxbox.backend.session.proxmox import ProxmoxSession +from netbox_proxbox.backend.exception import ProxboxException router = APIRouter() +async def proxmox_session( + proxmox_settings: Annotated[ProxmoxSessionSchema, Depends(proxmox_settings)], +): + proxmox_session_obj = [] + + try: + for cluster in proxmox_settings: + proxmox_session_obj.append( + await ProxmoxSession(cluster).proxmoxer() + ) + + return proxmox_session_obj + except Exception as error: + print(f"Exception error: {error}") + raise ProxboxException( + message = "Could not return Proxmox Sessions connections based on user-provided parameters", + python_exception = f"{error}" + ) + +# Make Session reusable +ProxmoxSessionDep = Annotated[Any, Depends(proxmox_session)] + +@router.get("/version") +async def proxmox_version( + px_sessions: ProxmoxSessionDep +): + response = [] + + print(f"{px_sessions}") + return f"{px_sessions}" + + for px in px_sessions: + print("PX type equal to: ", type(px)) + response.append(px.version.get()) + + return response + + @router.get("/") async def proxmox(): @@ -22,7 +64,7 @@ def minimize_result(endpoint_name): for obj in result: endpoint_list.append(obj.get("name")) - return endpoint_listp + return endpoint_list api_hierarchy = { "access": minimize_result("access"), diff --git a/netbox_proxbox/backend/session/proxmox.py b/netbox_proxbox/backend/session/proxmox.py index 36a25ed2..7f8341bd 100644 --- a/netbox_proxbox/backend/session/proxmox.py +++ b/netbox_proxbox/backend/session/proxmox.py @@ -1,54 +1,120 @@ # Proxmox from proxmoxer import ProxmoxAPI +from proxmoxer.core import ResourceException + +from netbox_proxbox.backend.exception import ProxboxException + +#from netbox_proxbox.backend.schemas.proxmox import ProxmoxSessionSchema # # PROXMOX SESSION # class ProxmoxSession: def __init__(self, proxmox_settings): - self.domain = proxmox_settings.domain - self.http_port = proxmox_settings.http_port - self.user = proxmox_settings.user - self.password = proxmox_settings.password - self.token_name = proxmox_settings.token.name - self.token_value = proxmox_settings.token.value - self.ssl = proxmox_settings.ssl + #proxmox_settings = proxmox_settings.json() + + proxmox_settings = proxmox_settings.dict() + print(proxmox_settings, type(proxmox_settings)) + + self.domain = proxmox_settings["domain"] + self.http_port = proxmox_settings["http_port"] + self.user = proxmox_settings["user"] + self.password = proxmox_settings["password"] + self.token_name = proxmox_settings["token"]["name"] + self.token_value = proxmox_settings["token"]["value"] + self.ssl = proxmox_settings["ssl"] + + print(self.token_name) + print(self.token_value) + + + async def token_auth(self): + error_message = f"Error trying to initialize Proxmox API connection using TOKEN NAME '{self.token_name}' and TOKEN_VALUE provided", + # Establish Proxmox Session with Token + try: + print("Using token to authenticate with Proxmox") + proxmox_session = ProxmoxAPI( + self.domain, + port=self.http_port, + token_name=self.token_name, + token_value=self.token_value, + verify_ssl=self.ssl + ) + + return proxmox_session + except ResourceException as error: + raise ProxboxException( + message = error_message, + detail = "'ResourceException' from proxmoxer lib raised.", + python_exception = f"{error}" + ) + except Exception as error: + raise ProxboxException( + message = error_message, + detail = "Unknown error.", + python_exception = f"{error}" + ) + + + + async def password_auth(self): + try: + # Start PROXMOX session using USER CREDENTIALS + print("Using password authenticate with Proxmox") + proxmox_session = ProxmoxAPI( + self.domain, + port=self.http_port, + user=self.user, + password=self.password, + verify_ssl=self.ssl + ) + + except Exception as error: + raise RuntimeError() + except Exception as error: + return { + "error": { + "message": f'Error trying to initialize Proxmox Session using USER {self.user} and PASSWORD provided', + "detail": "Not able to establish Proxmox API connection using password provided by the user.", + "python_exception": f"{error}", + } + } + async def proxmoxer(self): print("Establish Proxmox connection...") - # Check if token was provided + # DISABLE SSL WARNING if self.ssl == False: - # DISABLE SSL WARNING import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) - + + # Prefer using token to authenticate if self.token_name and self.token_value: - # Establish Proxmox Session with Token - try: - proxmox_session = ProxmoxAPI( - self.domain, - port=self.http_port, - token_name=self.token_name, - token_value=self.token_value, - verify_ssl=self.ssl - ) - - return proxmox_session - - except Exception as error: - raise RuntimeError(f'Error trying to initialize Proxmox Session using TOKEN (token_name: {self.token_name} and token_value: {self.token_value} provided') + px = await self.token_auth() + else: - try: - # Start PROXMOX session using USER CREDENTIALS - PROXMOX_SESSION = ProxmoxAPI( - self.domain, - port=self.http_port, - user=self.user, - password=self.password, - verify_ssl=self.ssl - ) - - return proxmox_session - except Exception as error: - raise RuntimeError(f'Error trying to initialize Proxmox Session using USER {self.user} and PASSWORD provided') \ No newline at end of file + px = await self.password_auth() + + try: + px.version.get() + except ResourceException as error: + raise ProxboxException( + message = "Testing Proxmox connection failed. Proxmoxer 'ResourceException' raised.", + detail = "After instianting connection from 'ProxmoxAPI', testing the communication failed.", + python_exception = f"{error}", + ) + + except Exception as error: + return { + "error": { + "message": "Testing Proxmox connection failed.", + "detail": "Unkown error.", + "python_exception": f"{error}", + } + } + + return px + + + \ No newline at end of file diff --git a/netbox_proxbox/main.py b/netbox_proxbox/main.py index 95713c8b..2291d630 100644 --- a/netbox_proxbox/main.py +++ b/netbox_proxbox/main.py @@ -56,7 +56,11 @@ from typing import Annotated -from fastapi import FastAPI +from fastapi import FastAPI, Request +from fastapi.responses import JSONResponse + +from netbox_proxbox.backend.exception import ProxboxException + from .backend.routes.netbox import ( router as netbox_router ) @@ -74,6 +78,17 @@ # Init FastAPI app = FastAPI() +@app.exception_handler(ProxboxException) +async def proxmoxer_exception_handler(request: Request, exc: ProxboxException): + return JSONResponse( + status_code=400, + content={ + "message": exc.message, + "detail": exc.detail, + "python_exception": exc.python_exception, + } + ) + # Routes (Endpoints) app.include_router(netbox_router, prefix="/netbox", tags=["netbox"]) app.include_router(proxbox_router, prefix="/proxbox", tags=["proxbox"]) From 4e78fbb2b8e44fe4d942be7c11c1d58a6e4910a3 Mon Sep 17 00:00:00 2001 From: emersonfelipesp Date: Tue, 24 Oct 2023 01:25:25 +0000 Subject: [PATCH 14/34] '/{top_level}/{second_level}' proxmox dynamic path working with single and multi-cluster --- netbox_proxbox/backend/routes/proxmox.py | 147 ++++++++++------------ netbox_proxbox/backend/session/proxmox.py | 58 +++++---- 2 files changed, 99 insertions(+), 106 deletions(-) diff --git a/netbox_proxbox/backend/routes/proxmox.py b/netbox_proxbox/backend/routes/proxmox.py index ac33d59a..cad86316 100644 --- a/netbox_proxbox/backend/routes/proxmox.py +++ b/netbox_proxbox/backend/routes/proxmox.py @@ -1,8 +1,10 @@ -from fastapi import APIRouter, Depends +from fastapi import APIRouter, Depends, HTTPException from typing import Annotated, Any +from proxmoxer.core import ResourceException + from netbox_proxbox.backend.schemas.proxmox import ProxmoxSessionSchema from netbox_proxbox.backend.routes.proxbox import proxmox_settings from netbox_proxbox.backend.session.proxmox import ProxmoxSession @@ -49,7 +51,10 @@ async def proxmox_version( @router.get("/") -async def proxmox(): +async def proxmox( + px_sessions: ProxmoxSessionDep +): + return_list = [] def minimize_result(endpoint_name): endpoint_list = [] @@ -66,14 +71,17 @@ def minimize_result(endpoint_name): return endpoint_list - api_hierarchy = { - "access": minimize_result("access"), - "cluster": minimize_result("cluster"), - "nodes": px.nodes.get(), - "pools": px.pools.get(), - "storage": px.storage.get(), - "version": px.version.get(), - } + for px in px_sessions: + api_hierarchy = { + "access": minimize_result("access"), + "cluster": minimize_result("cluster"), + "nodes": px.nodes.get(), + "pools": px.pools.get(), + "storage": px.storage.get(), + "version": px.version.get(), + } + + return_list.append(api_hierarchy) return { "message": "Proxmox API", @@ -84,30 +92,19 @@ def minimize_result(endpoint_name): "proxmoxer": "https://github.com/proxmoxer/proxmoxer", "proxbox": "https://github.com/netdevopsbr/netbox-proxbox" }, - "base_endpoints": api_hierarchy + "clusters": return_list } -""" -# Import Proxmox Session Config -from .proxbox import app_settings - -@router.get("/session") -async def proxmox_session( - app: str = "proxmox", - PROXMOX_CONFIG = Depends(app_settings), -): - print(app) - # Import lib to run Proxmox communication - from proxmoxer import ProxmoxAPI +TOPLEVEL_ENDPOINTS = ["access", "cluster", "nodes", "pools", "storage", "version"] - return PROXMOX_CONFIG -""" - -""" @router.get("/{top_level}") async def top_level_endpoint( + px_sessions: ProxmoxSessionDep, top_level: str | None = None, ): + # Get only a Proxmox Cluster + px = px_sessions[0] + if top_level not in TOPLEVEL_ENDPOINTS: return { "message": f"'{top_level}' is not a valid endpoint/path name.", @@ -123,69 +120,61 @@ async def top_level_endpoint( "other_endpoints": other_endpoints, } - @router.get("/{top_level}/{second_level}") async def second_level_endpoint( - top_level: str | None = None, - second_level: str | None = None, - type: str | None = None, - id: str | None = None, + px_sessions: ProxmoxSessionDep, + top_level: str, + second_level: str, + mode: str = "multi", ): if top_level not in TOPLEVEL_ENDPOINTS: return { "message": f"'{top_level}' is not a valid endpoint/path name.", "valid_names": TOPLEVEL_ENDPOINTS, } - - json_obj = {f"{top_level}": {}} - - try: - path = f"{top_level}/{second_level}" - # HTTP request through proxmoxer lib - if path == "cluster/resources" and type != None: - result = px(path).get(type = type) - else: - result = px(path).get() - # Feed JSON result - json_obj[top_level][second_level] = result + async def single_cluster(px): + json_obj = {f"{top_level}": {}} + + try: + path = f"{top_level}/{second_level}" + + # HTTP request through proxmoxer lib + if path == "cluster/resources" and type != None: + result = px(path).get(type = type) + else: + result = px(path).get() + + # Feed JSON result + json_obj[top_level][second_level] = result + + return json_obj + + except ResourceException as error: + raise ProxboxException( + message = f"Path {path} does not exist.", + python_exception = f"{error}" + ) + + + async def multi_cluster(px_sessions): + clusters_response = [] - except ResourceException as error: - return { - "message": f"Path {path} does not exist.", - "error": error - } + for px in px_sessions: + clusters_response.append(await single_cluster(px)) - return json_obj -""" - -""" -@app.get("/netbox", response_class=HTMLResponse) -async def netbox( - request: Request, - proxmox: Annotated[dict, Depends(root)] -): - return templates.TemplateResponse("fastapi/home.html", { - "request": request, - "json_content": proxmox - } - ) -""" + return clusters_response -""" -@app.get("/", response_class=HTMLResponse) -async def root( - request: Request, - json_content: Annotated[dict, Depends(standalone_info)], - proxmox_output: Annotated[dict, Depends(proxmox)] -): - return templates.TemplateResponse("fastapi/home.html", { - "request": request, - "json_content": json_content, - "proxmox": proxmox_output, - "proxmox_str": json.dumps(proxmox_output, indent=4), - } - ) -""" \ No newline at end of file + if mode == "multi": + return await multi_cluster(px_sessions) + + if mode == "single": + raise HTTPException( + status_code=501, + detail="Single-cluster API call not implemented yet." + ) + + + return json_obj \ No newline at end of file diff --git a/netbox_proxbox/backend/session/proxmox.py b/netbox_proxbox/backend/session/proxmox.py index 7f8341bd..7cebd235 100644 --- a/netbox_proxbox/backend/session/proxmox.py +++ b/netbox_proxbox/backend/session/proxmox.py @@ -27,6 +27,8 @@ def __init__(self, proxmox_settings): print(self.token_name) print(self.token_value) + def __repr__(self): + return f"Proxmox Connection Object. URL: {domain}:{http_port}" async def token_auth(self): error_message = f"Error trying to initialize Proxmox API connection using TOKEN NAME '{self.token_name}' and TOKEN_VALUE provided", @@ -37,12 +39,25 @@ async def token_auth(self): proxmox_session = ProxmoxAPI( self.domain, port=self.http_port, + user=self.user, token_name=self.token_name, token_value=self.token_value, verify_ssl=self.ssl ) + try: + print(f"Testing Proxmox session 123:") + print(f"{proxmox_session}\n{proxmox_session.version.get()}") + + except Exception as error: + ProxboxException( + message = "Testing Proxmox connection failed.", + detail = "Unkown error.", + python_exception = f"{error}", + ) + return proxmox_session + except ResourceException as error: raise ProxboxException( message = error_message, @@ -59,6 +74,8 @@ async def token_auth(self): async def password_auth(self): + error_message = f'Error trying to initialize Proxmox API connection using USER {self.user} and PASSWORD provided', + try: # Start PROXMOX session using USER CREDENTIALS print("Using password authenticate with Proxmox") @@ -70,16 +87,21 @@ async def password_auth(self): verify_ssl=self.ssl ) + return proxmox_session + + except ResourceException as error: + raise ProxboxException( + message = error_message, + detail = "'ResourceException' from proxmoxer lib raised.", + python_exception = f"{error}" + ) + except Exception as error: - raise RuntimeError() - except Exception as error: - return { - "error": { - "message": f'Error trying to initialize Proxmox Session using USER {self.user} and PASSWORD provided', - "detail": "Not able to establish Proxmox API connection using password provided by the user.", - "python_exception": f"{error}", - } - } + raise ProxboxException( + message = error_message, + detail = "Unknown error.", + python_exception = f"{error}" + ) async def proxmoxer(self): print("Establish Proxmox connection...") @@ -95,25 +117,7 @@ async def proxmoxer(self): else: px = await self.password_auth() - - try: - px.version.get() - except ResourceException as error: - raise ProxboxException( - message = "Testing Proxmox connection failed. Proxmoxer 'ResourceException' raised.", - detail = "After instianting connection from 'ProxmoxAPI', testing the communication failed.", - python_exception = f"{error}", - ) - except Exception as error: - return { - "error": { - "message": "Testing Proxmox connection failed.", - "detail": "Unkown error.", - "python_exception": f"{error}", - } - } - return px From 1ebdcfa89cf3f2df77820ff796cb90ec693ac95b Mon Sep 17 00:00:00 2001 From: emersonfelipesp Date: Tue, 24 Oct 2023 15:09:37 +0000 Subject: [PATCH 15/34] Add Enum validation to '/{top_level}' proxmox path and minor changes --- netbox_proxbox/backend/routes/proxmox.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/netbox_proxbox/backend/routes/proxmox.py b/netbox_proxbox/backend/routes/proxmox.py index cad86316..b3381571 100644 --- a/netbox_proxbox/backend/routes/proxmox.py +++ b/netbox_proxbox/backend/routes/proxmox.py @@ -97,10 +97,20 @@ def minimize_result(endpoint_name): TOPLEVEL_ENDPOINTS = ["access", "cluster", "nodes", "pools", "storage", "version"] +from enum import Enum + +class ProxmoxUpperPaths(str, Enum): + access = "access" + cluster = "cluster" + nodes = "nodes" + storage = "storage" + version = "version" + + @router.get("/{top_level}") async def top_level_endpoint( px_sessions: ProxmoxSessionDep, - top_level: str | None = None, + top_level: ProxmoxUpperPaths, ): # Get only a Proxmox Cluster px = px_sessions[0] @@ -126,6 +136,7 @@ async def second_level_endpoint( top_level: str, second_level: str, mode: str = "multi", + type: str | None = None, ): if top_level not in TOPLEVEL_ENDPOINTS: return { From 29b6f7f557587b8e32903996f4dc3633bafd20ea Mon Sep 17 00:00:00 2001 From: emersonfelipesp Date: Wed, 25 Oct 2023 15:42:55 +0000 Subject: [PATCH 16/34] /proxmox/cluster/resources path working with data validation and response_model. Next step: ResponseValidationException handling --- netbox_proxbox/backend/enum/proxmox.py | 73 ++++++++++++++++++++++ netbox_proxbox/backend/routes/proxmox.py | 74 +++++++++++++++++------ netbox_proxbox/backend/schemas/proxmox.py | 49 +++++++++------ 3 files changed, 158 insertions(+), 38 deletions(-) create mode 100644 netbox_proxbox/backend/enum/proxmox.py diff --git a/netbox_proxbox/backend/enum/proxmox.py b/netbox_proxbox/backend/enum/proxmox.py new file mode 100644 index 00000000..68749e2b --- /dev/null +++ b/netbox_proxbox/backend/enum/proxmox.py @@ -0,0 +1,73 @@ +from enum import Enum + +class ProxmoxModeOptions(str, Enum): + single = "single" + multi = "multi" + +class ProxmoxUpperPaths(str, Enum): + access = "access" + cluster = "cluster" + nodes = "nodes" + storage = "storage" + version = "version" + +class ProxmoxAccessPaths(str, Enum): + domains = "domains" + groups = "groups" + openid = "openid" + roles = "roles" + tfa = "tfa" + users = "users" + acl = "acl" + password = "password" + permissions = "permissions" + ticket = "ticket" + +class ProxmoxClusterPaths(str, Enum): + acme = "acme" + backup = "backup" + backup_info = "backup-info" + ceph = "ceph" + config = "config" + firewall = "firewall" + ha = "ha" + jobs = "jobs" + mapping = "mapping" + metrics = "metrics" + replication = "replication" + sdn = "sdn" + log = "log" + nextid = "nextid" + options = "options" + resources = "resources" + status = "status" + tasks = "tasks" + +class ClusterResourcesType(str, Enum): + vm = "vm" + storage = "storage" + node = "node" + sdn = "sdn" + + +class ClusterResourcesTypeResponse(str, Enum): + node = "node" + storage = "storage" + pool = "pool" + qemu = "qemu" + lxc = "lxc" + openvz = "openvz" + sdn = "sdn" + + +class ProxmoxNodesPaths(str, Enum): + node = "node" + +class ResourceType(Enum): + node = "node" + storage = "storage" + pool = "pool" + qemu = "qemu" + lxc = "lxc" + openvz = "openvz" + sdn = "sdn" \ No newline at end of file diff --git a/netbox_proxbox/backend/routes/proxmox.py b/netbox_proxbox/backend/routes/proxmox.py index b3381571..c4ed98a7 100644 --- a/netbox_proxbox/backend/routes/proxmox.py +++ b/netbox_proxbox/backend/routes/proxmox.py @@ -1,14 +1,16 @@ -from fastapi import APIRouter, Depends, HTTPException +from fastapi import APIRouter, Depends, HTTPException, Path, Query +from fastapi.exceptions import ResponseValidationError, ValidationException from typing import Annotated, Any from proxmoxer.core import ResourceException -from netbox_proxbox.backend.schemas.proxmox import ProxmoxSessionSchema +from netbox_proxbox.backend.schemas.proxmox import * from netbox_proxbox.backend.routes.proxbox import proxmox_settings from netbox_proxbox.backend.session.proxmox import ProxmoxSession from netbox_proxbox.backend.exception import ProxboxException +from netbox_proxbox.backend.enum.proxmox import * router = APIRouter() @@ -95,16 +97,7 @@ def minimize_result(endpoint_name): "clusters": return_list } -TOPLEVEL_ENDPOINTS = ["access", "cluster", "nodes", "pools", "storage", "version"] -from enum import Enum - -class ProxmoxUpperPaths(str, Enum): - access = "access" - cluster = "cluster" - nodes = "nodes" - storage = "storage" - version = "version" @router.get("/{top_level}") @@ -130,19 +123,64 @@ async def top_level_endpoint( "other_endpoints": other_endpoints, } +async def get_cluster_name(px): + cluster_status_list = px("cluster/status").get() + + for item in cluster_status_list: + if item.get("type") == "cluster": + return item.get("name") + + +@router.get("/cluster/resources", response_model=ClusterResourcesList) +async def cluster_resources( + px_sessions: ProxmoxSessionDep, + type: Annotated[ + ClusterResourcesType, + Query( + title="Proxmox Resource Type", + description="Type of Proxmox resource to return (ex. 'vm' return QEMU Virtual Machines).",) + ], + mode: ProxmoxModeOptions = "multi", +): + json_response = {} + if mode == "multi": + + for px in px_sessions: + + try: + print("Testing Resources/Cluster") + cluster_name = await get_cluster_name(px) + print(cluster_name) + + cluster_resources_response = px("cluster/resources").get(type = "vm") + json_response[cluster_name] = cluster_resources_response + + except ResponseValidationException as error: + raise ProxboxException( + message = f"Could not validate data returned by Proxmox API (path: cluster/resources)", + python_exception = f"{error}" + ) + + return json_response + +''' +@router.get("/cluster/{cluster_paths}") +async def cluster_paths( + px_sessions: ProxmoxSessionDep, + cluster_paths: ProxmoxClusterPaths, + mode: ProxmoxModeOptions = "multi", +): + pass +''' + @router.get("/{top_level}/{second_level}") async def second_level_endpoint( px_sessions: ProxmoxSessionDep, - top_level: str, + top_level: ProxmoxUpperPaths, second_level: str, - mode: str = "multi", + mode: ProxmoxModeOptions = "multi", type: str | None = None, ): - if top_level not in TOPLEVEL_ENDPOINTS: - return { - "message": f"'{top_level}' is not a valid endpoint/path name.", - "valid_names": TOPLEVEL_ENDPOINTS, - } async def single_cluster(px): diff --git a/netbox_proxbox/backend/schemas/proxmox.py b/netbox_proxbox/backend/schemas/proxmox.py index 1d7d8007..1e17a464 100644 --- a/netbox_proxbox/backend/schemas/proxmox.py +++ b/netbox_proxbox/backend/schemas/proxmox.py @@ -1,4 +1,8 @@ -from pydantic import BaseModel +from pydantic import BaseModel, RootModel + +from typing import List, Dict + +from netbox_proxbox.backend.enum.proxmox import ResourceType class ProxmoxTokenSchema(BaseModel): name: str @@ -12,22 +16,27 @@ class ProxmoxSessionSchema(BaseModel): token: ProxmoxTokenSchema ssl: bool - """ - model_config = { - "json_schema_extra": { - "examples": [ - { - 'domain': 'proxbox2.example.com', - 'http_port': 8006, - 'user': 'root@pam', - 'password': 'Strong@P4ssword', - 'token': { - 'name': 'tokenID', - 'value': '039az154-23b2-4be0-8d20-b66abc8c4686' - }, - 'ssl': False - } - ] - } - } - """ \ No newline at end of file +class Resources(BaseModel): + cgroup_mode: int = None + content: str = None + cpu: float = None + disk: int = None + hastate: str = None + id: str + level: str = None + maxcpu: float = None + maxdisk: int = None + maxmem: int = None + mem: int = None + name: str = None + node: str = None + plugintype: str = None + pool: str = None + status: str = None + storage: str = None + type: ResourceType + uptime: int = None + vmid: int = None + +ResourcesList = RootModel[List[Resources]] +ClusterResourcesList = RootModel[Dict[str, ResourcesList]] From e09689e99bcd65ec4177520fddea4d6c76a68f31 Mon Sep 17 00:00:00 2001 From: emersonfelipesp Date: Wed, 25 Oct 2023 15:48:42 +0000 Subject: [PATCH 17/34] Add Query class to describe query parameters of /cluster/resources and add 501 HTTP code to Single Cluster call --- netbox_proxbox/backend/routes/proxmox.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/netbox_proxbox/backend/routes/proxmox.py b/netbox_proxbox/backend/routes/proxmox.py index c4ed98a7..6bb06dc5 100644 --- a/netbox_proxbox/backend/routes/proxmox.py +++ b/netbox_proxbox/backend/routes/proxmox.py @@ -138,9 +138,16 @@ async def cluster_resources( ClusterResourcesType, Query( title="Proxmox Resource Type", - description="Type of Proxmox resource to return (ex. 'vm' return QEMU Virtual Machines).",) - ], - mode: ProxmoxModeOptions = "multi", + description="Type of Proxmox resource to return (ex. 'vm' return QEMU Virtual Machines).", + ) + ], + mode: Annotated[ + ProxmoxModeOptions, + Query( + title="Proxmox Cluster Mode", + description="Defines if the API call will be made to a single cluster or to all clusters.", + ) + ] = "multi" ): json_response = {} if mode == "multi": @@ -161,6 +168,12 @@ async def cluster_resources( python_exception = f"{error}" ) + if mode == "single": + raise HTTPException( + status_code=501, + detail="Single-cluster API call not implemented yet." + ) + return json_response ''' From 5bb350fa150a5890543a4a20ff1167b3b98a5d8d Mon Sep 17 00:00:00 2001 From: emersonfelipesp Date: Wed, 25 Oct 2023 17:51:04 +0000 Subject: [PATCH 18/34] Separate /proxmox/cluster/{path} routes from proxmox.py into specific module cluster.py --- netbox_proxbox/backend/routes/proxmox.py | 2 +- .../backend/routes/proxmox/__init__.py | 195 ++++++++++++++++++ .../backend/routes/proxmox/cluster.py | 55 +++++ netbox_proxbox/main.py | 75 +------ 4 files changed, 258 insertions(+), 69 deletions(-) create mode 100644 netbox_proxbox/backend/routes/proxmox/__init__.py create mode 100644 netbox_proxbox/backend/routes/proxmox/cluster.py diff --git a/netbox_proxbox/backend/routes/proxmox.py b/netbox_proxbox/backend/routes/proxmox.py index 6bb06dc5..a8cd30e8 100644 --- a/netbox_proxbox/backend/routes/proxmox.py +++ b/netbox_proxbox/backend/routes/proxmox.py @@ -162,7 +162,7 @@ async def cluster_resources( cluster_resources_response = px("cluster/resources").get(type = "vm") json_response[cluster_name] = cluster_resources_response - except ResponseValidationException as error: + except Exception as error: raise ProxboxException( message = f"Could not validate data returned by Proxmox API (path: cluster/resources)", python_exception = f"{error}" diff --git a/netbox_proxbox/backend/routes/proxmox/__init__.py b/netbox_proxbox/backend/routes/proxmox/__init__.py new file mode 100644 index 00000000..612c67e9 --- /dev/null +++ b/netbox_proxbox/backend/routes/proxmox/__init__.py @@ -0,0 +1,195 @@ +from fastapi import APIRouter, Depends, HTTPException, Path, Query + +from typing import Annotated, Any + +from proxmoxer.core import ResourceException + +from netbox_proxbox.backend.schemas.proxmox import * +from netbox_proxbox.backend.routes.proxbox import proxmox_settings +from netbox_proxbox.backend.session.proxmox import ProxmoxSession +from netbox_proxbox.backend.exception import ProxboxException +from netbox_proxbox.backend.enum.proxmox import * + +router = APIRouter() + +async def proxmox_session( + proxmox_settings: Annotated[ProxmoxSessionSchema, Depends(proxmox_settings)], +): + proxmox_session_obj = [] + + try: + for cluster in proxmox_settings: + proxmox_session_obj.append( + await ProxmoxSession(cluster).proxmoxer() + ) + + return proxmox_session_obj + except Exception as error: + print(f"Exception error: {error}") + raise ProxboxException( + message = "Could not return Proxmox Sessions connections based on user-provided parameters", + python_exception = f"{error}" + ) + +# Make Session reusable +ProxmoxSessionDep = Annotated[Any, Depends(proxmox_session)] + +@router.get("/version") +async def proxmox_version( + px_sessions: ProxmoxSessionDep +): + response = [] + + print(f"{px_sessions}") + return f"{px_sessions}" + + for px in px_sessions: + print("PX type equal to: ", type(px)) + response.append(px.version.get()) + + return response + + +@router.get("/") +async def proxmox( + px_sessions: ProxmoxSessionDep +): + return_list = [] + + def minimize_result(endpoint_name): + endpoint_list = [] + result = px(endpoint_name).get() + + match endpoint_name: + case "access": + for obj in result: + endpoint_list.append(obj.get("subdir")) + + case "cluster": + for obj in result: + endpoint_list.append(obj.get("name")) + + return endpoint_list + + for px in px_sessions: + api_hierarchy = { + "access": minimize_result("access"), + "cluster": minimize_result("cluster"), + "nodes": px.nodes.get(), + "pools": px.pools.get(), + "storage": px.storage.get(), + "version": px.version.get(), + } + + return_list.append(api_hierarchy) + + return { + "message": "Proxmox API", + "proxmox_api_viewer": "https://pve.proxmox.com/pve-docs/api-viewer/", + "github": { + "netbox": "https://github.com/netbox-community/netbox", + "pynetbox": "https://github.com/netbox-community/pynetbox", + "proxmoxer": "https://github.com/proxmoxer/proxmoxer", + "proxbox": "https://github.com/netdevopsbr/netbox-proxbox" + }, + "clusters": return_list + } + + + + +@router.get("/{top_level}") +async def top_level_endpoint( + px_sessions: ProxmoxSessionDep, + top_level: ProxmoxUpperPaths, +): + # Get only a Proxmox Cluster + px = px_sessions[0] + + if top_level not in TOPLEVEL_ENDPOINTS: + return { + "message": f"'{top_level}' is not a valid endpoint/path name.", + "valid_names": TOPLEVEL_ENDPOINTS, + } + + current_index = TOPLEVEL_ENDPOINTS.index(top_level) + other_endpoints = TOPLEVEL_ENDPOINTS.copy() + other_endpoints.pop(current_index) + + return { + f"{top_level}": px(top_level).get(), + "other_endpoints": other_endpoints, + } + +async def get_cluster_name(px): + cluster_status_list = px("cluster/status").get() + + for item in cluster_status_list: + if item.get("type") == "cluster": + return item.get("name") + + +''' +@router.get("/cluster/{cluster_paths}") +async def cluster_paths( + px_sessions: ProxmoxSessionDep, + cluster_paths: ProxmoxClusterPaths, + mode: ProxmoxModeOptions = "multi", +): + pass +''' + +@router.get("/{top_level}/{second_level}") +async def second_level_endpoint( + px_sessions: ProxmoxSessionDep, + top_level: ProxmoxUpperPaths, + second_level: str, + mode: ProxmoxModeOptions = "multi", + type: str | None = None, +): + + + async def single_cluster(px): + json_obj = {f"{top_level}": {}} + + try: + path = f"{top_level}/{second_level}" + + # HTTP request through proxmoxer lib + if path == "cluster/resources" and type != None: + result = px(path).get(type = type) + else: + result = px(path).get() + + # Feed JSON result + json_obj[top_level][second_level] = result + + return json_obj + + except ResourceException as error: + raise ProxboxException( + message = f"Path {path} does not exist.", + python_exception = f"{error}" + ) + + + async def multi_cluster(px_sessions): + clusters_response = [] + + for px in px_sessions: + clusters_response.append(await single_cluster(px)) + + return clusters_response + + + if mode == "multi": + return await multi_cluster(px_sessions) + + if mode == "single": + raise HTTPException( + status_code=501, + detail="Single-cluster API call not implemented yet." + ) + + + return json_obj \ No newline at end of file diff --git a/netbox_proxbox/backend/routes/proxmox/cluster.py b/netbox_proxbox/backend/routes/proxmox/cluster.py new file mode 100644 index 00000000..227551ef --- /dev/null +++ b/netbox_proxbox/backend/routes/proxmox/cluster.py @@ -0,0 +1,55 @@ +from fastapi import APIRouter, Depends, HTTPException, Path, Query + +from typing import Annotated, Any + +from netbox_proxbox.backend.schemas.proxmox import * +from netbox_proxbox.backend.routes.proxmox import ProxmoxSessionDep, get_cluster_name +from netbox_proxbox.backend.exception import ProxboxException +from netbox_proxbox.backend.enum.proxmox import * + +router = APIRouter() + +@router.get("/resources", response_model=ClusterResourcesList) +async def cluster_resources( + px_sessions: ProxmoxSessionDep, + type: Annotated[ + ClusterResourcesType, + Query( + title="Proxmox Resource Type", + description="Type of Proxmox resource to return (ex. 'vm' return QEMU Virtual Machines).", + ) + ], + mode: Annotated[ + ProxmoxModeOptions, + Query( + title="Proxmox Cluster Mode", + description="Defines if the API call will be made to a single cluster or to all clusters.", + ) + ] = "multi" +): + json_response = {} + if mode == "multi": + + for px in px_sessions: + + try: + print("Testing Resources/Cluster...") + cluster_name = await get_cluster_name(px) + print(cluster_name) + + cluster_resources_response = px("cluster/resources").get(type = "vm") + json_response[cluster_name] = cluster_resources_response + + except Exception as error: + raise ProxboxException( + message = f"Could not validate data returned by Proxmox API (path: cluster/resources)", + python_exception = f"{error}" + ) + + if mode == "single": + raise HTTPException( + status_code=501, + detail="Single-cluster API call not implemented yet." + ) + + return json_response \ No newline at end of file diff --git a/netbox_proxbox/main.py b/netbox_proxbox/main.py index 2291d630..d14050e6 100644 --- a/netbox_proxbox/main.py +++ b/netbox_proxbox/main.py @@ -1,59 +1,3 @@ -# Python Framework -""" - -from typing import Callable - - -from fastapi import Depends, FastAPI, Request -from fastapi.responses import HTMLResponse -from fastapi.staticfiles import StaticFiles -from fastapi.templating import Jinja2Templates -from fastapi import APIRouter, FastAPI, Request, Response -from fastapi.routing import APIRoute - -# NP import to use 'copy' array method -import numpy as np - -import json -import time -""" - -# Proxmoxer lib (https://proxmoxer.github.io/) -# from proxmoxer import ProxmoxAPI, ResourceException - - -# HTTP SSL handling -# import requests -# import urllib3 -# urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) - -# TOPLEVEL_ENDPOINTS = ["access", "cluster", "nodes", "pools", "storage", "version"] - -""" -# Proxbox -from netbox_proxbox.proxbox_api.plugins_config import PROXMOX_SESSIONS, PROXMOX_SETTING - -sessions_list = [] - -# Get SESSIONs from JSON -for px_node in PROXMOX_SETTING: - domain = px_node.get("domain") - - px_json = PROXMOX_SESSIONS.get(domain) - px_session = px_json.get('PROXMOX_SESSION') - sessions_list.append(px_session) - -# Single Session -px = None -try: - px = sessions_list[0] -except Exception as error: - print(f"Not able to establish session.\n > {error}") - -FASTAPI_HOST = "127.0.0.1" -FASTAPI_PORT = "9000" -""" - from typing import Annotated from fastapi import FastAPI, Request @@ -61,15 +5,10 @@ from netbox_proxbox.backend.exception import ProxboxException -from .backend.routes.netbox import ( - router as netbox_router -) -from .backend.routes.proxbox import ( - router as proxbox_router -) -from .backend.routes.proxmox import ( - router as proxmox_router -) +from .backend.routes.netbox import router as netbox_router +from .backend.routes.proxbox import router as proxbox_router +from .backend.routes.proxmox import router as proxmox_router +from .backend.routes.proxmox.cluster import router as px_cluster_router from .backend.schemas import * @@ -88,15 +27,15 @@ async def proxmoxer_exception_handler(request: Request, exc: ProxboxException): "python_exception": exc.python_exception, } ) - + + # Routes (Endpoints) app.include_router(netbox_router, prefix="/netbox", tags=["netbox"]) app.include_router(proxbox_router, prefix="/proxbox", tags=["proxbox"]) +app.include_router(px_cluster_router, prefix="/proxmox/cluster", tags=["proxmox / cluster"]) app.include_router(proxmox_router, prefix="/proxmox", tags=["proxmox"]) -# app.mount("/static", StaticFiles(directory="/opt/netbox/netbox/netbox-proxbox/netbox_proxbox/static"), name="static") -# templates = Jinja2Templates(directory="/opt/netbox/netbox/netbox-proxbox/netbox_proxbox/templates/netbox_proxbox") @app.get("/") From 4d606c701fe524d50a5a7dbcc9a9827e63df4357 Mon Sep 17 00:00:00 2001 From: emersonfelipesp Date: Wed, 25 Oct 2023 20:23:10 +0000 Subject: [PATCH 19/34] Create ProxmoxSessions so that I can return not only the session object, but details like the Cluster name --- netbox_proxbox/backend/routes/proxmox.py | 242 ------------------ .../backend/routes/proxmox/__init__.py | 41 ++- .../backend/routes/proxmox/cluster.py | 15 +- netbox_proxbox/backend/session/proxmox.py | 91 ++++++- 4 files changed, 104 insertions(+), 285 deletions(-) delete mode 100644 netbox_proxbox/backend/routes/proxmox.py diff --git a/netbox_proxbox/backend/routes/proxmox.py b/netbox_proxbox/backend/routes/proxmox.py deleted file mode 100644 index a8cd30e8..00000000 --- a/netbox_proxbox/backend/routes/proxmox.py +++ /dev/null @@ -1,242 +0,0 @@ - -from fastapi import APIRouter, Depends, HTTPException, Path, Query -from fastapi.exceptions import ResponseValidationError, ValidationException - -from typing import Annotated, Any - -from proxmoxer.core import ResourceException - -from netbox_proxbox.backend.schemas.proxmox import * -from netbox_proxbox.backend.routes.proxbox import proxmox_settings -from netbox_proxbox.backend.session.proxmox import ProxmoxSession -from netbox_proxbox.backend.exception import ProxboxException -from netbox_proxbox.backend.enum.proxmox import * - -router = APIRouter() - -async def proxmox_session( - proxmox_settings: Annotated[ProxmoxSessionSchema, Depends(proxmox_settings)], -): - proxmox_session_obj = [] - - try: - for cluster in proxmox_settings: - proxmox_session_obj.append( - await ProxmoxSession(cluster).proxmoxer() - ) - - return proxmox_session_obj - except Exception as error: - print(f"Exception error: {error}") - raise ProxboxException( - message = "Could not return Proxmox Sessions connections based on user-provided parameters", - python_exception = f"{error}" - ) - -# Make Session reusable -ProxmoxSessionDep = Annotated[Any, Depends(proxmox_session)] - -@router.get("/version") -async def proxmox_version( - px_sessions: ProxmoxSessionDep -): - response = [] - - print(f"{px_sessions}") - return f"{px_sessions}" - - for px in px_sessions: - print("PX type equal to: ", type(px)) - response.append(px.version.get()) - - return response - - -@router.get("/") -async def proxmox( - px_sessions: ProxmoxSessionDep -): - return_list = [] - - def minimize_result(endpoint_name): - endpoint_list = [] - result = px(endpoint_name).get() - - match endpoint_name: - case "access": - for obj in result: - endpoint_list.append(obj.get("subdir")) - - case "cluster": - for obj in result: - endpoint_list.append(obj.get("name")) - - return endpoint_list - - for px in px_sessions: - api_hierarchy = { - "access": minimize_result("access"), - "cluster": minimize_result("cluster"), - "nodes": px.nodes.get(), - "pools": px.pools.get(), - "storage": px.storage.get(), - "version": px.version.get(), - } - - return_list.append(api_hierarchy) - - return { - "message": "Proxmox API", - "proxmox_api_viewer": "https://pve.proxmox.com/pve-docs/api-viewer/", - "github": { - "netbox": "https://github.com/netbox-community/netbox", - "pynetbox": "https://github.com/netbox-community/pynetbox", - "proxmoxer": "https://github.com/proxmoxer/proxmoxer", - "proxbox": "https://github.com/netdevopsbr/netbox-proxbox" - }, - "clusters": return_list - } - - - - -@router.get("/{top_level}") -async def top_level_endpoint( - px_sessions: ProxmoxSessionDep, - top_level: ProxmoxUpperPaths, -): - # Get only a Proxmox Cluster - px = px_sessions[0] - - if top_level not in TOPLEVEL_ENDPOINTS: - return { - "message": f"'{top_level}' is not a valid endpoint/path name.", - "valid_names": TOPLEVEL_ENDPOINTS, - } - - current_index = TOPLEVEL_ENDPOINTS.index(top_level) - other_endpoints = TOPLEVEL_ENDPOINTS.copy() - other_endpoints.pop(current_index) - - return { - f"{top_level}": px(top_level).get(), - "other_endpoints": other_endpoints, - } - -async def get_cluster_name(px): - cluster_status_list = px("cluster/status").get() - - for item in cluster_status_list: - if item.get("type") == "cluster": - return item.get("name") - - -@router.get("/cluster/resources", response_model=ClusterResourcesList) -async def cluster_resources( - px_sessions: ProxmoxSessionDep, - type: Annotated[ - ClusterResourcesType, - Query( - title="Proxmox Resource Type", - description="Type of Proxmox resource to return (ex. 'vm' return QEMU Virtual Machines).", - ) - ], - mode: Annotated[ - ProxmoxModeOptions, - Query( - title="Proxmox Cluster Mode", - description="Defines if the API call will be made to a single cluster or to all clusters.", - ) - ] = "multi" -): - json_response = {} - if mode == "multi": - - for px in px_sessions: - - try: - print("Testing Resources/Cluster") - cluster_name = await get_cluster_name(px) - print(cluster_name) - - cluster_resources_response = px("cluster/resources").get(type = "vm") - json_response[cluster_name] = cluster_resources_response - - except Exception as error: - raise ProxboxException( - message = f"Could not validate data returned by Proxmox API (path: cluster/resources)", - python_exception = f"{error}" - ) - - if mode == "single": - raise HTTPException( - status_code=501, - detail="Single-cluster API call not implemented yet." - ) - - return json_response - -''' -@router.get("/cluster/{cluster_paths}") -async def cluster_paths( - px_sessions: ProxmoxSessionDep, - cluster_paths: ProxmoxClusterPaths, - mode: ProxmoxModeOptions = "multi", -): - pass -''' - -@router.get("/{top_level}/{second_level}") -async def second_level_endpoint( - px_sessions: ProxmoxSessionDep, - top_level: ProxmoxUpperPaths, - second_level: str, - mode: ProxmoxModeOptions = "multi", - type: str | None = None, -): - - - async def single_cluster(px): - json_obj = {f"{top_level}": {}} - - try: - path = f"{top_level}/{second_level}" - - # HTTP request through proxmoxer lib - if path == "cluster/resources" and type != None: - result = px(path).get(type = type) - else: - result = px(path).get() - - # Feed JSON result - json_obj[top_level][second_level] = result - - return json_obj - - except ResourceException as error: - raise ProxboxException( - message = f"Path {path} does not exist.", - python_exception = f"{error}" - ) - - - async def multi_cluster(px_sessions): - clusters_response = [] - - for px in px_sessions: - clusters_response.append(await single_cluster(px)) - - return clusters_response - - - if mode == "multi": - return await multi_cluster(px_sessions) - - if mode == "single": - raise HTTPException( - status_code=501, - detail="Single-cluster API call not implemented yet." - ) - - - return json_obj \ No newline at end of file diff --git a/netbox_proxbox/backend/routes/proxmox/__init__.py b/netbox_proxbox/backend/routes/proxmox/__init__.py index 612c67e9..e539123e 100644 --- a/netbox_proxbox/backend/routes/proxmox/__init__.py +++ b/netbox_proxbox/backend/routes/proxmox/__init__.py @@ -6,14 +6,15 @@ from netbox_proxbox.backend.schemas.proxmox import * from netbox_proxbox.backend.routes.proxbox import proxmox_settings -from netbox_proxbox.backend.session.proxmox import ProxmoxSession +from netbox_proxbox.backend.session.proxmox import ProxmoxSessions from netbox_proxbox.backend.exception import ProxboxException from netbox_proxbox.backend.enum.proxmox import * router = APIRouter() +""" async def proxmox_session( - proxmox_settings: Annotated[ProxmoxSessionSchema, Depends(proxmox_settings)], + , ): proxmox_session_obj = [] @@ -30,20 +31,21 @@ async def proxmox_session( message = "Could not return Proxmox Sessions connections based on user-provided parameters", python_exception = f"{error}" ) +""" # Make Session reusable -ProxmoxSessionDep = Annotated[Any, Depends(proxmox_session)] +ProxmoxSessionsDep = Annotated[ProxmoxSessions, Depends()] @router.get("/version") async def proxmox_version( - px_sessions: ProxmoxSessionDep + pxs: ProxmoxSessionsDep ): response = [] - print(f"{px_sessions}") - return f"{px_sessions}" + print(f"{await pxs.sessions()}") + return f"{await pxs.sessions()}" - for px in px_sessions: + for px in pxs: print("PX type equal to: ", type(px)) response.append(px.version.get()) @@ -52,7 +54,7 @@ async def proxmox_version( @router.get("/") async def proxmox( - px_sessions: ProxmoxSessionDep + pxs: ProxmoxSessionsDep ): return_list = [] @@ -71,7 +73,7 @@ def minimize_result(endpoint_name): return endpoint_list - for px in px_sessions: + for px in pxs: api_hierarchy = { "access": minimize_result("access"), "cluster": minimize_result("cluster"), @@ -100,11 +102,11 @@ def minimize_result(endpoint_name): @router.get("/{top_level}") async def top_level_endpoint( - px_sessions: ProxmoxSessionDep, + pxs: ProxmoxSessionsDep, top_level: ProxmoxUpperPaths, ): # Get only a Proxmox Cluster - px = px_sessions[0] + px = pxs[0] if top_level not in TOPLEVEL_ENDPOINTS: return { @@ -121,18 +123,11 @@ async def top_level_endpoint( "other_endpoints": other_endpoints, } -async def get_cluster_name(px): - cluster_status_list = px("cluster/status").get() - - for item in cluster_status_list: - if item.get("type") == "cluster": - return item.get("name") - ''' @router.get("/cluster/{cluster_paths}") async def cluster_paths( - px_sessions: ProxmoxSessionDep, + pxs: ProxmoxSessionsDep, cluster_paths: ProxmoxClusterPaths, mode: ProxmoxModeOptions = "multi", ): @@ -141,7 +136,7 @@ async def cluster_paths( @router.get("/{top_level}/{second_level}") async def second_level_endpoint( - px_sessions: ProxmoxSessionDep, + pxs: ProxmoxSessionsDep, top_level: ProxmoxUpperPaths, second_level: str, mode: ProxmoxModeOptions = "multi", @@ -173,17 +168,17 @@ async def single_cluster(px): ) - async def multi_cluster(px_sessions): + async def multi_cluster(pxs): clusters_response = [] - for px in px_sessions: + for px in pxs: clusters_response.append(await single_cluster(px)) return clusters_response if mode == "multi": - return await multi_cluster(px_sessions) + return await multi_cluster(pxs) if mode == "single": raise HTTPException( diff --git a/netbox_proxbox/backend/routes/proxmox/cluster.py b/netbox_proxbox/backend/routes/proxmox/cluster.py index 227551ef..5bf14f21 100644 --- a/netbox_proxbox/backend/routes/proxmox/cluster.py +++ b/netbox_proxbox/backend/routes/proxmox/cluster.py @@ -1,24 +1,26 @@ from fastapi import APIRouter, Depends, HTTPException, Path, Query -from typing import Annotated, Any +from typing import Annotated from netbox_proxbox.backend.schemas.proxmox import * -from netbox_proxbox.backend.routes.proxmox import ProxmoxSessionDep, get_cluster_name +from netbox_proxbox.backend.routes.proxmox import ProxmoxSessionsDep from netbox_proxbox.backend.exception import ProxboxException from netbox_proxbox.backend.enum.proxmox import * router = APIRouter() +# /proxmox/cluster/ API Endpoints + @router.get("/resources", response_model=ClusterResourcesList) async def cluster_resources( - px_sessions: ProxmoxSessionDep, + pxs: ProxmoxSessionsDep, type: Annotated[ ClusterResourcesType, Query( title="Proxmox Resource Type", description="Type of Proxmox resource to return (ex. 'vm' return QEMU Virtual Machines).", ) - ], + ] = None, mode: Annotated[ ProxmoxModeOptions, Query( @@ -30,14 +32,13 @@ async def cluster_resources( json_response = {} if mode == "multi": - for px in px_sessions: + for px in pxs: try: - print("Testing Resources/Cluster...") cluster_name = await get_cluster_name(px) print(cluster_name) - cluster_resources_response = px("cluster/resources").get(type = "vm") + cluster_resources_response = px("cluster/resources").get(type = type) if type else px("cluster/resources").get() json_response[cluster_name] = cluster_resources_response except Exception as error: diff --git a/netbox_proxbox/backend/session/proxmox.py b/netbox_proxbox/backend/session/proxmox.py index 7cebd235..06f4e4ad 100644 --- a/netbox_proxbox/backend/session/proxmox.py +++ b/netbox_proxbox/backend/session/proxmox.py @@ -1,7 +1,12 @@ +from fastapi import Depends +from typing import Annotated + # Proxmox from proxmoxer import ProxmoxAPI from proxmoxer.core import ResourceException +from netbox_proxbox.backend.routes.proxbox import proxmox_settings +from netbox_proxbox.backend.schemas.proxmox import ProxmoxSessionSchema from netbox_proxbox.backend.exception import ProxboxException #from netbox_proxbox.backend.schemas.proxmox import ProxmoxSessionSchema @@ -10,19 +15,22 @@ # PROXMOX SESSION # class ProxmoxSession: - def __init__(self, proxmox_settings): + def __init__( + self, + cluster_config + ): #proxmox_settings = proxmox_settings.json() - proxmox_settings = proxmox_settings.dict() - print(proxmox_settings, type(proxmox_settings)) + cluster_config = cluster_config.dict() + print(cluster_config, type(cluster_config)) - self.domain = proxmox_settings["domain"] - self.http_port = proxmox_settings["http_port"] - self.user = proxmox_settings["user"] - self.password = proxmox_settings["password"] - self.token_name = proxmox_settings["token"]["name"] - self.token_value = proxmox_settings["token"]["value"] - self.ssl = proxmox_settings["ssl"] + self.domain = cluster_config["domain"] + self.http_port = cluster_config["http_port"] + self.user = cluster_config["user"] + self.password = cluster_config["password"] + self.token_name = cluster_config["token"]["name"] + self.token_value = cluster_config["token"]["value"] + self.ssl = cluster_config["ssl"] print(self.token_name) print(self.token_value) @@ -46,8 +54,8 @@ async def token_auth(self): ) try: - print(f"Testing Proxmox session 123:") - print(f"{proxmox_session}\n{proxmox_session.version.get()}") + + proxmox_session.version.get() except Exception as error: ProxboxException( @@ -121,4 +129,61 @@ async def proxmoxer(self): return px - \ No newline at end of file +class ProxmoxSessions: + def __init__( + self, + proxmox_settings: Annotated[ProxmoxSessionSchema, Depends(proxmox_settings)], + ): + self.proxmox_settings = proxmox_settings + + + async def sessions(self): + proxmox_sessions = [] + + for cluster in self.proxmox_settings: + session = await ProxmoxSession(cluster).proxmoxer() + cluster_info = await self.get_cluster(session) + print(cluster_info) + proxmox_sessions.append( + { + "session": session, + "cluster_name": cluster_info.get("name"), + "fingerprints": cluster_info.get("fingerprints"), + } + ) + #self.cluster_info = await self.get_cluster(self.session) + + """ + proxmox_sessions.append( + { + "session": self.session, + }.update(self.cluster_info) + ) + """ + + return proxmox_sessions + + + async def fingerprints(self, px): + """Get Nodes Fingerprints. It is the way I better found to differentiate clusters.""" + join_info = px("cluster/config/join").get() + + fingerprints = [] + for node in join_info.get("nodelist"): + fingerprints.append(node.get("pve_fp")) + + return fingerprints + + async def get_cluster(self, px): + """Get Proxmox Cluster Name""" + cluster_status_list = px("cluster/status").get() + + for item in cluster_status_list: + if item.get("type") == "cluster": + return { + "name": item.get("name"), + "fingerprints": await self.fingerprints(px) + } + + + \ No newline at end of file From c27b4438fcb2d60b55a3c812a9af5493a6a85dcf Mon Sep 17 00:00:00 2001 From: emersonfelipesp Date: Thu, 26 Oct 2023 14:49:18 +0000 Subject: [PATCH 20/34] Add docs to 'ProxmoxSession' and 'ProxmoxSessions' and try-excepts to 'ProxmoxSession' --- .../backend/routes/proxmox/__init__.py | 27 ++- netbox_proxbox/backend/session/proxmox.py | 157 ++++++++++++++---- 2 files changed, 143 insertions(+), 41 deletions(-) diff --git a/netbox_proxbox/backend/routes/proxmox/__init__.py b/netbox_proxbox/backend/routes/proxmox/__init__.py index e539123e..b214d8ca 100644 --- a/netbox_proxbox/backend/routes/proxmox/__init__.py +++ b/netbox_proxbox/backend/routes/proxmox/__init__.py @@ -34,18 +34,27 @@ async def proxmox_session( """ # Make Session reusable -ProxmoxSessionsDep = Annotated[ProxmoxSessions, Depends()] - + +''' @router.get("/version") +async def proxmox_sessions( + pxs: Annotated[ProxmoxSessions, Depends()] +): + """Instantiate Proxmox Sessions and return a list of Proxmox Sessions objects.""" + return await pxs.sessions() + +ProxmoxSessionsDep = Annotated[Any, Depends(proxmox_sessions)] +''' + +ProxmoxSessionsDep = Annotated[ProxmoxSessions, Depends()] + +@router.get("/version", response_model=None) async def proxmox_version( - pxs: ProxmoxSessionsDep + pxs: Annotated[ProxmoxSessions, Depends()] ): - response = [] - - print(f"{await pxs.sessions()}") - return f"{await pxs.sessions()}" + return pxs - for px in pxs: + for px.session in pxs: print("PX type equal to: ", type(px)) response.append(px.version.get()) @@ -54,7 +63,7 @@ async def proxmox_version( @router.get("/") async def proxmox( - pxs: ProxmoxSessionsDep + pxs: Annotated[ProxmoxSessions, Depends()] ): return_list = [] diff --git a/netbox_proxbox/backend/session/proxmox.py b/netbox_proxbox/backend/session/proxmox.py index 06f4e4ad..b77681ff 100644 --- a/netbox_proxbox/backend/session/proxmox.py +++ b/netbox_proxbox/backend/session/proxmox.py @@ -15,25 +15,75 @@ # PROXMOX SESSION # class ProxmoxSession: + """ + (Single-cluster) This class takes user-defined parameters to establish Proxmox connection and returns ProxmoxAPI object (with no further details) + + NOTE: As `__init__()` does not support ASYNC methods, I had to create a method to establish Proxmox connection and return ProxmoxAPI object, which is `proxmoxer()` method. + Which means that only calling ProxmoxSession() will not establish Proxmox connection. You must call `proxmoxer()` method to do so. + + INPUT must be: + - dict + - pydantic model - will be converted to dict + - json (string) - will be converted to dict + + Example of class instantiation: + ```python + ProxmoxSession( + { + "domain": "proxmox.domain.com", + "http_port": 8006, + "user": "user@pam", + "password": "password", + "token": { + "name": "token_name", + "value": "token_value" + }, + } + ).proxmoxer() + ``` + + OUTPUT: ProxmoxAPI object (from proxmoxer lib) + """ def __init__( self, cluster_config ): - #proxmox_settings = proxmox_settings.json() - - cluster_config = cluster_config.dict() - print(cluster_config, type(cluster_config)) - - self.domain = cluster_config["domain"] - self.http_port = cluster_config["http_port"] - self.user = cluster_config["user"] - self.password = cluster_config["password"] - self.token_name = cluster_config["token"]["name"] - self.token_value = cluster_config["token"]["value"] - self.ssl = cluster_config["ssl"] - - print(self.token_name) - print(self.token_value) + # Validate cluster_config type + if isinstance(cluster_config, ProxmoxSessionSchema): + cluster_config = cluster_config.model_dump(mode="python") + + elif isinstance(cluster_config, str): + try: + import json + cluster_config = json.loads(cluster_config) + + except Exception as error: + raise ProxboxException( + message = f"Could not proccess the input provided, check if it is correct. Input type provided: {type(cluster_config)}", + detail = "ProxmoxSession class tried to convert INPUT to dict, but failed.", + python_exception = f"{error}", + ) + elif isinstance(cluster_config, dict): + pass + else: + raise ProxboxException( + message = f"INPUT of ProxmoxSession() must be a pydantic model or dict (either one will work). Input type provided: {type(cluster_config)}", + ) + + try: + # Save cluster_config as class attributes + self.domain = cluster_config["domain"] + self.http_port = cluster_config["http_port"] + self.user = cluster_config["user"] + self.password = cluster_config["password"] + self.token_name = cluster_config["token"]["name"] + self.token_value = cluster_config["token"]["value"] + self.ssl = cluster_config["ssl"] + except KeyError: + raise ProxboxException( + message = "ProxmoxSession class wasn't able to find all required parameters to establish Proxmox connection. Check if you provided all required parameters.", + detail = "Python KeyError raised" + ) def __repr__(self): return f"Proxmox Connection Object. URL: {domain}:{http_port}" @@ -128,20 +178,72 @@ async def proxmoxer(self): return px +async def sessions( + proxmox_settings: Annotated[ProxmoxSessionSchema, Depends(proxmox_settings)] +): + proxmox_sessions = [] + + for cluster in proxmox_settings: + # Convert pydantic mdoel to dict + cluster = cluster.model_dump() + + cluster["object"] = await ProxmoxSession(cluster).proxmoxer() + + print(f"CLUSTER: {cluster}") + proxmox_sessions.append(cluster) + print(proxmox_sessions) + class ProxmoxSessions: + """ + (Multi-cluster) This class takes user-defined parameters to establish Proxmox connection and returns ProxmoxAPI object alongside with cluster details (name and fingerprints) + + INPUT must be a list of dicts with the following structure: + + ProxmoxSessions( + [ + { + 'domain': '10.0.30.9', + 'http_port': 8006, + 'user': 'root@pam', + 'password': '@YourStrongProxmoxPassword', + 'token': { + 'name': 'token_name', # 'proxbox', + 'value': 'e7fb5ecb-XXXX-YYYY-ZZZZ-ed1059e5772f' # + }, + 'ssl': False + }, + { + 'domain': '10.0.30.140', + 'http_port': 8006, + 'user': 'root@pam', + 'password': '@YourStrongProxmoxPassword', + 'token': { + 'name': 'token_name', + 'value': '2a00665d-XXXX-YYYY-ZZZZ-67852c50c706' + }, + 'ssl': False + } + ] + ) + + OUTPUT: [ + {} + ]ProxmoxAPI object (from proxmoxer lib) + """ + def __init__( self, proxmox_settings: Annotated[ProxmoxSessionSchema, Depends(proxmox_settings)], + sessions: Annotated[list, Depends(sessions)] ): self.proxmox_settings = proxmox_settings - - - async def sessions(self): - proxmox_sessions = [] + self.teste = "Teste" + self.sessions = sessions - for cluster in self.proxmox_settings: - session = await ProxmoxSession(cluster).proxmoxer() + + + """ cluster_info = await self.get_cluster(session) print(cluster_info) proxmox_sessions.append( @@ -152,18 +254,8 @@ async def sessions(self): } ) #self.cluster_info = await self.get_cluster(self.session) - - """ - proxmox_sessions.append( - { - "session": self.session, - }.update(self.cluster_info) - ) - """ - - return proxmox_sessions + """ - async def fingerprints(self, px): """Get Nodes Fingerprints. It is the way I better found to differentiate clusters.""" join_info = px("cluster/config/join").get() @@ -174,6 +266,7 @@ async def fingerprints(self, px): return fingerprints + async def get_cluster(self, px): """Get Proxmox Cluster Name""" cluster_status_list = px("cluster/status").get() From db74bf5c0f5baa9ee6b78c0c255bcca418cfcab2 Mon Sep 17 00:00:00 2001 From: emersonfelipesp Date: Thu, 26 Oct 2023 20:57:11 +0000 Subject: [PATCH 21/34] proxmox_sessions(), ProxmoxConfigDep and ProxmoxConfigDep returning clusters objects. Now I have to adapt to Standalone PVE --- netbox_proxbox/backend/routes/proxbox.py | 34 +-- .../backend/routes/proxmox/__init__.py | 75 +++++- .../backend/routes/proxmox/cluster.py | 17 +- netbox_proxbox/backend/schemas/proxmox.py | 4 +- netbox_proxbox/backend/session/proxmox.py | 213 ++++++++---------- 5 files changed, 192 insertions(+), 151 deletions(-) diff --git a/netbox_proxbox/backend/routes/proxbox.py b/netbox_proxbox/backend/routes/proxbox.py index f95bbbd3..2d9d0a01 100644 --- a/netbox_proxbox/backend/routes/proxbox.py +++ b/netbox_proxbox/backend/routes/proxbox.py @@ -4,7 +4,9 @@ from netbox_proxbox.backend.schemas import PluginConfig from netbox_proxbox.backend.schemas.netbox import NetboxSessionSchema -from netbox_proxbox.backend.schemas.proxmox import ProxmoxSessionSchema +from netbox_proxbox.backend.schemas.proxmox import ProxmoxMultiClusterConfig +from netbox_proxbox.backend.exception import ProxboxException + router = APIRouter() PROXBOX_PLUGIN_NAME = "netbox_proxbox" @@ -21,12 +23,10 @@ async def netbox_plugins_config( try: from netbox.settings import PLUGINS_CONFIG except Exception as e: - return { - "error": { - "message": "Could not import PLUGINS CONFIG from configuration.py", - "python_exception": f"{e}" - } - } + raise ProxboxException( + message = "Could not import PLUGINS CONFIG from configuration.py", + python_exception = f"{e}" + ) # If ?list=all=True # Return complete PLUGINS_CONFIG (including other plugins) @@ -55,13 +55,11 @@ async def netbox_plugins_config( ) except Exception as e: - return { - "error": { - "message": "Plugin configuration at PLUGINS_CONFIG (configuration.py) is probably incorrect.", - "detail": "Could not feed 'PluginConfig' pydantic model with config provided from 'PLUGINS_CONFIG'.", - "python_exception": f"{e}", - } - } + raise ProxboxException( + message = "Plugin configuration at PLUGINS_CONFIG (configuration.py) is probably incorrect.", + detail = "Could not feed 'PluginConfig' pydantic model with config provided from 'PLUGINS_CONFIG'.", + python_exception = f"{e}", + ) @router.get("/netbox/default-settings") @@ -106,4 +104,10 @@ async def proxmox_settings( """ Get user configuration for Proxmox from PLUGINS_CONFIG """ - return proxbox_config.proxmox \ No newline at end of file + return proxbox_config.proxmox + + + +NetboxConfigDep = Annotated[NetboxSessionSchema, Depends(netbox_settings)] +ProxmoxConfigDep = Annotated[ProxmoxMultiClusterConfig, Depends(proxmox_settings)] + \ No newline at end of file diff --git a/netbox_proxbox/backend/routes/proxmox/__init__.py b/netbox_proxbox/backend/routes/proxmox/__init__.py index b214d8ca..887e9735 100644 --- a/netbox_proxbox/backend/routes/proxmox/__init__.py +++ b/netbox_proxbox/backend/routes/proxmox/__init__.py @@ -1,12 +1,12 @@ from fastapi import APIRouter, Depends, HTTPException, Path, Query -from typing import Annotated, Any +from typing import Annotated, Any, List from proxmoxer.core import ResourceException from netbox_proxbox.backend.schemas.proxmox import * from netbox_proxbox.backend.routes.proxbox import proxmox_settings -from netbox_proxbox.backend.session.proxmox import ProxmoxSessions +from netbox_proxbox.backend.session.proxmox import ProxmoxSingleSession from netbox_proxbox.backend.exception import ProxboxException from netbox_proxbox.backend.enum.proxmox import * @@ -46,19 +46,75 @@ async def proxmox_sessions( ProxmoxSessionsDep = Annotated[Any, Depends(proxmox_sessions)] ''' -ProxmoxSessionsDep = Annotated[ProxmoxSessions, Depends()] +from netbox_proxbox.backend.routes.proxbox import ProxmoxConfigDep +async def proxmox_sessions( + pxc: ProxmoxConfigDep +): + """Instantiate Proxmox Sessions and return a list of Proxmox Sessions objects.""" + + proxmox_objects = [] + + for px in pxc: + px_obj = ProxmoxSingleSession(px) + + proxmox_objects.append( + { + "domain": px_obj.domain, + "session": px_obj.proxmoxer, + "cluster": px_obj.cluster, + "fingerprints": px_obj.cluster, + } + ) + + return proxmox_objects + +ProxmoxSessionsDep = Annotated[list, Depends(proxmox_sessions)] + +@router.get("/session") +async def proxmox_test( + pxs: ProxmoxSessionsDep +): + print("\n\n\nPXS:", pxs, type(pxs[0])) + px = ProxmoxSingleSession( + { + 'domain': '10.0.30.9', + 'http_port': 8006, + 'user': 'root@pam', + 'password': '@PVE288nm', + 'token': { + 'name': 'teste', + 'value': 'e7fb5ecb-30dd-49ab-8a58-ed1059e5772f' + }, + 'ssl': False + } + ) + print(f"Proxmox Test: {px.token_name}") + return "Teste" + + + + + +""" @router.get("/version", response_model=None) async def proxmox_version( pxs: Annotated[ProxmoxSessions, Depends()] ): return pxs - for px.session in pxs: - print("PX type equal to: ", type(px)) - response.append(px.version.get()) - - return response + ProxmoxSession( + { + "domain": "proxmox.domain.com", + "http_port": 8006, + "user": "user@pam", + "password": "password", + "token": { + "name": "token_name", + "value": "token_value" + }, + } + ).proxmoxer() @router.get("/") @@ -196,4 +252,5 @@ async def multi_cluster(pxs): ) - return json_obj \ No newline at end of file + return json_obj +""" \ No newline at end of file diff --git a/netbox_proxbox/backend/routes/proxmox/cluster.py b/netbox_proxbox/backend/routes/proxmox/cluster.py index 5bf14f21..17c63595 100644 --- a/netbox_proxbox/backend/routes/proxmox/cluster.py +++ b/netbox_proxbox/backend/routes/proxmox/cluster.py @@ -1,14 +1,15 @@ -from fastapi import APIRouter, Depends, HTTPException, Path, Query +from fastapi import APIRouter, Depends, HTTPException, Path, Query +""" from typing import Annotated from netbox_proxbox.backend.schemas.proxmox import * from netbox_proxbox.backend.routes.proxmox import ProxmoxSessionsDep from netbox_proxbox.backend.exception import ProxboxException from netbox_proxbox.backend.enum.proxmox import * - +""" router = APIRouter() - +""" # /proxmox/cluster/ API Endpoints @router.get("/resources", response_model=ClusterResourcesList) @@ -29,16 +30,19 @@ async def cluster_resources( ) ] = "multi" ): + pxs = await pxs.sessions() json_response = {} + + print(pxs) if mode == "multi": for px in pxs: try: - cluster_name = await get_cluster_name(px) + cluster_name = px.get("cluster_name") print(cluster_name) - cluster_resources_response = px("cluster/resources").get(type = type) if type else px("cluster/resources").get() + cluster_resources_response = px[session]("cluster/resources").get(type = type) if type else px("cluster/resources").get() json_response[cluster_name] = cluster_resources_response except Exception as error: @@ -53,4 +57,5 @@ async def cluster_resources( detail="Single-cluster API call not implemented yet." ) - return json_response \ No newline at end of file + return json_response +""" \ No newline at end of file diff --git a/netbox_proxbox/backend/schemas/proxmox.py b/netbox_proxbox/backend/schemas/proxmox.py index 1e17a464..fbfe5699 100644 --- a/netbox_proxbox/backend/schemas/proxmox.py +++ b/netbox_proxbox/backend/schemas/proxmox.py @@ -15,7 +15,9 @@ class ProxmoxSessionSchema(BaseModel): password: str token: ProxmoxTokenSchema ssl: bool - + +ProxmoxMultiClusterConfig = RootModel[List[ProxmoxSessionSchema]] + class Resources(BaseModel): cgroup_mode: int = None content: str = None diff --git a/netbox_proxbox/backend/session/proxmox.py b/netbox_proxbox/backend/session/proxmox.py index b77681ff..529ee371 100644 --- a/netbox_proxbox/backend/session/proxmox.py +++ b/netbox_proxbox/backend/session/proxmox.py @@ -1,20 +1,17 @@ from fastapi import Depends -from typing import Annotated +from typing import Annotated, Any # Proxmox from proxmoxer import ProxmoxAPI from proxmoxer.core import ResourceException -from netbox_proxbox.backend.routes.proxbox import proxmox_settings from netbox_proxbox.backend.schemas.proxmox import ProxmoxSessionSchema from netbox_proxbox.backend.exception import ProxboxException -#from netbox_proxbox.backend.schemas.proxmox import ProxmoxSessionSchema - # # PROXMOX SESSION # -class ProxmoxSession: +class ProxmoxSingleSession: """ (Single-cluster) This class takes user-defined parameters to establish Proxmox connection and returns ProxmoxAPI object (with no further details) @@ -28,7 +25,7 @@ class ProxmoxSession: Example of class instantiation: ```python - ProxmoxSession( + ProxmoxSingleSession( { "domain": "proxmox.domain.com", "http_port": 8006, @@ -39,37 +36,43 @@ class ProxmoxSession: "value": "token_value" }, } - ).proxmoxer() + ) ``` - - OUTPUT: ProxmoxAPI object (from proxmoxer lib) """ def __init__( self, - cluster_config + cluster_config: Any ): + print(f"INPUT: {cluster_config}, type: {type(cluster_config)}") + # Validate cluster_config type if isinstance(cluster_config, ProxmoxSessionSchema): + print("INPUT is Pydantic Model ProxmoxSessionSchema") cluster_config = cluster_config.model_dump(mode="python") elif isinstance(cluster_config, str): - try: - import json - cluster_config = json.loads(cluster_config) + print("INPUT is string") + import json + cluster_config = json.loads(cluster_config) + print(f"json_loads: {cluster_config} - type: {type(cluster_config)}""}") + + """ except Exception as error: raise ProxboxException( message = f"Could not proccess the input provided, check if it is correct. Input type provided: {type(cluster_config)}", detail = "ProxmoxSession class tried to convert INPUT to dict, but failed.", python_exception = f"{error}", ) + """ elif isinstance(cluster_config, dict): + print("INPUT is dict") pass else: raise ProxboxException( message = f"INPUT of ProxmoxSession() must be a pydantic model or dict (either one will work). Input type provided: {type(cluster_config)}", - ) - + ) + try: # Save cluster_config as class attributes self.domain = cluster_config["domain"] @@ -79,16 +82,55 @@ def __init__( self.token_name = cluster_config["token"]["name"] self.token_value = cluster_config["token"]["value"] self.ssl = cluster_config["ssl"] + except KeyError: raise ProxboxException( message = "ProxmoxSession class wasn't able to find all required parameters to establish Proxmox connection. Check if you provided all required parameters.", detail = "Python KeyError raised" ) + + print(f"\n\n{cluster_config}, {type(cluster_config)}\n\n") + + try: + # DISABLE SSL WARNING + if self.ssl == False: + import urllib3 + urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) + + # Prefer using token to authenticate + if self.token_name and self.token_value: + self.proxmoxer = self.token_auth() + + else: + self.proxmoxer = self.password_auth() + + except Exception as error: + raise ProxboxException( + message = f"Could not establish Proxmox connection to '{self.domain}:{self.http_port}' using token name '{self.token_name}'.", + detail = "Unknown error.", + python_exception = f"{error}" + ) + + + try: + """Test Proxmox Connection""" + print(f"\n{self.proxmoxer.version.get()}\n") + except Exception as error: + raise ProxboxException( + message = f"After instatiating object connection, could not make API call to Proxmox '{self.domain}:{self.http_port}' using token name '{self.token_name}'.", + detail = "Unknown error.", + python_exception = f"{error}" + ) + + self.cluster = self.get_cluster(self.proxmoxer) + self.fingerprints = self.get_fingerprints(self.proxmoxer) + - def __repr__(self): - return f"Proxmox Connection Object. URL: {domain}:{http_port}" + #def __repr__(self): + # return f"Proxmox Connection Object. URL: {self.domain}:{self.http_port}" - async def token_auth(self): + + def token_auth(self): error_message = f"Error trying to initialize Proxmox API connection using TOKEN NAME '{self.token_name}' and TOKEN_VALUE provided", # Establish Proxmox Session with Token @@ -114,6 +156,7 @@ async def token_auth(self): python_exception = f"{error}", ) + print(f"proxmox_session: {proxmox_session}") return proxmox_session except ResourceException as error: @@ -128,10 +171,9 @@ async def token_auth(self): detail = "Unknown error.", python_exception = f"{error}" ) - - async def password_auth(self): + def password_auth(self): error_message = f'Error trying to initialize Proxmox API connection using USER {self.user} and PASSWORD provided', try: @@ -160,24 +202,39 @@ async def password_auth(self): detail = "Unknown error.", python_exception = f"{error}" ) - - async def proxmoxer(self): - print("Establish Proxmox connection...") - - # DISABLE SSL WARNING - if self.ssl == False: - import urllib3 - urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) + + def get_fingerprints(self, px): + """Get Nodes Fingerprints. It is the way I better found to differentiate clusters.""" + try: + join_info = px("cluster/config/join").get() - # Prefer using token to authenticate - if self.token_name and self.token_value: - px = await self.token_auth() + fingerprints = [] + for node in join_info.get("nodelist"): + fingerprints.append(node.get("pve_fp")) + + return fingerprints - else: - px = await self.password_auth() + except Exception as error: + raise ProxboxException( + message = "Could not get Nodes Fingerprints", + python_exception = f"{error}" + ) - return px + def get_cluster(self, px): + """Get Proxmox Cluster Name""" + try: + cluster_status_list = px("cluster/status").get() + for item in cluster_status_list: + if item.get("type") == "cluster": + return item.get("name") + + except Exception as error: + raise ProxboxException( + message = "Could not get Proxmox Cluster Name and Nodes Fingerprints", + python_exception = f"{error}" + ) +""" async def sessions( proxmox_settings: Annotated[ProxmoxSessionSchema, Depends(proxmox_settings)] ): @@ -193,90 +250,6 @@ async def sessions( proxmox_sessions.append(cluster) print(proxmox_sessions) - -class ProxmoxSessions: - """ - (Multi-cluster) This class takes user-defined parameters to establish Proxmox connection and returns ProxmoxAPI object alongside with cluster details (name and fingerprints) - - INPUT must be a list of dicts with the following structure: - - ProxmoxSessions( - [ - { - 'domain': '10.0.30.9', - 'http_port': 8006, - 'user': 'root@pam', - 'password': '@YourStrongProxmoxPassword', - 'token': { - 'name': 'token_name', # 'proxbox', - 'value': 'e7fb5ecb-XXXX-YYYY-ZZZZ-ed1059e5772f' # - }, - 'ssl': False - }, - { - 'domain': '10.0.30.140', - 'http_port': 8006, - 'user': 'root@pam', - 'password': '@YourStrongProxmoxPassword', - 'token': { - 'name': 'token_name', - 'value': '2a00665d-XXXX-YYYY-ZZZZ-67852c50c706' - }, - 'ssl': False - } - ] - ) - - OUTPUT: [ - {} - ]ProxmoxAPI object (from proxmoxer lib) - """ - - def __init__( - self, - proxmox_settings: Annotated[ProxmoxSessionSchema, Depends(proxmox_settings)], - sessions: Annotated[list, Depends(sessions)] - ): - self.proxmox_settings = proxmox_settings - self.teste = "Teste" - self.sessions = sessions - - - - """ - cluster_info = await self.get_cluster(session) - print(cluster_info) - proxmox_sessions.append( - { - "session": session, - "cluster_name": cluster_info.get("name"), - "fingerprints": cluster_info.get("fingerprints"), - } - ) - #self.cluster_info = await self.get_cluster(self.session) - """ - - async def fingerprints(self, px): - """Get Nodes Fingerprints. It is the way I better found to differentiate clusters.""" - join_info = px("cluster/config/join").get() - - fingerprints = [] - for node in join_info.get("nodelist"): - fingerprints.append(node.get("pve_fp")) - - return fingerprints - +""" - async def get_cluster(self, px): - """Get Proxmox Cluster Name""" - cluster_status_list = px("cluster/status").get() - - for item in cluster_status_list: - if item.get("type") == "cluster": - return { - "name": item.get("name"), - "fingerprints": await self.fingerprints(px) - } - - - \ No newline at end of file +#class ProxmoxMultiSessions: From 5ff8d5de4d1e839ec4e6f036e49add271932b5d6 Mon Sep 17 00:00:00 2001 From: emersonfelipesp Date: Fri, 27 Oct 2023 16:51:48 +0000 Subject: [PATCH 22/34] All /proxmox paths working with 'ProxmoxSessionsDep' dependency representing Proxmox Sessions's objects --- .../backend/routes/proxmox/__init__.py | 253 ++++-------------- .../backend/routes/proxmox/cluster.py | 64 ++--- netbox_proxbox/backend/schemas/proxmox.py | 2 +- netbox_proxbox/backend/session/proxmox.py | 171 +++++++----- 4 files changed, 195 insertions(+), 295 deletions(-) diff --git a/netbox_proxbox/backend/routes/proxmox/__init__.py b/netbox_proxbox/backend/routes/proxmox/__init__.py index 887e9735..58ea737e 100644 --- a/netbox_proxbox/backend/routes/proxmox/__init__.py +++ b/netbox_proxbox/backend/routes/proxmox/__init__.py @@ -5,127 +5,79 @@ from proxmoxer.core import ResourceException from netbox_proxbox.backend.schemas.proxmox import * -from netbox_proxbox.backend.routes.proxbox import proxmox_settings -from netbox_proxbox.backend.session.proxmox import ProxmoxSingleSession +from netbox_proxbox.backend.session.proxmox import ProxmoxSessionsDep from netbox_proxbox.backend.exception import ProxboxException from netbox_proxbox.backend.enum.proxmox import * router = APIRouter() -""" -async def proxmox_session( - , -): - proxmox_session_obj = [] - - try: - for cluster in proxmox_settings: - proxmox_session_obj.append( - await ProxmoxSession(cluster).proxmoxer() - ) - - return proxmox_session_obj - except Exception as error: - print(f"Exception error: {error}") - raise ProxboxException( - message = "Could not return Proxmox Sessions connections based on user-provided parameters", - python_exception = f"{error}" - ) -""" - -# Make Session reusable - -''' -@router.get("/version") -async def proxmox_sessions( - pxs: Annotated[ProxmoxSessions, Depends()] -): - """Instantiate Proxmox Sessions and return a list of Proxmox Sessions objects.""" - return await pxs.sessions() - -ProxmoxSessionsDep = Annotated[Any, Depends(proxmox_sessions)] -''' - -from netbox_proxbox.backend.routes.proxbox import ProxmoxConfigDep +# +# /proxmox/* API Endpoints +# +@router.get("/sessions") async def proxmox_sessions( - pxc: ProxmoxConfigDep + pxs: ProxmoxSessionsDep ): - """Instantiate Proxmox Sessions and return a list of Proxmox Sessions objects.""" - - proxmox_objects = [] + json_response = [] - for px in pxc: - px_obj = ProxmoxSingleSession(px) - - proxmox_objects.append( + for px in pxs: + json_response.append( { - "domain": px_obj.domain, - "session": px_obj.proxmoxer, - "cluster": px_obj.cluster, - "fingerprints": px_obj.cluster, + "domain": px.domain, + "http_port": px.http_port, + "user": px.user, + "name": px.name, + "mode": px.mode, } ) - return proxmox_objects + return json_response + -ProxmoxSessionsDep = Annotated[list, Depends(proxmox_sessions)] -@router.get("/session") -async def proxmox_test( +@router.get("/version", ) +async def proxmox_version( pxs: ProxmoxSessionsDep ): - print("\n\n\nPXS:", pxs, type(pxs[0])) - px = ProxmoxSingleSession( - { - 'domain': '10.0.30.9', - 'http_port': 8006, - 'user': 'root@pam', - 'password': '@PVE288nm', - 'token': { - 'name': 'teste', - 'value': 'e7fb5ecb-30dd-49ab-8a58-ed1059e5772f' - }, - 'ssl': False - } - ) - print(f"Proxmox Test: {px.token_name}") - return "Teste" + json_response = [] + for px in pxs: + json_response.append( + { + px.name: px.session.version.get() + } + ) + + return json_response - - -""" -@router.get("/version", response_model=None) -async def proxmox_version( - pxs: Annotated[ProxmoxSessions, Depends()] +@router.get("/{top_level}") +async def top_level_endpoint( + pxs: ProxmoxSessionsDep, + top_level: ProxmoxUpperPaths, ): - return pxs - - ProxmoxSession( - { - "domain": "proxmox.domain.com", - "http_port": 8006, - "user": "user@pam", - "password": "password", - "token": { - "name": "token_name", - "value": "token_value" - }, + json_response = [] + + for px in pxs: + json_response.append( + { + px.name: px.session(top_level).get() } - ).proxmoxer() + ) + return json_response + @router.get("/") async def proxmox( - pxs: Annotated[ProxmoxSessions, Depends()] + pxs: ProxmoxSessionsDep ): - return_list = [] + json_response = [] def minimize_result(endpoint_name): endpoint_list = [] - result = px(endpoint_name).get() + result = px.session(endpoint_name).get() match endpoint_name: case "access": @@ -139,16 +91,18 @@ def minimize_result(endpoint_name): return endpoint_list for px in pxs: - api_hierarchy = { - "access": minimize_result("access"), - "cluster": minimize_result("cluster"), - "nodes": px.nodes.get(), - "pools": px.pools.get(), - "storage": px.storage.get(), - "version": px.version.get(), - } - - return_list.append(api_hierarchy) + json_response.append( + { + f"{px.name}": { + "access": minimize_result("access"), + "cluster": minimize_result("cluster"), + "nodes": px.session.nodes.get(), + "pools": px.session.pools.get(), + "storage": px.session.storage.get(), + "version": px.session.version.get(), + } + } + ) return { "message": "Proxmox API", @@ -159,98 +113,5 @@ def minimize_result(endpoint_name): "proxmoxer": "https://github.com/proxmoxer/proxmoxer", "proxbox": "https://github.com/netdevopsbr/netbox-proxbox" }, - "clusters": return_list - } - - - - -@router.get("/{top_level}") -async def top_level_endpoint( - pxs: ProxmoxSessionsDep, - top_level: ProxmoxUpperPaths, -): - # Get only a Proxmox Cluster - px = pxs[0] - - if top_level not in TOPLEVEL_ENDPOINTS: - return { - "message": f"'{top_level}' is not a valid endpoint/path name.", - "valid_names": TOPLEVEL_ENDPOINTS, - } - - current_index = TOPLEVEL_ENDPOINTS.index(top_level) - other_endpoints = TOPLEVEL_ENDPOINTS.copy() - other_endpoints.pop(current_index) - - return { - f"{top_level}": px(top_level).get(), - "other_endpoints": other_endpoints, - } - - -''' -@router.get("/cluster/{cluster_paths}") -async def cluster_paths( - pxs: ProxmoxSessionsDep, - cluster_paths: ProxmoxClusterPaths, - mode: ProxmoxModeOptions = "multi", -): - pass -''' - -@router.get("/{top_level}/{second_level}") -async def second_level_endpoint( - pxs: ProxmoxSessionsDep, - top_level: ProxmoxUpperPaths, - second_level: str, - mode: ProxmoxModeOptions = "multi", - type: str | None = None, -): - - - async def single_cluster(px): - json_obj = {f"{top_level}": {}} - - try: - path = f"{top_level}/{second_level}" - - # HTTP request through proxmoxer lib - if path == "cluster/resources" and type != None: - result = px(path).get(type = type) - else: - result = px(path).get() - - # Feed JSON result - json_obj[top_level][second_level] = result - - return json_obj - - except ResourceException as error: - raise ProxboxException( - message = f"Path {path} does not exist.", - python_exception = f"{error}" - ) - - - async def multi_cluster(pxs): - clusters_response = [] - - for px in pxs: - clusters_response.append(await single_cluster(px)) - - return clusters_response - - - if mode == "multi": - return await multi_cluster(pxs) - - if mode == "single": - raise HTTPException( - status_code=501, - detail="Single-cluster API call not implemented yet." - ) - - - return json_obj -""" \ No newline at end of file + "clusters": json_response + } \ No newline at end of file diff --git a/netbox_proxbox/backend/routes/proxmox/cluster.py b/netbox_proxbox/backend/routes/proxmox/cluster.py index 17c63595..850e03fb 100644 --- a/netbox_proxbox/backend/routes/proxmox/cluster.py +++ b/netbox_proxbox/backend/routes/proxmox/cluster.py @@ -1,15 +1,32 @@ from fastapi import APIRouter, Depends, HTTPException, Path, Query -""" + from typing import Annotated from netbox_proxbox.backend.schemas.proxmox import * -from netbox_proxbox.backend.routes.proxmox import ProxmoxSessionsDep +from netbox_proxbox.backend.session.proxmox import ProxmoxSessionsDep from netbox_proxbox.backend.exception import ProxboxException from netbox_proxbox.backend.enum.proxmox import * -""" + router = APIRouter() -""" + + +# /proxmox/cluster/ API Endpoints +@router.get("/status") +async def cluster_status( + pxs: ProxmoxSessionsDep +): + json_response = [] + + for px in pxs: + json_response.append( + { + px.name: px.session("cluster/status").get() + } + ) + return json_response + + # /proxmox/cluster/ API Endpoints @router.get("/resources", response_model=ClusterResourcesList) @@ -22,40 +39,15 @@ async def cluster_resources( description="Type of Proxmox resource to return (ex. 'vm' return QEMU Virtual Machines).", ) ] = None, - mode: Annotated[ - ProxmoxModeOptions, - Query( - title="Proxmox Cluster Mode", - description="Defines if the API call will be made to a single cluster or to all clusters.", - ) - ] = "multi" ): - pxs = await pxs.sessions() - json_response = {} + json_response = [] - print(pxs) - if mode == "multi": + for px in pxs: - for px in pxs: - - try: - cluster_name = px.get("cluster_name") - print(cluster_name) - - cluster_resources_response = px[session]("cluster/resources").get(type = type) if type else px("cluster/resources").get() - json_response[cluster_name] = cluster_resources_response - - except Exception as error: - raise ProxboxException( - message = f"Could not validate data returned by Proxmox API (path: cluster/resources)", - python_exception = f"{error}" - ) - - if mode == "single": - raise HTTPException( - status_code=501, - detail="Single-cluster API call not implemented yet." - ) + json_response.append( + { + px.name: px.session("cluster/resources").get(type = type) if type else px.session("cluster/resources").get() + } + ) return json_response -""" \ No newline at end of file diff --git a/netbox_proxbox/backend/schemas/proxmox.py b/netbox_proxbox/backend/schemas/proxmox.py index fbfe5699..3ba5ec96 100644 --- a/netbox_proxbox/backend/schemas/proxmox.py +++ b/netbox_proxbox/backend/schemas/proxmox.py @@ -41,4 +41,4 @@ class Resources(BaseModel): vmid: int = None ResourcesList = RootModel[List[Resources]] -ClusterResourcesList = RootModel[Dict[str, ResourcesList]] +ClusterResourcesList = RootModel[List[Dict[str, ResourcesList]]] diff --git a/netbox_proxbox/backend/session/proxmox.py b/netbox_proxbox/backend/session/proxmox.py index 529ee371..4edbed4e 100644 --- a/netbox_proxbox/backend/session/proxmox.py +++ b/netbox_proxbox/backend/session/proxmox.py @@ -7,11 +7,12 @@ from netbox_proxbox.backend.schemas.proxmox import ProxmoxSessionSchema from netbox_proxbox.backend.exception import ProxboxException +from netbox_proxbox.backend.routes.proxbox import ProxmoxConfigDep # # PROXMOX SESSION # -class ProxmoxSingleSession: +class ProxmoxSession: """ (Single-cluster) This class takes user-defined parameters to establish Proxmox connection and returns ProxmoxAPI object (with no further details) @@ -43,13 +44,14 @@ def __init__( self, cluster_config: Any ): - print(f"INPUT: {cluster_config}, type: {type(cluster_config)}") - + # # Validate cluster_config type + # if isinstance(cluster_config, ProxmoxSessionSchema): print("INPUT is Pydantic Model ProxmoxSessionSchema") cluster_config = cluster_config.model_dump(mode="python") - + + # FIXME: This is not working elif isinstance(cluster_config, str): print("INPUT is string") import json @@ -88,9 +90,11 @@ def __init__( message = "ProxmoxSession class wasn't able to find all required parameters to establish Proxmox connection. Check if you provided all required parameters.", detail = "Python KeyError raised" ) - - print(f"\n\n{cluster_config}, {type(cluster_config)}\n\n") - + + + # + # Establish Proxmox Session + # try: # DISABLE SSL WARNING if self.ssl == False: @@ -103,6 +107,8 @@ def __init__( else: self.proxmoxer = self.password_auth() + + self.session = self.proxmoxer except Exception as error: raise ProxboxException( @@ -111,25 +117,47 @@ def __init__( python_exception = f"{error}" ) - + # + # Test Connection and Return Cluster Status if succeeded. + # try: - """Test Proxmox Connection""" - print(f"\n{self.proxmoxer.version.get()}\n") + """Test Proxmox Connection and return Cluster Status API response as class attribute""" + self.cluster_status = self.proxmoxer("cluster/status").get() except Exception as error: raise ProxboxException( message = f"After instatiating object connection, could not make API call to Proxmox '{self.domain}:{self.http_port}' using token name '{self.token_name}'.", detail = "Unknown error.", - python_exception = f"{error}" + python_exception = f"{__name__}: {error}" ) - self.cluster = self.get_cluster(self.proxmoxer) - self.fingerprints = self.get_fingerprints(self.proxmoxer) + # + # Add more attributes to class about Proxmox Session + # + self.mode = self.get_cluster_mode() + if self.mode == "cluster": + cluster_name: str = self.get_cluster_name() + + self.cluster_name = cluster_name + self.name = cluster_name + self.fingerprints: list = self.get_node_fingerprints(self.proxmoxer) + + elif self.mode == "standalone": + standalone_node_name: str = self.get_standalone_name() + + self.node_name = standalone_node_name + self.name = standalone_node_name + self.fingerprints = None + - #def __repr__(self): - # return f"Proxmox Connection Object. URL: {self.domain}:{self.http_port}" + def __repr__(self): + return f"Proxmox Connection Object. URL: {self.domain}:{self.http_port}" + # + # Proxmox Authentication Modes: TOKEN-BASED & PASSWORD-BASED + # + def token_auth(self): error_message = f"Error trying to initialize Proxmox API connection using TOKEN NAME '{self.token_name}' and TOKEN_VALUE provided", @@ -145,26 +173,8 @@ def token_auth(self): verify_ssl=self.ssl ) - try: - - proxmox_session.version.get() - - except Exception as error: - ProxboxException( - message = "Testing Proxmox connection failed.", - detail = "Unkown error.", - python_exception = f"{error}", - ) - - print(f"proxmox_session: {proxmox_session}") return proxmox_session - - except ResourceException as error: - raise ProxboxException( - message = error_message, - detail = "'ResourceException' from proxmoxer lib raised.", - python_exception = f"{error}" - ) + except Exception as error: raise ProxboxException( message = error_message, @@ -188,13 +198,6 @@ def password_auth(self): ) return proxmox_session - - except ResourceException as error: - raise ProxboxException( - message = error_message, - detail = "'ResourceException' from proxmoxer lib raised.", - python_exception = f"{error}" - ) except Exception as error: raise ProxboxException( @@ -202,8 +205,12 @@ def password_auth(self): detail = "Unknown error.", python_exception = f"{error}" ) - - def get_fingerprints(self, px): + + + # + # Get Proxmox Details about Cluster and Nodes + # + def get_node_fingerprints(self, px): """Get Nodes Fingerprints. It is the way I better found to differentiate clusters.""" try: join_info = px("cluster/config/join").get() @@ -220,12 +227,26 @@ def get_fingerprints(self, px): python_exception = f"{error}" ) - def get_cluster(self, px): - """Get Proxmox Cluster Name""" + + def get_cluster_mode(self): + """Get Proxmox Cluster Mode (Standalone or Cluster)""" try: - cluster_status_list = px("cluster/status").get() + if len(self.cluster_status) == 1 and self.cluster_status[0].get("type") == "node": + return "standalone" + else: + return "cluster" - for item in cluster_status_list: + except Exception as error: + raise ProxboxException( + message = "Could not get Proxmox Cluster Mode (Standalone or Cluster)", + python_exception = f"{error}" + ) + + + def get_cluster_name(self): + """Get Proxmox Cluster Name""" + try: + for item in self.cluster_status: if item.get("type") == "cluster": return item.get("name") @@ -234,22 +255,48 @@ def get_cluster(self, px): message = "Could not get Proxmox Cluster Name and Nodes Fingerprints", python_exception = f"{error}" ) -""" -async def sessions( - proxmox_settings: Annotated[ProxmoxSessionSchema, Depends(proxmox_settings)] + + + def get_standalone_name(self): + """Get Proxmox Standalone Node Name""" + try: + if len(self.cluster_status) == 1 and self.cluster_status[0].get("type") == "node": + return self.cluster_status[0].get("name") + + except Exception as error: + raise ProxboxException( + message = "Could not get Proxmox Standalone Node Name", + python_exception = f"{error}" + ) + + +async def proxmox_sessions( + pxc: ProxmoxConfigDep, + source: str = "netbox", + name: str = None, + domain: str = None, ): - proxmox_sessions = [] - - for cluster in proxmox_settings: - # Convert pydantic mdoel to dict - cluster = cluster.model_dump() - - cluster["object"] = await ProxmoxSession(cluster).proxmoxer() + """ + Default Behavior: Instantiate Proxmox Sessions and return a list of Proxmox Sessions objects. + If 'name' is provided, return only the Proxmox Session with that name. + """ + + if source == "netbox": + proxmox_objects = [] - print(f"CLUSTER: {cluster}") - proxmox_sessions.append(cluster) + for px in pxc: + # Instantiate Proxmox Session object from ProxmoxSession class + px_obj = ProxmoxSession(px) + + # If name is provided, return only the Proxmox Session with that name + if px_obj.name == name: + return [px_obj] + elif px_obj.domain == domain: + return [px_obj] + + proxmox_objects.append(px_obj) - print(proxmox_sessions) -""" + # Return all Proxmox Sessions based on User-Provided Config + return proxmox_objects -#class ProxmoxMultiSessions: +ProxmoxSessionsDep = Annotated[list, Depends(proxmox_sessions)] \ No newline at end of file From 36d1d3829c1b1ec848fd1cfc3dc1d4b33848791e Mon Sep 17 00:00:00 2001 From: emersonfelipesp Date: Fri, 27 Oct 2023 17:02:00 +0000 Subject: [PATCH 23/34] Add query descriptions to 'ProxmoxSessionsDep' --- netbox_proxbox/backend/session/proxmox.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/netbox_proxbox/backend/session/proxmox.py b/netbox_proxbox/backend/session/proxmox.py index 4edbed4e..3303a99a 100644 --- a/netbox_proxbox/backend/session/proxmox.py +++ b/netbox_proxbox/backend/session/proxmox.py @@ -1,4 +1,4 @@ -from fastapi import Depends +from fastapi import Depends, Query from typing import Annotated, Any # Proxmox @@ -16,9 +16,6 @@ class ProxmoxSession: """ (Single-cluster) This class takes user-defined parameters to establish Proxmox connection and returns ProxmoxAPI object (with no further details) - NOTE: As `__init__()` does not support ASYNC methods, I had to create a method to establish Proxmox connection and return ProxmoxAPI object, which is `proxmoxer()` method. - Which means that only calling ProxmoxSession() will not establish Proxmox connection. You must call `proxmoxer()` method to do so. - INPUT must be: - dict - pydantic model - will be converted to dict @@ -273,8 +270,20 @@ def get_standalone_name(self): async def proxmox_sessions( pxc: ProxmoxConfigDep, source: str = "netbox", - name: str = None, - domain: str = None, + name: Annotated[ + str, + Query( + title="Proxmox Name", + description="Name of Proxmox Cluster or Proxmox Node (if standalone)." + ) + ] = None, + domain: Annotated[ + str, + Query( + title="Proxmox Domain", + description="Domain of Proxmox Cluster or Proxmox Node (if standalone)." + ) + ] = None, ): """ Default Behavior: Instantiate Proxmox Sessions and return a list of Proxmox Sessions objects. From 07386176154711260965f50d40e3c9fc3724ba13 Mon Sep 17 00:00:00 2001 From: emersonfelipesp Date: Fri, 27 Oct 2023 18:36:02 +0000 Subject: [PATCH 24/34] /proxmox/nodes/ path working with pydantic and multi-cluster --- netbox_proxbox/backend/enum/proxmox.py | 7 +++- netbox_proxbox/backend/routes/proxbox.py | 40 +++++++++++++------ .../backend/routes/proxmox/nodes.py | 21 ++++++++++ netbox_proxbox/backend/schemas/proxmox.py | 28 ++++++++++++- netbox_proxbox/main.py | 3 ++ 5 files changed, 85 insertions(+), 14 deletions(-) create mode 100644 netbox_proxbox/backend/routes/proxmox/nodes.py diff --git a/netbox_proxbox/backend/enum/proxmox.py b/netbox_proxbox/backend/enum/proxmox.py index 68749e2b..13b9139d 100644 --- a/netbox_proxbox/backend/enum/proxmox.py +++ b/netbox_proxbox/backend/enum/proxmox.py @@ -70,4 +70,9 @@ class ResourceType(Enum): qemu = "qemu" lxc = "lxc" openvz = "openvz" - sdn = "sdn" \ No newline at end of file + sdn = "sdn" + +class NodeStatus(Enum): + unknown = "unknown" + online = "online" + offline = "offline" \ No newline at end of file diff --git a/netbox_proxbox/backend/routes/proxbox.py b/netbox_proxbox/backend/routes/proxbox.py index 2d9d0a01..5bf50562 100644 --- a/netbox_proxbox/backend/routes/proxbox.py +++ b/netbox_proxbox/backend/routes/proxbox.py @@ -1,6 +1,6 @@ from typing import Annotated -from fastapi import APIRouter, Depends +from fastapi import APIRouter, Depends, Query from netbox_proxbox.backend.schemas import PluginConfig from netbox_proxbox.backend.schemas.netbox import NetboxSessionSchema @@ -13,8 +13,20 @@ @router.get("/netbox/plugins-config") async def netbox_plugins_config( - plugin_name: str | None = PROXBOX_PLUGIN_NAME, - list_all: bool | None = False + plugin_name: Annotated[ + str, + Query( + title="Netbox Plugin Name", + description="Netbox plugin name to get configuration from PLUGINS_CONFIG variable located at Netbox 'configuration.py' file." + ) + ] | None = PROXBOX_PLUGIN_NAME, + list_all: Annotated[ + bool, + Query( + title="List All Plugins", + description="Return all plugins configuration from PLUGINS_CONFIG variable located at Netbox 'configuration.py' file.", + ) + ] | None = False ): """ PLUGIN_CONFIG variable defined by user in Netbox 'configuration.py' file @@ -76,19 +88,24 @@ async def proxbox_netbox_default(): async def proxbox_settings( plugins_config: Annotated[PluginConfig, Depends(netbox_plugins_config)], default_settings: Annotated[PluginConfig, Depends(proxbox_netbox_default)], - list_all: bool | None = False + list_all: Annotated[ + bool, + Query( + title="List All Plugins", + description="Return all plugins configuration from PLUGINS_CONFIG variable located at Netbox 'configuration.py' file.", + ) + ] | None = False ): - if list_all: - return { - "plugins_config": plugins_config, - "default_settings": default_settings - } + """ + TODO: Compare PLUGINS_CONFIG defined by user with default settings from ProxboxConfig.default_settings + """ return plugins_config +ProxboxConfigDep = Annotated[PluginConfig, Depends(proxbox_settings)] @router.get("/settings/netbox") async def netbox_settings( - proxbox_config: Annotated[PluginConfig, Depends(proxbox_settings)], + proxbox_config: ProxboxConfigDep ): """ Get user configuration for Netbox from PLUGINS_CONFIG @@ -99,7 +116,7 @@ async def netbox_settings( @router.get("/settings/proxmox") async def proxmox_settings( - proxbox_config: Annotated[PluginConfig, Depends(proxbox_settings)], + proxbox_config: ProxboxConfigDep ): """ Get user configuration for Proxmox from PLUGINS_CONFIG @@ -107,7 +124,6 @@ async def proxmox_settings( return proxbox_config.proxmox - NetboxConfigDep = Annotated[NetboxSessionSchema, Depends(netbox_settings)] ProxmoxConfigDep = Annotated[ProxmoxMultiClusterConfig, Depends(proxmox_settings)] \ No newline at end of file diff --git a/netbox_proxbox/backend/routes/proxmox/nodes.py b/netbox_proxbox/backend/routes/proxmox/nodes.py new file mode 100644 index 00000000..c239cc4c --- /dev/null +++ b/netbox_proxbox/backend/routes/proxmox/nodes.py @@ -0,0 +1,21 @@ +from fastapi import APIRouter + +router = APIRouter() + +from netbox_proxbox.backend.session.proxmox import ProxmoxSessionsDep +from netbox_proxbox.backend.schemas.proxmox import ResponseNodeList + +@router.get("/", response_model=ResponseNodeList) +async def nodes( + pxs: ProxmoxSessionsDep +): + json_result = [] + + for px in pxs: + json_result.append( + { + px.name: px.session.nodes.get() + } + ) + + return json_result \ No newline at end of file diff --git a/netbox_proxbox/backend/schemas/proxmox.py b/netbox_proxbox/backend/schemas/proxmox.py index 3ba5ec96..814692c4 100644 --- a/netbox_proxbox/backend/schemas/proxmox.py +++ b/netbox_proxbox/backend/schemas/proxmox.py @@ -2,7 +2,8 @@ from typing import List, Dict -from netbox_proxbox.backend.enum.proxmox import ResourceType +from netbox_proxbox.backend.enum.proxmox import ResourceType, NodeStatus + class ProxmoxTokenSchema(BaseModel): name: str @@ -18,6 +19,10 @@ class ProxmoxSessionSchema(BaseModel): ProxmoxMultiClusterConfig = RootModel[List[ProxmoxSessionSchema]] + +# +# /cluster +# class Resources(BaseModel): cgroup_mode: int = None content: str = None @@ -42,3 +47,24 @@ class Resources(BaseModel): ResourcesList = RootModel[List[Resources]] ClusterResourcesList = RootModel[List[Dict[str, ResourcesList]]] + + +# +# /nodes +# + +class Node(BaseModel): + node: str + status: NodeStatus + cpu: float = None + level: str = None + maxcpu: int = None + maxmem: int = None + mem: int = None + ssl_fingerprint: str = None + uptime: int = None + +NodeList = RootModel[List[Node]] +ResponseNodeList = RootModel[List[Dict[str, ResourcesList]]] + + diff --git a/netbox_proxbox/main.py b/netbox_proxbox/main.py index d14050e6..2129622c 100644 --- a/netbox_proxbox/main.py +++ b/netbox_proxbox/main.py @@ -9,6 +9,8 @@ from .backend.routes.proxbox import router as proxbox_router from .backend.routes.proxmox import router as proxmox_router from .backend.routes.proxmox.cluster import router as px_cluster_router +from .backend.routes.proxmox.nodes import router as px_nodes_router + from .backend.schemas import * @@ -32,6 +34,7 @@ async def proxmoxer_exception_handler(request: Request, exc: ProxboxException): # Routes (Endpoints) app.include_router(netbox_router, prefix="/netbox", tags=["netbox"]) app.include_router(proxbox_router, prefix="/proxbox", tags=["proxbox"]) +app.include_router(px_nodes_router, prefix="/proxmox/nodes", tags=["proxmox / nodes"]) app.include_router(px_cluster_router, prefix="/proxmox/cluster", tags=["proxmox / cluster"]) app.include_router(proxmox_router, prefix="/proxmox", tags=["proxmox"]) From b20fc5e7dda047fd623a87ac72150bdbc50d89ea Mon Sep 17 00:00:00 2001 From: emersonfelipesp Date: Wed, 1 Nov 2023 16:25:52 +0000 Subject: [PATCH 25/34] Add first Netbox View 'Clusters' rendering '/proxmox/cluster/status' response from FastAPI backend --- .../backend/routes/proxmox/nodes.py | 51 +++++++++++++- netbox_proxbox/navigation.py | 7 ++ .../netbox_proxbox/proxmox/cluster.html | 68 +++++++++++++++++++ netbox_proxbox/urls.py | 3 +- netbox_proxbox/views.py | 32 ++++++++- 5 files changed, 156 insertions(+), 5 deletions(-) create mode 100644 netbox_proxbox/templates/netbox_proxbox/proxmox/cluster.html diff --git a/netbox_proxbox/backend/routes/proxmox/nodes.py b/netbox_proxbox/backend/routes/proxmox/nodes.py index c239cc4c..c8bc591b 100644 --- a/netbox_proxbox/backend/routes/proxmox/nodes.py +++ b/netbox_proxbox/backend/routes/proxmox/nodes.py @@ -1,21 +1,66 @@ -from fastapi import APIRouter +from fastapi import APIRouter, Path + +from typing import Annotated + +from proxmoxer.core import ResourceException router = APIRouter() from netbox_proxbox.backend.session.proxmox import ProxmoxSessionsDep from netbox_proxbox.backend.schemas.proxmox import ResponseNodeList + + +""" @router.get("/", response_model=ResponseNodeList) +async def nodes(pxs: ProxmoxSessionsDep): + json_result = [] + + for px in pxs: + json_result.append( + { + px.name: px.session(path).get() + } + ) + + return json_result +""" + +@router.get("/teste") +async def test(): + return "teste" + +@router.get("/{node}") async def nodes( - pxs: ProxmoxSessionsDep + pxs: ProxmoxSessionsDep, + node: Annotated[str, Path(title="Proxmox Node", description="Proxmox Node name (ex. 'pve01').")], ): json_result = [] for px in pxs: json_result.append( { - px.name: px.session.nodes.get() + px.name: px.session(f"/nodes/{node}").get() } ) + return json_result + +@router.get("/{node}/qemu") +async def nodes( + pxs: ProxmoxSessionsDep, + node: Annotated[str, Path(title="Proxmox Node", description="Proxmox Node name (ex. 'pve01').")], +): + json_result = [] + + for px in pxs: + try: + json_result.append( + { + px.name: px.session(f"/nodes/{node}/qemu").get() + } + ) + except ResourceException as error: + pass + return json_result \ No newline at end of file diff --git a/netbox_proxbox/navigation.py b/netbox_proxbox/navigation.py index aebb9fe8..521221eb 100755 --- a/netbox_proxbox/navigation.py +++ b/netbox_proxbox/navigation.py @@ -1,5 +1,6 @@ from extras.plugins import PluginMenuButton, PluginMenuItem, PluginMenu from utilities.choices import ButtonColorChoices +import requests fullupdate_item = PluginMenuItem( link='plugins:netbox_proxbox:home', @@ -36,10 +37,16 @@ ] ) +proxmox_cluster_item = PluginMenuItem( + link='plugins:netbox_proxbox:proxmox_cluster', + link_text='Clusters', +) + menu = PluginMenu( label='Proxbox', groups=( ('Proxmox Plugin', (fullupdate_item,)), + ('Proxmox', (proxmox_cluster_item,)), ('Join our community', (contributing_item, community_item,)), ), icon_class='mdi mdi-dns' diff --git a/netbox_proxbox/templates/netbox_proxbox/proxmox/cluster.html b/netbox_proxbox/templates/netbox_proxbox/proxmox/cluster.html new file mode 100644 index 00000000..bbdcd721 --- /dev/null +++ b/netbox_proxbox/templates/netbox_proxbox/proxmox/cluster.html @@ -0,0 +1,68 @@ +{% extends 'base/layout.html' %} +{% load static %} + +{% block content %} + +

+ Proxmox Clusters +

+ + + + {% for cluster in response %} + + +
+

{{ cluster_name }}

+
+ {% for cluster_name, cluster_data in cluster.items %} +
+
{{ cluster_name }}
+
+ + + + + + + + + + + + + + + + + + {% for dict in cluster_data %} + + + + + + + + + + + + + + {% endfor %} + +
IDNameTypeIPLevelLocalNode IDNodesOnlineQuorateVersion
{% if dict.id %}{{ dict.id }}{% endif %}{% if dict.name %}{{ dict.name }}{% endif %}{% if dict.type %}{{ dict.type }}{% endif %}{% if dict.ip %}{{ dict.ip }}{% endif %}{% if dict.level %}{{ dict.level }}{% endif %}{% if dict.local %}{{ dict.local }}{% endif %}{% if dict.nodeid %}{{ dict.nodeid }}{% endif %}{% if dict.nodeid %}{{ dict.nodes }}{% endif %}{% if dict.nodeid %}{{ dict.online }}{% endif %}{% if dict.nodeid %}{{ dict.quorate }}{% endif %}{% if dict.nodeid %}{{ dict.version }}{% endif %}
+
+
+ {% endfor %} +
+
+ {% endfor %} +{% endblock %} + +{% block footer_links %} + {{ block.super }} + + {% include "netbox_proxbox/footer.html" %} +{% endblock %} diff --git a/netbox_proxbox/urls.py b/netbox_proxbox/urls.py index 17f810b5..e0cf37e0 100755 --- a/netbox_proxbox/urls.py +++ b/netbox_proxbox/urls.py @@ -30,5 +30,6 @@ # Proxbox API full update path("full_update/", views.ProxmoxFullUpdate.as_view(), name="proxmoxvm_full_update"), - path("single_update/", views.ProxmoxSingleUpdate.as_view(), name="proxmoxvm_single_update") + path("single_update/", views.ProxmoxSingleUpdate.as_view(), name="proxmoxvm_single_update"), + path("proxmox/cluster/", views.ProxmoxCluster.as_view(), name="proxmox_cluster"), ] diff --git a/netbox_proxbox/views.py b/netbox_proxbox/views.py index abfaeadc..ac7d381f 100755 --- a/netbox_proxbox/views.py +++ b/netbox_proxbox/views.py @@ -26,6 +26,8 @@ import markdown from . import github +import requests + class HomeView(View): """Homepage""" template_name = 'netbox_proxbox/home.html' @@ -282,4 +284,32 @@ class ProxmoxVMEditView(PermissionRequiredMixin, UpdateView): model = ProxmoxVM form_class = ProxmoxVMForm - template_name = "netbox_proxbox/proxmox_vm_edit.html" \ No newline at end of file + template_name = "netbox_proxbox/proxmox_vm_edit.html" + +class ProxmoxCluster(View): + """Homepage""" + template_name = 'netbox_proxbox/proxmox/cluster.html' + + domain = "http://localhost:8800" + path = "/proxmox/cluster/status" + + + response = requests.get(f"{domain}{path}").json() + """ + try: + response = requests.get(f"{domain}{path}").json() + except Exception as error: + response_error = error + """ + + # service incoming GET HTTP requests + def get(self, request): + """Get request.""" + + return render( + request, + self.template_name, + { + "response": self.response, + } + ) \ No newline at end of file From f6ad5bf7867a1cf247873f755738bd6c3ddf35dc Mon Sep 17 00:00:00 2001 From: emersonfelipesp Date: Wed, 8 Nov 2023 21:23:06 +0000 Subject: [PATCH 26/34] Fist React component using Next.js with dynamic data from FastAPI backend working at /proxmox/sessions next app --- netbox_proxbox/navigation.py | 1 - .../netbox_proxbox/proxmox/cluster.html | 4 +- netbox_proxbox/views.py | 21 + standalone/.eslintrc.json | 3 + standalone/.gitignore | 36 + standalone/README.md | 36 + standalone/app/api/route.js | 13 + .../app/cluster/[cluster_name]/page.tsx | 5 + standalone/app/cluster/layout.js | 12 + standalone/app/cluster/page.tsx | 10 + standalone/app/cluster/testpage.tsx | 3 + standalone/app/error.tsx | 30 + standalone/app/favicon.ico | Bin 0 -> 25931 bytes standalone/app/globals.css | 27 + standalone/app/layout.js | 19 + standalone/app/loading.js | 7 + standalone/app/page.tsx | 12 + standalone/app/page_default_next.js | 113 + standalone/app/proxmox/sessions/page.tsx | 48 + standalone/jsconfig.json | 7 + standalone/next.config.js | 4 + standalone/package-lock.json | 4331 +++++++++++++++++ standalone/package.json | 25 + standalone/postcss.config.js | 6 + standalone/public/next.svg | 1 + standalone/public/vercel.svg | 1 + standalone/tailwind.config.js | 18 + standalone/tsconfig.json | 34 + 28 files changed, 4825 insertions(+), 2 deletions(-) create mode 100644 standalone/.eslintrc.json create mode 100644 standalone/.gitignore create mode 100644 standalone/README.md create mode 100644 standalone/app/api/route.js create mode 100644 standalone/app/cluster/[cluster_name]/page.tsx create mode 100644 standalone/app/cluster/layout.js create mode 100644 standalone/app/cluster/page.tsx create mode 100644 standalone/app/cluster/testpage.tsx create mode 100644 standalone/app/error.tsx create mode 100644 standalone/app/favicon.ico create mode 100644 standalone/app/globals.css create mode 100644 standalone/app/layout.js create mode 100644 standalone/app/loading.js create mode 100644 standalone/app/page.tsx create mode 100644 standalone/app/page_default_next.js create mode 100644 standalone/app/proxmox/sessions/page.tsx create mode 100644 standalone/jsconfig.json create mode 100644 standalone/next.config.js create mode 100644 standalone/package-lock.json create mode 100644 standalone/package.json create mode 100644 standalone/postcss.config.js create mode 100644 standalone/public/next.svg create mode 100644 standalone/public/vercel.svg create mode 100644 standalone/tailwind.config.js create mode 100644 standalone/tsconfig.json diff --git a/netbox_proxbox/navigation.py b/netbox_proxbox/navigation.py index 521221eb..9028994c 100755 --- a/netbox_proxbox/navigation.py +++ b/netbox_proxbox/navigation.py @@ -1,6 +1,5 @@ from extras.plugins import PluginMenuButton, PluginMenuItem, PluginMenu from utilities.choices import ButtonColorChoices -import requests fullupdate_item = PluginMenuItem( link='plugins:netbox_proxbox:home', diff --git a/netbox_proxbox/templates/netbox_proxbox/proxmox/cluster.html b/netbox_proxbox/templates/netbox_proxbox/proxmox/cluster.html index bbdcd721..df732c8e 100644 --- a/netbox_proxbox/templates/netbox_proxbox/proxmox/cluster.html +++ b/netbox_proxbox/templates/netbox_proxbox/proxmox/cluster.html @@ -1,4 +1,5 @@ {% extends 'base/layout.html' %} +{% load django_tables2 %} {% load static %} {% block content %} @@ -45,7 +46,7 @@
{{ cluster_name }}
{% if dict.level %}{{ dict.level }}{% endif %} {% if dict.local %}{{ dict.local }}{% endif %} {% if dict.nodeid %}{{ dict.nodeid }}{% endif %} - {% if dict.nodeid %}{{ dict.nodes }}{% endif %} + {% if dict.nodes %}{{ dict.nodes }}{% endif %} {% if dict.nodeid %}{{ dict.online }}{% endif %} {% if dict.nodeid %}{{ dict.quorate }}{% endif %} {% if dict.nodeid %}{{ dict.version }}{% endif %} @@ -59,6 +60,7 @@
{{ cluster_name }}
{% endfor %} + {% endblock %} {% block footer_links %} diff --git a/netbox_proxbox/views.py b/netbox_proxbox/views.py index ac7d381f..0c959a6d 100755 --- a/netbox_proxbox/views.py +++ b/netbox_proxbox/views.py @@ -286,6 +286,24 @@ class ProxmoxVMEditView(PermissionRequiredMixin, UpdateView): form_class = ProxmoxVMForm template_name = "netbox_proxbox/proxmox_vm_edit.html" + + +import django_tables2 as tables + +class ClusterStatus(tables.Table): + id = tables.Column(verbose_name="ID") + name = tables.Column(verbose_name="Name") + type = tables.Column(verbose_name="Type") + ip = tables.Column(verbose_name="IP") + level = tables.Column(verbose_name="Level") + local = tables.Column(verbose_name="Local") + nodeid = tables.Column(verbose_name="Node ID") + nodes = tables.Column(verbose_name="Nodes") + online = tables.Column(verbose_name="Online") + quorate = tables.Column(verbose_name="Quorate") + version = tables.Column(verbose_name="Version") + + class ProxmoxCluster(View): """Homepage""" template_name = 'netbox_proxbox/proxmox/cluster.html' @@ -294,7 +312,9 @@ class ProxmoxCluster(View): path = "/proxmox/cluster/status" + response = requests.get(f"{domain}{path}").json() + table_cluster_01 = ClusterStatus(response[0].get("PVE-CLUSTER-02")) """ try: response = requests.get(f"{domain}{path}").json() @@ -311,5 +331,6 @@ def get(self, request): self.template_name, { "response": self.response, + "table": self.table_cluster_01 } ) \ No newline at end of file diff --git a/standalone/.eslintrc.json b/standalone/.eslintrc.json new file mode 100644 index 00000000..bffb357a --- /dev/null +++ b/standalone/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "next/core-web-vitals" +} diff --git a/standalone/.gitignore b/standalone/.gitignore new file mode 100644 index 00000000..fd3dbb57 --- /dev/null +++ b/standalone/.gitignore @@ -0,0 +1,36 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js +.yarn/install-state.gz + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env*.local + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/standalone/README.md b/standalone/README.md new file mode 100644 index 00000000..0dc9ea2b --- /dev/null +++ b/standalone/README.md @@ -0,0 +1,36 @@ +This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). + +## Getting Started + +First, run the development server: + +```bash +npm run dev +# or +yarn dev +# or +pnpm dev +# or +bun dev +``` + +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. + +You can start editing the page by modifying `app/page.js`. The page auto-updates as you edit the file. + +This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. + +## Learn More + +To learn more about Next.js, take a look at the following resources: + +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. +- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. + +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! + +## Deploy on Vercel + +The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. + +Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/standalone/app/api/route.js b/standalone/app/api/route.js new file mode 100644 index 00000000..dcdc6315 --- /dev/null +++ b/standalone/app/api/route.js @@ -0,0 +1,13 @@ +const proxbox_domain = 'http://localhost:8800' + +export async function GET() { + const res = await fetch(proxbox_domain, { + headers: { + 'Content-Type': 'application/json', + }, + }) + + const data = await res.json() + + return Response.json({ data }) +} \ No newline at end of file diff --git a/standalone/app/cluster/[cluster_name]/page.tsx b/standalone/app/cluster/[cluster_name]/page.tsx new file mode 100644 index 00000000..ee455ccd --- /dev/null +++ b/standalone/app/cluster/[cluster_name]/page.tsx @@ -0,0 +1,5 @@ +export default function Page( + { params }: { params: { cluster_name: string } } +) { + return
Cluster: {params.cluster_name}
+} \ No newline at end of file diff --git a/standalone/app/cluster/layout.js b/standalone/app/cluster/layout.js new file mode 100644 index 00000000..4e8d68a5 --- /dev/null +++ b/standalone/app/cluster/layout.js @@ -0,0 +1,12 @@ +export default function DashboardLayout( + { + children, // will be a page or nested layout + } +) { + return ( +
+ {/* Include shared UI here e.g. a header or sidebar */} + {children} +
+ ) + } \ No newline at end of file diff --git a/standalone/app/cluster/page.tsx b/standalone/app/cluster/page.tsx new file mode 100644 index 00000000..e56a7bca --- /dev/null +++ b/standalone/app/cluster/page.tsx @@ -0,0 +1,10 @@ +import Link from 'next/link' + +export default function Page() { + return ( +
+

Proxmox Cluster

+ Homepage +
+ ) +} \ No newline at end of file diff --git a/standalone/app/cluster/testpage.tsx b/standalone/app/cluster/testpage.tsx new file mode 100644 index 00000000..e520861f --- /dev/null +++ b/standalone/app/cluster/testpage.tsx @@ -0,0 +1,3 @@ +export default function Test() { + return
Test
+} \ No newline at end of file diff --git a/standalone/app/error.tsx b/standalone/app/error.tsx new file mode 100644 index 00000000..101c38c8 --- /dev/null +++ b/standalone/app/error.tsx @@ -0,0 +1,30 @@ +'use client' // Error components must be Client Components + +import { useEffect } from 'react' + +export default function Error({ + error, + reset, +}: { + error: Error & { digest?: string } + reset: () => void +}) { + useEffect(() => { + // Log the error to an error reporting service + console.error(error) + }, [error]) + + return ( +
+

Something went wrong!

+ +
+ ) +} \ No newline at end of file diff --git a/standalone/app/favicon.ico b/standalone/app/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..718d6fea4835ec2d246af9800eddb7ffb276240c GIT binary patch literal 25931 zcmeHv30#a{`}aL_*G&7qml|y<+KVaDM2m#dVr!KsA!#An?kSQM(q<_dDNCpjEux83 zLb9Z^XxbDl(w>%i@8hT6>)&Gu{h#Oeyszu?xtw#Zb1mO{pgX9699l+Qppw7jXaYf~-84xW z)w4x8?=youko|}Vr~(D$UXIbiXABHh`p1?nn8Po~fxRJv}|0e(BPs|G`(TT%kKVJAdg5*Z|x0leQq0 zkdUBvb#>9F()jo|T~kx@OM8$9wzs~t2l;K=woNssA3l6|sx2r3+kdfVW@e^8e*E}v zA1y5{bRi+3Z`uD3{F7LgFJDdvm;nJilkzDku>BwXH(8ItVCXk*-lSJnR?-2UN%hJ){&rlvg`CDTj z)Bzo!3v7Ou#83zEDEFcKt(f1E0~=rqeEbTnMvWR#{+9pg%7G8y>u1OVRUSoox-ovF z2Ydma(;=YuBY(eI|04{hXzZD6_f(v~H;C~y5=DhAC{MMS>2fm~1H_t2$56pc$NH8( z5bH|<)71dV-_oCHIrzrT`2s-5w_+2CM0$95I6X8p^r!gHp+j_gd;9O<1~CEQQGS8) zS9Qh3#p&JM-G8rHekNmKVewU;pJRcTAog68KYo^dRo}(M>36U4Us zfgYWSiHZL3;lpWT=zNAW>Dh#mB!_@Lg%$ms8N-;aPqMn+C2HqZgz&9~Eu z4|Kp<`$q)Uw1R?y(~S>ePdonHxpV1#eSP1B;Ogo+-Pk}6#0GsZZ5!||ev2MGdh}_m z{DeR7?0-1^zVs&`AV6Vt;r3`I`OI_wgs*w=eO%_#7Kepl{B@xiyCANc(l zzIyd4y|c6PXWq9-|KM8(zIk8LPk(>a)zyFWjhT!$HJ$qX1vo@d25W<fvZQ2zUz5WRc(UnFMKHwe1| zWmlB1qdbiA(C0jmnV<}GfbKtmcu^2*P^O?MBLZKt|As~ge8&AAO~2K@zbXelK|4T<{|y4`raF{=72kC2Kn(L4YyenWgrPiv z@^mr$t{#X5VuIMeL!7Ab6_kG$&#&5p*Z{+?5U|TZ`B!7llpVmp@skYz&n^8QfPJzL z0G6K_OJM9x+Wu2gfN45phANGt{7=C>i34CV{Xqlx(fWpeAoj^N0Biu`w+MVcCUyU* zDZuzO0>4Z6fbu^T_arWW5n!E45vX8N=bxTVeFoep_G#VmNlQzAI_KTIc{6>c+04vr zx@W}zE5JNSU>!THJ{J=cqjz+4{L4A{Ob9$ZJ*S1?Ggg3klFp!+Y1@K+pK1DqI|_gq z5ZDXVpge8-cs!o|;K73#YXZ3AShj50wBvuq3NTOZ`M&qtjj#GOFfgExjg8Gn8>Vq5 z`85n+9|!iLCZF5$HJ$Iu($dm?8~-ofu}tEc+-pyke=3!im#6pk_Wo8IA|fJwD&~~F zc16osQ)EBo58U7XDuMexaPRjU@h8tXe%S{fA0NH3vGJFhuyyO!Uyl2^&EOpX{9As0 zWj+P>{@}jxH)8|r;2HdupP!vie{sJ28b&bo!8`D^x}TE$%zXNb^X1p@0PJ86`dZyj z%ce7*{^oo+6%&~I!8hQy-vQ7E)0t0ybH4l%KltWOo~8cO`T=157JqL(oq_rC%ea&4 z2NcTJe-HgFjNg-gZ$6!Y`SMHrlj}Etf7?r!zQTPPSv}{so2e>Fjs1{gzk~LGeesX%r(Lh6rbhSo_n)@@G-FTQy93;l#E)hgP@d_SGvyCp0~o(Y;Ee8{ zdVUDbHm5`2taPUOY^MAGOw*>=s7=Gst=D+p+2yON!0%Hk` zz5mAhyT4lS*T3LS^WSxUy86q&GnoHxzQ6vm8)VS}_zuqG?+3td68_x;etQAdu@sc6 zQJ&5|4(I?~3d-QOAODHpZ=hlSg(lBZ!JZWCtHHSj`0Wh93-Uk)_S%zsJ~aD>{`A0~ z9{AG(e|q3g5B%wYKRxiL2Y$8(4w6bzchKuloQW#e&S3n+P- z8!ds-%f;TJ1>)v)##>gd{PdS2Oc3VaR`fr=`O8QIO(6(N!A?pr5C#6fc~Ge@N%Vvu zaoAX2&(a6eWy_q&UwOhU)|P3J0Qc%OdhzW=F4D|pt0E4osw;%<%Dn58hAWD^XnZD= z>9~H(3bmLtxpF?a7su6J7M*x1By7YSUbxGi)Ot0P77`}P3{)&5Un{KD?`-e?r21!4vTTnN(4Y6Lin?UkSM z`MXCTC1@4A4~mvz%Rh2&EwY))LeoT=*`tMoqcEXI>TZU9WTP#l?uFv+@Dn~b(>xh2 z;>B?;Tz2SR&KVb>vGiBSB`@U7VIWFSo=LDSb9F{GF^DbmWAfpms8Sx9OX4CnBJca3 zlj9(x!dIjN?OG1X4l*imJNvRCk}F%!?SOfiOq5y^mZW)jFL@a|r-@d#f7 z2gmU8L3IZq0ynIws=}~m^#@&C%J6QFo~Mo4V`>v7MI-_!EBMMtb%_M&kvAaN)@ZVw z+`toz&WG#HkWDjnZE!6nk{e-oFdL^$YnbOCN}JC&{$#$O27@|Tn-skXr)2ml2~O!5 zX+gYoxhoc7qoU?C^3~&!U?kRFtnSEecWuH0B0OvLodgUAi}8p1 zrO6RSXHH}DMc$&|?D004DiOVMHV8kXCP@7NKB zgaZq^^O<7PoKEp72kby@W0Z!Y*Ay{&vfg#C&gG@YVR9g?FEocMUi1gSN$+V+ayF45{a zuDZDTN}mS|;BO%gEf}pjBfN2-gIrU#G5~cucA;dokXW89%>AyXJJI z9X4UlIWA|ZYHgbI z5?oFk@A=Ik7lrEQPDH!H+b`7_Y~aDb_qa=B2^Y&Ow41cU=4WDd40dp5(QS-WMN-=Y z9g;6_-JdNU;|6cPwf$ak*aJIcwL@1n$#l~zi{c{EW?T;DaW*E8DYq?Umtz{nJ&w-M zEMyTDrC&9K$d|kZe2#ws6)L=7K+{ zQw{XnV6UC$6-rW0emqm8wJoeZK)wJIcV?dST}Z;G0Arq{dVDu0&4kd%N!3F1*;*pW zR&qUiFzK=@44#QGw7k1`3t_d8&*kBV->O##t|tonFc2YWrL7_eqg+=+k;!F-`^b8> z#KWCE8%u4k@EprxqiV$VmmtiWxDLgnGu$Vs<8rppV5EajBXL4nyyZM$SWVm!wnCj-B!Wjqj5-5dNXukI2$$|Bu3Lrw}z65Lc=1G z^-#WuQOj$hwNGG?*CM_TO8Bg-1+qc>J7k5c51U8g?ZU5n?HYor;~JIjoWH-G>AoUP ztrWWLbRNqIjW#RT*WqZgPJXU7C)VaW5}MiijYbABmzoru6EmQ*N8cVK7a3|aOB#O& zBl8JY2WKfmj;h#Q!pN%9o@VNLv{OUL?rixHwOZuvX7{IJ{(EdPpuVFoQqIOa7giLVkBOKL@^smUA!tZ1CKRK}#SSM)iQHk)*R~?M!qkCruaS!#oIL1c z?J;U~&FfH#*98^G?i}pA{ z9Jg36t4=%6mhY(quYq*vSxptes9qy|7xSlH?G=S@>u>Ebe;|LVhs~@+06N<4CViBk zUiY$thvX;>Tby6z9Y1edAMQaiH zm^r3v#$Q#2T=X>bsY#D%s!bhs^M9PMAcHbCc0FMHV{u-dwlL;a1eJ63v5U*?Q_8JO zT#50!RD619#j_Uf))0ooADz~*9&lN!bBDRUgE>Vud-i5ck%vT=r^yD*^?Mp@Q^v+V zG#-?gKlr}Eeqifb{|So?HM&g91P8|av8hQoCmQXkd?7wIJwb z_^v8bbg`SAn{I*4bH$u(RZ6*xUhuA~hc=8czK8SHEKTzSxgbwi~9(OqJB&gwb^l4+m`k*Q;_?>Y-APi1{k zAHQ)P)G)f|AyjSgcCFps)Fh6Bca*Xznq36!pV6Az&m{O8$wGFD? zY&O*3*J0;_EqM#jh6^gMQKpXV?#1?>$ml1xvh8nSN>-?H=V;nJIwB07YX$e6vLxH( zqYwQ>qxwR(i4f)DLd)-$P>T-no_c!LsN@)8`e;W@)-Hj0>nJ-}Kla4-ZdPJzI&Mce zv)V_j;(3ERN3_@I$N<^|4Lf`B;8n+bX@bHbcZTopEmDI*Jfl)-pFDvo6svPRoo@(x z);_{lY<;);XzT`dBFpRmGrr}z5u1=pC^S-{ce6iXQlLGcItwJ^mZx{m$&DA_oEZ)B{_bYPq-HA zcH8WGoBG(aBU_j)vEy+_71T34@4dmSg!|M8Vf92Zj6WH7Q7t#OHQqWgFE3ARt+%!T z?oLovLVlnf?2c7pTc)~cc^($_8nyKwsN`RA-23ed3sdj(ys%pjjM+9JrctL;dy8a( z@en&CQmnV(()bu|Y%G1-4a(6x{aLytn$T-;(&{QIJB9vMox11U-1HpD@d(QkaJdEb zG{)+6Dos_L+O3NpWo^=gR?evp|CqEG?L&Ut#D*KLaRFOgOEK(Kq1@!EGcTfo+%A&I z=dLbB+d$u{sh?u)xP{PF8L%;YPPW53+@{>5W=Jt#wQpN;0_HYdw1{ksf_XhO4#2F= zyPx6Lx2<92L-;L5PD`zn6zwIH`Jk($?Qw({erA$^bC;q33hv!d!>%wRhj# zal^hk+WGNg;rJtb-EB(?czvOM=H7dl=vblBwAv>}%1@{}mnpUznfq1cE^sgsL0*4I zJ##!*B?=vI_OEVis5o+_IwMIRrpQyT_Sq~ZU%oY7c5JMIADzpD!Upz9h@iWg_>>~j zOLS;wp^i$-E?4<_cp?RiS%Rd?i;f*mOz=~(&3lo<=@(nR!_Rqiprh@weZlL!t#NCc zO!QTcInq|%#>OVgobj{~ixEUec`E25zJ~*DofsQdzIa@5^nOXj2T;8O`l--(QyU^$t?TGY^7#&FQ+2SS3B#qK*k3`ye?8jUYSajE5iBbJls75CCc(m3dk{t?- zopcER9{Z?TC)mk~gpi^kbbu>b-+a{m#8-y2^p$ka4n60w;Sc2}HMf<8JUvhCL0B&Btk)T`ctE$*qNW8L$`7!r^9T+>=<=2qaq-;ll2{`{Rg zc5a0ZUI$oG&j-qVOuKa=*v4aY#IsoM+1|c4Z)<}lEDvy;5huB@1RJPquU2U*U-;gu z=En2m+qjBzR#DEJDO`WU)hdd{Vj%^0V*KoyZ|5lzV87&g_j~NCjwv0uQVqXOb*QrQ zy|Qn`hxx(58c70$E;L(X0uZZ72M1!6oeg)(cdKO ze0gDaTz+ohR-#d)NbAH4x{I(21yjwvBQfmpLu$)|m{XolbgF!pmsqJ#D}(ylp6uC> z{bqtcI#hT#HW=wl7>p!38sKsJ`r8}lt-q%Keqy%u(xk=yiIJiUw6|5IvkS+#?JTBl z8H5(Q?l#wzazujH!8o>1xtn8#_w+397*_cy8!pQGP%K(Ga3pAjsaTbbXJlQF_+m+-UpUUent@xM zg%jqLUExj~o^vQ3Gl*>wh=_gOr2*|U64_iXb+-111aH}$TjeajM+I20xw(((>fej-@CIz4S1pi$(#}P7`4({6QS2CaQS4NPENDp>sAqD z$bH4KGzXGffkJ7R>V>)>tC)uax{UsN*dbeNC*v}#8Y#OWYwL4t$ePR?VTyIs!wea+ z5Urmc)X|^`MG~*dS6pGSbU+gPJoq*^a=_>$n4|P^w$sMBBy@f*Z^Jg6?n5?oId6f{ z$LW4M|4m502z0t7g<#Bx%X;9<=)smFolV&(V^(7Cv2-sxbxopQ!)*#ZRhTBpx1)Fc zNm1T%bONzv6@#|dz(w02AH8OXe>kQ#1FMCzO}2J_mST)+ExmBr9cva-@?;wnmWMOk z{3_~EX_xadgJGv&H@zK_8{(x84`}+c?oSBX*Ge3VdfTt&F}yCpFP?CpW+BE^cWY0^ zb&uBN!Ja3UzYHK-CTyA5=L zEMW{l3Usky#ly=7px648W31UNV@K)&Ub&zP1c7%)`{);I4b0Q<)B}3;NMG2JH=X$U zfIW4)4n9ZM`-yRj67I)YSLDK)qfUJ_ij}a#aZN~9EXrh8eZY2&=uY%2N0UFF7<~%M zsB8=erOWZ>Ct_#^tHZ|*q`H;A)5;ycw*IcmVxi8_0Xk}aJA^ath+E;xg!x+As(M#0=)3!NJR6H&9+zd#iP(m0PIW8$ z1Y^VX`>jm`W!=WpF*{ioM?C9`yOR>@0q=u7o>BP-eSHqCgMDj!2anwH?s%i2p+Q7D zzszIf5XJpE)IG4;d_(La-xenmF(tgAxK`Y4sQ}BSJEPs6N_U2vI{8=0C_F?@7<(G; zo$~G=8p+076G;`}>{MQ>t>7cm=zGtfbdDXm6||jUU|?X?CaE?(<6bKDYKeHlz}DA8 zXT={X=yp_R;HfJ9h%?eWvQ!dRgz&Su*JfNt!Wu>|XfU&68iRikRrHRW|ZxzRR^`eIGt zIeiDgVS>IeExKVRWW8-=A=yA`}`)ZkWBrZD`hpWIxBGkh&f#ijr449~m`j6{4jiJ*C!oVA8ZC?$1RM#K(_b zL9TW)kN*Y4%^-qPpMP7d4)o?Nk#>aoYHT(*g)qmRUb?**F@pnNiy6Fv9rEiUqD(^O zzyS?nBrX63BTRYduaG(0VVG2yJRe%o&rVrLjbxTaAFTd8s;<<@Qs>u(<193R8>}2_ zuwp{7;H2a*X7_jryzriZXMg?bTuegABb^87@SsKkr2)0Gyiax8KQWstw^v#ix45EVrcEhr>!NMhprl$InQMzjSFH54x5k9qHc`@9uKQzvL4ihcq{^B zPrVR=o_ic%Y>6&rMN)hTZsI7I<3&`#(nl+3y3ys9A~&^=4?PL&nd8)`OfG#n zwAMN$1&>K++c{^|7<4P=2y(B{jJsQ0a#U;HTo4ZmWZYvI{+s;Td{Yzem%0*k#)vjpB zia;J&>}ICate44SFYY3vEelqStQWFihx%^vQ@Do(sOy7yR2@WNv7Y9I^yL=nZr3mb zXKV5t@=?-Sk|b{XMhA7ZGB@2hqsx}4xwCW!in#C zI@}scZlr3-NFJ@NFaJlhyfcw{k^vvtGl`N9xSo**rDW4S}i zM9{fMPWo%4wYDG~BZ18BD+}h|GQKc-g^{++3MY>}W_uq7jGHx{mwE9fZiPCoxN$+7 zrODGGJrOkcPQUB(FD5aoS4g~7#6NR^ma7-!>mHuJfY5kTe6PpNNKC9GGRiu^L31uG z$7v`*JknQHsYB!Tm_W{a32TM099djW%5e+j0Ve_ct}IM>XLF1Ap+YvcrLV=|CKo6S zb+9Nl3_YdKP6%Cxy@6TxZ>;4&nTneadr z_ES90ydCev)LV!dN=#(*f}|ZORFdvkYBni^aLbUk>BajeWIOcmHP#8S)*2U~QKI%S zyrLmtPqb&TphJ;>yAxri#;{uyk`JJqODDw%(Z=2`1uc}br^V%>j!gS)D*q*f_-qf8&D;W1dJgQMlaH5er zN2U<%Smb7==vE}dDI8K7cKz!vs^73o9f>2sgiTzWcwY|BMYHH5%Vn7#kiw&eItCqa zIkR2~Q}>X=Ar8W|^Ms41Fm8o6IB2_j60eOeBB1Br!boW7JnoeX6Gs)?7rW0^5psc- zjS16yb>dFn>KPOF;imD}e!enuIniFzv}n$m2#gCCv4jM#ArwlzZ$7@9&XkFxZ4n!V zj3dyiwW4Ki2QG{@i>yuZXQizw_OkZI^-3otXC{!(lUpJF33gI60ak;Uqitp74|B6I zgg{b=Iz}WkhCGj1M=hu4#Aw173YxIVbISaoc z-nLZC*6Tgivd5V`K%GxhBsp@SUU60-rfc$=wb>zdJzXS&-5(NRRodFk;Kxk!S(O(a0e7oY=E( zAyS;Ow?6Q&XA+cnkCb{28_1N8H#?J!*$MmIwLq^*T_9-z^&UE@A(z9oGYtFy6EZef LrJugUA?W`A8`#=m literal 0 HcmV?d00001 diff --git a/standalone/app/globals.css b/standalone/app/globals.css new file mode 100644 index 00000000..fd81e885 --- /dev/null +++ b/standalone/app/globals.css @@ -0,0 +1,27 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +:root { + --foreground-rgb: 0, 0, 0; + --background-start-rgb: 214, 219, 220; + --background-end-rgb: 255, 255, 255; +} + +@media (prefers-color-scheme: dark) { + :root { + --foreground-rgb: 255, 255, 255; + --background-start-rgb: 0, 0, 0; + --background-end-rgb: 0, 0, 0; + } +} + +body { + color: rgb(var(--foreground-rgb)); + background: linear-gradient( + to bottom, + transparent, + rgb(var(--background-end-rgb)) + ) + rgb(var(--background-start-rgb)); +} diff --git a/standalone/app/layout.js b/standalone/app/layout.js new file mode 100644 index 00000000..2b3348da --- /dev/null +++ b/standalone/app/layout.js @@ -0,0 +1,19 @@ +import { Inter } from 'next/font/google' +import './globals.css' + +const inter = Inter({ subsets: ['latin'] }) + +export const metadata = { + title: 'Proxbox App', + description: 'The Proxbox Standalone Version!', +} + +export default function RootLayout({ children }) { + return ( + + + {children} + + + ) +} diff --git a/standalone/app/loading.js b/standalone/app/loading.js new file mode 100644 index 00000000..cde234be --- /dev/null +++ b/standalone/app/loading.js @@ -0,0 +1,7 @@ +function LoadingSkeleton () { +
Loading Skeleton!
+} + +export default function Loading() { + return "Loading..." +} \ No newline at end of file diff --git a/standalone/app/page.tsx b/standalone/app/page.tsx new file mode 100644 index 00000000..3094dd65 --- /dev/null +++ b/standalone/app/page.tsx @@ -0,0 +1,12 @@ +import Image from 'next/image' +import Link from 'next/link' + +export default function Home() { + return ( + <> +
Welcome to Proxmox Standalone Version!
+ Clusters + + ) + +} diff --git a/standalone/app/page_default_next.js b/standalone/app/page_default_next.js new file mode 100644 index 00000000..801ec13a --- /dev/null +++ b/standalone/app/page_default_next.js @@ -0,0 +1,113 @@ +import Image from 'next/image' + +export default function Home() { + return ( +
+
+

+ Get started by editing  + app/page.js +

+ +
+ +
+ Next.js Logo +
+ + +
+ ) +} diff --git a/standalone/app/proxmox/sessions/page.tsx b/standalone/app/proxmox/sessions/page.tsx new file mode 100644 index 00000000..0c47e174 --- /dev/null +++ b/standalone/app/proxmox/sessions/page.tsx @@ -0,0 +1,48 @@ + + +async function getData() { + const res = await fetch('http://localhost:8800/proxmox/sessions', { + 'headers': { + 'Content-Type': 'application/json', + } + }) + + if (!res.ok) { + // This will activate the closest `error.js` Error Boundary + throw new Error('Failed to fetch data') + } + + return res.json() +} + + +async function Session({ sessions }) { + + return ( + <> + { + sessions.map(( session ) => ( +
    +
  • {session.domain}
  • +
  • {session.http_user}
  • +
  • {session.user}
  • +
  • {session.name}
  • +
  • {session.mode}
  • +
+ )) + } + + ) + + +} +export default async function Page() { + const data = await getData() + + return ( +
+

Proxmox Sessions

+ +
+ ) +} \ No newline at end of file diff --git a/standalone/jsconfig.json b/standalone/jsconfig.json new file mode 100644 index 00000000..2a2e4b3b --- /dev/null +++ b/standalone/jsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "paths": { + "@/*": ["./*"] + } + } +} diff --git a/standalone/next.config.js b/standalone/next.config.js new file mode 100644 index 00000000..767719fc --- /dev/null +++ b/standalone/next.config.js @@ -0,0 +1,4 @@ +/** @type {import('next').NextConfig} */ +const nextConfig = {} + +module.exports = nextConfig diff --git a/standalone/package-lock.json b/standalone/package-lock.json new file mode 100644 index 00000000..2919857b --- /dev/null +++ b/standalone/package-lock.json @@ -0,0 +1,4331 @@ +{ + "name": "standalone", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "standalone", + "version": "0.1.0", + "dependencies": { + "next": "14.0.1", + "react": "^18", + "react-dom": "^18" + }, + "devDependencies": { + "@types/node": "20.9.0", + "@types/react": "18.2.37", + "autoprefixer": "^10.0.1", + "eslint": "^8", + "eslint-config-next": "14.0.1", + "postcss": "^8", + "tailwindcss": "^3.3.0" + } + }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@alloc/quick-lru": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", + "integrity": "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@babel/runtime": { + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.2.tgz", + "integrity": "sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg==", + "dev": true, + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.3.tgz", + "integrity": "sha512-yZzuIG+jnVu6hNSzFEN07e8BxF3uAzYtQb6uDkaYZLo6oYZDCq454c5kB8zxnzfCYyP4MIuyBn10L0DqwujTmA==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/js": { + "version": "8.53.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.53.0.tgz", + "integrity": "sha512-Kn7K8dx/5U6+cT1yEhpX1w4PCSg0M+XyRILPgvwcEBjerFWCwQj5sbr3/VmxqV0JGHCBCzyd6LxypEuehypY1w==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.13", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", + "integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.1", + "debug": "^4.1.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz", + "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==", + "dev": true + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.20", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz", + "integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@next/env": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/@next/env/-/env-14.0.1.tgz", + "integrity": "sha512-Ms8ZswqY65/YfcjrlcIwMPD7Rg/dVjdLapMcSHG26W6O67EJDF435ShW4H4LXi1xKO1oRc97tLXUpx8jpLe86A==" + }, + "node_modules/@next/eslint-plugin-next": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-14.0.1.tgz", + "integrity": "sha512-bLjJMwXdzvhnQOnxvHoTTUh/+PYk6FF/DCgHi4BXwXCINer+o1ZYfL9aVeezj/oI7wqGJOqwGIXrlBvPbAId3w==", + "dev": true, + "dependencies": { + "glob": "7.1.7" + } + }, + "node_modules/@next/swc-darwin-arm64": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.0.1.tgz", + "integrity": "sha512-JyxnGCS4qT67hdOKQ0CkgFTp+PXub5W1wsGvIq98TNbF3YEIN7iDekYhYsZzc8Ov0pWEsghQt+tANdidITCLaw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-darwin-x64": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.0.1.tgz", + "integrity": "sha512-625Z7bb5AyIzswF9hvfZWa+HTwFZw+Jn3lOBNZB87lUS0iuCYDHqk3ujuHCkiyPtSC0xFBtYDLcrZ11mF/ap3w==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-gnu": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.0.1.tgz", + "integrity": "sha512-iVpn3KG3DprFXzVHM09kvb//4CNNXBQ9NB/pTm8LO+vnnnaObnzFdS5KM+w1okwa32xH0g8EvZIhoB3fI3mS1g==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-musl": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.0.1.tgz", + "integrity": "sha512-mVsGyMxTLWZXyD5sen6kGOTYVOO67lZjLApIj/JsTEEohDDt1im2nkspzfV5MvhfS7diDw6Rp/xvAQaWZTv1Ww==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-gnu": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.0.1.tgz", + "integrity": "sha512-wMqf90uDWN001NqCM/auRl3+qVVeKfjJdT9XW+RMIOf+rhUzadmYJu++tp2y+hUbb6GTRhT+VjQzcgg/QTD9NQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-musl": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.0.1.tgz", + "integrity": "sha512-ol1X1e24w4j4QwdeNjfX0f+Nza25n+ymY0T2frTyalVczUmzkVD7QGgPTZMHfR1aLrO69hBs0G3QBYaj22J5GQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-arm64-msvc": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.0.1.tgz", + "integrity": "sha512-WEmTEeWs6yRUEnUlahTgvZteh5RJc4sEjCQIodJlZZ5/VJwVP8p2L7l6VhzQhT4h7KvLx/Ed4UViBdne6zpIsw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-ia32-msvc": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.0.1.tgz", + "integrity": "sha512-oFpHphN4ygAgZUKjzga7SoH2VGbEJXZa/KL8bHCAwCjDWle6R1SpiGOdUdA8EJ9YsG1TYWpzY6FTbUA+iAJeww==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-x64-msvc": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.0.1.tgz", + "integrity": "sha512-FFp3nOJ/5qSpeWT0BZQ+YE1pSMk4IMpkME/1DwKBwhg4mJLB9L+6EXuJi4JEwaJdl5iN+UUlmUD3IsR1kx5fAg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@rushstack/eslint-patch": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.5.1.tgz", + "integrity": "sha512-6i/8UoL0P5y4leBIGzvkZdS85RDMG9y1ihZzmTZQ5LdHUYmZ7pKFoj8X0236s3lusPs1Fa5HTQUpwI+UfTcmeA==", + "dev": true + }, + "node_modules/@swc/helpers": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.2.tgz", + "integrity": "sha512-E4KcWTpoLHqwPHLxidpOqQbcrZVgi0rsmmZXUle1jXmJfuIf/UWpczUJ7MZZ5tlxytgJXyp0w4PGkkeLiuIdZw==", + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.9.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.0.tgz", + "integrity": "sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/prop-types": { + "version": "15.7.10", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.10.tgz", + "integrity": "sha512-mxSnDQxPqsZxmeShFH+uwQ4kO4gcJcGahjjMFeLbKE95IAZiiZyiEepGZjtXJ7hN/yfu0bu9xN2ajcU0JcxX6A==", + "dev": true + }, + "node_modules/@types/react": { + "version": "18.2.37", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.37.tgz", + "integrity": "sha512-RGAYMi2bhRgEXT3f4B92WTohopH6bIXw05FuGlmJEnv/omEn190+QYEIYxIAuIBdKgboYYdVved2p1AxZVQnaw==", + "dev": true, + "dependencies": { + "@types/prop-types": "*", + "@types/scheduler": "*", + "csstype": "^3.0.2" + } + }, + "node_modules/@types/scheduler": { + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.6.tgz", + "integrity": "sha512-Vlktnchmkylvc9SnwwwozTv04L/e1NykF5vgoQ0XTmI8DD+wxfjQuHuvHS3p0r2jz2x2ghPs2h1FVeDirIteWA==", + "dev": true + }, + "node_modules/@typescript-eslint/parser": { + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.10.0.tgz", + "integrity": "sha512-+sZwIj+s+io9ozSxIWbNB5873OSdfeBEH/FR0re14WLI6BaKuSOnnwCJ2foUiu8uXf4dRp1UqHP0vrZ1zXGrog==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "6.10.0", + "@typescript-eslint/types": "6.10.0", + "@typescript-eslint/typescript-estree": "6.10.0", + "@typescript-eslint/visitor-keys": "6.10.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.10.0.tgz", + "integrity": "sha512-TN/plV7dzqqC2iPNf1KrxozDgZs53Gfgg5ZHyw8erd6jd5Ta/JIEcdCheXFt9b1NYb93a1wmIIVW/2gLkombDg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.10.0", + "@typescript-eslint/visitor-keys": "6.10.0" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.10.0.tgz", + "integrity": "sha512-36Fq1PWh9dusgo3vH7qmQAj5/AZqARky1Wi6WpINxB6SkQdY5vQoT2/7rW7uBIsPDcvvGCLi4r10p0OJ7ITAeg==", + "dev": true, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.10.0.tgz", + "integrity": "sha512-ek0Eyuy6P15LJVeghbWhSrBCj/vJpPXXR+EpaRZqou7achUWL8IdYnMSC5WHAeTWswYQuP2hAZgij/bC9fanBg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.10.0", + "@typescript-eslint/visitor-keys": "6.10.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.10.0.tgz", + "integrity": "sha512-xMGluxQIEtOM7bqFCo+rCMh5fqI+ZxV5RUUOa29iVPz1OgCZrtc7rFnz5cLUazlkPKYqX+75iuDq7m0HQ48nCg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.10.0", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, + "node_modules/acorn": { + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz", + "integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "dev": true + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/arg": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", + "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", + "dev": true + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/aria-query": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", + "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", + "dev": true, + "dependencies": { + "dequal": "^2.0.3" + } + }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", + "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "is-array-buffer": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-includes": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.7.tgz", + "integrity": "sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/array.prototype.findlastindex": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.3.tgz", + "integrity": "sha512-LzLoiOMAxvy+Gd3BAq3B7VeIgPdo+Q8hthvKtXybMvRV0jrXfJM/t8mw7nNlpEcVlVUnCnM2KSX4XU5HmpodOA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0", + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", + "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flatmap": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz", + "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.tosorted": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.2.tgz", + "integrity": "sha512-HuQCHOlk1Weat5jzStICBCd83NxiIMwqDg/dHEsoefabn/hJRj5pVdWcPUSpRrwhwxZOsQassMpgN/xRYFBMIg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0", + "get-intrinsic": "^1.2.1" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz", + "integrity": "sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", + "is-array-buffer": "^3.0.2", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/ast-types-flow": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.8.tgz", + "integrity": "sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==", + "dev": true + }, + "node_modules/asynciterator.prototype": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/asynciterator.prototype/-/asynciterator.prototype-1.0.0.tgz", + "integrity": "sha512-wwHYEIS0Q80f5mosx3L/dfG5t5rjEa9Ft51GTaNt862EnpyGHpgz2RkZvLPp1oF5TnAiTohkEKVEu8pQPJI7Vg==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.3" + } + }, + "node_modules/autoprefixer": { + "version": "10.4.16", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.16.tgz", + "integrity": "sha512-7vd3UC6xKp0HLfua5IjZlcXvGAGy7cBAXTg2lyQ/8WpNhd6SiZ8Be+xm3FyBSYJx5GKcpRCzBh7RH4/0dnY+uQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/autoprefixer" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "browserslist": "^4.21.10", + "caniuse-lite": "^1.0.30001538", + "fraction.js": "^4.3.6", + "normalize-range": "^0.1.2", + "picocolors": "^1.0.0", + "postcss-value-parser": "^4.2.0" + }, + "bin": { + "autoprefixer": "bin/autoprefixer" + }, + "engines": { + "node": "^10 || ^12 || >=14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/available-typed-arrays": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/axe-core": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.7.0.tgz", + "integrity": "sha512-M0JtH+hlOL5pLQwHOLNYZaXuhqmvS8oExsqB1SBYgA4Dk7u/xx+YdGHXaK5pyUfed5mYXdlYiphWq3G8cRi5JQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/axobject-query": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz", + "integrity": "sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==", + "dev": true, + "dependencies": { + "dequal": "^2.0.3" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.22.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.1.tgz", + "integrity": "sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "caniuse-lite": "^1.0.30001541", + "electron-to-chromium": "^1.4.535", + "node-releases": "^2.0.13", + "update-browserslist-db": "^1.0.13" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, + "node_modules/call-bind": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", + "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.1", + "set-function-length": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase-css": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz", + "integrity": "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001561", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001561.tgz", + "integrity": "sha512-NTt0DNoKe958Q0BE0j0c1V9jbUzhBxHIEJy7asmGrpE0yG63KTV7PLHPnK2E1O9RsQrQ081I3NLuXGS6zht3cw==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ] + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chokidar/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/client-only": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", + "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==" + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true, + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/csstype": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", + "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==", + "dev": true + }, + "node_modules/damerau-levenshtein": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz", + "integrity": "sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==", + "dev": true + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/define-data-property": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", + "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/didyoumean": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", + "integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==", + "dev": true + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/dlv": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", + "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==", + "dev": true + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.4.577", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.577.tgz", + "integrity": "sha512-/5xHPH6f00SxhHw6052r+5S1xO7gHNc89hV7tqlvnStvKbSrDqc/u6AlwPvVWWNj+s4/KL6T6y8ih+nOY0qYNA==", + "dev": true + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/enhanced-resolve": { + "version": "5.15.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz", + "integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/es-abstract": { + "version": "1.22.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.3.tgz", + "integrity": "sha512-eiiY8HQeYfYH2Con2berK+To6GrK2RxbPawDkGq4UiCQQfZHb6wX9qQqkbpPqaxQFcl8d9QzZqo0tGE0VcrdwA==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "arraybuffer.prototype.slice": "^1.0.2", + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.5", + "es-set-tostringtag": "^2.0.1", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.2", + "get-symbol-description": "^1.0.0", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0", + "internal-slot": "^1.0.5", + "is-array-buffer": "^3.0.2", + "is-callable": "^1.2.7", + "is-negative-zero": "^2.0.2", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.12", + "is-weakref": "^1.0.2", + "object-inspect": "^1.13.1", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.5.1", + "safe-array-concat": "^1.0.1", + "safe-regex-test": "^1.0.0", + "string.prototype.trim": "^1.2.8", + "string.prototype.trimend": "^1.0.7", + "string.prototype.trimstart": "^1.0.7", + "typed-array-buffer": "^1.0.0", + "typed-array-byte-length": "^1.0.0", + "typed-array-byte-offset": "^1.0.0", + "typed-array-length": "^1.0.4", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-iterator-helpers": { + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.0.15.tgz", + "integrity": "sha512-GhoY8uYqd6iwUl2kgjTm4CZAf6oo5mHK7BPqx3rKgx893YSsy0LGHV6gfqqQvZt/8xM8xeOnfXBCfqclMKkJ5g==", + "dev": true, + "dependencies": { + "asynciterator.prototype": "^1.0.0", + "call-bind": "^1.0.2", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.1", + "es-set-tostringtag": "^2.0.1", + "function-bind": "^1.1.1", + "get-intrinsic": "^1.2.1", + "globalthis": "^1.0.3", + "has-property-descriptors": "^1.0.0", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.5", + "iterator.prototype": "^1.1.2", + "safe-array-concat": "^1.0.1" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.2.tgz", + "integrity": "sha512-BuDyupZt65P9D2D2vA/zqcI3G5xRsklm5N3xCwuiy+/vKy8i0ifdsQP1sLgO4tZDSCaQUSnmC48khknGMV3D2Q==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.2", + "has-tostringtag": "^1.0.0", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", + "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", + "dev": true, + "dependencies": { + "hasown": "^2.0.0" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "8.53.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.53.0.tgz", + "integrity": "sha512-N4VuiPjXDUa4xVeV/GC/RV3hQW9Nw+Y463lkWaKKXKYMvmRiRDAtfpuPFLN+E1/6ZhyR8J2ig+eVREnYgUsiag==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.3", + "@eslint/js": "8.53.0", + "@humanwhocodes/config-array": "^0.11.13", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-config-next": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-14.0.1.tgz", + "integrity": "sha512-QfIFK2WD39H4WOespjgf6PLv9Bpsd7KGGelCtmq4l67nGvnlsGpuvj0hIT+aIy6p5gKH+lAChYILsyDlxP52yg==", + "dev": true, + "dependencies": { + "@next/eslint-plugin-next": "14.0.1", + "@rushstack/eslint-patch": "^1.3.3", + "@typescript-eslint/parser": "^5.4.2 || ^6.0.0", + "eslint-import-resolver-node": "^0.3.6", + "eslint-import-resolver-typescript": "^3.5.2", + "eslint-plugin-import": "^2.28.1", + "eslint-plugin-jsx-a11y": "^6.7.1", + "eslint-plugin-react": "^7.33.2", + "eslint-plugin-react-hooks": "^4.5.0 || 5.0.0-canary-7118f5dd7-20230705" + }, + "peerDependencies": { + "eslint": "^7.23.0 || ^8.0.0", + "typescript": ">=3.3.1" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/eslint-import-resolver-node": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", + "dev": true, + "dependencies": { + "debug": "^3.2.7", + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-import-resolver-typescript": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.6.1.tgz", + "integrity": "sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==", + "dev": true, + "dependencies": { + "debug": "^4.3.4", + "enhanced-resolve": "^5.12.0", + "eslint-module-utils": "^2.7.4", + "fast-glob": "^3.3.1", + "get-tsconfig": "^4.5.0", + "is-core-module": "^2.11.0", + "is-glob": "^4.0.3" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts/projects/eslint-import-resolver-ts" + }, + "peerDependencies": { + "eslint": "*", + "eslint-plugin-import": "*" + } + }, + "node_modules/eslint-module-utils": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", + "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", + "dev": true, + "dependencies": { + "debug": "^3.2.7" + }, + "engines": { + "node": ">=4" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import": { + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.0.tgz", + "integrity": "sha512-QPOO5NO6Odv5lpoTkddtutccQjysJuFxoPS7fAHO+9m9udNHvTCPSAMW9zGAYj8lAIdr40I8yPCdUYrncXtrwg==", + "dev": true, + "dependencies": { + "array-includes": "^3.1.7", + "array.prototype.findlastindex": "^1.2.3", + "array.prototype.flat": "^1.3.2", + "array.prototype.flatmap": "^1.3.2", + "debug": "^3.2.7", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.8.0", + "hasown": "^2.0.0", + "is-core-module": "^2.13.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.fromentries": "^2.0.7", + "object.groupby": "^1.0.1", + "object.values": "^1.1.7", + "semver": "^6.3.1", + "tsconfig-paths": "^3.14.2" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" + } + }, + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-import/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/eslint-plugin-jsx-a11y": { + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.8.0.tgz", + "integrity": "sha512-Hdh937BS3KdwwbBaKd5+PLCOmYY6U4f2h9Z2ktwtNKvIdIEu137rjYbcb9ApSbVJfWxANNuiKTD/9tOKjK9qOA==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.23.2", + "aria-query": "^5.3.0", + "array-includes": "^3.1.7", + "array.prototype.flatmap": "^1.3.2", + "ast-types-flow": "^0.0.8", + "axe-core": "=4.7.0", + "axobject-query": "^3.2.1", + "damerau-levenshtein": "^1.0.8", + "emoji-regex": "^9.2.2", + "es-iterator-helpers": "^1.0.15", + "hasown": "^2.0.0", + "jsx-ast-utils": "^3.3.5", + "language-tags": "^1.0.9", + "minimatch": "^3.1.2", + "object.entries": "^1.1.7", + "object.fromentries": "^2.0.7" + }, + "engines": { + "node": ">=4.0" + }, + "peerDependencies": { + "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8" + } + }, + "node_modules/eslint-plugin-react": { + "version": "7.33.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.33.2.tgz", + "integrity": "sha512-73QQMKALArI8/7xGLNI/3LylrEYrlKZSb5C9+q3OtOewTnMQi5cT+aE9E41sLCmli3I9PGGmD1yiZydyo4FEPw==", + "dev": true, + "dependencies": { + "array-includes": "^3.1.6", + "array.prototype.flatmap": "^1.3.1", + "array.prototype.tosorted": "^1.1.1", + "doctrine": "^2.1.0", + "es-iterator-helpers": "^1.0.12", + "estraverse": "^5.3.0", + "jsx-ast-utils": "^2.4.1 || ^3.0.0", + "minimatch": "^3.1.2", + "object.entries": "^1.1.6", + "object.fromentries": "^2.0.6", + "object.hasown": "^1.1.2", + "object.values": "^1.1.6", + "prop-types": "^15.8.1", + "resolve": "^2.0.0-next.4", + "semver": "^6.3.1", + "string.prototype.matchall": "^4.0.8" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8" + } + }, + "node_modules/eslint-plugin-react-hooks": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz", + "integrity": "sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==", + "dev": true, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0" + } + }, + "node_modules/eslint-plugin-react/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-react/node_modules/resolve": { + "version": "2.0.0-next.5", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz", + "integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/eslint-plugin-react/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.1.tgz", + "integrity": "sha512-/qM2b3LUIaIgviBQovTLvijfyOQXPtSRnRK26ksj2J7rzPIecePUIpJsZ4T02Qg+xiAEKIs5K8dsHEd+VaKa/Q==", + "dev": true, + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.2.9", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz", + "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==", + "dev": true + }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.3" + } + }, + "node_modules/fraction.js": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz", + "integrity": "sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==", + "dev": true, + "engines": { + "node": "*" + }, + "funding": { + "type": "patreon", + "url": "https://github.com/sponsors/rawify" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", + "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-symbol-description": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-tsconfig": { + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.2.tgz", + "integrity": "sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, + "node_modules/glob": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==" + }, + "node_modules/globals": { + "version": "13.23.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", + "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dev": true, + "dependencies": { + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz", + "integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", + "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ignore": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/internal-slot": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.6.tgz", + "integrity": "sha512-Xj6dv+PsbtwyPpEflsejS+oIZxmMlV44zAhG479uYu89MsjcYOhCFnNyKrkJrihbsiasQyY0afoCl/9BLR65bg==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.2", + "hasown": "^2.0.0", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", + "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.0", + "is-typed-array": "^1.1.10" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-async-function": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.0.0.tgz", + "integrity": "sha512-Y1JXKrfykRJGdlDwdKlLpLyMIiWqWvuSd17TvZk68PLAOGOoF4Xyav1z0Xhoi+gCYjZVeC5SI+hYFOfvXmGRCA==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "dev": true, + "dependencies": { + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-finalizationregistry": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.0.2.tgz", + "integrity": "sha512-0by5vtUJs8iFQb5TYUHHPudOR+qXYIMKtiUzvLIZITZUjknFmziyBJuLhVRc+Ds0dREFlskDNJKYIdIzu/9pfw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-generator-function": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", + "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", + "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", + "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-set": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", + "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", + "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", + "dev": true, + "dependencies": { + "which-typed-array": "^1.1.11" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakmap": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", + "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakset": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz", + "integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/iterator.prototype": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/iterator.prototype/-/iterator.prototype-1.1.2.tgz", + "integrity": "sha512-DR33HMMr8EzwuRL8Y9D3u2BMj8+RqSE850jfGu59kS7tbmPLzGkZmVSfyCFSDxuZiEY6Rzt3T2NA/qU+NwVj1w==", + "dev": true, + "dependencies": { + "define-properties": "^1.2.1", + "get-intrinsic": "^1.2.1", + "has-symbols": "^1.0.3", + "reflect.getprototypeof": "^1.0.4", + "set-function-name": "^2.0.1" + } + }, + "node_modules/jiti": { + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.0.tgz", + "integrity": "sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==", + "dev": true, + "bin": { + "jiti": "bin/jiti.js" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/jsx-ast-utils": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", + "integrity": "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==", + "dev": true, + "dependencies": { + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "object.assign": "^4.1.4", + "object.values": "^1.1.6" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/language-subtag-registry": { + "version": "0.3.22", + "resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.22.tgz", + "integrity": "sha512-tN0MCzyWnoz/4nHS6uxdlFWoUZT7ABptwKPQ52Ea7URk6vll88bWBVhodtnlfEuCcKWNGoc+uGbw1cwa9IKh/w==", + "dev": true + }, + "node_modules/language-tags": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/language-tags/-/language-tags-1.0.9.tgz", + "integrity": "sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA==", + "dev": true, + "dependencies": { + "language-subtag-registry": "^0.3.20" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lilconfig": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", + "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dev": true, + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "node_modules/nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "node_modules/next": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/next/-/next-14.0.1.tgz", + "integrity": "sha512-s4YaLpE4b0gmb3ggtmpmV+wt+lPRuGtANzojMQ2+gmBpgX9w5fTbjsy6dXByBuENsdCX5pukZH/GxdFgO62+pA==", + "dependencies": { + "@next/env": "14.0.1", + "@swc/helpers": "0.5.2", + "busboy": "1.6.0", + "caniuse-lite": "^1.0.30001406", + "postcss": "8.4.31", + "styled-jsx": "5.1.1", + "watchpack": "2.4.0" + }, + "bin": { + "next": "dist/bin/next" + }, + "engines": { + "node": ">=18.17.0" + }, + "optionalDependencies": { + "@next/swc-darwin-arm64": "14.0.1", + "@next/swc-darwin-x64": "14.0.1", + "@next/swc-linux-arm64-gnu": "14.0.1", + "@next/swc-linux-arm64-musl": "14.0.1", + "@next/swc-linux-x64-gnu": "14.0.1", + "@next/swc-linux-x64-musl": "14.0.1", + "@next/swc-win32-arm64-msvc": "14.0.1", + "@next/swc-win32-ia32-msvc": "14.0.1", + "@next/swc-win32-x64-msvc": "14.0.1" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.1.0", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "sass": "^1.3.0" + }, + "peerDependenciesMeta": { + "@opentelemetry/api": { + "optional": true + }, + "sass": { + "optional": true + } + } + }, + "node_modules/node-releases": { + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", + "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", + "dev": true + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/normalize-range": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", + "integrity": "sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-hash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", + "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/object-inspect": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", + "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.entries": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.7.tgz", + "integrity": "sha512-jCBs/0plmPsOnrKAfFQXRG2NFjlhZgjjcBLSmTnEhU8U6vVTsVe8ANeQJCHTl3gSsI4J+0emOoCgoKlmQPMgmA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.fromentries": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.7.tgz", + "integrity": "sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.groupby": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.1.tgz", + "integrity": "sha512-HqaQtqLnp/8Bn4GL16cj+CUYbnpe1bh0TtEaWvybszDG4tgxCJuRpV8VGuvNaI1fAnI4lUJzDG55MXcOH4JZcQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1" + } + }, + "node_modules/object.hasown": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.3.tgz", + "integrity": "sha512-fFI4VcYpRHvSLXxP7yiZOMAd331cPfd2p7PFDVbgUsYOfCT3tICVqXWngbjr4m49OvsBwUBQ6O2uQoJvy3RexA==", + "dev": true, + "dependencies": { + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.values": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.7.tgz", + "integrity": "sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optionator": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "dev": true, + "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pirates": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/postcss": { + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-import": { + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-15.1.0.tgz", + "integrity": "sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==", + "dev": true, + "dependencies": { + "postcss-value-parser": "^4.0.0", + "read-cache": "^1.0.0", + "resolve": "^1.1.7" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "postcss": "^8.0.0" + } + }, + "node_modules/postcss-js": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-js/-/postcss-js-4.0.1.tgz", + "integrity": "sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==", + "dev": true, + "dependencies": { + "camelcase-css": "^2.0.1" + }, + "engines": { + "node": "^12 || ^14 || >= 16" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": "^8.4.21" + } + }, + "node_modules/postcss-load-config": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-4.0.1.tgz", + "integrity": "sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==", + "dev": true, + "dependencies": { + "lilconfig": "^2.0.5", + "yaml": "^2.1.1" + }, + "engines": { + "node": ">= 14" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": ">=8.0.9", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "postcss": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "node_modules/postcss-nested": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.0.1.tgz", + "integrity": "sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==", + "dev": true, + "dependencies": { + "postcss-selector-parser": "^6.0.11" + }, + "engines": { + "node": ">=12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": "^8.2.14" + } + }, + "node_modules/postcss-selector-parser": { + "version": "6.0.13", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.13.tgz", + "integrity": "sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ==", + "dev": true, + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", + "dev": true + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "dev": true, + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/react": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", + "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", + "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.0" + }, + "peerDependencies": { + "react": "^18.2.0" + } + }, + "node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "dev": true + }, + "node_modules/read-cache": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", + "integrity": "sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==", + "dev": true, + "dependencies": { + "pify": "^2.3.0" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/reflect.getprototypeof": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.4.tgz", + "integrity": "sha512-ECkTw8TmJwW60lOTR+ZkODISW6RQ8+2CL3COqtiJKLd6MmB45hN51HprHFziKLGkAuTGQhBb91V8cy+KHlaCjw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", + "globalthis": "^1.0.3", + "which-builtin-type": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==", + "dev": true + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz", + "integrity": "sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "set-function-name": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-array-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.1.tgz", + "integrity": "sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-regex-test": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", + "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "is-regex": "^1.1.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/scheduler": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", + "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, + "node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/set-function-length": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz", + "integrity": "sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.1", + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz", + "integrity": "sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==", + "dev": true, + "dependencies": { + "define-data-property": "^1.0.1", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/string.prototype.matchall": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.10.tgz", + "integrity": "sha512-rGXbGmOEosIQi6Qva94HUjgPs9vKW+dkG7Y8Q5O2OYkWL6wFaTRZO8zM4mhP94uX55wgyrXzfS2aGtGzUL7EJQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.5", + "regexp.prototype.flags": "^1.5.0", + "set-function-name": "^2.0.0", + "side-channel": "^1.0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz", + "integrity": "sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz", + "integrity": "sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", + "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/styled-jsx": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.1.tgz", + "integrity": "sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==", + "dependencies": { + "client-only": "0.0.1" + }, + "engines": { + "node": ">= 12.0.0" + }, + "peerDependencies": { + "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/sucrase": { + "version": "3.34.0", + "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.34.0.tgz", + "integrity": "sha512-70/LQEZ07TEcxiU2dz51FKaE6hCTWC6vr7FOk3Gr0U60C3shtAN+H+BFr9XlYe5xqf3RA8nrc+VIwzCfnxuXJw==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.2", + "commander": "^4.0.0", + "glob": "7.1.6", + "lines-and-columns": "^1.1.6", + "mz": "^2.7.0", + "pirates": "^4.0.1", + "ts-interface-checker": "^0.1.9" + }, + "bin": { + "sucrase": "bin/sucrase", + "sucrase-node": "bin/sucrase-node" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/sucrase/node_modules/glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/tailwindcss": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.3.5.tgz", + "integrity": "sha512-5SEZU4J7pxZgSkv7FP1zY8i2TIAOooNZ1e/OGtxIEv6GltpoiXUqWvLy89+a10qYTB1N5Ifkuw9lqQkN9sscvA==", + "dev": true, + "dependencies": { + "@alloc/quick-lru": "^5.2.0", + "arg": "^5.0.2", + "chokidar": "^3.5.3", + "didyoumean": "^1.2.2", + "dlv": "^1.1.3", + "fast-glob": "^3.3.0", + "glob-parent": "^6.0.2", + "is-glob": "^4.0.3", + "jiti": "^1.19.1", + "lilconfig": "^2.1.0", + "micromatch": "^4.0.5", + "normalize-path": "^3.0.0", + "object-hash": "^3.0.0", + "picocolors": "^1.0.0", + "postcss": "^8.4.23", + "postcss-import": "^15.1.0", + "postcss-js": "^4.0.1", + "postcss-load-config": "^4.0.1", + "postcss-nested": "^6.0.1", + "postcss-selector-parser": "^6.0.11", + "resolve": "^1.22.2", + "sucrase": "^3.32.0" + }, + "bin": { + "tailwind": "lib/cli.js", + "tailwindcss": "lib/cli.js" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tapable": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dev": true, + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "dev": true, + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/ts-api-utils": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz", + "integrity": "sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==", + "dev": true, + "engines": { + "node": ">=16.13.0" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, + "node_modules/ts-interface-checker": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", + "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", + "dev": true + }, + "node_modules/tsconfig-paths": { + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz", + "integrity": "sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==", + "dev": true, + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typed-array-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz", + "integrity": "sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz", + "integrity": "sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz", + "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", + "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "is-typed-array": "^1.1.9" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typescript": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", + "dev": true, + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/update-browserslist-db": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", + "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true + }, + "node_modules/watchpack": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", + "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", + "dependencies": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-builtin-type": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.1.3.tgz", + "integrity": "sha512-YmjsSMDBYsM1CaFiayOVT06+KJeXf0o5M/CAd4o1lTadFAtacTUM49zoYxr/oroopFDfhvN6iEcBxUyc3gvKmw==", + "dev": true, + "dependencies": { + "function.prototype.name": "^1.1.5", + "has-tostringtag": "^1.0.0", + "is-async-function": "^2.0.0", + "is-date-object": "^1.0.5", + "is-finalizationregistry": "^1.0.2", + "is-generator-function": "^1.0.10", + "is-regex": "^1.1.4", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.0.2", + "which-collection": "^1.0.1", + "which-typed-array": "^1.1.9" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-collection": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", + "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", + "dev": true, + "dependencies": { + "is-map": "^2.0.1", + "is-set": "^2.0.1", + "is-weakmap": "^2.0.1", + "is-weakset": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.13.tgz", + "integrity": "sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.4", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/yaml": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", + "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", + "dev": true, + "engines": { + "node": ">= 14" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/standalone/package.json b/standalone/package.json new file mode 100644 index 00000000..d580e5ee --- /dev/null +++ b/standalone/package.json @@ -0,0 +1,25 @@ +{ + "name": "standalone", + "version": "0.1.0", + "private": true, + "scripts": { + "dev": "next dev", + "build": "next build", + "start": "next start", + "lint": "next lint" + }, + "dependencies": { + "next": "14.0.1", + "react": "^18", + "react-dom": "^18" + }, + "devDependencies": { + "@types/node": "20.9.0", + "@types/react": "18.2.37", + "autoprefixer": "^10.0.1", + "eslint": "^8", + "eslint-config-next": "14.0.1", + "postcss": "^8", + "tailwindcss": "^3.3.0" + } +} diff --git a/standalone/postcss.config.js b/standalone/postcss.config.js new file mode 100644 index 00000000..33ad091d --- /dev/null +++ b/standalone/postcss.config.js @@ -0,0 +1,6 @@ +module.exports = { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +} diff --git a/standalone/public/next.svg b/standalone/public/next.svg new file mode 100644 index 00000000..5174b28c --- /dev/null +++ b/standalone/public/next.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/standalone/public/vercel.svg b/standalone/public/vercel.svg new file mode 100644 index 00000000..d2f84222 --- /dev/null +++ b/standalone/public/vercel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/standalone/tailwind.config.js b/standalone/tailwind.config.js new file mode 100644 index 00000000..8c4d1b21 --- /dev/null +++ b/standalone/tailwind.config.js @@ -0,0 +1,18 @@ +/** @type {import('tailwindcss').Config} */ +module.exports = { + content: [ + './pages/**/*.{js,ts,jsx,tsx,mdx}', + './components/**/*.{js,ts,jsx,tsx,mdx}', + './app/**/*.{js,ts,jsx,tsx,mdx}', + ], + theme: { + extend: { + backgroundImage: { + 'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))', + 'gradient-conic': + 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))', + }, + }, + }, + plugins: [], +} diff --git a/standalone/tsconfig.json b/standalone/tsconfig.json new file mode 100644 index 00000000..14bd9ea9 --- /dev/null +++ b/standalone/tsconfig.json @@ -0,0 +1,34 @@ +{ + "compilerOptions": { + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], + "allowJs": true, + "skipLibCheck": true, + "strict": false, + "noEmit": true, + "incremental": true, + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve", + "plugins": [ + { + "name": "next" + } + ] + }, + "include": [ + "next-env.d.ts", + ".next/types/**/*.ts", + "**/*.ts", + "**/*.tsx" + ], + "exclude": [ + "node_modules" + ] +} From 9fa7a6cc95e07ab9ead3508e6568b22b86c1ddc5 Mon Sep 17 00:00:00 2001 From: emersonfelipesp Date: Thu, 9 Nov 2023 02:23:28 +0000 Subject: [PATCH 27/34] Start styling with tailwind --- standalone/app/globals.css | 6 +++++ standalone/app/layout.js | 19 ---------------- standalone/app/layout.tsx | 22 ++++++++++++++++++ standalone/app/page.tsx | 23 +++++++++++++++---- standalone/app/proxmox/sessions/page.tsx | 29 ++++++++++++++++-------- standalone/package-lock.json | 25 ++++++++++++++++++++ standalone/package.json | 2 ++ 7 files changed, 93 insertions(+), 33 deletions(-) delete mode 100644 standalone/app/layout.js create mode 100644 standalone/app/layout.tsx diff --git a/standalone/app/globals.css b/standalone/app/globals.css index fd81e885..2317ff7c 100644 --- a/standalone/app/globals.css +++ b/standalone/app/globals.css @@ -8,6 +8,8 @@ --background-end-rgb: 255, 255, 255; } +/* Dark mode */ +/* @media (prefers-color-scheme: dark) { :root { --foreground-rgb: 255, 255, 255; @@ -15,7 +17,10 @@ --background-end-rgb: 0, 0, 0; } } +*/ +/* Set the background to a linear gradient. */ +/* body { color: rgb(var(--foreground-rgb)); background: linear-gradient( @@ -25,3 +30,4 @@ body { ) rgb(var(--background-start-rgb)); } +*/ diff --git a/standalone/app/layout.js b/standalone/app/layout.js deleted file mode 100644 index 2b3348da..00000000 --- a/standalone/app/layout.js +++ /dev/null @@ -1,19 +0,0 @@ -import { Inter } from 'next/font/google' -import './globals.css' - -const inter = Inter({ subsets: ['latin'] }) - -export const metadata = { - title: 'Proxbox App', - description: 'The Proxbox Standalone Version!', -} - -export default function RootLayout({ children }) { - return ( - - - {children} - - - ) -} diff --git a/standalone/app/layout.tsx b/standalone/app/layout.tsx new file mode 100644 index 00000000..a319f344 --- /dev/null +++ b/standalone/app/layout.tsx @@ -0,0 +1,22 @@ +import Head from 'next/head' +import type { Metadata } from 'next' + +// These styles apply to every route in the application +import './globals.css' + +export const metadata: Metadata = { + title: 'Proxbox App', + description: 'The Proxbox Standalone Version!', +} + +export default function RootLayout({ + children, +}: { + children: React.ReactNode +}) { + return ( + + {children} + + ) +} \ No newline at end of file diff --git a/standalone/app/page.tsx b/standalone/app/page.tsx index 3094dd65..179f1a46 100644 --- a/standalone/app/page.tsx +++ b/standalone/app/page.tsx @@ -3,10 +3,25 @@ import Link from 'next/link' export default function Home() { return ( - <> -
Welcome to Proxmox Standalone Version!
- Clusters - +
+
+

Welcome to Proxmox Standalone Version!

+
+ +
    +
  • Clusters
  • +
  • Proxmox Sessions
  • +
+ + +
+ +

Proxmox Sessions

+
+

View all Proxmox

+
+
+ ) } diff --git a/standalone/app/proxmox/sessions/page.tsx b/standalone/app/proxmox/sessions/page.tsx index 0c47e174..b7e7a831 100644 --- a/standalone/app/proxmox/sessions/page.tsx +++ b/standalone/app/proxmox/sessions/page.tsx @@ -19,19 +19,28 @@ async function getData() { async function Session({ sessions }) { return ( - <> +
{ sessions.map(( session ) => ( -
    -
  • {session.domain}
  • -
  • {session.http_user}
  • -
  • {session.user}
  • -
  • {session.name}
  • -
  • {session.mode}
  • -
+ <> + +
+ +

{session.name}

+
+

View all Proxmox

+
+
    +
  • {session.domain}
  • +
  • {session.http_user}
  • +
  • {session.user}
  • +
  • {session.name}
  • +
  • {session.mode}
  • +
+ )) } - +
) @@ -40,7 +49,7 @@ export default async function Page() { const data = await getData() return ( -
+

Proxmox Sessions

diff --git a/standalone/package-lock.json b/standalone/package-lock.json index 2919857b..475abf0c 100644 --- a/standalone/package-lock.json +++ b/standalone/package-lock.json @@ -8,6 +8,8 @@ "name": "standalone", "version": "0.1.0", "dependencies": { + "@headlessui/react": "^1.7.17", + "@heroicons/react": "^2.0.18", "next": "14.0.1", "react": "^18", "react-dom": "^18" @@ -111,6 +113,29 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/@headlessui/react": { + "version": "1.7.17", + "resolved": "https://registry.npmjs.org/@headlessui/react/-/react-1.7.17.tgz", + "integrity": "sha512-4am+tzvkqDSSgiwrsEpGWqgGo9dz8qU5M3znCkC4PgkpY4HcCZzEDEvozltGGGHIKl9jbXbZPSH5TWn4sWJdow==", + "dependencies": { + "client-only": "^0.0.1" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "react": "^16 || ^17 || ^18", + "react-dom": "^16 || ^17 || ^18" + } + }, + "node_modules/@heroicons/react": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/@heroicons/react/-/react-2.0.18.tgz", + "integrity": "sha512-7TyMjRrZZMBPa+/5Y8lN0iyvUU/01PeMGX2+RE7cQWpEUIcb4QotzUObFkJDejj/HUH4qjP/eQ0gzzKs2f+6Yw==", + "peerDependencies": { + "react": ">= 16" + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.13", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", diff --git a/standalone/package.json b/standalone/package.json index d580e5ee..e2a182ce 100644 --- a/standalone/package.json +++ b/standalone/package.json @@ -9,6 +9,8 @@ "lint": "next lint" }, "dependencies": { + "@headlessui/react": "^1.7.17", + "@heroicons/react": "^2.0.18", "next": "14.0.1", "react": "^18", "react-dom": "^18" From 8a50cb21ac753a6413b1aaffc574d78bfcd52c22 Mon Sep 17 00:00:00 2001 From: emersonfelipesp Date: Thu, 9 Nov 2023 16:09:09 +0000 Subject: [PATCH 28/34] Create draft of homepage with tailwind grid and flex --- standalone/app/page.tsx | 43 +++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/standalone/app/page.tsx b/standalone/app/page.tsx index 179f1a46..f037d990 100644 --- a/standalone/app/page.tsx +++ b/standalone/app/page.tsx @@ -3,25 +3,34 @@ import Link from 'next/link' export default function Home() { return ( -
-
-

Welcome to Proxmox Standalone Version!

-
- -
    -
  • Clusters
  • -
  • Proxmox Sessions
  • -
- - -
- -

Proxmox Sessions

+ <> +
- +
+

Proxbox

+
+ +
Col 2
+
Col 3
+
Col 4
+
Col 5
+
Standalone
+
+
+ ) } From f727064195de3a5c320e24ee0a2bda12bb945b8b Mon Sep 17 00:00:00 2001 From: emersonfelipesp Date: Thu, 9 Nov 2023 20:42:17 +0000 Subject: [PATCH 29/34] Split cluster card into components and add navbar --- standalone/app/layout.tsx | 44 +++++++++++++++- standalone/app/page.tsx | 65 ++++++++++++++---------- standalone/app/proxmox/sessions/page.tsx | 2 - 3 files changed, 81 insertions(+), 30 deletions(-) diff --git a/standalone/app/layout.tsx b/standalone/app/layout.tsx index a319f344..b07159f9 100644 --- a/standalone/app/layout.tsx +++ b/standalone/app/layout.tsx @@ -8,7 +8,44 @@ export const metadata: Metadata = { title: 'Proxbox App', description: 'The Proxbox Standalone Version!', } - + +function LogoNavbar() { + return ( + <> + + proxbox + + + ) +} + + +function Navbar() { + return ( + + ) +} + export default function RootLayout({ children, }: { @@ -16,7 +53,10 @@ export default function RootLayout({ }) { return ( - {children} + + + {children} + ) } \ No newline at end of file diff --git a/standalone/app/page.tsx b/standalone/app/page.tsx index f037d990..5903450f 100644 --- a/standalone/app/page.tsx +++ b/standalone/app/page.tsx @@ -1,36 +1,49 @@ import Image from 'next/image' import Link from 'next/link' -export default function Home() { + +const clusters = [ + { + "domain": "10.0.30.9", + "http_port": 8006, + "user": "root@pam", + "name": "PVE-CLUSTER-02", + "mode": "cluster" + }, + { + "domain": "10.0.30.139", + "http_port": 8006, + "user": "root@pam", + "name": "pve01proxbox", + "mode": "standalone" + } +] + +function ClusterCard({ cluster }) { + return ( - <> -
-

Proxbox

-
- -
-
- Status - Domain - IP -
+
+
+
+ Status + {cluster.domain} + {cluster.http_port}
-
Linha 01
-
Cluster
+
{cluster.name}
+
{cluster.mode}
-
-

Proxbox

-
- -
Col 2
-
Col 3
-
Col 4
-
Col 5
-
Standalone
-
-
- ) +} +export default function Home() { + return ( + <> + { + clusters.map(( cluster ) => ( + + )) + } + + ) } diff --git a/standalone/app/proxmox/sessions/page.tsx b/standalone/app/proxmox/sessions/page.tsx index b7e7a831..3aad5833 100644 --- a/standalone/app/proxmox/sessions/page.tsx +++ b/standalone/app/proxmox/sessions/page.tsx @@ -1,5 +1,3 @@ - - async function getData() { const res = await fetch('http://localhost:8800/proxmox/sessions', { 'headers': { From 1074c9559dabe1ab61f2cf605d04e6d7327cc82e Mon Sep 17 00:00:00 2001 From: emersonfelipesp Date: Fri, 10 Nov 2023 13:54:37 +0000 Subject: [PATCH 30/34] Adjust RootLayout with Components --- standalone/app/layout.tsx | 67 +++++++++++++++++++++++++++------------ 1 file changed, 47 insertions(+), 20 deletions(-) diff --git a/standalone/app/layout.tsx b/standalone/app/layout.tsx index b07159f9..226c05aa 100644 --- a/standalone/app/layout.tsx +++ b/standalone/app/layout.tsx @@ -3,6 +3,7 @@ import type { Metadata } from 'next' // These styles apply to every route in the application import './globals.css' +import Page from './cluster/page' export const metadata: Metadata = { title: 'Proxbox App', @@ -12,32 +13,31 @@ export const metadata: Metadata = { function LogoNavbar() { return ( <> - - proxbox + + proxbox ) } - function Navbar() { return ( -