flock-core 0.4.0b35__py3-none-any.whl → 0.4.0b37__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of flock-core might be problematic. Click here for more details.
- flock/__init__.py +34 -11
- flock/cli/loaded_flock_cli.py +38 -18
- flock/core/flock.py +48 -3
- flock/themes/alabaster.toml +43 -43
- flock/themes/guezwhoz.toml +43 -43
- flock/themes/wildcherry.toml +43 -43
- flock/themes/wombat.toml +43 -43
- flock/themes/zenburn.toml +43 -43
- flock/webapp/app/config.py +80 -2
- flock/webapp/app/main.py +506 -3
- flock/webapp/app/templates/theme_mapper.html +326 -0
- flock/webapp/app/theme_mapper.py +812 -0
- flock/webapp/run.py +116 -14
- flock/webapp/static/css/custom.css +168 -83
- flock/webapp/templates/base.html +14 -7
- flock/webapp/templates/partials/_agent_detail_form.html +4 -3
- flock/webapp/templates/partials/_agent_list.html +1 -6
- flock/webapp/templates/partials/_agent_manager_view.html +52 -14
- flock/webapp/templates/partials/_agent_manager_view_old.html +19 -0
- flock/webapp/templates/partials/_create_flock_form.html +1 -1
- flock/webapp/templates/partials/_dashboard_flock_properties_preview.html +1 -1
- flock/webapp/templates/partials/_env_vars_table.html +25 -0
- flock/webapp/templates/partials/_execution_form.html +1 -1
- flock/webapp/templates/partials/_execution_view_container.html +13 -12
- flock/webapp/templates/partials/_flock_properties_form.html +2 -1
- flock/webapp/templates/partials/_header_flock_status.html +5 -0
- flock/webapp/templates/partials/_load_manager_view.html +50 -0
- flock/webapp/templates/partials/_settings_env_content.html +10 -0
- flock/webapp/templates/partials/_settings_theme_content.html +15 -0
- flock/webapp/templates/partials/_settings_view.html +36 -0
- flock/webapp/templates/partials/_sidebar.html +13 -6
- flock/webapp/templates/partials/_structured_data_view.html +4 -4
- flock/webapp/templates/partials/_theme_preview.html +23 -0
- {flock_core-0.4.0b35.dist-info → flock_core-0.4.0b37.dist-info}/METADATA +1 -1
- {flock_core-0.4.0b35.dist-info → flock_core-0.4.0b37.dist-info}/RECORD +38 -29
- flock/webapp/templates/partials/_load_manage_view.html +0 -88
- {flock_core-0.4.0b35.dist-info → flock_core-0.4.0b37.dist-info}/WHEEL +0 -0
- {flock_core-0.4.0b35.dist-info → flock_core-0.4.0b37.dist-info}/entry_points.txt +0 -0
- {flock_core-0.4.0b35.dist-info → flock_core-0.4.0b37.dist-info}/licenses/LICENSE +0 -0
flock/themes/zenburn.toml
CHANGED
|
@@ -2,28 +2,28 @@
|
|
|
2
2
|
panel_style = "on #3f3f3f"
|
|
3
3
|
table_header_style = "bold #c2d87a on #21322f"
|
|
4
4
|
table_title_style = "bold #dcdccc"
|
|
5
|
-
table_border_style = "#94bff3"
|
|
6
|
-
panel_border_style = "#94bff3"
|
|
5
|
+
table_border_style = " #94bff3"
|
|
6
|
+
panel_border_style = " #94bff3"
|
|
7
7
|
column_output = "bold #dcdccc"
|
|
8
|
-
column_value = "#dcdccc"
|
|
9
|
-
bright_black = "#709080"
|
|
10
|
-
bright_blue = "#94bff3"
|
|
11
|
-
bright_cyan = "#93e0e3"
|
|
12
|
-
bright_green = "#c3bf9f"
|
|
13
|
-
bright_magenta = "#ec93d3"
|
|
14
|
-
bright_red = "#dca3a3"
|
|
15
|
-
bright_white = "#ffffff"
|
|
16
|
-
bright_yellow = "#e0cf9f"
|
|
17
|
-
normal_black = "#4d4d4d"
|
|
18
|
-
normal_blue = "#506070"
|
|
19
|
-
normal_cyan = "#8cd0d3"
|
|
20
|
-
normal_green = "#60b48a"
|
|
21
|
-
normal_magenta = "#dc8cc3"
|
|
22
|
-
normal_red = "#705050"
|
|
23
|
-
normal_white = "#dcdccc"
|
|
24
|
-
normal_yellow = "#f0dfaf"
|
|
25
|
-
cursor_cursor = "#73635a"
|
|
26
|
-
cursor_text = "#000000"
|
|
8
|
+
column_value = " #dcdccc"
|
|
9
|
+
bright_black = " #709080"
|
|
10
|
+
bright_blue = " #94bff3"
|
|
11
|
+
bright_cyan = " #93e0e3"
|
|
12
|
+
bright_green = " #c3bf9f"
|
|
13
|
+
bright_magenta = " #ec93d3"
|
|
14
|
+
bright_red = " #dca3a3"
|
|
15
|
+
bright_white = " #ffffff"
|
|
16
|
+
bright_yellow = " #e0cf9f"
|
|
17
|
+
normal_black = " #4d4d4d"
|
|
18
|
+
normal_blue = " #506070"
|
|
19
|
+
normal_cyan = " #8cd0d3"
|
|
20
|
+
normal_green = " #60b48a"
|
|
21
|
+
normal_magenta = " #dc8cc3"
|
|
22
|
+
normal_red = " #705050"
|
|
23
|
+
normal_white = " #dcdccc"
|
|
24
|
+
normal_yellow = " #f0dfaf"
|
|
25
|
+
cursor_cursor = " #73635a"
|
|
26
|
+
cursor_text = " #000000"
|
|
27
27
|
table_show_lines = false
|
|
28
28
|
table_box = "HEAVY"
|
|
29
29
|
panel_padding = [ 1, 2,]
|
|
@@ -45,33 +45,33 @@ table_caption_justify = "center"
|
|
|
45
45
|
table_highlight = false
|
|
46
46
|
|
|
47
47
|
[colors.bright]
|
|
48
|
-
black = "#709080"
|
|
49
|
-
blue = "#94bff3"
|
|
50
|
-
cyan = "#93e0e3"
|
|
51
|
-
green = "#c3bf9f"
|
|
52
|
-
magenta = "#ec93d3"
|
|
53
|
-
red = "#dca3a3"
|
|
54
|
-
white = "#ffffff"
|
|
55
|
-
yellow = "#e0cf9f"
|
|
48
|
+
black = " #709080"
|
|
49
|
+
blue = " #94bff3"
|
|
50
|
+
cyan = " #93e0e3"
|
|
51
|
+
green = " #c3bf9f"
|
|
52
|
+
magenta = " #ec93d3"
|
|
53
|
+
red = " #dca3a3"
|
|
54
|
+
white = " #ffffff"
|
|
55
|
+
yellow = " #e0cf9f"
|
|
56
56
|
|
|
57
57
|
[colors.cursor]
|
|
58
|
-
cursor = "#73635a"
|
|
59
|
-
text = "#000000"
|
|
58
|
+
cursor = " #73635a"
|
|
59
|
+
text = " #000000"
|
|
60
60
|
|
|
61
61
|
[colors.normal]
|
|
62
|
-
black = "#4d4d4d"
|
|
63
|
-
blue = "#506070"
|
|
64
|
-
cyan = "#8cd0d3"
|
|
65
|
-
green = "#60b48a"
|
|
66
|
-
magenta = "#dc8cc3"
|
|
67
|
-
red = "#705050"
|
|
68
|
-
white = "#dcdccc"
|
|
69
|
-
yellow = "#f0dfaf"
|
|
62
|
+
black = " #4d4d4d"
|
|
63
|
+
blue = " #506070"
|
|
64
|
+
cyan = " #8cd0d3"
|
|
65
|
+
green = " #60b48a"
|
|
66
|
+
magenta = " #dc8cc3"
|
|
67
|
+
red = " #705050"
|
|
68
|
+
white = " #dcdccc"
|
|
69
|
+
yellow = " #f0dfaf"
|
|
70
70
|
|
|
71
71
|
[colors.primary]
|
|
72
|
-
background = "#3f3f3f"
|
|
73
|
-
foreground = "#dcdccc"
|
|
72
|
+
background = " #3f3f3f"
|
|
73
|
+
foreground = " #dcdccc"
|
|
74
74
|
|
|
75
75
|
[colors.selection]
|
|
76
|
-
background = "#21322f"
|
|
77
|
-
text = "#c2d87a"
|
|
76
|
+
background = " #21322f"
|
|
77
|
+
text = " #c2d87a"
|
flock/webapp/app/config.py
CHANGED
|
@@ -1,9 +1,87 @@
|
|
|
1
1
|
import os
|
|
2
|
+
import random # Added for random theme selection
|
|
2
3
|
from pathlib import Path
|
|
3
4
|
|
|
5
|
+
from flock.core import Flock # Add type hint
|
|
6
|
+
from flock.core.logging.formatters.themes import OutputTheme
|
|
7
|
+
|
|
4
8
|
FLOCK_FILES_DIR = Path(os.getenv("FLOCK_FILES_DIR", "./.flock_ui_projects"))
|
|
5
9
|
FLOCK_FILES_DIR.mkdir(parents=True, exist_ok=True)
|
|
6
10
|
|
|
11
|
+
# --- Theme Configuration ---
|
|
12
|
+
# Calculate themes directory relative to this config file's location, assuming structure:
|
|
13
|
+
# src/flock/webapp/app/config.py
|
|
14
|
+
# src/flock/themes/
|
|
15
|
+
CONFIG_FILE_PATH = Path(__file__).resolve() # src/flock/webapp/app/config.py
|
|
16
|
+
FLOCK_WEBAPP_DIR = CONFIG_FILE_PATH.parent.parent # src/flock/webapp/
|
|
17
|
+
FLOCK_BASE_DIR = FLOCK_WEBAPP_DIR.parent # src/flock/
|
|
18
|
+
THEMES_DIR = FLOCK_BASE_DIR / "themes"
|
|
19
|
+
|
|
7
20
|
# Global state for MVP - NOT SUITABLE FOR PRODUCTION/MULTI-USER
|
|
8
|
-
CURRENT_FLOCK_INSTANCE = None
|
|
9
|
-
CURRENT_FLOCK_FILENAME = None
|
|
21
|
+
CURRENT_FLOCK_INSTANCE: Flock | None = None
|
|
22
|
+
CURRENT_FLOCK_FILENAME: str | None = None
|
|
23
|
+
|
|
24
|
+
DEFAULT_THEME_NAME = OutputTheme.ayu.value # Default if random fails or invalid theme specified
|
|
25
|
+
|
|
26
|
+
def list_available_themes() -> list[str]:
|
|
27
|
+
"""Scans the THEMES_DIR for .toml files and returns their names (without .toml)."""
|
|
28
|
+
if not THEMES_DIR.exists() or not THEMES_DIR.is_dir():
|
|
29
|
+
return []
|
|
30
|
+
return sorted([p.stem for p in THEMES_DIR.glob("*.toml") if p.is_file()])
|
|
31
|
+
|
|
32
|
+
# Initialize CURRENT_THEME_NAME
|
|
33
|
+
_initial_theme_from_env = os.environ.get("FLOCK_WEB_THEME")
|
|
34
|
+
_resolved_initial_theme = DEFAULT_THEME_NAME
|
|
35
|
+
|
|
36
|
+
if _initial_theme_from_env:
|
|
37
|
+
if _initial_theme_from_env.lower() == "random":
|
|
38
|
+
available_themes = list_available_themes()
|
|
39
|
+
if available_themes:
|
|
40
|
+
_resolved_initial_theme = random.choice(available_themes)
|
|
41
|
+
print(f"Config: Initial theme from FLOCK_WEB_THEME='random' resolved to: {_resolved_initial_theme}")
|
|
42
|
+
else:
|
|
43
|
+
print(f"Warning: FLOCK_WEB_THEME='random' specified, but no themes found in {THEMES_DIR}. Using default: {DEFAULT_THEME_NAME}")
|
|
44
|
+
_resolved_initial_theme = DEFAULT_THEME_NAME
|
|
45
|
+
elif _initial_theme_from_env in [t.value for t in OutputTheme] or _initial_theme_from_env in list_available_themes():
|
|
46
|
+
_resolved_initial_theme = _initial_theme_from_env
|
|
47
|
+
print(f"Config: Initial theme set from FLOCK_WEB_THEME env var: {_resolved_initial_theme}")
|
|
48
|
+
else:
|
|
49
|
+
print(f"Warning: Invalid theme name '{_initial_theme_from_env}' in FLOCK_WEB_THEME. Using default: {DEFAULT_THEME_NAME}")
|
|
50
|
+
_resolved_initial_theme = DEFAULT_THEME_NAME
|
|
51
|
+
|
|
52
|
+
CURRENT_THEME_NAME: str = _resolved_initial_theme
|
|
53
|
+
|
|
54
|
+
def set_current_theme_name(theme_name: str | None):
|
|
55
|
+
"""Sets the globally accessible current theme name.
|
|
56
|
+
If 'random' is passed, a random theme is chosen.
|
|
57
|
+
"""
|
|
58
|
+
global CURRENT_THEME_NAME
|
|
59
|
+
resolved_theme = DEFAULT_THEME_NAME # Default to start
|
|
60
|
+
|
|
61
|
+
if theme_name:
|
|
62
|
+
if theme_name.lower() == "random":
|
|
63
|
+
available = list_available_themes()
|
|
64
|
+
if available:
|
|
65
|
+
resolved_theme = random.choice(available)
|
|
66
|
+
print(f"Config: Theme 'random' resolved to: {resolved_theme}")
|
|
67
|
+
else:
|
|
68
|
+
print(f"Warning: Theme 'random' specified, but no themes found in {THEMES_DIR}. Using default: {DEFAULT_THEME_NAME}")
|
|
69
|
+
# resolved_theme remains DEFAULT_THEME_NAME
|
|
70
|
+
elif theme_name in [t.value for t in OutputTheme] or theme_name in list_available_themes():
|
|
71
|
+
resolved_theme = theme_name
|
|
72
|
+
else:
|
|
73
|
+
print(f"Warning: Invalid theme name provided ('{theme_name}'). Using default: {DEFAULT_THEME_NAME}")
|
|
74
|
+
# resolved_theme remains DEFAULT_THEME_NAME
|
|
75
|
+
else: # theme_name is None
|
|
76
|
+
# resolved_theme remains DEFAULT_THEME_NAME (set at the beginning of function)
|
|
77
|
+
pass
|
|
78
|
+
|
|
79
|
+
CURRENT_THEME_NAME = resolved_theme
|
|
80
|
+
# Ensure the theme name is set in the environment if we want other processes to see it,
|
|
81
|
+
# though this might be better handled by the calling process (e.g. CLI)
|
|
82
|
+
# os.environ["FLOCK_WEB_THEME"] = CURRENT_THEME_NAME
|
|
83
|
+
print(f"Config: Current theme explicitly set to: {CURRENT_THEME_NAME}")
|
|
84
|
+
|
|
85
|
+
def get_current_theme_name() -> str:
|
|
86
|
+
"""Gets the globally accessible current theme name."""
|
|
87
|
+
return CURRENT_THEME_NAME
|