AutoAction-Editor: Speichern, Laden und Loeschen
Der Editor las seine Geraete aus homeMesh, schrieb aber nach solarLog in
Tabellen, deren Fremdschluessel auf solarLog.actors/sensors zeigten. Jedes
INSERT lief damit gegen den Fremdschluessel - autoactionsSensors und
autoactionsActors sind deshalb leer geblieben, und die Aktor-Schleife war
ohnehin nie geschrieben worden.
Die Automatiken liegen jetzt in homeMesh neben dem Geraetemodell
(homeMesh_automations.sql). Eine Bedingung verweist mit einem einzigen
Fremdschluessel auf actor_states statt auf Geraet, State-URL und ein
unklares valID; Kommandoparameter stehen zeilenweise statt in vier festen
Spalten "Wert 1" bis "Wert 4". Verknuepft wird ueber group_no: gleiche
Nummer UND, verschiedene ODER, ausgewertet als any(all(gruppe)).
Im Editor ist eine Gruppe ein gerahmter Block mit eigenem "+ Bedingung",
dazwischen steht ODER - die Klammerung ist damit gezeichnet und nicht
vereinbart, und darunter steht derselbe Satz noch einmal in Worten. Die
Uebersicht zeigt ihn in der Spalte "Ausloeser" und ersetzt die bisher fest
verdrahtete Beispielzeile.
Nebenbei behoben: die Operator-Knoepfe schickten ihr innerHTML ("≠",
">") an eine Whitelist, die "!=" erwartete - jede Bedingung "ungleich"
wurde still zu "gleich". Ausgeblendete Wertfelder sendeten ihren Inhalt
trotzdem mit. Beides entfaellt, weil der Editor jetzt JSON aus einem
Modell schickt statt durchnummerierter Formularfelder.
Die vier Endpunkte fillSensorDD, fillActorDD, sensorDetails und
actorDetails entfallen: der Geraetekatalog reist einmal mit dem Editor
mit, statt je Bedingungszeile zwei Anfragen nachzuladen.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+15
-33
@@ -155,43 +155,25 @@
|
||||
</div>
|
||||
<div class="tab-content" id="actions-tabContent">
|
||||
<div class="tab-pane fade <?php if($_GET["floor"] == "OG") echo "active show"; ?>" id="actions-OG" role="tabpanel" aria-labelledby="actions-OG-tab">
|
||||
<table class="table table-hover">
|
||||
<thead><tr><th>Name</th><th>Aktiv</th><th>Auslöser</th><th>Zeitfenster</th><th>Aktion</th><th>Wochentage</th><th></th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td>Kinder zu</td>
|
||||
<td><input class="form-check-input" type="checkbox" value="" id="flexCheckDefault" disabled checked></td>
|
||||
<td>Uhrzeit: 16:30</td>
|
||||
<td>n/a</td>
|
||||
<td>Rollo "Magdalena Tür" schließen<br />Rollo "Magdalena Fenster" schließen</td>
|
||||
<td>
|
||||
<input class="form-check-input" type="checkbox" value="" id="flexCheckDefault" disabled checked /> <label class="form-check-label" for="flexCheckDefault">Mo.</label><br />
|
||||
<input class="form-check-input" type="checkbox" value="" id="flexCheckDefault" disabled checked /> <label class="form-check-label" for="flexCheckDefault">Di.</label><br />
|
||||
<input class="form-check-input" type="checkbox" value="" id="flexCheckDefault" disabled checked /> <label class="form-check-label" for="flexCheckDefault">Mi.</label><br />
|
||||
<input class="form-check-input" type="checkbox" value="" id="flexCheckDefault" disabled checked /> <label class="form-check-label" for="flexCheckDefault">Do.</label><br />
|
||||
<input class="form-check-input" type="checkbox" value="" id="flexCheckDefault" disabled checked /> <label class="form-check-label" for="flexCheckDefault">Fr.</label><br />
|
||||
<input class="form-check-input" type="checkbox" value="" id="flexCheckDefault" disabled checked /> <label class="form-check-label" for="flexCheckDefault">Sa.</label><br />
|
||||
<input class="form-check-input" type="checkbox" value="" id="flexCheckDefault" disabled checked /> <label class="form-check-label" for="flexCheckDefault">So.</label><br />
|
||||
<input class="form-check-input" type="checkbox" value="" id="flexCheckDefault" disabled checked /> <label class="form-check-label" for="flexCheckDefault">Feiertag</label><br />
|
||||
<input class="form-check-input" type="checkbox" value="" id="flexCheckDefault" disabled checked /> <label class="form-check-label" for="flexCheckDefault">Ferien</label><br />
|
||||
</td>
|
||||
<td>
|
||||
<div class="tools">
|
||||
<button type="button" class="btn btn-info btn-sm"><i class="bi bi-pause-fill"></i></button>
|
||||
<button type="button" class="btn btn-warning btn-sm"><i class="bi bi-pencil-square"></i></button>
|
||||
<button type="button" class="btn btn-danger btn-sm"><i class="bi bi-trash3"></i></button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<button type="button" class="btn btn-success" onclick="openAutoActionModal('?action=new&floor=OG')"><i class="bi bi-plus-square"></i></button>
|
||||
<!-- Inhalt kommt aus ajax/AutoAction.php?action=list, gefuellt von
|
||||
refreshAutomations() in js/solar/autoActionFuncs.js -->
|
||||
<div id="actions-OG-list">Wird geladen...</div>
|
||||
<button type="button" class="btn btn-success" title="Neue Automatik"
|
||||
onclick="openAutoActionModal('?action=editor&floor=OG')"><i class="bi bi-plus-square"></i></button>
|
||||
</div>
|
||||
<div class="tab-pane fade <?php if($_GET["floor"] == "EG") echo "active show"; ?>" id="actions-EG" role="tabpanel" aria-labelledby="actions-EG-tab">
|
||||
<button class="btn btn-primary" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasWithBackdrop" aria-controls="offcanvasWithBackdrop">Enable backdrop (default)</button>
|
||||
Mauris tincidunt mi at erat gravida, eget tristique urna bibendum. Mauris pharetra purus ut ligula tempor, et vulputate metus facilisis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Maecenas sollicitudin, nisi a luctus interdum, nisl ligula placerat mi, quis posuere purus ligula eu lectus. Donec nunc tellus, elementum sit amet ultricies at, posuere nec nunc. Nunc euismod pellentesque diam.
|
||||
<!-- Inhalt kommt aus ajax/AutoAction.php?action=list, gefuellt von
|
||||
refreshAutomations() in js/solar/autoActionFuncs.js -->
|
||||
<div id="actions-EG-list">Wird geladen...</div>
|
||||
<button type="button" class="btn btn-success" title="Neue Automatik"
|
||||
onclick="openAutoActionModal('?action=editor&floor=EG')"><i class="bi bi-plus-square"></i></button>
|
||||
</div>
|
||||
<div class="tab-pane fade <?php if($_GET["floor"] == "UG") echo "active show"; ?>" id="actions-UG" role="tabpanel" aria-labelledby="actions-UG-tab">
|
||||
Morbi turpis dolor, vulputate vitae felis non, tincidunt congue mauris. Phasellus volutpat augue id mi placerat mollis. Vivamus faucibus eu massa eget condimentum. Fusce nec hendrerit sem, ac tristique nulla. Integer vestibulum orci odio. Cras nec augue ipsum. Suspendisse ut velit condimentum, mattis urna a, malesuada nunc. Curabitur eleifend facilisis velit finibus tristique. Nam vulputate, eros non luctus efficitur, ipsum odio volutpat massa, sit amet sollicitudin est libero sed ipsum. Nulla lacinia, ex vitae gravida fermentum, lectus ipsum gravida arcu, id fermentum metus arcu vel metus. Curabitur eget sem eu risus tincidunt eleifend ac ornare magna.
|
||||
<!-- Inhalt kommt aus ajax/AutoAction.php?action=list, gefuellt von
|
||||
refreshAutomations() in js/solar/autoActionFuncs.js -->
|
||||
<div id="actions-UG-list">Wird geladen...</div>
|
||||
<button type="button" class="btn btn-success" title="Neue Automatik"
|
||||
onclick="openAutoActionModal('?action=editor&floor=UG')"><i class="bi bi-plus-square"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user