diff --git a/.idea/HomelabWatchdog.iml b/.idea/HomelabWatchdog.iml index cf84ae4..86509b0 100644 --- a/.idea/HomelabWatchdog.iml +++ b/.idea/HomelabWatchdog.iml @@ -2,10 +2,11 @@ - - + + + - + \ No newline at end of file diff --git a/Cargo.lock b/Rust-Workers/Cargo.lock similarity index 100% rename from Cargo.lock rename to Rust-Workers/Cargo.lock diff --git a/Cargo.toml b/Rust-Workers/Cargo.toml similarity index 100% rename from Cargo.toml rename to Rust-Workers/Cargo.toml diff --git a/src/host.rs b/Rust-Workers/src/host.rs similarity index 100% rename from src/host.rs rename to Rust-Workers/src/host.rs diff --git a/src/main.rs b/Rust-Workers/src/main.rs similarity index 100% rename from src/main.rs rename to Rust-Workers/src/main.rs diff --git a/main.py b/main.py new file mode 100644 index 0000000..32e9e9b --- /dev/null +++ b/main.py @@ -0,0 +1,19 @@ + +from textual.app import App, ComposeResult +from textual.widgets import Static, Button + + +class WatchDogApp(App): + """A Textual app to manage servers.""" + CSS_PATH = "tui/tcss/main.tcss" + + def compose(self) -> ComposeResult: + yield Static("First column", classes="box") + yield Static("Two", classes="box") + yield Static("Three", classes="servers") + yield Static("Four", classes="box") + yield Static("Five", classes="box") + +if __name__ == "__main__": + app = WatchDogApp() + app.run() \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..de82f2c --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +textual +pymysql diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..8376390 --- /dev/null +++ b/setup.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -e + +VENV_DIR=".venv" +REQ_FILE="requirements.txt" + +echo "== Homelab Watchdog: Setup ==" + +# 1. venv erstellen, falls nicht vorhanden +if [ ! -d "$VENV_DIR" ]; then + echo "-> Erstelle virtuelle Umgebung in $VENV_DIR ..." + python3 -m venv "$VENV_DIR" +else + echo "-> venv existiert bereits, überspringe." +fi + +# 2. venv aktivieren (nur innerhalb dieses Scripts) +source "$VENV_DIR/bin/activate" + +# 3. pip selbst aktualisieren +pip install --upgrade pip + +# 4. requirements.txt anlegen, falls nicht vorhanden +if [ ! -f "$REQ_FILE" ]; then + echo "-> Keine requirements.txt gefunden, erstelle Standard-Stückliste." + cat > "$REQ_FILE" < Installiere Pakete aus $REQ_FILE ..." +pip install -r "$REQ_FILE" + +echo "== Setup fertig ==" +echo "Aktivieren mit: source $VENV_DIR/bin/activate" diff --git a/tui/tcss/main.tcss b/tui/tcss/main.tcss new file mode 100644 index 0000000..ec7ead1 --- /dev/null +++ b/tui/tcss/main.tcss @@ -0,0 +1,17 @@ +Screen { + layout: grid; + grid-size: 3 2; + grid-columns: 1fr 1fr 0.5fr; + grid-rows: 1fr 1fr; +} + +.box { + height: 100%; + border: solid green; +} + +.servers { + row-span: 2; + height: 100%; + border: solid green; +}