|
|
@ -12,7 +12,7 @@ class Database { |
|
|
|
user: 'ledcontroller', |
|
|
|
database: 'led' |
|
|
|
}).then(res => { |
|
|
|
db = res; |
|
|
|
db = res; |
|
|
|
resolve() |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
@ -94,6 +94,20 @@ class Database { |
|
|
|
//return db.execute("DELETE FROM ")
|
|
|
|
} |
|
|
|
|
|
|
|
getBoards(){ |
|
|
|
return db.execute("SELECT PK_board as boardID, address from `led`.`board`") |
|
|
|
.then(res => { |
|
|
|
return res[0] |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
getLampTypes(){ |
|
|
|
return db.execute("SELECT PK_type as typeID, name, channel from `led`.`type`") |
|
|
|
.then(res => { |
|
|
|
return res[0] |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
createLamp(boardID, type, channelMapping, title, description) { |
|
|
|
db.execute("SELECT PK_type FROM led.type where `key` LIKE \""+type+"\"") |
|
|
|