added listener function to cfg util

This commit is contained in:
UpstreamData
2022-05-30 13:27:56 -06:00
parent 739126935a
commit dd5ccafa1e
4 changed files with 84 additions and 22 deletions

View File

@@ -150,6 +150,10 @@ BUTTON_KEYS = [
"scan_all",
"scan_refresh",
"scan_web",
"boards_report",
"boards_all",
"boards_refresh",
"boards_web",
"cmd_all",
"cmd_light",
"cmd_reboot",
@@ -162,6 +166,7 @@ BUTTON_KEYS = [
"cfg_generate",
"cfg_all",
"cfg_web",
"cmd_listen",
]
TABLE_HEIGHT = 27
@@ -217,7 +222,6 @@ def get_scan_layout():
"Scan",
key="btn_scan",
border_width=BTN_BORDER,
disabled_button_color=BTN_DISABLED,
mouseover_colors=BTN_DISABLED,
bind_return_key=True,
),
@@ -227,20 +231,23 @@ def get_scan_layout():
"ALL",
key="scan_all",
border_width=BTN_BORDER,
disabled_button_color=BTN_DISABLED,
pad=((0, 5), (1, 1)),
),
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.Button(
"STOP LISTENING",
key="scan_cancel_listen",
border_width=BTN_BORDER,
visible=False,
),
],
[
@@ -302,20 +309,23 @@ def get_boards_layout():
"ALL",
key="boards_all",
border_width=BTN_BORDER,
disabled_button_color=BTN_DISABLED,
pad=((0, 5), (1, 1)),
),
sg.Button(
"REFRESH DATA",
key="boards_refresh",
border_width=BTN_BORDER,
disabled_button_color=BTN_DISABLED,
),
sg.Button(
"OPEN IN WEB",
key="boards_web",
border_width=BTN_BORDER,
disabled_button_color=BTN_DISABLED,
),
sg.Button(
"STOP LISTENING",
key="boards_cancel_listen",
border_width=BTN_BORDER,
visible=False,
),
],
[
@@ -370,7 +380,6 @@ def get_command_layout():
"Send Command",
key="btn_cmd",
border_width=BTN_BORDER,
disabled_button_color=BTN_DISABLED,
),
],
[
@@ -378,26 +387,33 @@ def get_command_layout():
"ALL",
key="cmd_all",
border_width=BTN_BORDER,
disabled_button_color=BTN_DISABLED,
pad=((0, 5), (1, 1)),
),
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.Button(
"LISTEN",
key="cmd_listen",
border_width=BTN_BORDER,
),
sg.Button(
"STOP LISTENING",
key="cmd_cancel_listen",
border_width=BTN_BORDER,
visible=False,
),
],
[
@@ -447,20 +463,23 @@ def get_pools_layout():
"ALL",
key="pools_all",
border_width=BTN_BORDER,
disabled_button_color=BTN_DISABLED,
pad=((0, 5), (6, 7)),
),
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.Button(
"STOP LISTENING",
key="pools_cancel_listen",
border_width=BTN_BORDER,
visible=False,
),
],
[
@@ -614,37 +633,39 @@ def get_config_layout():
"IMPORT",
key="cfg_import",
border_width=BTN_BORDER,
disabled_button_color=BTN_DISABLED,
pad=((0, 5), (6, 0)),
),
sg.Button(
"CONFIG",
key="cfg_config",
border_width=BTN_BORDER,
disabled_button_color=BTN_DISABLED,
pad=((0, 5), (6, 0)),
),
sg.Button(
"GENERATE",
key="cfg_generate",
border_width=BTN_BORDER,
disabled_button_color=BTN_DISABLED,
pad=((0, 5), (6, 0)),
),
sg.Button(
"STOP LISTENING",
key="cfg_cancel_listen",
border_width=BTN_BORDER,
pad=((0, 5), (6, 0)),
visible=False,
),
],
[
sg.Button(
"ALL",
key="cfg_all",
border_width=BTN_BORDER,
disabled_button_color=BTN_DISABLED,
pad=((0, 5), (1, 0)),
),
sg.Button(
"OPEN IN WEB",
key="cfg_web",
border_width=BTN_BORDER,
disabled_button_color=BTN_DISABLED,
pad=((5, 5), (3, 2)),
),
sg.Push(background_color=MAIN_TABS_BG),