From 1a2024d92b98c0871cbd8bf793c77ddb798c0fb2 Mon Sep 17 00:00:00 2001 From: Admin Date: Thu, 25 Feb 2016 16:42:35 -0600 Subject: [PATCH] Tables in all views updated to scrollable/sortable. Refactored controllers for views. debugging logging message return for messages with invalid text for json parsing. --- pom.xml | 2 +- .../HABridge/upnp/UpnpListener.java | 6 +- .../HABridge/upnp/UpnpSettingsResource.java | 4 +- src/main/resources/public/css/main.css | 17 +- .../resources/public/css/scrollable-table.css | 127 ++++++ src/main/resources/public/index.html | 2 + .../public/js/angular-scrollable-table.min.js | 1 + src/main/resources/public/scripts/app.js | 372 +++++++++++------- .../resources/public/views/configuration.html | 20 +- .../resources/public/views/editdevice.html | 1 + src/main/resources/public/views/editor.html | 1 + .../public/views/harmonyactivity.html | 39 +- .../resources/public/views/harmonydevice.html | 42 +- src/main/resources/public/views/logs.html | 36 +- .../resources/public/views/nestactions.html | 35 +- .../resources/public/views/veradevice.html | 59 +-- .../resources/public/views/verascene.html | 49 +-- 17 files changed, 465 insertions(+), 348 deletions(-) create mode 100644 src/main/resources/public/css/scrollable-table.css create mode 100644 src/main/resources/public/js/angular-scrollable-table.min.js diff --git a/pom.xml b/pom.xml index 66ea73c..45f44cd 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.bwssystems.HABridge ha-bridge - 1.4.0c + 1.4.0d jar HA Bridge diff --git a/src/main/java/com/bwssystems/HABridge/upnp/UpnpListener.java b/src/main/java/com/bwssystems/HABridge/upnp/UpnpListener.java index fb4a8a3..19f8dbe 100644 --- a/src/main/java/com/bwssystems/HABridge/upnp/UpnpListener.java +++ b/src/main/java/com/bwssystems/HABridge/upnp/UpnpListener.java @@ -104,7 +104,7 @@ public class UpnpListener { */ protected boolean isSSDPDiscovery(DatagramPacket packet){ //Only respond to discover request for strict upnp form - String packetString = new String(packet.getData()); + String packetString = new String(packet.getData(), 0, packet.getLength()); if(packetString != null && packetString.startsWith("M-SEARCH * HTTP/1.1") && packetString.contains("\"ssdp:discover\"")){ log.debug("isSSDPDiscovery Found message to be an M-SEARCH message."); log.debug("isSSDPDiscovery Got SSDP packet from " + packet.getAddress().getHostAddress() + ":" + packet.getPort() + ", body: " + packetString); @@ -148,9 +148,9 @@ public class UpnpListener { String discoveryResponse = null; discoveryResponse = String.format(discoveryTemplate, responseAddress, httpServerPort); if(traceupnp) - log.info("Traceupnp: sendUpnpResponse: " + discoveryResponse); + log.info("Traceupnp: sendUpnpResponse discovery template with address: " + responseAddress + " and port: " + httpServerPort); else - log.debug("sendUpnpResponse: " + discoveryResponse); + log.debug("sendUpnpResponse discovery template with address: " + responseAddress + " and port: " + httpServerPort); DatagramPacket response = new DatagramPacket(discoveryResponse.getBytes(), discoveryResponse.length(), requester, sourcePort); socket.send(response); } diff --git a/src/main/java/com/bwssystems/HABridge/upnp/UpnpSettingsResource.java b/src/main/java/com/bwssystems/HABridge/upnp/UpnpSettingsResource.java index e437b9c..3bcb423 100644 --- a/src/main/java/com/bwssystems/HABridge/upnp/UpnpSettingsResource.java +++ b/src/main/java/com/bwssystems/HABridge/upnp/UpnpSettingsResource.java @@ -54,9 +54,9 @@ public class UpnpSettingsResource { String filledTemplate = null; filledTemplate = String.format(hueTemplate, theSettings.getUpnpConfigAddress(), portNumber, theSettings.getUpnpConfigAddress()); if(theSettings.isTraceupnp()) - log.info("Traceupnp: upnp device settings response: " + filledTemplate); + log.info("Traceupnp: upnp device settings template filled with address: " + theSettings.getUpnpConfigAddress() + " and port: " + portNumber); else - log.debug("upnp device settings response: " + filledTemplate); + log.debug("Traceupnp: upnp device settings template filled with address: " + theSettings.getUpnpConfigAddress() + " and port: " + portNumber); // response.header("Cache-Control", "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"); // response.header("Pragma", "no-cache"); // response.header("Expires", "Mon, 1 Aug 2011 09:00:00 GMT"); diff --git a/src/main/resources/public/css/main.css b/src/main/resources/public/css/main.css index 5c1ccad..4f6a5dc 100644 --- a/src/main/resources/public/css/main.css +++ b/src/main/resources/public/css/main.css @@ -8,19 +8,4 @@ body { } .sortorder.reverse:after { content: '\25bc'; - } -.table-fixed thead { - width: 97%; -} -.table-fixed tbody { - height: 500px; - overflow-y: auto; - width: 100%; -} -.table-fixed thead, .table-fixed tbody, .table-fixed tr, .table-fixed td, .table-fixed th { - display: block; -} -.table-fixed tbody td, .table-fixed thead > tr> th { - float: left; - border-bottom-width: 0; -} \ No newline at end of file + } \ No newline at end of file diff --git a/src/main/resources/public/css/scrollable-table.css b/src/main/resources/public/css/scrollable-table.css new file mode 100644 index 0000000..b99b843 --- /dev/null +++ b/src/main/resources/public/css/scrollable-table.css @@ -0,0 +1,127 @@ +.scrollableContainer { + height: 800px; + position: relative; + padding-top: 35px; + overflow: hidden; +} +.scrollableContainer .headerSpacer { + border: 1px solid #d5d5d5; + border-bottom-color: #bbb; + position: absolute; + height: 36px; + top: 0; + right: 0; + left: 0; +} +.scrollableContainer th .orderWrapper { + position: absolute; + top: 0; + right: 2px; + cursor: pointer; +} +.scrollableContainer th .orderWrapper .order { + font-size: 8pt; + color: #BDBDBD; +} +.scrollableContainer th .orderWrapper .active { + color: #464646; +} + +.scrollArea { + height: 100%; + overflow-x: auto; + overflow-y: auto; + border: 1px solid #d5d5d5; + /* the implementation of this is still quite buggy; specifically, it doesn't like the + absolutely positioned headers within + -webkit-overflow-scrolling: touch; */ +} +.scrollArea table { + overflow-x: hidden; + overflow-y: auto; + margin-bottom: 0; + width: 100%; + border: none; + /*border-collapse: separate;*/ +} +.scrollArea table th { + padding: 0 !important; + border: none !important; + min-width: 60px; +} +.scrollArea table .th-inner { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + position: absolute; + top: 0; + height: 36px; + line-height: 36px; +} + +.scrollArea table th .box { + padding: 0 8px; + padding-right: 11px; /* order icon width*/ + border-left: 1px solid #ddd; +} + +/* to hack fix firefox border issue */ +@-moz-document url-prefix() { + .scrollArea table th .box{ + border-right: 1px solid #ddd; + border-left: none; + } +} + +.scrollArea table .th-inner .ng-scope { + display: block; + overflow: hidden; + text-overflow: ellipsis; +} +.scrollArea table tr th:first-child th .box { + border-left: none; +} +.scrollArea table .th-inner.condensed { + padding: 0 3px; +} +.scrollArea table tbody tr td:first-child { + border-left: none; +} +.scrollArea table tbody tr td:last-child { + border-right: none; +} +.scrollArea table tbody tr:first-child td { + border-top: none; +} +.scrollArea table tbody tr:last-child td { + border-bottom: 2px solid #ddd; +} +.scrollArea table tbody tr td { + border-bottom: 1px solid #ddd; + overflow: hidden; + text-overflow: ellipsis; +} + +.scrollableContainer .scaler { + position: absolute; + top: 0px; + width: 2px; + height: 100%; + background-color: #CFCFCF; +} + +.scrollableContainer th .resize-rod { + position: absolute; + top: 0; + right: 0; + cursor: col-resize; + width: 4px; + height: 100%; +} + +.scrollable-resizing .scrollableContainer { + cursor: col-resize; + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; +} \ No newline at end of file diff --git a/src/main/resources/public/index.html b/src/main/resources/public/index.html index f51be3f..ec28645 100644 --- a/src/main/resources/public/index.html +++ b/src/main/resources/public/index.html @@ -12,6 +12,7 @@ +