Skip to content

Commit 42d4039

Browse files
committed
Adding hwdb-dash.
1 parent 79c8f6f commit 42d4039

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+4092
-284
lines changed

hwdb-dash

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
#
4+
# Let's assume that the directory containing this script is at the root level for the project.
5+
#
6+
7+
PROJECT_ROOT="$(dirname ${BASH_SOURCE[0]})"
8+
9+
#
10+
# Set all the scripts to be executable
11+
#
12+
13+
chmod +x $PROJECT_ROOT/hwdb-*
14+
chmod +x $PROJECT_ROOT/bin/*.py
15+
16+
#
17+
# Set some path variables.
18+
#
19+
20+
export PYTHONPATH=$PROJECT_ROOT/lib:$PYTHONPATH
21+
export PATH=$PROJECT_ROOT/bin:$PATH
22+
23+
#
24+
# Run the script
25+
#
26+
27+
python -m Sisyphus.Gui.Dashboard
28+

lib/.DS_Store

-6 KB
Binary file not shown.

lib/Sisyphus/.DS_Store

-6 KB
Binary file not shown.

lib/Sisyphus/Gui/Dashboard/__init__.py

Whitespace-only changes.
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
from .utils import silence_warnings
2+
3+
import threading, webbrowser
4+
from threading import Timer
5+
from dash import Dash
6+
import dash_bootstrap_components as dbc
7+
8+
9+
import os, sys, io, contextlib
10+
import logging
11+
os.environ["FLASK_RUN_FROM_CLI"] = "false"
12+
logging.getLogger("werkzeug").disabled = True
13+
14+
15+
from Sisyphus.Configuration import config
16+
logger = config.getLogger(__name__)
17+
18+
from .layout.layout_main import layout, register_layout_callbacks
19+
from .callbacks.callbacks_preferences import register_preferences_callbacks
20+
from .callbacks.callbacks_jsonselect import register_jsonselect_callbacks
21+
22+
from .callbacks import (
23+
register_conditions_callbacks,
24+
register_filter_callbacks,
25+
register_valuefilter_callbacks,
26+
register_hidecharts_callbacks,
27+
register_load_callbacks,
28+
register_plot_callbacks,
29+
register_sync_callbacks,
30+
register_updatemenu_callbacks,
31+
)
32+
33+
#------------- create the website and interface -------
34+
app = Dash(
35+
__name__,
36+
external_stylesheets=[dbc.themes.BOOTSTRAP],
37+
suppress_callback_exceptions=True
38+
)
39+
app.title = "HWDB Dashboard"
40+
# Pass IsPro into layout generator
41+
app.layout = layout
42+
register_layout_callbacks(app)
43+
44+
# Register all callback modules
45+
register_preferences_callbacks(app)
46+
register_conditions_callbacks(app)
47+
register_filter_callbacks(app)
48+
register_valuefilter_callbacks(app)
49+
register_hidecharts_callbacks(app)
50+
register_load_callbacks(app)
51+
register_plot_callbacks(app)
52+
register_sync_callbacks(app)
53+
register_updatemenu_callbacks(app)
54+
register_jsonselect_callbacks(app)
55+
56+
logger.info("Dashboard is starting up...")
57+
# Run the app
58+
host = "127.0.0.1"
59+
port = 8050
60+
def open_browser():
61+
webbrowser.open_new(f"http://{host}:{port}")
62+
63+
if __name__ == "__main__":
64+
with contextlib.redirect_stdout(io.StringIO()), contextlib.redirect_stderr(io.StringIO()):
65+
# Launch browser after short delay so server starts first
66+
threading.Timer(1.0, open_browser).start()
67+
app.run(debug=False, use_reloader=False)
68+
25.9 KB
Loading

lib/Sisyphus/Gui/Dashboard/assets/__init__.py

Whitespace-only changes.
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/* =============== */
2+
/* TAB BASE STYLES */
3+
/* =============== */
4+
5+
.custom-tab {
6+
/* Layout and shape */
7+
background: linear-gradient(180deg, #f7f9fc 0%, #e0e6ed 100%);
8+
border: 1px solid #c3c9d4;
9+
border-radius: 10px 10px 0 0;
10+
padding: 10px 25px;
11+
margin-right: 6px;
12+
13+
/* Typography */
14+
font-family: "Arial", sans-serif;
15+
font-weight: 700;
16+
font-size: 18px;
17+
color: #2c3e50;
18+
19+
/* Effects */
20+
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
21+
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.6);
22+
cursor: pointer;
23+
transition: all 0.25s ease-in-out;
24+
}
25+
26+
/* Hover effect – adds depth and interactivity */
27+
/*
28+
.custom-tab:hover {
29+
background: linear-gradient(180deg, #ffffff 0%, #dfe6f2 100%);
30+
transform: translateY(-2px);
31+
box-shadow: 0 5px 12px rgba(0, 0, 0, 0.25);
32+
}
33+
*/
34+
35+
/* ================== */
36+
/* SELECTED TAB STYLE */
37+
/* ================== */
38+
39+
.custom-tab--selected {
40+
background: linear-gradient(180deg, #80b3ff 0%, #4d94ff 100%);
41+
color: #ffffff; /* white text for clear contrast */
42+
font-weight: 800;
43+
border-bottom: 3px solid #007acc;
44+
45+
/* subtle glow & lift */
46+
box-shadow:
47+
inset 0 3px 6px rgba(0, 0, 0, 0.15),
48+
0 2px 8px rgba(0, 122, 204, 0.3);
49+
transform: translateY(-1px);
50+
text-shadow: 0 1px 3px rgba(0, 122, 204, 0.3);
51+
}
52+
53+
/* Hover on selected tab (keeps tone but slightly brightens) */
54+
/*
55+
.custom-tab--selected:hover {
56+
background: linear-gradient(180deg, #001a33 0%, #000d1a 100%);
57+
color: #cce6ff; /* faint bluish white */
58+
border-bottom: 3px solid #000a14;
59+
box-shadow:
60+
inset 0 3px 6px rgba(0, 0, 0, 0.4),
61+
0 4px 16px rgba(0, 64, 128, 0.8); /* bluish outer glow */
62+
transform: translateY(-2px);
63+
text-shadow: 0 1px 5px rgba(0, 64, 128, 0.8);
64+
}
65+
*/
66+
67+
/* ================= */
68+
/* TAB CONTAINER FIX */
69+
/* ================= */
70+
71+
.dash-tabs {
72+
background-color: transparent !important;
73+
border: none !important;
74+
}

0 commit comments

Comments
 (0)