updated look of CFG util
This commit is contained in:
@@ -2,7 +2,73 @@ import PySimpleGUI as sg
|
||||
|
||||
from .imgs import WINDOW_ICON
|
||||
|
||||
sg.set_options(font=("Liberation Mono", 10))
|
||||
WINDOW_BG = "#0F4C75"
|
||||
|
||||
PROGRESS_BG = "#FFFFFF"
|
||||
PROGRESS_FULL = "#00A8CC"
|
||||
|
||||
MAIN_TABS_BG = "#0F4C75"
|
||||
MAIN_TABS_SELECTED = MAIN_TABS_BG
|
||||
MAIN_TABS_NORMAL = "#BBE1FA"
|
||||
MAIN_TABS_TEXT_SELECTED = "#FFFFFF"
|
||||
MAIN_TABS_TEXT_NORMAL = "#000000"
|
||||
|
||||
TEXT_COLOR = "#FFFFFF"
|
||||
|
||||
BTN_TEXT_COLOR = "#000000"
|
||||
BTN_COLOR = "#3282B8"
|
||||
BTN_DISABLED_COLOR = "#BBE1FA"
|
||||
BTN_DISABLED_TEXT_COLOR = "#1B262C"
|
||||
BTN_DISABLED = BTN_DISABLED_TEXT_COLOR, BTN_DISABLED_COLOR
|
||||
BTN_BORDER = 1
|
||||
|
||||
INFO_BTN_TEXT_COLOR = "#000000"
|
||||
INFO_BTN_BG = "#FFFFFF"
|
||||
|
||||
INPUT_BG = "#BBE1FA"
|
||||
INPUT_TEXT = "#000000"
|
||||
|
||||
POOLS_TABS_BG = "#3282B8"
|
||||
POOLS_TABS_SELECTED = POOLS_TABS_BG
|
||||
POOLS_TABS_NORMAL = "#BBE1FA"
|
||||
POOLS_TABS_TEXT_SELECTED = "#FFFFFF"
|
||||
POOLS_TABS_TEXT_NORMAL = "#000000"
|
||||
|
||||
TABLE_BG = "#BBE1FA"
|
||||
TABLE_TEXT = "#000000"
|
||||
TABLE_HEADERS_COLOR = "#3282B8"
|
||||
TABLE_HEADERS_TEXT_COLOR = "#000000"
|
||||
TABLE_HEADERS_HOVER = "#27496D"
|
||||
TABLE_BORDER = 1
|
||||
TABLE_HEADER_BORDER = 3
|
||||
|
||||
POOLS_TABLE_BG = TABLE_BG
|
||||
POOLS_TABLE_TEXT = TABLE_TEXT
|
||||
POOLS_TABLE_HEADERS_COLOR = TABLE_HEADERS_COLOR
|
||||
POOLS_TABLE_HEADERS_TEXT_COLOR = TABLE_HEADERS_TEXT_COLOR
|
||||
POOLS_TABLE_HEADERS_HOVER = TABLE_HEADERS_HOVER
|
||||
POOLS_TABLE_BORDER = 1
|
||||
POOLS_TABLE_HEADER_BORDER = 3
|
||||
|
||||
sg.set_options(font=("Noto Mono", 10))
|
||||
# Add your new theme colors and settings
|
||||
|
||||
|
||||
sg.LOOK_AND_FEEL_TABLE["cfg_util_theme"] = {
|
||||
"BACKGROUND": WINDOW_BG,
|
||||
"TEXT": TEXT_COLOR,
|
||||
"INPUT": INPUT_BG,
|
||||
"TEXT_INPUT": INPUT_TEXT,
|
||||
"SCROLL": "#142850",
|
||||
"BUTTON": (BTN_TEXT_COLOR, BTN_COLOR), # Text Color, Background
|
||||
"PROGRESS": (PROGRESS_FULL, PROGRESS_BG), # Filled, Empty
|
||||
"BORDER": 1,
|
||||
"SLIDER_DEPTH": 0,
|
||||
"PROGRESS_DEPTH": 0,
|
||||
}
|
||||
|
||||
# Switch to use your newly created theme
|
||||
sg.theme("cfg_util_theme")
|
||||
|
||||
TABLE_HEADERS = {
|
||||
"SCAN": [
|
||||
@@ -123,10 +189,16 @@ async def update_prog_bar(count: int, max: int = None):
|
||||
def get_scan_layout():
|
||||
scan_layout = [
|
||||
[
|
||||
sg.Text("Scan IP"),
|
||||
sg.Text("Scan IP", background_color=MAIN_TABS_BG),
|
||||
sg.InputText(key="scan_ip", size=(31, 1)),
|
||||
sg.Button("Scan", key="btn_scan"),
|
||||
sg.Push(),
|
||||
sg.Button(
|
||||
"Scan",
|
||||
key="btn_scan",
|
||||
border_width=BTN_BORDER,
|
||||
disabled_button_color=BTN_DISABLED,
|
||||
mouseover_colors=BTN_DISABLED,
|
||||
),
|
||||
sg.Push(background_color=MAIN_TABS_BG),
|
||||
sg.Button(
|
||||
"Sort: IP",
|
||||
disabled=True,
|
||||
@@ -150,9 +222,24 @@ def get_scan_layout():
|
||||
),
|
||||
],
|
||||
[
|
||||
sg.Button("ALL", key="scan_all"),
|
||||
sg.Button("REFRESH DATA", key="scan_refresh"),
|
||||
sg.Button("OPEN IN WEB", key="scan_web"),
|
||||
sg.Button(
|
||||
"ALL",
|
||||
key="scan_all",
|
||||
border_width=BTN_BORDER,
|
||||
disabled_button_color=BTN_DISABLED,
|
||||
),
|
||||
sg.Button(
|
||||
"REFRESH DATA",
|
||||
key="scan_refresh",
|
||||
border_width=BTN_BORDER,
|
||||
disabled_button_color=BTN_DISABLED,
|
||||
),
|
||||
sg.Button(
|
||||
"OPEN IN WEB",
|
||||
key="scan_web",
|
||||
border_width=BTN_BORDER,
|
||||
disabled_button_color=BTN_DISABLED,
|
||||
),
|
||||
],
|
||||
[
|
||||
sg.Table(
|
||||
@@ -163,8 +250,12 @@ def get_scan_layout():
|
||||
justification="center",
|
||||
key="scan_table",
|
||||
col_widths=SCAN_COL_WIDTHS,
|
||||
background_color="white",
|
||||
text_color="black",
|
||||
background_color=TABLE_BG,
|
||||
text_color=TABLE_TEXT,
|
||||
header_background_color=TABLE_HEADERS_COLOR,
|
||||
header_text_color=TABLE_HEADERS_TEXT_COLOR,
|
||||
border_width=TABLE_BORDER,
|
||||
header_border_width=TABLE_HEADER_BORDER,
|
||||
size=(TABLE_TOTAL_WIDTH, TABLE_HEIGHT),
|
||||
expand_x=True,
|
||||
enable_click_events=True,
|
||||
@@ -184,10 +275,15 @@ def get_command_layout():
|
||||
|
||||
command_layout = [
|
||||
[
|
||||
sg.Text("Custom Command"),
|
||||
sg.Text("Custom Command", background_color=MAIN_TABS_BG),
|
||||
sg.InputText(key="cmd_txt", expand_x=True),
|
||||
sg.Button("Send Command", key="btn_cmd"),
|
||||
sg.Push(),
|
||||
sg.Button(
|
||||
"Send Command",
|
||||
key="btn_cmd",
|
||||
border_width=BTN_BORDER,
|
||||
disabled_button_color=BTN_DISABLED,
|
||||
),
|
||||
sg.Push(background_color=MAIN_TABS_BG),
|
||||
sg.Button(
|
||||
"Sort: IP",
|
||||
disabled=True,
|
||||
@@ -204,10 +300,30 @@ def get_command_layout():
|
||||
),
|
||||
],
|
||||
[
|
||||
sg.Button("ALL", key="cmd_all"),
|
||||
sg.Button("LIGHT", key="cmd_light"),
|
||||
sg.Button("REBOOT", key="cmd_reboot"),
|
||||
sg.Button("RESTART BACKEND", key="cmd_backend"),
|
||||
sg.Button(
|
||||
"ALL",
|
||||
key="cmd_all",
|
||||
border_width=BTN_BORDER,
|
||||
disabled_button_color=BTN_DISABLED,
|
||||
),
|
||||
sg.Button(
|
||||
"LIGHT",
|
||||
key="cmd_light",
|
||||
border_width=BTN_BORDER,
|
||||
disabled_button_color=BTN_DISABLED,
|
||||
),
|
||||
sg.Button(
|
||||
"REBOOT",
|
||||
key="cmd_reboot",
|
||||
border_width=BTN_BORDER,
|
||||
disabled_button_color=BTN_DISABLED,
|
||||
),
|
||||
sg.Button(
|
||||
"RESTART BACKEND",
|
||||
key="cmd_backend",
|
||||
border_width=BTN_BORDER,
|
||||
disabled_button_color=BTN_DISABLED,
|
||||
),
|
||||
],
|
||||
[
|
||||
sg.Tree(
|
||||
@@ -218,8 +334,12 @@ def get_command_layout():
|
||||
justification="center",
|
||||
key="cmd_table",
|
||||
col_widths=col_widths,
|
||||
background_color="white",
|
||||
text_color="black",
|
||||
background_color=TABLE_BG,
|
||||
text_color=TABLE_TEXT,
|
||||
header_background_color=TABLE_HEADERS_COLOR,
|
||||
header_text_color=TABLE_HEADERS_TEXT_COLOR,
|
||||
border_width=TABLE_BORDER,
|
||||
header_border_width=TABLE_HEADER_BORDER,
|
||||
expand_x=True,
|
||||
expand_y=True,
|
||||
col0_heading="Light",
|
||||
@@ -241,10 +361,25 @@ def get_pools_layout():
|
||||
]
|
||||
pools_layout = [
|
||||
[
|
||||
sg.Button("ALL", key="pools_all"),
|
||||
sg.Button("REFRESH DATA", key="pools_refresh"),
|
||||
sg.Button("OPEN IN WEB", key="pools_web"),
|
||||
sg.Push(),
|
||||
sg.Button(
|
||||
"ALL",
|
||||
key="pools_all",
|
||||
border_width=BTN_BORDER,
|
||||
disabled_button_color=BTN_DISABLED,
|
||||
),
|
||||
sg.Button(
|
||||
"REFRESH DATA",
|
||||
key="pools_refresh",
|
||||
border_width=BTN_BORDER,
|
||||
disabled_button_color=BTN_DISABLED,
|
||||
),
|
||||
sg.Button(
|
||||
"OPEN IN WEB",
|
||||
key="pools_web",
|
||||
border_width=BTN_BORDER,
|
||||
disabled_button_color=BTN_DISABLED,
|
||||
),
|
||||
sg.Push(background_color=MAIN_TABS_BG),
|
||||
sg.Button(
|
||||
"Sort: IP",
|
||||
disabled=True,
|
||||
@@ -285,8 +420,12 @@ def get_pools_layout():
|
||||
max_col_width=15,
|
||||
justification="center",
|
||||
key="pools_table",
|
||||
background_color="white",
|
||||
text_color="black",
|
||||
background_color=POOLS_TABLE_BG,
|
||||
text_color=POOLS_TABLE_TEXT,
|
||||
header_background_color=POOLS_TABLE_HEADERS_COLOR,
|
||||
header_text_color=POOLS_TABLE_HEADERS_TEXT_COLOR,
|
||||
border_width=POOLS_TABLE_BORDER,
|
||||
header_border_width=POOLS_TABLE_HEADER_BORDER,
|
||||
col_widths=col_widths,
|
||||
size=(0, TABLE_HEIGHT),
|
||||
expand_x=True,
|
||||
@@ -294,6 +433,7 @@ def get_pools_layout():
|
||||
)
|
||||
]
|
||||
],
|
||||
background_color=POOLS_TABS_BG,
|
||||
)
|
||||
],
|
||||
[
|
||||
@@ -311,8 +451,12 @@ def get_pools_layout():
|
||||
max_col_width=15,
|
||||
justification="center",
|
||||
key="pools_1_table",
|
||||
background_color="white",
|
||||
text_color="black",
|
||||
background_color=POOLS_TABLE_BG,
|
||||
text_color=POOLS_TABLE_TEXT,
|
||||
header_background_color=POOLS_TABLE_HEADERS_COLOR,
|
||||
header_text_color=POOLS_TABLE_HEADERS_TEXT_COLOR,
|
||||
border_width=POOLS_TABLE_BORDER,
|
||||
header_border_width=POOLS_TABLE_HEADER_BORDER,
|
||||
col_widths=col_widths,
|
||||
size=(0, TABLE_HEIGHT),
|
||||
expand_x=True,
|
||||
@@ -320,6 +464,7 @@ def get_pools_layout():
|
||||
)
|
||||
]
|
||||
],
|
||||
background_color=POOLS_TABS_BG,
|
||||
)
|
||||
],
|
||||
[
|
||||
@@ -337,8 +482,12 @@ def get_pools_layout():
|
||||
max_col_width=15,
|
||||
justification="center",
|
||||
key="pools_2_table",
|
||||
background_color="white",
|
||||
text_color="black",
|
||||
background_color=POOLS_TABLE_BG,
|
||||
text_color=POOLS_TABLE_TEXT,
|
||||
header_background_color=POOLS_TABLE_HEADERS_COLOR,
|
||||
header_text_color=POOLS_TABLE_HEADERS_TEXT_COLOR,
|
||||
border_width=POOLS_TABLE_BORDER,
|
||||
header_border_width=POOLS_TABLE_HEADER_BORDER,
|
||||
col_widths=col_widths,
|
||||
size=(0, TABLE_HEIGHT),
|
||||
expand_x=True,
|
||||
@@ -346,9 +495,17 @@ def get_pools_layout():
|
||||
)
|
||||
]
|
||||
],
|
||||
background_color=POOLS_TABS_BG,
|
||||
)
|
||||
],
|
||||
]
|
||||
],
|
||||
background_color=MAIN_TABS_BG,
|
||||
title_color=POOLS_TABS_TEXT_NORMAL,
|
||||
tab_background_color=POOLS_TABS_NORMAL,
|
||||
selected_background_color=POOLS_TABS_SELECTED,
|
||||
selected_title_color=POOLS_TABS_TEXT_SELECTED,
|
||||
border_width=0,
|
||||
tab_border_width=2,
|
||||
)
|
||||
],
|
||||
]
|
||||
@@ -358,10 +515,25 @@ def get_pools_layout():
|
||||
def get_config_layout():
|
||||
config_layout = [
|
||||
[
|
||||
sg.Button("IMPORT", key="cfg_import"),
|
||||
sg.Button("CONFIG", key="cfg_config"),
|
||||
sg.Button("GENERATE", key="cfg_generate"),
|
||||
sg.Push(),
|
||||
sg.Button(
|
||||
"IMPORT",
|
||||
key="cfg_import",
|
||||
border_width=BTN_BORDER,
|
||||
disabled_button_color=BTN_DISABLED,
|
||||
),
|
||||
sg.Button(
|
||||
"CONFIG",
|
||||
key="cfg_config",
|
||||
border_width=BTN_BORDER,
|
||||
disabled_button_color=BTN_DISABLED,
|
||||
),
|
||||
sg.Button(
|
||||
"GENERATE",
|
||||
key="cfg_generate",
|
||||
border_width=BTN_BORDER,
|
||||
disabled_button_color=BTN_DISABLED,
|
||||
),
|
||||
sg.Push(background_color=MAIN_TABS_BG),
|
||||
sg.Button(
|
||||
"Sort: IP",
|
||||
disabled=True,
|
||||
@@ -385,10 +557,24 @@ def get_config_layout():
|
||||
),
|
||||
],
|
||||
[
|
||||
sg.Button("ALL", key="cfg_all"),
|
||||
sg.Button("OPEN IN WEB", key="cfg_web"),
|
||||
sg.Push(),
|
||||
sg.Checkbox("Append IP to Username", key="cfg_append_ip"),
|
||||
sg.Button(
|
||||
"ALL",
|
||||
key="cfg_all",
|
||||
border_width=BTN_BORDER,
|
||||
disabled_button_color=BTN_DISABLED,
|
||||
),
|
||||
sg.Button(
|
||||
"OPEN IN WEB",
|
||||
key="cfg_web",
|
||||
border_width=BTN_BORDER,
|
||||
disabled_button_color=BTN_DISABLED,
|
||||
),
|
||||
sg.Push(background_color=MAIN_TABS_BG),
|
||||
sg.Checkbox(
|
||||
"Append IP to Username",
|
||||
key="cfg_append_ip",
|
||||
background_color=MAIN_TABS_BG,
|
||||
),
|
||||
],
|
||||
[
|
||||
sg.Table(
|
||||
@@ -398,8 +584,12 @@ def get_config_layout():
|
||||
max_col_width=15,
|
||||
justification="center",
|
||||
key="cfg_table",
|
||||
background_color="white",
|
||||
text_color="black",
|
||||
background_color=TABLE_BG,
|
||||
text_color=TABLE_TEXT,
|
||||
header_background_color=TABLE_HEADERS_COLOR,
|
||||
header_text_color=TABLE_HEADERS_TEXT_COLOR,
|
||||
header_border_width=TABLE_HEADER_BORDER,
|
||||
border_width=TABLE_BORDER,
|
||||
col_widths=[
|
||||
IP_COL_WIDTH,
|
||||
MODEL_COL_WIDTH,
|
||||
@@ -426,12 +616,26 @@ layout = [
|
||||
[
|
||||
sg.TabGroup(
|
||||
[
|
||||
[sg.Tab("Scan", get_scan_layout())],
|
||||
[sg.Tab("Pools", get_pools_layout())],
|
||||
[sg.Tab("Configure", get_config_layout())],
|
||||
[sg.Tab("Command", get_command_layout())],
|
||||
]
|
||||
)
|
||||
[sg.Tab("Scan", get_scan_layout(), background_color=MAIN_TABS_BG)],
|
||||
[sg.Tab("Pools", get_pools_layout(), background_color=MAIN_TABS_BG)],
|
||||
[
|
||||
sg.Tab(
|
||||
"Configure", get_config_layout(), background_color=MAIN_TABS_BG
|
||||
)
|
||||
],
|
||||
[
|
||||
sg.Tab(
|
||||
"Command", get_command_layout(), background_color=MAIN_TABS_BG
|
||||
)
|
||||
],
|
||||
],
|
||||
tab_background_color=MAIN_TABS_NORMAL,
|
||||
title_color=MAIN_TABS_TEXT_NORMAL,
|
||||
selected_background_color=MAIN_TABS_BG,
|
||||
selected_title_color=MAIN_TABS_TEXT_SELECTED,
|
||||
border_width=0,
|
||||
tab_border_width=2,
|
||||
),
|
||||
],
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user