Remake approved view and add rename input in setting for room name

This commit is contained in:
haitem
2021-03-01 17:38:44 +01:00
parent 5f03295ad3
commit 4ab70a1c2d
4 changed files with 26 additions and 3 deletions

View File

@@ -115,8 +115,12 @@
<input type="hidden" name="deviceId" value="<?php echo (!empty($device['device_id']) ? $device['device_id'] : ""); ?>">
<button class="fa custom-file-input" <?php echo (!empty($device['command']) && $device['command'] == "reset" ? "style=\"color:red;\"" : ""); ?> type="submit" name="deviceCommand" value="reset" title="Reset">&#xf01e;</button>
<button class="fa custom-file-input" <?php echo (!empty($device['command']) && $device['command'] == "config" ? "style=\"color:red;\"" : ""); ?> type="submit" name="deviceCommand" value="config" title="Config">&#xf013;</button>
<button class="fas fa custom-file-input" <?php echo (!empty($device['approved']) && $device['approved'] == 1 ? "style=\"color:Green;\"" : ""); ?> type="submit" name="deviceApproved" value="1" title="Approved">&#xf00c;</button>
<button class="fas fa custom-file-input" <?php echo (!empty($device['approved']) && $device['approved'] == 2 ? "style=\"color:red;\"" : ""); ?> type="submit" name="deviceApproved" value="2" title="Blocked">&#xf00d;</button>
<?php if (isset($device['approved']) && $device['approved'] == 0) : ?>
<button class="fas fa custom-file-input" type="submit" name="deviceApproved" value="1" title="Approved">&#xf00c;</button>
<?php endif; ?>
<?php if (isset($device['approved']) && $device['approved'] < 2) : ?>
<button class="fas fa custom-file-input" type="submit" name="deviceApproved" value="2" title="Blocked">&#xf00d;</button>
<?php endif; ?>
<div style="float: clear;"></div>
</form>
<?php endif; ?>

View File

@@ -177,7 +177,12 @@ $partial = new Partial('head');
<tbody>
<?php foreach ($ROOMS as $key => $room) { ?>
<tr>
<td><?php echo $room['name']; ?></td>
<td>
<form method="post" action="">
<input type="hidden" name="roomId" value="<?php echo (!empty($room['room_id']) ? $room['room_id'] : ""); ?>">
<input class="input" type="text" onchange="this.form.submit();" name="roomName" value="<?php echo (!empty($room['name']) ? $room['name'] : ""); ?>">
</form>
</td>
<td>
<button name="deleteRoom" type="button" class="button is-danger fa">&#xf1f8;</button>
<button name="defaultRoom" type="button" class="button fa" <?php echo ($room['default'] ? 'disabled' : ''); ?>>&#xf140;</button>