Device network setting part 1

This commit is contained in:
JonatanRek 2019-11-27 19:48:59 +01:00
parent 0045d00abc
commit e0ee40cb0d

View File

@ -22,11 +22,11 @@
</div> </div>
<div class="label"><?php $LANGMNG->echo('l_permission'); ?></div> <div class="label"><?php $LANGMNG->echo('l_permission'); ?></div>
<div class="row"> <div class="row">
<div class="col-6"> <div class="col-6">
<div class="label"> - <?php $LANGMNG->echo('l_owner'); ?></div> <div class="label"> - <?php $LANGMNG->echo('l_owner'); ?></div>
</div> </div>
<div class="col-6"> <div class="col-6">
<?php <?php
$permissions = $DEVICE['permission']; $permissions = $DEVICE['permission'];
@ -40,7 +40,7 @@
<input type="radio" name="permissionOwner" value=1 <?php ECHO ($permissions[0] == 1 ? 'checked' : ''); ?>/><?php $LANGMNG->echo('l_read'); ?> <input type="radio" name="permissionOwner" value=1 <?php ECHO ($permissions[0] == 1 ? 'checked' : ''); ?>/><?php $LANGMNG->echo('l_read'); ?>
<input type="radio" name="permissionOwner" value=2 <?php ECHO ($permissions[0] == 2 ? 'checked' : ''); ?>/><?php $LANGMNG->echo('l_use'); ?> <input type="radio" name="permissionOwner" value=2 <?php ECHO ($permissions[0] == 2 ? 'checked' : ''); ?>/><?php $LANGMNG->echo('l_use'); ?>
<input type="radio" name="permissionOwner" value=3 <?php ECHO ($permissions[0] == 3 ? 'checked' : ''); ?>/><?php $LANGMNG->echo('l_edit'); ?> <input type="radio" name="permissionOwner" value=3 <?php ECHO ($permissions[0] == 3 ? 'checked' : ''); ?>/><?php $LANGMNG->echo('l_edit'); ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -62,15 +62,22 @@
<div class="label">Token:</div> <div class="label">Token:</div>
<input class="input" type="text" name="deviceToken" value="<?php echo $DEVICE['token']; ?>" disabled> <input class="input" type="text" name="deviceToken" value="<?php echo $DEVICE['token']; ?>" disabled>
</div> </div>
<?php //TODO: firmware tipe send to api?> <h4 class="mb-4"><?php $LANGMNG->echo('t_networkSetting'); ?></h4>
<div class="field"> <div class="field">
<div class="label">Type:</div> <div class="label">Type:</div>
<input class="input" type="text" name="deviceToken" value="<?php echo $DEVICE['type']; ?>" disabled> <input class="input" type="text" name="deviceToken" value="<?php echo $DEVICE['type']; ?>" disabled>
</div> </div>
<?php //TODO: add Static Ip Functionality?>
<div class="field"> <div class="field">
<div class="label">IP:</div> <div class="label">IP:</div>
<input class="input" type="text" name="deviceToken" value="<?php echo $DEVICE['ip']; ?>" disabled> <input class="input" type="text" name="deviceToken" value="<?php echo $DEVICE['ip']; ?>" minlength="7" maxlength="15" size="15" pattern="^((\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$" disabled>
</div>
<div class="field">
<div class="label">Subnet:</div>
<input class="input" type="text" name="deviceToken" value="<?php echo $DEVICE['subnet']; ?>" minlength="7" maxlength="15" size="15" pattern="^((\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$" disabled>
</div>
<div class="field">
<div class="label">Gateway:</div>
<input class="input" type="text" name="deviceToken" value="<?php echo $DEVICE['gateway']; ?>" minlength="7" maxlength="15" size="15" pattern="^((\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$" disabled>
</div> </div>
<?php if ($DEVICE['userIsAdmin']) { ?> <?php if ($DEVICE['userIsAdmin']) { ?>
<?php if (!in_array($SUBDEVICE['type'], ['on/off', 'door', 'water'])) { ?> <?php if (!in_array($SUBDEVICE['type'], ['on/off', 'door', 'water'])) { ?>
@ -114,19 +121,19 @@
<div class="device-button col-4 col-sm-3 col-xl-2 square-wrap"> <div class="device-button col-4 col-sm-3 col-xl-2 square-wrap">
<div class="square"> <div class="square">
<div class="square-content"> <div class="square-content">
<div class="row no-gutters"> <div class="row no-gutters">
<div class="col"> <div class="col">
<h5 unselectable="on" class="fa">&#x<?php echo $DEVICE['icon'] ?></h5> <h5 unselectable="on" class="fa">&#x<?php echo $DEVICE['icon'] ?></h5>
</div>
<div class="col">
<h5 unselectable="on" class="device-button-value text-right" title="<?php echo $subDevice['lastRecort']['time']; ?>"><?php echo $subDevice['lastRecort']['value'] . $subDevice['unit']?></h5>
</div>
</div> </div>
<div class="col"> <div class="row">
<h5 unselectable="on" class="device-button-value text-right" title="<?php echo $subDevice['lastRecort']['time']; ?>"><?php echo $subDevice['lastRecort']['value'] . $subDevice['unit']?></h5> <div class="col button-text" unselectable="on" >
<?php echo $DEVICE['name']; ?>
</div>
</div> </div>
</div>
<div class="row">
<div class="col button-text" unselectable="on" >
<?php echo $DEVICE['name']; ?>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -143,10 +150,10 @@
<div class="device-button col-4 col-sm-3 col-xl-2 square-wrap"> <div class="device-button col-4 col-sm-3 col-xl-2 square-wrap">
<div class="square"> <div class="square">
<div class="square-content"> <div class="square-content">
<?php echo $DEVICE['name']; ?> <?php echo $DEVICE['name']; ?>
</div> </div>
</div> </div>
</div> </div>