ktui 0.1.0__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.
- ktui/__init__.py +1 -0
- ktui/app.py +49 -0
- ktui/data/k8s_schema.json +48620 -0
- ktui/generator/__init__.py +5 -0
- ktui/generator/yaml_emitter.py +124 -0
- ktui/kubernetes/__init__.py +0 -0
- ktui/kubernetes/client.py +100 -0
- ktui/models/__init__.py +25 -0
- ktui/models/core.py +28 -0
- ktui/models/kubernetes/__init__.py +8 -0
- ktui/models/kubernetes/configmap.py +41 -0
- ktui/models/kubernetes/deployment.py +113 -0
- ktui/models/kubernetes/pod.py +39 -0
- ktui/models/kubernetes/service.py +86 -0
- ktui/models/openshift/__init__.py +5 -0
- ktui/models/openshift/route.py +105 -0
- ktui/models/shared/__init__.py +207 -0
- ktui/registry.py +122 -0
- ktui/schema/__init__.py +1 -0
- ktui/schema/emitter.py +28 -0
- ktui/schema/loader.py +103 -0
- ktui/ui/__init__.py +0 -0
- ktui/ui/engine/__init__.py +0 -0
- ktui/ui/engine/form_builder.py +266 -0
- ktui/ui/engine/schema_form_builder.py +450 -0
- ktui/ui/engine/state.py +56 -0
- ktui/ui/screens/__init__.py +0 -0
- ktui/ui/screens/cluster_import.py +124 -0
- ktui/ui/screens/directory_picker.py +112 -0
- ktui/ui/screens/field_picker.py +195 -0
- ktui/ui/screens/main_screen.py +377 -0
- ktui/ui/screens/yaml_preview.py +129 -0
- ktui/ui/styles/.gitkeep +0 -0
- ktui/ui/styles/app.tcss +165 -0
- ktui/ui/widgets/__init__.py +0 -0
- ktui/ui/widgets/connection_panel.py +157 -0
- ktui/ui/widgets/list_editor.py +208 -0
- ktui/ui/widgets/map_editor.py +180 -0
- ktui-0.1.0.dist-info/METADATA +223 -0
- ktui-0.1.0.dist-info/RECORD +43 -0
- ktui-0.1.0.dist-info/WHEEL +4 -0
- ktui-0.1.0.dist-info/entry_points.txt +2 -0
- ktui-0.1.0.dist-info/licenses/LICENSE +131 -0
ktui/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""ktui — interactive Kubernetes TUI manifest builder for Kubernetes and OpenShift."""
|
ktui/app.py
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"""Main Textual application entry point."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from textual.app import App, ComposeResult
|
|
6
|
+
from textual.theme import Theme
|
|
7
|
+
|
|
8
|
+
from ktui.ui.screens.main_screen import MainScreen
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class YAMLGeneratorApp(App):
|
|
12
|
+
"""ktui — Kubernetes TUI manifest builder."""
|
|
13
|
+
|
|
14
|
+
TITLE = "ktui"
|
|
15
|
+
SUB_TITLE = "Kubernetes manifest builder"
|
|
16
|
+
CSS_PATH = "ui/styles/app.tcss"
|
|
17
|
+
|
|
18
|
+
BINDINGS = [
|
|
19
|
+
("t", "cycle_theme", "Cycle Theme"),
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
def on_mount(self) -> None:
|
|
23
|
+
self.theme = "textual-dark"
|
|
24
|
+
self._available_themes = [
|
|
25
|
+
"textual-dark",
|
|
26
|
+
"catppuccin-mocha",
|
|
27
|
+
"tokyo-night",
|
|
28
|
+
"dracula",
|
|
29
|
+
"nord",
|
|
30
|
+
]
|
|
31
|
+
self.push_screen(MainScreen())
|
|
32
|
+
|
|
33
|
+
def action_cycle_theme(self) -> None:
|
|
34
|
+
try:
|
|
35
|
+
idx = self._available_themes.index(self.theme)
|
|
36
|
+
except ValueError:
|
|
37
|
+
idx = 0
|
|
38
|
+
next_theme = self._available_themes[(idx + 1) % len(self._available_themes)]
|
|
39
|
+
self.theme = next_theme
|
|
40
|
+
self.notify(f"Theme: {next_theme}", timeout=2.0)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def main() -> None:
|
|
44
|
+
"""Entry point used by the ``yamlgen`` console script."""
|
|
45
|
+
YAMLGeneratorApp().run()
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
if __name__ == "__main__":
|
|
49
|
+
main()
|