Merge branch 'master' of git://github.com/svenp/volkszaehler.org
Added form to create new entities (thx to paepke) Conflicts: misc/controller/bash/log_i2c_ds1631_ecmd.sh
This commit is contained in:
commit
60900666ee
3 changed files with 30 additions and 16 deletions
|
@ -139,7 +139,7 @@
|
|||
<ul>
|
||||
<li><a href="#entity-subscribe">Kanal abonnieren</a></li>
|
||||
<li><a href="#entity-subscribe-public">öffentliche Kanäle</a></li>
|
||||
<!-- <li><a href="#entity-create">Kanal erstellen</a></li> -->
|
||||
<li><a href="#entity-create">Kanal erstellen</a></li>
|
||||
</ul>
|
||||
<div id="entity-subscribe">
|
||||
<p>Hier können Sie einen existierenden Kanal über seine UUID hinzufügen</p>
|
||||
|
@ -154,12 +154,22 @@
|
|||
<p><label for="cookie">Cookie:</label> </td><td><input class="cookie" type="checkbox" /></p>
|
||||
<input type="button" value="abonnieren" />
|
||||
</div>
|
||||
<!-- <div id="entity-create">
|
||||
<p>Hier können Sie einen neuen Kanal erstellen</p>
|
||||
<p><label for="type">Typ: </label><select id="type" size="1"></select></p>
|
||||
<fieldset id="properties"></fieldset>
|
||||
<input type="button" value="erstellen" />
|
||||
</div> -->
|
||||
<div id="entity-create">
|
||||
<form method="post" target="_blank">
|
||||
<table>
|
||||
<tr><td>Middleware URL:</td><td><input type="text" id="entity-create-middlware" /><p style="font-size: small">Bsp: http://volkszaehler.org/demo/middleware.php</p></td></tr>
|
||||
<tr><td>Typ:</td><td><select name="type" size="1"></select></td></tr>
|
||||
<tr><td>Öffentlich:</td><td><input type="radio" name="public" value="1"> ja<br /><input type="radio" name="public" value="0"> nein</td></tr>
|
||||
<tr><td>Titel:</td><td><input type="text" name="title" value="Kühlschrank" /></td></tr>
|
||||
<tr><td>Auflösung:</td><td><input type="text" name="resolution" value="1000" /></td></tr>
|
||||
<tr><td>Kosten:<br /><p style="font-size: small">pro Wh</p></td><td><input type="text" name="cost" value="0.00025" /> €</td></tr>
|
||||
<tr><td>Beschreibung:</td><td><input type="text" name="description" value="Swissnox 1-phasig" /></td></tr>
|
||||
</table>
|
||||
<p><input type="submit" value="erstellen" /></p>
|
||||
<p>Es wird ein neuer Kanal erstellt. Die Antwort des Backends enthällt dann die UUID.<br />
|
||||
Diese muss dann im Controller angegeben werden (z.B. AVR Net-IO).</p>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -36,7 +36,7 @@ vz.wui.init = function() {
|
|||
$('#entity-list').show(); // open entity list by default
|
||||
|
||||
// buttons
|
||||
$('button, input[type=button],[type=image]').button();
|
||||
$('button, input[type=button],[type=image],[type=submit]').button();
|
||||
$('button[name=options-save]').click(vz.options.save);
|
||||
$('#permalink').click(function() {
|
||||
var uuids = [];
|
||||
|
@ -130,17 +130,20 @@ vz.wui.dialogs.init = function() {
|
|||
|
||||
// show available entity types
|
||||
vz.capabilities.definitions.entities.each(function(index, def) {
|
||||
$('#entity-create select#type').append(
|
||||
$('<option>').html(def.translation[vz.options.language]).data('definition', def)
|
||||
$('#entity-create select[name=type]').append(
|
||||
$('<option>').html(def.translation[vz.options.language]).data('definition', def).val(def.name)
|
||||
);
|
||||
});
|
||||
$('#entity-create option[value=power]').attr('selected', 'selected');
|
||||
|
||||
/*$('#entity-create select#type option:selected').data('definition').required.each(function(index, property) {
|
||||
/*$('#entity-create select[name=type] option:selected').data('definition').required.each(function(index, property) {
|
||||
$('#entity-create #properties').append(
|
||||
vz.capabilities.definitions.get('properties', property).getDOM()
|
||||
)
|
||||
});*/
|
||||
|
||||
$('#entity-create-middlware').val(vz.options.middlewareUrl);
|
||||
|
||||
// actions
|
||||
$('#entity-subscribe input[type=button]').click(function() {
|
||||
try {
|
||||
|
@ -191,9 +194,10 @@ vz.wui.dialogs.init = function() {
|
|||
}
|
||||
});
|
||||
|
||||
/*$('#entity-create input[type=button]').click(function() {
|
||||
|
||||
});*/
|
||||
$('#entity-create form').submit(function() {
|
||||
$(this).attr('action', $('#entity-create-middlware').val() + '/channel.json');
|
||||
$('#entity-add').dialog('close');
|
||||
});
|
||||
|
||||
// update event handler
|
||||
$('button[name=entity-add]').unbind('click', this.init);
|
||||
|
|
|
@ -39,7 +39,7 @@ URL="http://volkszaehler.org/demo/middleware.php"
|
|||
# sensor settings
|
||||
# Sensor 0x48 (72) ist bei ds1631 sensorid = 0 warum auch immer?
|
||||
# folglich ist sensor 0x4d (75) sensorid = 3 usw.
|
||||
SENSORID=<put your onewire sensors hw id here>
|
||||
SENSORID=<put your i2c sensors hw id here>
|
||||
|
||||
# ip address of the controller board running ethersex
|
||||
ESEXIP=<put the ip address of your controller board here>
|
||||
|
@ -55,7 +55,7 @@ NC=/bin/nc
|
|||
|
||||
# ========= do not change anything below this line ==============
|
||||
|
||||
echo "ds1631 convert $SENSORID 1" |$NC $ESEXIP 2701 -q 1 2>/dev/null | grep -qie OK || exit 1
|
||||
echo "ds1631 convert $SENSORID 1" |$NC $ESEXIP 2701 -q 1 2>/dev/null | grep -qe OK || exit 1
|
||||
TEMPERATURE=`echo ds1631 temp $SENSORID | $NC $ESEXIP 2701 -q 1 2>/dev/null | sed -e 's/Temperatur: //'`
|
||||
|
||||
$CURL --data "" "$URL/data/$UUID.json?value=$TEMPERATURE"
|
||||
|
|
Loading…
Add table
Reference in a new issue