Compare commits
1 Commits
dev-setup
...
fix/perf-a
| Author | SHA1 | Date | |
|---|---|---|---|
| 058c5dd015 |
@@ -285,14 +285,15 @@ function optionGroups(entities, selectedIds = new Set()) {
|
||||
async function loadOverview() {
|
||||
const status = document.getElementById("status");
|
||||
const chips = document.getElementById("status-chips");
|
||||
let reconciliation = null;
|
||||
try {
|
||||
const [health, websocket, ml, reconciliation, actuators] = await Promise.all([
|
||||
const [health, websocket, ml] = await Promise.all([
|
||||
api("health"),
|
||||
api("health/websocket"),
|
||||
api("ml/health"),
|
||||
api("v1/actuators/reconciliation/state"),
|
||||
api("v1/actuators"),
|
||||
]);
|
||||
reconciliation = await api("v1/actuators/reconciliation/state");
|
||||
const actuators = await api("v1/actuators");
|
||||
status.innerHTML = `<p class="ok">System bereit</p><p>Letzte automatische Prüfung: ${escapeHtml(reconciliation.last_completed_at || "noch nie")}</p>`;
|
||||
chips.innerHTML = [
|
||||
`<span class="chip">API: ${escapeHtml(health.status)}</span>`,
|
||||
@@ -313,12 +314,8 @@ async function loadActuatorDiscovery() {
|
||||
const options = document.getElementById("actuator-options");
|
||||
const select = document.getElementById("actuator-select");
|
||||
try {
|
||||
const [available, configured] = await Promise.all([
|
||||
api("v1/actuators/discovery"),
|
||||
api("v1/actuators"),
|
||||
]);
|
||||
const configuredIds = new Set(configured.map(record => record.actuator_entity_id));
|
||||
actuatorChoices = available.filter(entity => !configuredIds.has(entity.entity_id));
|
||||
const available = await api("v1/actuators/discovery");
|
||||
actuatorChoices = available;
|
||||
options.innerHTML = actuatorChoices.slice(0, 120).map(entity =>
|
||||
`<option value="${escapeHtml(entity.entity_id)}">${escapeHtml(entity.friendly_name || entity.entity_id)}${entity.area_name ? ` (${escapeHtml(entity.area_name)})` : ""}</option>`
|
||||
).join("");
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
# Locale Dev-Umgebung — sillyhome-next-dev
|
||||
|
||||
Ziel: Repo lokal klonen, Backend starten und Änderungen entwickeln, ohne das produktive Add-on direkt zu beeinflussen.
|
||||
|
||||
## Voraussetzungen
|
||||
|
||||
- Git
|
||||
- Python 3.10+
|
||||
- `pip`
|
||||
- Optional: Nginx als Reverse-Proxy
|
||||
|
||||
## 1. Repo klonen
|
||||
|
||||
```bash
|
||||
git clone http://192.168.6.31:3000/Otto/sillyhome-next-dev.git
|
||||
cd sillyhome-next-dev
|
||||
```
|
||||
|
||||
## 2. Abhängigkeiten installieren
|
||||
|
||||
```bash
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y git python3 python3-pip uvicorn
|
||||
pip3 install -r requirements.txt
|
||||
```
|
||||
|
||||
## 3. Backend starten (temporär)
|
||||
|
||||
```bash
|
||||
uvicorn app.main:app --reload
|
||||
```
|
||||
|
||||
## 4. Backend dauerhaft per systemd starten
|
||||
|
||||
Datei `/etc/systemd/system/sillyhome-dev.service`:
|
||||
|
||||
```ini
|
||||
[Unit]
|
||||
Description=Sillyhome Next Dev
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
WorkingDirectory=/home/otto/sillyhome-next-dev
|
||||
Environment="PATH=/home/otto/.local/bin:/usr/local/bin:/usr/bin:/bin"
|
||||
ExecStart=/usr/local/bin/uvicorn app.main:app --host 0.0.0.0 --port 8000
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
Aktivieren:
|
||||
|
||||
```bash
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable --now sillyhome-dev.service
|
||||
```
|
||||
|
||||
## 5. Optional: Nginx Reverse-Proxy
|
||||
|
||||
Datei `/etc/nginx/sites-available/sillyhome-dev`:
|
||||
|
||||
```nginx
|
||||
server {
|
||||
listen 8080;
|
||||
server_name sillyhome-dev.local;
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8000/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Aktivieren:
|
||||
|
||||
```bash
|
||||
sudo ln -sf /etc/nginx/sites-available/sillyhome-dev /etc/nginx/sites-enabled/
|
||||
sudo nginx -t && sudo systemctl reload nginx
|
||||
```
|
||||
|
||||
## 6. Nur Frontend testen
|
||||
|
||||
```bash
|
||||
cd /home/otto/sillyhome-next-dev/app/static
|
||||
python3 -m http.server 8080 --directory .
|
||||
```
|
||||
|
||||
Danach im Browser `http://127.0.0.1:8080` öffnen.
|
||||
|
||||
## Hinweis für Weiterentwicklung
|
||||
|
||||
Dieser Branch ist für lokale Entwicklungsiterationen gedacht. Änderungen hier sollen einzeln reviewt und danach in den passenden Produktiv-Branch übernommen werden.
|
||||
Reference in New Issue
Block a user