FTP to GIT sync
This commit is contained in:
parent
1ea7e600c2
commit
aa8235c1bf
@ -3,11 +3,11 @@ class DeviceManager{
|
||||
public static $devices;
|
||||
|
||||
function getAllDevices () {
|
||||
return Db::loadAll ("SELECT * FROM devices");
|
||||
return Db::loadAll ("SELECT * FROM devices WHERE approved != ?", Array(2));
|
||||
}
|
||||
|
||||
function getAllDevicesInRoom ($roomId = "") {
|
||||
return Db::loadAll ("SELECT * FROM devices WHERE room_id = ?", Array($roomId));
|
||||
return Db::loadAll ("SELECT * FROM devices WHERE room_id = ? AND approved != ?", Array($roomId, 2));
|
||||
}
|
||||
|
||||
function getOtherDevices(){
|
||||
|
@ -70,5 +70,11 @@ class RecordManager{
|
||||
Db::command ('DELETE FROM records WHERE time < ADDDATE(NOW(), INTERVAL -? DAY);', array($day));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//TODO: zkontrolovat jestli neco nezbilo po smazaní
|
||||
public static function cleanSubdeviceRecords ($subDeviceId) {
|
||||
Db::command ('DELETE FROM records WHERE subdevice_id = ?);', array($subDeviceId));
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -52,4 +52,10 @@ class SubDeviceManager
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
public function remove($subDeviceId)
|
||||
{
|
||||
RecordManager::cleanSubdeviceRecords($subDeviceId);
|
||||
return Db::loadAll("DELETE FROM subdevices WHERE subdevice_id = ?", array($subDeviceId));
|
||||
}
|
||||
}
|
||||
|
@ -2953,4 +2953,19 @@ h6 {
|
||||
.is-inactive {
|
||||
opacity: .4;
|
||||
}
|
||||
|
||||
.noselect {
|
||||
-webkit-touch-callout: none; /* iOS Safari */
|
||||
-webkit-user-select: none; /* Safari */
|
||||
-khtml-user-select: none; /* Konqueror HTML */
|
||||
-moz-user-select: none; /* Firefox */
|
||||
-ms-user-select: none; /* Internet Explorer/Edge */
|
||||
user-select: none; /* Non-prefixed version, currently
|
||||
supported by Chrome and Opera */
|
||||
-moz-user-select: none; /* Firefox */
|
||||
-ms-user-select: none; /* Internet Explorer */
|
||||
-khtml-user-select: none; /* KHTML browsers (e.g. Konqueror) */
|
||||
-webkit-user-select: none; /* Chrome, Safari, and Opera */
|
||||
-webkit-touch-callout: none; /* Disable Android and iOS callouts*/
|
||||
}
|
||||
/*# sourceMappingURL=main.css.map */
|
@ -30,8 +30,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9 main-body">
|
||||
<a href="#modal" class="button is-primary m-1">Add Device</a>
|
||||
<a id="remove" class="button m-1"><i class="fa fa-trash" aria-hidden="true"></i></a>
|
||||
<a onClick="$('#modal').removeClass('modal-container-hiden').show();" class="button is-primary m-1">Add Device</a>
|
||||
<div class="row no-gutters">
|
||||
<?php foreach ($DASHBOARD as $dashboardItemId => $dashboardItemData) {
|
||||
$partialDeviceButton = new Partial('dashboardButton');
|
||||
@ -45,7 +44,9 @@
|
||||
|
||||
<div class="modal-container modal-container-hiden" id="modal">
|
||||
<div class="modal">
|
||||
<a href=""><i class="fa fa-times close"></i></a>
|
||||
<div class="close">
|
||||
<i class="fa fa-times"></i>
|
||||
</div>
|
||||
<h4 class="mb-4">Modal bitch</h4>
|
||||
<form method="post" action="controls/dashboard.php">
|
||||
<div class="field px-2">
|
||||
|
54
templates/part/automationButton.phtml
Normal file
54
templates/part/automationButton.phtml
Normal file
@ -0,0 +1,54 @@
|
||||
<div class="col-12 col-md-6 col-xl-4 square-wrap">
|
||||
<div class="rectangle-2">
|
||||
<div class="square-content double <?php echo ($AUTOMATIONDATA['active'] == 0 ? 'paused' : ''); ?>" id="automation-<?php echo $AUTOMATIONID; ?>">
|
||||
<div class="row">
|
||||
<div class="col-1">
|
||||
<h5 class="fa">
|
||||
<?php
|
||||
//echo $AUTOMATIONDATA['ifSomething'];
|
||||
switch ($AUTOMATIONDATA['ifSomething']) {
|
||||
case 'sunSet':
|
||||
echo'';
|
||||
break;
|
||||
|
||||
case 'sunRise':
|
||||
echo' ';
|
||||
break;
|
||||
|
||||
case 'inHome':
|
||||
echo'';
|
||||
break;
|
||||
|
||||
case 'outHome':
|
||||
echo'';
|
||||
break;
|
||||
|
||||
case 'outDevice':
|
||||
echo'';
|
||||
break;
|
||||
|
||||
default:
|
||||
echo'';
|
||||
break;
|
||||
}
|
||||
?>
|
||||
</h5>
|
||||
</div>
|
||||
<div class="col">
|
||||
<h5 class="text-right break-all">
|
||||
<?php
|
||||
if (!in_array($AUTOMATIONDATA['ifSomething'], ["sunRise", "sunSet"])) {
|
||||
echo $AUTOMATIONDATA['ifSomething'];
|
||||
}
|
||||
?>
|
||||
</h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<?php echo implode(', ',$AUTOMATIONDATA['onDays']);?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -1,8 +1,7 @@
|
||||
<div class="col-4 col-sm-3 col-xl-2 square-wrap">
|
||||
<div class="square">
|
||||
<div class="square-content" id="device-<?php echo $DASHBOARDITEMDATA['masterId'] ?>" onClick="ajaxPost('./ajax.php',{subDevice_id:'<?php echo $DASHBOARDITEMDATA['id']; ?>'}, this);">
|
||||
<div class="square-content" id="device-<?php echo $DASHBOARDITEMDATA['masterId'] ?>" onClick="ajaxPost('ajax',{subDevice_id:'<?php echo $DASHBOARDITEMDATA['id']; ?>'}, this);">
|
||||
<div class="content">
|
||||
<div class="delete">delete</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h5 class="fa">&#x<?php echo $DASHBOARDITEMDATA['icon'] ?></h5>
|
||||
|
22
templates/part/sceneButton.phtml
Normal file
22
templates/part/sceneButton.phtml
Normal file
@ -0,0 +1,22 @@
|
||||
<div class="col-12 col-md-6 col-xl-4 square-wrap noselect">
|
||||
<div class="rectangle-2">
|
||||
<div class="square-content double" id="scene-<?php echo $SCENEID ?>" onClick="ajaxPost('ajax',{scene_id:'<?php echo $SCENEID; ?>'}, this);" >
|
||||
<div class="row">
|
||||
<div class="col-1">
|
||||
<h5 class="fa noselect">
|
||||
&#x<?php echo $SCENEDATA['icon']; ?>
|
||||
</h5>
|
||||
</div>
|
||||
<div class="col">
|
||||
<h5 class="text-right break-all noselect">
|
||||
<?php echo $SCENEDATA['name']; ?>
|
||||
</h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -30,40 +30,23 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9 main-body">
|
||||
<a class="button is-primary m-2" onClick="$('#modal').removeClass('modal-container-hiden').show();"><?php echo $LANG['t_createScene'];?></a>
|
||||
<a class="button is-primary m-1" onClick="$('#modal').removeClass('modal-container-hiden').show();"><?php echo $LANG['t_createScene'];?></a>
|
||||
<div class="row no-gutters">
|
||||
<?php foreach ($SCENES as $sceneId => $sceneData) { ?>
|
||||
<div class="col-12 col-md-6 col-xl-4 square-wrap">
|
||||
<div class="rectangle-2">
|
||||
<div class="square-content double" id="scene-<?php echo $sceneId ?>" onClick="ajaxPost('ajax',{scene_id:'<?php echo $sceneId; ?>'}, this);" >
|
||||
<div class="row">
|
||||
<div class="col-1">
|
||||
<h5 class="fa">
|
||||
&#x<?php echo $sceneData['icon']; ?>
|
||||
</h5>
|
||||
</div>
|
||||
<div class="col">
|
||||
<h5 class="text-right break-all">
|
||||
<?php echo $sceneData['name']; ?>
|
||||
</h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php foreach ($SCENES as $sceneId => $sceneData) {
|
||||
//BUTTON
|
||||
$partialScenButton = new Partial('sceneButton');
|
||||
$partialScenButton->prepare('lang', $LANG);
|
||||
$partialScenButton->prepare('sceneId', $sceneId);
|
||||
$partialScenButton->prepare('sceneData', $sceneData);
|
||||
|
||||
$partialScenButton->render();
|
||||
|
||||
<?php
|
||||
// Edit
|
||||
$partialSceneEdit = new Partial('sceneEdit');
|
||||
$partialSceneEdit->prepare('lang',$LANG);
|
||||
$partialSceneEdit->prepare('sceneId',$sceneId);
|
||||
$partialSceneEdit->prepare('scene',$sceneData);
|
||||
|
||||
|
||||
$partialSceneEdit->render();
|
||||
?>
|
||||
<?php } ?>
|
||||
@ -77,11 +60,13 @@
|
||||
$partial->prepare('setStateFormDevices',$SETSTATEFORMDEVICES );
|
||||
$partial->prepare('sceneIcon',$SCENEICON );
|
||||
$partial->prepare('SceneName',$SCENENAME );
|
||||
|
||||
$partial->render();
|
||||
} else {
|
||||
$partial = new Partial('sceneCreate');
|
||||
$partial->prepare('lang',$LANG);
|
||||
$partial->prepare('subDevices',$SUBDEVICES);
|
||||
|
||||
$partial->render();
|
||||
}
|
||||
$partial = new Partial('footer');
|
||||
|
@ -27,9 +27,6 @@
|
||||
<div class="nav-item">
|
||||
<a href="scene"><i class="fa fa-terminal" aria-hidden="true"></i><span><?php echo $LANG['m_scenes']?></span></a>
|
||||
</div>
|
||||
<div class="nav-item">
|
||||
<a href="rooms"><i class="fa fa-terminal" aria-hidden="true"></i><span>ROOMS</span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9 main-body">
|
||||
@ -53,8 +50,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-sm-9 mx-auto mt-4">
|
||||
<div class="label">Testovavcí Nastavení</div>
|
||||
<div class="field">
|
||||
<button id="enable-features" class="button">Enable Alpha Feature</button>
|
||||
<a href="rooms" class="button">ROOMS</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -93,10 +93,7 @@ class Home extends Template
|
||||
}
|
||||
|
||||
$subDevices[$subDeviceData['subdevice_id']] = [
|
||||
'data' => $data,
|
||||
'events'=> $events,
|
||||
'labels' => $labels,
|
||||
'range' => RANGES[$subDevice['type']],
|
||||
'type' => $subDeviceData['type'],
|
||||
'unit' => $subDeviceData['unit'],
|
||||
'comError' => $connectionError,
|
||||
@ -125,6 +122,7 @@ class Home extends Template
|
||||
'room' => $deviceData['room_id'],
|
||||
'token' => $deviceData['token'],
|
||||
'sleepTime' => $deviceData['sleep_time'],
|
||||
'approved' => $deviceData['approved'],
|
||||
'permission' => $permissionArray,
|
||||
'owner' => $deviceData['owner'],
|
||||
'userIsAdmin' => $userIsDeviceAdmin,
|
||||
|
@ -27,7 +27,7 @@ class Scene extends Template
|
||||
$scenes[$sceneData['scene_id']] = [
|
||||
"name" => $sceneData['name'],
|
||||
"icon" => $sceneData['icon'],
|
||||
"do_something" => $doSomething,
|
||||
"doSomething" => $doSomething,
|
||||
|
||||
];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user