Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit c9c082f

Browse files
authored
Revert "refactor(ui): Replace base64 assets by image (#47)" (#48)
This reverts commit 9c018ba.
1 parent 9c018ba commit c9c082f

29 files changed

+1138
-1160
lines changed

CHANGELOG.md

-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# Changelog
22

3-
## 0.4.2 / 2024-07-05
4-
5-
* [CHANGE] Replaced base64 encoded files in web assets (HTML, CSS) with common images and added a new route for images.
6-
73
## 0.4.1 / 2024-06-30
84

95
* [ENHANCEMENT] Added a new web page for reports. This page allows exporting Prometheus data in various formats directly from the web UI. #43

src/api/v1/endpoints/web.py

+4-22
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,20 @@
44
from src.utils.log import logger
55
from fastapi import APIRouter
66
from fastapi import Request
7-
from os.path import exists
87

98
router = APIRouter()
109

1110
if arg_parser().get("web.enable_ui") == "true":
12-
rules_management = "ui/pages/rules-management"
13-
metrics_management = "ui/pages/metrics-management"
14-
reports = "ui/pages/reports"
11+
rules_management = "ui/rules-management"
12+
metrics_management = "ui/metrics-management"
13+
reports = "ui/reports"
1514
logger.info("Starting web management UI")
1615

1716
@router.get("/", response_class=HTMLResponse,
1817
description="Renders home page of this application",
1918
include_in_schema=False)
2019
async def homepage():
21-
return FileResponse("ui/pages/homepage/index.html")
22-
23-
@router.get(
24-
"/images/{path}",
25-
description="Returns common image resources for web UI",
26-
include_in_schema=False)
27-
async def images(path, request: Request):
28-
assets_images = "ui/assets/images"
29-
if exists(f"{assets_images}/{path}"):
30-
return FileResponse(f"{assets_images}/{path}")
31-
sts, msg = "404", "Not Found"
32-
logger.info(
33-
msg=msg,
34-
extra={
35-
"status": sts,
36-
"method": request.method,
37-
"request_path": request.url.path})
38-
return f"{sts} {msg}"
20+
return FileResponse("ui/homepage/index.html")
3921

4022
@router.get("/rules-management",
4123
description="Renders rules management HTML page of this application",

src/utils/openapi.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def openapi(app: FastAPI):
1616
"providing additional features and addressing its limitations. "
1717
"Running as a sidecar alongside the Prometheus server enables "
1818
"users to extend the capabilities of the API.",
19-
version="0.4.2",
19+
version="0.4.1",
2020
contact={
2121
"name": "Hayk Davtyan",
2222
"url": "https://hayk96.github.io",

ui/assets/images/icon-edit.png

-4.08 KB
Binary file not shown.

ui/assets/images/icon-home.png

-5.17 KB
Binary file not shown.
-6.22 KB
Binary file not shown.

ui/assets/images/icon-moon.png

-7.75 KB
Binary file not shown.

ui/assets/images/icon-remove.png

-5.64 KB
Binary file not shown.

ui/assets/images/icon-reports.png

-14.6 KB
Binary file not shown.
-6.55 KB
Binary file not shown.

ui/assets/images/icon-sun.png

-3.27 KB
Binary file not shown.

ui/assets/images/icon-web-code.png

-7.28 KB
Binary file not shown.

ui/assets/images/logo-github.png

-7.43 KB
Binary file not shown.

ui/assets/images/logo-prometheus.png

-2.96 KB
Binary file not shown.

ui/homepage/index.html

+194
Large diffs are not rendered by default.

ui/metrics-management/index.html

+72
Large diffs are not rendered by default.
File renamed without changes.
File renamed without changes.

ui/pages/homepage/index.html

-194
This file was deleted.

ui/pages/metrics-management/index.html

-72
This file was deleted.

0 commit comments

Comments
 (0)