Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hubigraph_time_graph.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ def graphSetupPage(){
sensors.each { sensor ->
settings["attributes_${sensor.id}"].each { attribute ->

parent.hubiForm_section(this,"${sensor.displayName} - ${attribute}", 1){
parent.hubiForm_section(this,"${sensor.displayName} - ${attribute}", 1, "", sensor.id){

container = [];

Expand Down
7 changes: 4 additions & 3 deletions hubigraph_time_line.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def deviceSelectionPage() {
if (sensors) {
sensors.each{sensor ->
id = sensor.id;
sensor_attributes = sensor.getSupportedAttributes().collect { it.getName() };
sensor_attributes = sensor.getSupportedAttributes().collect { it.getName() }.unique().sort();
def container = [];
container << parent.hubiForm_sub_section(this, "${sensor.displayName}");
parent.hubiForm_container(this, container, 1);
Expand Down Expand Up @@ -199,7 +199,7 @@ def attributeConfigurationPage() {
def attributes = settings["attributes_${sensor.id}"];
attributes.each { attribute ->
state.count_++;
parent.hubiForm_section(this, "${sensor.displayName} ${attribute}", 1, "directions"){
parent.hubiForm_section(this, "${sensor.displayName} ${attribute}", 1, "directions", sensor.id){
container = [];
container << parent.hubiForm_text_input(this, "Override Device Name<small></i><br>Use %deviceName% for DEVICE and %attributeName% for ATTRIBUTE</i></small>",
"graph_name_override_${sensor.id}_${attribute}",
Expand Down Expand Up @@ -299,7 +299,8 @@ def mainPage() {
}
parent.hubiForm_section(this, "Local Graph URL", 1, "link"){
container = [];
container << parent.hubiForm_text(this, "${state.localEndpointURL}graph/?access_token=${state.endpointSecret}");
container << parent.hubiForm_text(this, "${state.localEndpointURL}graph/?access_token=${state.endpointSecret}",
"${state.localEndpointURL}graph/?access_token=${state.endpointSecret}");

parent.hubiForm_container(this, container, 1);
}
Expand Down
7 changes: 3 additions & 4 deletions hubigraphs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,11 @@ def hubiForm_page_button(child, title, page, width, icon=""){



def hubiForm_section(child, title, pos, icon="", Closure code) {
def hubiForm_section(child, title, pos, icon="", suffix = "", Closure code) {

child.call(){
def id = title.replace(' ', '_').replace('(', '').replace(')','');
def title_ = title.replace("'", "").replace("`", "");

def id = title.replaceAll("\\W", "_") + suffix;
title_ = groovy.xml.XmlUtil.escapeXml(title);
def titleHTML = """
<div class="mdl-layout__header" style="display: block; background:#033673; margin: 0 -16px; width: calc(100% + 32px); position: relative; z-index: ${pos}; overflow: visible;">
<div class="mdl-layout__header-row">
Expand Down