Compare commits
4 Commits
feature/co
...
master
Author | SHA1 | Date |
---|---|---|
Haitem | 599ef47cd9 | |
JonatanRek | c68c051777 | |
JonatanRek | c381261a01 | |
JonatanRek | e39efd9176 |
|
@ -9,3 +9,5 @@ app/logs/*.log
|
||||||
.vscode/
|
.vscode/
|
||||||
.vscode/sftp.json
|
.vscode/sftp.json
|
||||||
app/updater/*.bin
|
app/updater/*.bin
|
||||||
|
logs/*
|
||||||
|
|
||||||
|
|
11
api.php
11
api.php
|
@ -19,15 +19,17 @@ $files = array_diff($files, array(
|
||||||
'Ajax.php',
|
'Ajax.php',
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach($files as $file) {
|
foreach($files as $file) {
|
||||||
include './app/class/'. $file;
|
include './app/class/'. $file;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Allow acces only wia Curl, Ajax ETC
|
//Allow acces only wia Curl, Ajax ETC
|
||||||
$restAcess = 'XMLHttpRequest' == ( $_SERVER['HTTP_X_REQUESTED_WITH'] ?? '' );
|
/*$restAcess = 'XMLHttpRequest' == ( $_SERVER['HTTP_X_REQUESTED_WITH'] ?? '' );
|
||||||
if (!$restAcess){
|
if (!$restAcess){
|
||||||
header('Location: ./');
|
header('Location: ./');
|
||||||
}
|
}*/
|
||||||
|
|
||||||
//Log
|
//Log
|
||||||
$logManager = new LogManager();
|
$logManager = new LogManager();
|
||||||
|
@ -215,6 +217,11 @@ if ($deviceLogs != null && $deviceLogs != ""){
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
if (count($values) == 1){
|
||||||
|
unset($values["wifi"]);
|
||||||
|
}
|
||||||
// Subdevices first data!
|
// Subdevices first data!
|
||||||
if ($values != null && $values != "") {
|
if ($values != null && $values != "") {
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ class Notification
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->jsonPayload["data"]["notification"]["title"] = $title;
|
$this->jsonPayload["data"]["notification"]["title"] = $title;
|
||||||
$this->jsonPayload["data"]["notification"]["body"] = $body;
|
$this->jsonPayload["data"]["notification"]["body"] = date("h:i") . " - " . $body;
|
||||||
$this->jsonPayload["data"]["notification"]["icon"] = $icon;
|
$this->jsonPayload["data"]["notification"]["icon"] = $icon;
|
||||||
$this->jsonPayload["data"]["notification"]["click_action"] = $action;
|
$this->jsonPayload["data"]["notification"]["click_action"] = $action;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,11 @@ if (isset($_POST) && !empty($_POST)){
|
||||||
UserManager::createUser($userName, $password);
|
UserManager::createUser($userName, $password);
|
||||||
header('Location: ' . BASEDIR . 'setting');
|
header('Location: ' . BASEDIR . 'setting');
|
||||||
die();
|
die();
|
||||||
|
} else if (isset($_POST['submitCreateRoom']) && $_POST['submitCreateRoom'] != "") {
|
||||||
|
$roomName = $_POST['roomName'];
|
||||||
|
RoomManager::create($roomName);
|
||||||
|
header('Location: ' . BASEDIR . 'setting');
|
||||||
|
die();
|
||||||
} else if (isset($_POST['submitEnableOta']) && $_POST['submitEnableOta'] != "") {
|
} else if (isset($_POST['submitEnableOta']) && $_POST['submitEnableOta'] != "") {
|
||||||
echo $otaCode = $_POST['otaCode'];
|
echo $otaCode = $_POST['otaCode'];
|
||||||
echo $otaSecret = $_POST['otaSecret'];
|
echo $otaSecret = $_POST['otaSecret'];
|
||||||
|
|
|
@ -91,7 +91,7 @@
|
||||||
url: 'ajax',
|
url: 'ajax',
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
//TODO: GET Attribute from ID
|
//TODO: GET Attribute from ID
|
||||||
data: { subDevice_id : '46', action : 'set', value: this.value},
|
data: { subDevice_id : '13', action : 'set', value: this.value},
|
||||||
success: function(msg){
|
success: function(msg){
|
||||||
console.log("message");
|
console.log("message");
|
||||||
console.log(msg);
|
console.log(msg);
|
||||||
|
|
|
@ -183,7 +183,7 @@
|
||||||
<input type="text" class="input" name="roomName" value="">
|
<input type="text" class="input" name="roomName" value="">
|
||||||
</div>
|
</div>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<input type="submit" name="submitCreateUser" class="button" value="<?php $LANGMNG->echo('b_create') ?>">
|
<input type="submit" name="submitCreateRoom" class="button" value="<?php $LANGMNG->echo('b_create') ?>">
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue