fixed creating new event or sensor from autodetect
This commit is contained in:
parent
88d2b2cebf
commit
52a2cb207f
2 changed files with 6 additions and 2 deletions
|
|
@ -9,6 +9,7 @@ import se.hal.page.HalAlertManager.HalAlert;
|
||||||
import se.hal.struct.ClassConfigurationData;
|
import se.hal.struct.ClassConfigurationData;
|
||||||
import se.hal.struct.Event;
|
import se.hal.struct.Event;
|
||||||
import se.hal.struct.User;
|
import se.hal.struct.User;
|
||||||
|
import zutil.ObjectUtil;
|
||||||
import zutil.db.DBConnection;
|
import zutil.db.DBConnection;
|
||||||
import zutil.io.file.FileUtil;
|
import zutil.io.file.FileUtil;
|
||||||
import zutil.parser.Templator;
|
import zutil.parser.Templator;
|
||||||
|
|
@ -43,8 +44,9 @@ public class EventConfigHttpPage extends HalHttpPage {
|
||||||
|
|
||||||
// Save new input
|
// Save new input
|
||||||
if(request.containsKey("action")){
|
if(request.containsKey("action")){
|
||||||
int id = (request.containsKey("id") ? Integer.parseInt(request.get("id")) : -1);
|
int id = (!ObjectUtil.isEmpty(request.get("id")) ? Integer.parseInt(request.get("id")) : -1);
|
||||||
Event event;
|
Event event;
|
||||||
|
|
||||||
switch(request.get("action")) {
|
switch(request.get("action")) {
|
||||||
// Local events
|
// Local events
|
||||||
case "create_local_event":
|
case "create_local_event":
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import se.hal.page.HalAlertManager.HalAlert;
|
||||||
import se.hal.struct.ClassConfigurationData;
|
import se.hal.struct.ClassConfigurationData;
|
||||||
import se.hal.struct.Sensor;
|
import se.hal.struct.Sensor;
|
||||||
import se.hal.struct.User;
|
import se.hal.struct.User;
|
||||||
|
import zutil.ObjectUtil;
|
||||||
import zutil.db.DBConnection;
|
import zutil.db.DBConnection;
|
||||||
import zutil.io.file.FileUtil;
|
import zutil.io.file.FileUtil;
|
||||||
import zutil.parser.Templator;
|
import zutil.parser.Templator;
|
||||||
|
|
@ -43,9 +44,10 @@ public class SensorConfigHttpPage extends HalHttpPage {
|
||||||
|
|
||||||
// Save new input
|
// Save new input
|
||||||
if(request.containsKey("action")){
|
if(request.containsKey("action")){
|
||||||
int id = (request.containsKey("id") ? Integer.parseInt(request.get("id")) : -1);
|
int id = (!ObjectUtil.isEmpty(request.get("id")) ? Integer.parseInt(request.get("id")) : -1);
|
||||||
Sensor sensor;
|
Sensor sensor;
|
||||||
User user;
|
User user;
|
||||||
|
|
||||||
switch(request.get("action")) {
|
switch(request.get("action")) {
|
||||||
// Local Sensors
|
// Local Sensors
|
||||||
case "create_local_sensor":
|
case "create_local_sensor":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue