Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Minor

Christian Bauercc72ce2b3665
diff --git a/manager/client/src/main/java/org/openremote/manager/client/assets/attributes/AttributesBrowser.java b/manager/client/src/main/java/org/openremote/manager/client/assets/attributes/AttributesBrowser.java
index 94742f16d..7b65ee5bd 100644
--- a/manager/client/src/main/java/org/openremote/manager/client/assets/attributes/AttributesBrowser.java
+++ b/manager/client/src/main/java/org/openremote/manager/client/assets/attributes/AttributesBrowser.java
@@ -217,7 +217,7 @@ public abstract class AttributesBrowser
editor.asWidget().addStyleName(environment.getWidgetStyle().HighlightBackground());
Browser.getWindow().setTimeout(() -> {
editor.asWidget().removeStyleName(environment.getWidgetStyle().HighlightBackground());
- }, 1000);
+ }, 250);
}
protected Widget createDatapointBrowser(AssetAttribute attribute) {
diff --git a/manager/client/src/main/java/org/openremote/manager/client/assets/attributes/AttributesEditor.java b/manager/client/src/main/java/org/openremote/manager/client/assets/attributes/AttributesEditor.java
index d399aaf78..41902afdf 100644
--- a/manager/client/src/main/java/org/openremote/manager/client/assets/attributes/AttributesEditor.java
+++ b/manager/client/src/main/java/org/openremote/manager/client/assets/attributes/AttributesEditor.java
@@ -35,13 +35,9 @@ import org.openremote.model.asset.AssetAttribute;
import org.openremote.model.asset.AssetAttributes;
import org.openremote.model.asset.AssetMeta;
-import java.util.logging.Logger;
-
public class AttributesEditor
extends AttributesView<AttributesEditor.Container, AttributesEditor.Style, AssetAttributes, AssetAttribute> {
- private static final Logger LOG = Logger.getLogger(AttributesEditor.class.getName());
-
protected final RegExp attributeNameRegExp = RegExp.compile(Attribute.ATTRIBUTE_NAME_PATTERN);
public interface Container extends AttributesView.Container<AttributesEditor.Style> {
@@ -105,6 +101,11 @@ public class AttributesEditor
formGroup.addExtension(new MetaEditor(attribute));
}
+ @Override
+ protected boolean isShowTimestamp(AssetAttribute attribute) {
+ return false;
+ }
+
/* ####################################################################### */
protected FormGroup createNewAttributeEditor() {
diff --git a/manager/client/src/main/java/org/openremote/manager/client/assets/attributes/AttributesView.java b/manager/client/src/main/java/org/openremote/manager/client/assets/attributes/AttributesView.java
index e05cc9d45..7c13602ec 100644
--- a/manager/client/src/main/java/org/openremote/manager/client/assets/attributes/AttributesView.java
+++ b/manager/client/src/main/java/org/openremote/manager/client/assets/attributes/AttributesView.java
@@ -262,8 +262,10 @@ public abstract class AttributesView<
panel.setStyleName("flex layout horizontal center");
FormInputText inputText = createStringEditorWidget(style, currentValue, defaultValue, updateConsumer);
panel.add(inputText);
- TimestampLabel timestampLabel = new TimestampLabel(attribute.getValueTimestamp());
- panel.add(timestampLabel);
+ if (isShowTimestamp(attribute)) {
+ TimestampLabel timestampLabel = new TimestampLabel(attribute.getValueTimestamp());
+ panel.add(timestampLabel);
+ }
return () -> panel;
}
@@ -312,8 +314,10 @@ public abstract class AttributesView<
panel.setStyleName("flex layout horizontal center");
FormInputNumber inputNumber = createIntegerEditorWidget(style, currentValue, defaultValue, updateConsumer, errorConsumer);
panel.add(inputNumber);
- TimestampLabel timestampLabel = new TimestampLabel(attribute.getValueTimestamp());
- panel.add(timestampLabel);
+ if (isShowTimestamp(attribute)) {
+ TimestampLabel timestampLabel = new TimestampLabel(attribute.getValueTimestamp());
+ panel.add(timestampLabel);
+ }
return () -> panel;
}
@@ -367,8 +371,10 @@ public abstract class AttributesView<
panel.setStyleName("flex layout horizontal center");
FormInputText inputText = createDecimalEditorWidget(style, currentValue, defaultValue, updateConsumer, errorConsumer);
panel.add(inputText);
- TimestampLabel timestampLabel = new TimestampLabel(attribute.getValueTimestamp());
- panel.add(timestampLabel);
+ if (isShowTimestamp(attribute)) {
+ TimestampLabel timestampLabel = new TimestampLabel(attribute.getValueTimestamp());
+ panel.add(timestampLabel);
+ }
return () -> panel;
}
@@ -416,8 +422,10 @@ public abstract class AttributesView<
panel.setStyleName("flex layout horizontal center");
FormCheckBox checkBox = createBooleanEditorWidget(style, currentValue, defaultValue, updateConsumer);
panel.add(checkBox);
- TimestampLabel timestampLabel = new TimestampLabel(attribute.getValueTimestamp());
- panel.add(timestampLabel);
+ if (isShowTimestamp(attribute)) {
+ TimestampLabel timestampLabel = new TimestampLabel(attribute.getValueTimestamp());
+ panel.add(timestampLabel);
+ }
return () -> panel;
}
@@ -464,7 +472,11 @@ public abstract class AttributesView<
}
protected boolean isDefaultReadOnly(A attribute) {
- return false;
+ return attribute.isReadOnly();
+ }
+
+ protected boolean isShowTimestamp(A attribute) {
+ return true;
}
protected void removeAttribute(A attribute) {