Skip to content

armgit / core

Public Imported from GitHub
0

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

Manager UI work

Christian Bauer25b434c54000
diff --git a/manager/client/src/main/java/org/openremote/manager/client/admin/syslog/AdminSyslogImpl.ui.xml b/manager/client/src/main/java/org/openremote/manager/client/admin/syslog/AdminSyslogImpl.ui.xml
index 1f6749f4d..f8bb01c8e 100644
--- a/manager/client/src/main/java/org/openremote/manager/client/admin/syslog/AdminSyslogImpl.ui.xml
+++ b/manager/client/src/main/java/org/openremote/manager/client/admin/syslog/AdminSyslogImpl.ui.xml
@@ -19,12 +19,11 @@
<g:HTMLPanel styleName="flex layout vertical">
<g:HTMLPanel
- styleName="layout horizontal center end-justified {widgetStyle.SecondaryNavHorizontal}">
+ styleName="flex-none layout horizontal center end-justified {widgetStyle.SecondaryNavHorizontal}">
</g:HTMLPanel>
- <g:HTMLPanel ui:field="mainContent"
- styleName="layout vertical {widgetStyle.MainContent}">
+ <div class="flex-none layout vertical {widgetStyle.MainContent}" style="z-index:1;">
<w:Headline icon="list-alt"
text="{managerMessages.syslog}"/>
@@ -78,14 +77,14 @@
</w:actions>
</w:FormGroup>
- <syslog:SyslogFilter ui:field="syslogFilter"/>
-
</w:Form>
- </g:HTMLPanel>
+ </div>
<syslog:SyslogItems ui:field="syslogItems"/>
+ <syslog:SyslogFilter ui:field="syslogFilter"/>
+
</g:HTMLPanel>
</ui:UiBinder>
\ No newline at end of file
diff --git a/manager/client/src/main/java/org/openremote/manager/client/admin/syslog/SyslogFilter.java b/manager/client/src/main/java/org/openremote/manager/client/admin/syslog/SyslogFilter.java
index 9a12151cf..f639dc2c0 100644
--- a/manager/client/src/main/java/org/openremote/manager/client/admin/syslog/SyslogFilter.java
+++ b/manager/client/src/main/java/org/openremote/manager/client/admin/syslog/SyslogFilter.java
@@ -28,20 +28,27 @@ import org.openremote.model.syslog.SyslogLevel;
import static org.openremote.manager.shared.syslog.SyslogConfig.DEFAULT_LEVEL;
import static org.openremote.manager.shared.syslog.SyslogConfig.DEFAULT_LIMIT;
-public abstract class SyslogFilter extends FormGroup {
+public abstract class SyslogFilter extends FlowPanel {
+ final protected FormGroup formGroup;
final protected FormListBox limitListBox;
final protected FormListBox levelListBox;
final protected FormButton pauseButton;
final protected FormButton continueButton;
public SyslogFilter(ManagerMessages messages, WidgetStyle widgetStyle) {
+ addStyleName("flex-none layout vertical");
+ addStyleName(widgetStyle.MainContent());
+
+ formGroup = new FormGroup();
+ add(formGroup);
+
FormLabel showLastLabel = new FormLabel(messages.showLast());
showLastLabel.addStyleName("inline");
- addFormLabel(showLastLabel);
+ formGroup.addFormLabel(showLastLabel);
FormField field = new FormField();
- addFormField(field);
+ formGroup.addFormField(field);
FlowPanel fieldPanel = new FlowPanel();
field.add(fieldPanel);
@@ -63,7 +70,7 @@ public abstract class SyslogFilter extends FormGroup {
fieldPanel.add(eventsLabel);
FormGroupActions actions = new FormGroupActions();
- addFormGroupActions(actions);
+ formGroup.addFormGroupActions(actions);
pauseButton = new FormButton(messages.pauseLog());
pauseButton.setIcon("pause");
diff --git a/manager/client/src/main/java/org/openremote/manager/client/admin/syslog/SyslogItems.java b/manager/client/src/main/java/org/openremote/manager/client/admin/syslog/SyslogItems.java
index 338e28f67..4f4346717 100644
--- a/manager/client/src/main/java/org/openremote/manager/client/admin/syslog/SyslogItems.java
+++ b/manager/client/src/main/java/org/openremote/manager/client/admin/syslog/SyslogItems.java
@@ -31,7 +31,7 @@ public class SyslogItems extends FlowPanel {
public SyslogItems(IsWidget emptyLabel) {
this.emptyLabel = emptyLabel;
- setStyleName("flex layout vertical or-FormList");
+ setStyleName("flex layout vertical or-MainContent or-FormList");
getElement().getStyle().setOverflow(Style.Overflow.AUTO);
add(emptyLabel);
}
diff --git a/manager/client/src/main/java/org/openremote/manager/client/admin/tenant/AdminTenantImpl.ui.xml b/manager/client/src/main/java/org/openremote/manager/client/admin/tenant/AdminTenantImpl.ui.xml
index 9e24c999e..c641d7f90 100644
--- a/manager/client/src/main/java/org/openremote/manager/client/admin/tenant/AdminTenantImpl.ui.xml
+++ b/manager/client/src/main/java/org/openremote/manager/client/admin/tenant/AdminTenantImpl.ui.xml
@@ -18,27 +18,27 @@
</g:HTMLPanel>
- <g:HTMLPanel ui:field="mainContent"
- styleName="flex {widgetStyle.MainContent}">
-
- <g:FlowPanel
- styleName="layout horizontal {style.formMessages} {widgetStyle.FormMessages} success"
- visible="false">
- <w:IconLabel icon="check" addStyleNames="{widgetStyle.MessagesIcon}"/>
- <g:FlowPanel ui:field="formMessagesSuccess"/>
- </g:FlowPanel>
+ <w:Form ui:field="form" addStyleNames="flex">
- <g:FlowPanel
- styleName="layout horizontal {style.formMessages} {widgetStyle.FormMessages} error"
- visible="false">
- <w:IconLabel icon="warning" addStyleNames="{widgetStyle.MessagesIcon}"/>
- <g:FlowPanel ui:field="formMessagesError"/>
- </g:FlowPanel>
+ <g:HTMLPanel styleName="flex {widgetStyle.MainContent}">
+
+ <g:FlowPanel
+ styleName="layout horizontal {style.formMessages} {widgetStyle.FormMessages} success"
+ visible="false">
+ <w:IconLabel icon="check" addStyleNames="{widgetStyle.MessagesIcon}"/>
+ <g:FlowPanel ui:field="formMessagesSuccess"/>
+ </g:FlowPanel>
+
+ <g:FlowPanel
+ styleName="layout horizontal {style.formMessages} {widgetStyle.FormMessages} error"
+ visible="false">
+ <w:IconLabel icon="warning" addStyleNames="{widgetStyle.MessagesIcon}"/>
+ <g:FlowPanel ui:field="formMessagesError"/>
+ </g:FlowPanel>
- <w:Headline icon="edit"
- text="{managerMessages.editTenant}"/>
+ <w:Headline icon="edit"
+ text="{managerMessages.editTenant}"/>
- <w:Form ui:field="form">
<w:FormGroup ui:field="displayNameGroup">
<w:label>
@@ -73,6 +73,9 @@
</w:field>
</w:FormGroup>
+ </g:HTMLPanel>
+
+ <g:FlowPanel styleName="flex-none layout vertical {widgetStyle.MainContent}">
<w:FormGroup>
<w:field>
<w:FormField>
@@ -86,10 +89,9 @@
</w:FormField>
</w:field>
</w:FormGroup>
+ </g:FlowPanel>
- </w:Form>
-
- </g:HTMLPanel>
+ </w:Form>
</g:HTMLPanel>
</ui:UiBinder>
\ No newline at end of file
diff --git a/manager/client/src/main/java/org/openremote/manager/client/admin/users/AdminUserImpl.ui.xml b/manager/client/src/main/java/org/openremote/manager/client/admin/users/AdminUserImpl.ui.xml
index 5b9d7b72b..fdbfb6356 100644
--- a/manager/client/src/main/java/org/openremote/manager/client/admin/users/AdminUserImpl.ui.xml
+++ b/manager/client/src/main/java/org/openremote/manager/client/admin/users/AdminUserImpl.ui.xml
@@ -18,71 +18,27 @@
</g:HTMLPanel>
- <g:HTMLPanel ui:field="mainContent"
- styleName="flex {widgetStyle.MainContent}">
-
- <g:FlowPanel
- styleName="layout horizontal {style.formMessages} {widgetStyle.FormMessages} success"
- visible="false">
- <w:IconLabel icon="check" addStyleNames="{widgetStyle.MessagesIcon}"/>
- <g:FlowPanel ui:field="formMessagesSuccess"/>
- </g:FlowPanel>
+ <w:Form ui:field="form" addStyleNames="flex">
- <g:FlowPanel
- styleName="layout horizontal {style.formMessages} {widgetStyle.FormMessages} error"
- visible="false">
- <w:IconLabel icon="warning" addStyleNames="{widgetStyle.MessagesIcon}"/>
- <g:FlowPanel ui:field="formMessagesError"/>
- </g:FlowPanel>
+ <g:HTMLPanel ui:field="mainContent"
+ styleName="flex layout vertical {widgetStyle.MainContent} scrollable">
- <w:Headline icon="edit"
- text="{managerMessages.editUser}"/>
+ <g:FlowPanel
+ styleName="layout horizontal {style.formMessages} {widgetStyle.FormMessages} success"
+ visible="false">
+ <w:IconLabel icon="check" addStyleNames="{widgetStyle.MessagesIcon}"/>
+ <g:FlowPanel ui:field="formMessagesSuccess"/>
+ </g:FlowPanel>
- <w:Form ui:field="form">
+ <g:FlowPanel
+ styleName="layout horizontal {style.formMessages} {widgetStyle.FormMessages} error"
+ visible="false">
+ <w:IconLabel icon="warning" addStyleNames="{widgetStyle.MessagesIcon}"/>
+ <g:FlowPanel ui:field="formMessagesError"/>
+ </g:FlowPanel>
- <w:FormGroup ui:field="usernameGroup">
- <w:label>
- <w:FormLabel text="{managerMessages.username}" addStyleNames="larger"/>
- </w:label>
- <w:field>
- <w:FormField>
- <w:FormInputText ui:field="usernameInput"/>
- </w:FormField>
- </w:field>
- </w:FormGroup>
-
- <w:FormGroup ui:field="firstNameGroup">
- <w:label>
- <w:FormLabel text="{managerMessages.firstName}" addStyleNames="larger"/>
- </w:label>
- <w:field>
- <w:FormField>
- <w:FormInputText ui:field="firstNameInput"/>
- </w:FormField>
- </w:field>
- </w:FormGroup>
-
- <w:FormGroup ui:field="lastNameGroup">
- <w:label>
- <w:FormLabel text="{managerMessages.lastName}" addStyleNames="larger"/>
- </w:label>
- <w:field>
- <w:FormField>
- <w:FormInputText ui:field="lastNameInput"/>
- </w:FormField>
- </w:field>
- </w:FormGroup>
-
- <w:FormGroup ui:field="emailGroup">
- <w:label>
- <w:FormLabel text="{managerMessages.email}" addStyleNames="larger"/>
- </w:label>
- <w:field>
- <w:FormField>
- <w:FormInputText ui:field="emailInput"/>
- </w:FormField>
- </w:field>
- </w:FormGroup>
+ <w:Headline icon="edit"
+ text="{managerMessages.editUser}"/>
<w:FormGroup ui:field="enabledGroup">
<w:label>
@@ -95,34 +51,81 @@
</w:field>
</w:FormGroup>
+ <div class="layout horizontal center wrap">
+ <w:FormGroup ui:field="usernameGroup" addStyleNames="flex">
+ <w:label>
+ <w:FormLabel text="{managerMessages.username}" addStyleNames="larger"/>
+ </w:label>
+ <w:field>
+ <w:FormField>
+ <w:FormInputText ui:field="usernameInput" addStyleNames="flex"/>
+ </w:FormField>
+ </w:field>
+ </w:FormGroup>
+ <w:FormGroup ui:field="emailGroup" addStyleNames="flex">
+ <w:label>
+ <w:FormLabel text="{managerMessages.email}" addStyleNames="larger"/>
+ </w:label>
+ <w:field>
+ <w:FormField>
+ <w:FormInputText ui:field="emailInput" addStyleNames="flex"/>
+ </w:FormField>
+ </w:field>
+ </w:FormGroup>
+ </div>
+
+ <div class="layout horizontal center wrap">
+ <w:FormGroup ui:field="firstNameGroup" addStyleNames="flex">
+ <w:label>
+ <w:FormLabel text="{managerMessages.firstName}" addStyleNames="larger"/>
+ </w:label>
+ <w:field>
+ <w:FormField>
+ <w:FormInputText ui:field="firstNameInput" addStyleNames="flex"/>
+ </w:FormField>
+ </w:field>
+ </w:FormGroup>
+ <w:FormGroup ui:field="lastNameGroup" addStyleNames="flex">
+ <w:label>
+ <w:FormLabel text="{managerMessages.lastName}" addStyleNames="larger"/>
+ </w:label>
+ <w:field>
+ <w:FormField>
+ <w:FormInputText ui:field="lastNameInput" addStyleNames="flex"/>
+ </w:FormField>
+ </w:field>
+ </w:FormGroup>
+ </div>
+
<g:Label ui:field="resetPasswordNote"
styleName="{widgetStyle.FormMessages} info"
text="{managerMessages.notePasswordAfterCreate}"/>
- <w:FormGroup ui:field="resetPasswordGroup">
- <w:label>
- <w:FormLabel text="{managerMessages.resetPassword}" addStyleNames="larger"/>
- </w:label>
- <w:field>
- <w:FormField>
- <!-- TODO: autocomplete="new-password" to disable browser saving password popup-->
- <g:PasswordTextBox ui:field="resetPasswordInput"
- addStyleNames="{widgetStyle.FormControl} {widgetStyle.FormInputText}"/>
- </w:FormField>
- </w:field>
- </w:FormGroup>
-
- <w:FormGroup ui:field="resetPasswordControlGroup">
- <w:label>
- <w:FormLabel text="{managerMessages.repeatPassword}" addStyleNames="larger"/>
- </w:label>
- <w:field>
- <w:FormField>
- <g:PasswordTextBox ui:field="resetPasswordControlInput"
- addStyleNames="{widgetStyle.FormControl} {widgetStyle.FormInputText}"/>
- </w:FormField>
- </w:field>
- </w:FormGroup>
+ <div class="layout horizontal center wrap">
+ <w:FormGroup ui:field="resetPasswordGroup" addStyleNames="flex">
+ <w:label>
+ <w:FormLabel text="{managerMessages.resetPassword}" addStyleNames="larger"/>
+ </w:label>
+ <w:field>
+ <w:FormField>
+ <!-- TODO: autocomplete="new-password" to disable browser saving password popup-->
+ <g:PasswordTextBox ui:field="resetPasswordInput"
+ addStyleNames="flex {widgetStyle.FormControl} {widgetStyle.FormInputText}"/>
+ </w:FormField>
+ </w:field>
+ </w:FormGroup>
+ <w:FormGroup ui:field="resetPasswordControlGroup" addStyleNames="flex">
+ <w:label>
+ <w:FormLabel text="{managerMessages.repeatPassword}" addStyleNames="larger"/>
+ </w:label>
+ <w:field>
+ <w:FormField>
+ <g:PasswordTextBox ui:field="resetPasswordControlInput"
+ addStyleNames="flex {widgetStyle.FormControl} {widgetStyle.FormInputText}"/>
+ </w:FormField>
+ </w:field>
+ </w:FormGroup>
+ </div>
<g:Label ui:field="rolesNote"
styleName="{widgetStyle.FormMessages} info"
@@ -140,6 +143,9 @@
</w:field>
</w:FormGroup>
+ </g:HTMLPanel>
+
+ <g:FlowPanel styleName="flex-none layout vertical {widgetStyle.MainContent}">
<w:FormGroup>
<w:field>
<w:FormField>
@@ -153,10 +159,9 @@
</w:FormField>
</w:field>
</w:FormGroup>
+ </g:FlowPanel>
- </w:Form>
-
- </g:HTMLPanel>
+ </w:Form>
</g:HTMLPanel>
diff --git a/manager/client/src/main/java/org/openremote/manager/client/apps/AppsViewImpl.java b/manager/client/src/main/java/org/openremote/manager/client/apps/AppsViewImpl.java
index 93ce3b9ba..5da131036 100644
--- a/manager/client/src/main/java/org/openremote/manager/client/apps/AppsViewImpl.java
+++ b/manager/client/src/main/java/org/openremote/manager/client/apps/AppsViewImpl.java
@@ -21,6 +21,7 @@ package org.openremote.manager.client.apps;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.IFrameElement;
+import com.google.gwt.dom.client.Style;
import com.google.gwt.resources.client.CssResource;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
@@ -81,6 +82,7 @@ public class AppsViewImpl extends Composite implements AppsView {
if (presenter == null) {
appsListPanel.clear();
frame.setSrc("about:blank");
+ frame.getStyle().setDisplay(com.google.gwt.dom.client.Style.Display.NONE);
placeholder.setVisible(true);
}
}
@@ -114,6 +116,7 @@ public class AppsViewImpl extends Composite implements AppsView {
@Override
public void openAppUrl(String appUrl) {
placeholder.setVisible(false);
+ frame.getStyle().clearDisplay();
frame.setSrc(appUrl);
Timeout.debounce("setiframefocus", () -> {
frame.focus();
diff --git a/manager/client/src/main/java/org/openremote/manager/client/apps/AppsViewImpl.ui.xml b/manager/client/src/main/java/org/openremote/manager/client/apps/AppsViewImpl.ui.xml
index 4ff934c61..a5cfcaee0 100644
--- a/manager/client/src/main/java/org/openremote/manager/client/apps/AppsViewImpl.ui.xml
+++ b/manager/client/src/main/java/org/openremote/manager/client/apps/AppsViewImpl.ui.xml
@@ -27,17 +27,15 @@
styleName="layout horizontal center end-justified {widgetStyle.SecondaryNavHorizontal}">
</g:HTMLPanel>
- <g:HTMLPanel styleName="{widgetStyle.MainContent}"
+ <g:HTMLPanel styleName="flex layout vertical {widgetStyle.MainContent}"
ui:field="placeholder" >
-
<g:Label addStyleNames="{widgetStyle.FormMessages} info"
text="{managerMessages.selectConsoleApp}"/>
-
</g:HTMLPanel>
<iframe ui:field="frame"
class="flex"
- style="width:100%; height:100%;border:0;"/>
+ style="display:none;width:100%; height:100%;border:0;"/>
</g:HTMLPanel>
diff --git a/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetEdit.java b/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetEdit.java
index 1aec0ecd7..603f69638 100644
--- a/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetEdit.java
+++ b/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetEdit.java
@@ -24,6 +24,7 @@ import org.openremote.manager.client.assets.attributes.AttributesEditor;
import org.openremote.manager.client.assets.browser.BrowserTreeNode;
import org.openremote.manager.client.widget.FormView;
import org.openremote.model.asset.AssetType;
+import org.openremote.model.attribute.AttributeType;
import org.openremote.model.geo.GeoJSON;
import org.openremote.model.value.ObjectValue;
@@ -43,6 +44,8 @@ public interface AssetEdit extends FormView, IsWidget {
void onAssetTypeSelected(AssetType value);
+ void addAttribute(String name, int attributeTypeIndex);
+
void update();
void create();
@@ -94,6 +97,10 @@ public interface AssetEdit extends FormView, IsWidget {
void setAttributesEditor(AttributesEditor attributesEditor);
+ void setAvailableAttributeTypes(AttributeType[] types);
+
+ void setNewAttributeError(boolean error);
+
void enableCreate(boolean enable);
void enableUpdate(boolean enable);
diff --git a/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetEditActivity.java b/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetEditActivity.java
index 9a5213b86..24adaeddd 100644
--- a/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetEditActivity.java
+++ b/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetEditActivity.java
@@ -34,7 +34,9 @@ import org.openremote.manager.shared.map.MapResource;
import org.openremote.manager.shared.security.Tenant;
import org.openremote.manager.shared.validation.ConstraintViolation;
import org.openremote.model.asset.Asset;
+import org.openremote.model.asset.AssetAttribute;
import org.openremote.model.asset.AssetType;
+import org.openremote.model.attribute.AttributeType;
import org.openremote.model.event.bus.EventBus;
import org.openremote.model.event.bus.EventRegistration;
@@ -123,6 +125,8 @@ public class AssetEditActivity
} else {
onMapReady();
}
+
+ view.setAvailableAttributeTypes(AttributeType.values());
}
@Override
@@ -187,6 +191,15 @@ public class AssetEditActivity
writeAttributesEditorToView();
}
+ @Override
+ public void addAttribute(String name, int attributeTypeIndex) {
+ if (attributesEditor != null) {
+ view.setNewAttributeError(
+ !attributesEditor.addAttribute(name, attributeTypeIndex >= 0 ? AttributeType.values()[attributeTypeIndex] : null)
+ );
+ }
+ }
+
@Override
public void update() {
view.setFormBusy(true);
diff --git a/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetEditImpl.java b/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetEditImpl.java
index 9231630ab..36c6ce2c7 100644
--- a/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetEditImpl.java
+++ b/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetEditImpl.java
@@ -41,6 +41,7 @@ import org.openremote.manager.client.widget.Hyperlink;
import org.openremote.manager.client.widget.PushButton;
import org.openremote.model.Constants;
import org.openremote.model.asset.AssetType;
+import org.openremote.model.attribute.AttributeType;
import org.openremote.model.geo.GeoJSON;
import org.openremote.model.value.ObjectValue;
@@ -127,8 +128,6 @@ public class AssetEditImpl extends FormViewImpl implements AssetEdit {
/* ############################################################################ */
- @UiField
- Form attributesForm;
@UiField
FormGroup typeGroup;
@UiField(provided = true)
@@ -143,7 +142,16 @@ public class AssetEditImpl extends FormViewImpl implements AssetEdit {
/* ############################################################################ */
@UiField
- Form submitForm;
+ FormGroup newAttributeFormGroup;
+ @UiField
+ FormInputText newAttributeNameInputText;
+ @UiField
+ FormListBox newAttributeTypeListBox;
+ @UiField
+ FormButton addAttributeButton;
+
+ /* ############################################################################ */
+
@UiField
FormGroup submitButtonGroup;
@UiField
@@ -245,6 +253,9 @@ public class AssetEditImpl extends FormViewImpl implements AssetEdit {
setOpaque(false);
attributesEditorContainer.clear();
attributesEditor = null;
+ newAttributeFormGroup.setError(false);
+ newAttributeNameInputText.setValue(null);
+ newAttributeTypeListBox.clear();
if (presenter != null) {
assetBrowser.asWidget().removeFromParent();
@@ -256,8 +267,6 @@ public class AssetEditImpl extends FormViewImpl implements AssetEdit {
public void setFormBusy(boolean busy) {
super.setFormBusy(busy);
headline.setVisible(!busy);
- attributesForm.setBusy(busy);
- submitForm.setBusy(busy);
mapWidget.setVisible(!busy);
if (!busy)
mapWidget.resize();
@@ -378,6 +387,12 @@ public class AssetEditImpl extends FormViewImpl implements AssetEdit {
@Override
public void setType(String type) {
typeInput.setValue(type);
+ AssetType assetType = AssetType.getByValue(type).orElse(AssetType.CUSTOM);
+ if (assetType == AssetType.CUSTOM) {
+ headline.setSub(type);
+ } else {
+ headline.setSub(managerMessages.assetTypeLabel(assetType.name()));
+ }
}
@Override
@@ -428,6 +443,28 @@ public class AssetEditImpl extends FormViewImpl implements AssetEdit {
attributesEditorContainer.clear();
}
+ @Override
+ public void setNewAttributeError(boolean error) {
+ newAttributeFormGroup.setError(error);
+ }
+
+ @Override
+ public void setAvailableAttributeTypes(AttributeType[] types) {
+ newAttributeTypeListBox.clear();
+ newAttributeTypeListBox.addItem(managerMessages.selectType());
+ for (AttributeType attributeType: types) {
+ newAttributeTypeListBox.addItem(
+ managerMessages.attributeType(attributeType.name())
+ );
+ }
+ }
+
+ @UiHandler("addAttributeButton")
+ public void addAttributeButtonClicked(ClickEvent e) {
+ if (presenter != null)
+ presenter.addAttribute(newAttributeNameInputText.getValue(), newAttributeTypeListBox.getSelectedIndex()-1);
+ }
+
/* ############################################################################ */
@Override
@@ -478,6 +515,7 @@ public class AssetEditImpl extends FormViewImpl implements AssetEdit {
typeGroup.setOpaque(opaque);
if (attributesEditor != null)
attributesEditor.setOpaque(opaque);
+ newAttributeFormGroup.setOpaque(opaque);
submitButtonGroup.setOpaque(opaque);
}
}
diff --git a/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetEditImpl.ui.xml b/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetEditImpl.ui.xml
index 8378fc783..69be65b4f 100644
--- a/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetEditImpl.ui.xml
+++ b/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetEditImpl.ui.xml
@@ -23,6 +23,11 @@
margin: 0 0 1em 1em;
height: 17em;
}
+
+ .newAttributeFormGroup {
+
+
+ }
</ui:style>
<ui:style field="attributesEditorStyle"
@@ -49,7 +54,7 @@
<w:FlexSplitPanel ui:field="splitPanel"
handleStyle="{widgetStyle.SplitPanelHandle}"
- firstPanelWidth="250"
+ firstPanelWidth="200"
firstPanelMinWidth="0"
secondPanelMinWidth="400">
@@ -60,8 +65,7 @@
<w:second>
<g:HTMLPanel styleName="flex layout vertical">
- <g:HTMLPanel
- styleName="layout horizontal center end-justified {widgetStyle.SecondaryNavHorizontal}">
+ <div class="layout horizontal center end-justified {widgetStyle.SecondaryNavHorizontal}">
<!--
<w:Hyperlink
@@ -86,40 +90,42 @@
targetHistoryToken="assetEdit:"
text="{managerMessages.createAsset}"/>
- </g:HTMLPanel>
+ </div>
+
+ <w:Form ui:field="form" addStyleNames="flex">
- <div class="flex layout vertical {widgetStyle.MainContent}">
+ <g:HTMLPanel styleName="flex-none layout vertical {widgetStyle.MainContent}">
- <div class="flex-none layout horizontal">
+ <div class="flex-none layout horizontal">
- <div class="layout vertical">
+ <div class="layout vertical">
- <w:Headline ui:field="headline" icon="edit"/>
+ <w:Headline ui:field="headline" icon="edit"/>
- <g:FlowPanel
- styleName="flex-none layout horizontal {style.formMessages} {widgetStyle.FormMessages} success"
- visible="false">
- <w:IconLabel icon="check"
- addStyleNames="{widgetStyle.MessagesIcon}"/>
- <g:FlowPanel ui:field="formMessagesSuccess"/>
- </g:FlowPanel>
+ <g:FlowPanel
+ styleName="flex-none layout horizontal {style.formMessages} {widgetStyle.FormMessages} success"
+ visible="false">
+ <w:IconLabel icon="check"
+ addStyleNames="{widgetStyle.MessagesIcon}"/>
+ <g:FlowPanel ui:field="formMessagesSuccess"/>
+ </g:FlowPanel>
- <g:FlowPanel
- styleName="flex-none layout horizontal {style.formMessages} {widgetStyle.FormMessages} error"
- visible="false">
- <w:IconLabel icon="warning"
- addStyleNames="{widgetStyle.MessagesIcon}"/>
- <g:FlowPanel ui:field="formMessagesError"/>
- </g:FlowPanel>
+ <g:FlowPanel
+ styleName="flex-none layout horizontal {style.formMessages} {widgetStyle.FormMessages} error"
+ visible="false">
+ <w:IconLabel icon="warning"
+ addStyleNames="{widgetStyle.MessagesIcon}"/>
+ <g:FlowPanel ui:field="formMessagesError"/>
+ </g:FlowPanel>
- <w:Form ui:field="form">
<w:FormGroup ui:field="nameGroup">
<w:label>
<w:FormLabel text="{managerMessages.assetName}"/>
</w:label>
<w:field>
<w:FormField addStyleNames="larger">
- <w:FormInputText ui:field="nameInput" addStyleNames="flex {style.nameInput}"/>
+ <w:FormInputText ui:field="nameInput"
+ addStyleNames="flex {style.nameInput}"/>
</w:FormField>
</w:field>
</w:FormGroup>
@@ -163,18 +169,14 @@
</w:FormGroupActions>
</w:actions>
</w:FormGroup>
- </w:Form>
+ </div>
+ <w:MapWidget ui:field="mapWidget"
+ addStyleNames="flex self-end {style.mapWidget} {widgetStyle.ItemWithBorder}"/>
</div>
- <w:MapWidget ui:field="mapWidget"
- addStyleNames="flex self-end {style.mapWidget} {widgetStyle.ItemWithBorder}"/>
- </div>
-
- <g:HTMLPanel styleName="flex-none layout horizontal">
- <w:Form ui:field="attributesForm" addStyleNames="flex">
-
- <w:FormGroup ui:field="typeGroup">
+ <div class="layout horizontal center wrap">
+ <w:FormGroup ui:field="typeGroup" addStyleNames="flex">
<w:label>
<w:FormLabel text="{managerMessages.assetType}"/>
</w:label>
@@ -192,35 +194,56 @@
<g:Label ui:field="customTypeInfoLabel" visible="false"
text="{managerMessages.enterCustomAssetType}"/>
</w:info>
-
</w:FormGroup>
-
- <g:FlowPanel ui:field="attributesEditorContainer"/>
-
- </w:Form>
- </g:HTMLPanel>
-
- <g:HTMLPanel styleName="flex-none layout horizontal">
- <w:Form ui:field="submitForm" addStyleNames="flex">
- <w:FormGroup ui:field="submitButtonGroup">
+ <w:FormGroup ui:field="newAttributeFormGroup" addStyleNames="flex secondary">
+ <w:label>
+ <w:FormLabel text="{managerMessages.newAttribute}"
+ icon="plus-square"
+ addStyleNames="larger"/>
+ </w:label>
<w:field>
<w:FormField>
- <w:FormButton ui:field="updateButton" primary="true"
- text="{managerMessages.updateAsset}" visible="false"
- icon="save"/>
- <w:FormButton ui:field="createButton" primary="true"
- text="{managerMessages.createAsset}" visible="false"
- icon="save"/>
- <w:FormButton ui:field="deleteButton" danger="true"
- text="{managerMessages.deleteAsset}" visible="false"
- icon="trash"/>
+ <w:FormInputText ui:field="newAttributeNameInputText"
+ addStyleNames="flex"/>
+ <w:FormListBox ui:field="newAttributeTypeListBox"/>
</w:FormField>
</w:field>
+ <w:actions>
+ <w:FormGroupActions>
+ <w:FormButton ui:field="addAttributeButton"
+ text="{managerMessages.addAttribute}"
+ icon="plus"/>
+ </w:FormGroupActions>
+ </w:actions>
</w:FormGroup>
- </w:Form>
+ </div>
+
</g:HTMLPanel>
- </div>
+ <g:FlowPanel ui:field="attributesEditorContainer"
+ styleName="flex layout vertical {widgetStyle.MainContent} {widgetStyle.FormList}"/>
+
+ <g:HTMLPanel styleName="flex-none layout vertical {widgetStyle.MainContent}">
+
+ <w:FormGroup ui:field="submitButtonGroup">
+ <w:field>
+ <w:FormField>
+ <w:FormButton ui:field="updateButton" primary="true"
+ text="{managerMessages.updateAsset}" visible="false"
+ icon="save"/>
+ <w:FormButton ui:field="createButton" primary="true"
+ text="{managerMessages.createAsset}" visible="false"
+ icon="save"/>
+ <w:FormButton ui:field="deleteButton" danger="true"
+ text="{managerMessages.deleteAsset}" visible="false"
+ icon="trash"/>
+ </w:FormField>
+ </w:field>
+ </w:FormGroup>
+
+ </g:HTMLPanel>
+
+ </w:Form>
</g:HTMLPanel>
</w:second>
diff --git a/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetView.java b/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetView.java
index be52130d2..25456c3ee 100644
--- a/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetView.java
+++ b/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetView.java
@@ -34,6 +34,10 @@ public interface AssetView extends IsWidget {
void onMapReady();
void centerMap();
+
+ void enableLiveUpdates(boolean enable);
+
+ void refresh();
}
void setPresenter(Presenter presenter);
@@ -63,4 +67,6 @@ public interface AssetView extends IsWidget {
AttributesBrowser.Container getAttributesBrowserContainer();
void setAttributesBrowser(AttributesBrowser attributesBrowser);
+
+ boolean isLiveUpdatesEnabled();
}
diff --git a/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetViewActivity.java b/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetViewActivity.java
index f17e12f0c..49220a0a8 100644
--- a/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetViewActivity.java
+++ b/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetViewActivity.java
@@ -153,6 +153,20 @@ public class AssetViewActivity
view.flyTo(asset.getCoordinates());
}
+ @Override
+ public void enableLiveUpdates(boolean enable) {
+ if (attributesBrowser != null) {
+ attributesBrowser.subscribeToLiveUpdates(enable);
+ }
+ }
+
+ @Override
+ public void refresh() {
+ if (attributesBrowser != null) {
+ attributesBrowser.readAllAttributeValues();
+ }
+ }
+
protected void writeAssetToView() {
view.setAssetEditHistoryToken(environment.getPlaceHistoryMapper().getToken(new AssetEditPlace(assetId)));
view.setName(asset.getName());
@@ -200,5 +214,6 @@ public class AssetViewActivity
};
view.setAttributesBrowser(attributesBrowser);
attributesBrowser.build();
+ attributesBrowser.subscribeToLiveUpdates(view.isLiveUpdatesEnabled());
}
}
diff --git a/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetViewImpl.java b/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetViewImpl.java
index 5f55f2f56..121b7f48f 100644
--- a/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetViewImpl.java
+++ b/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetViewImpl.java
@@ -128,7 +128,12 @@ public class AssetViewImpl extends Composite implements AssetView {
/* ############################################################################ */
@UiField
- Form attributesForm;
+ PushButton refreshButton;
+
+ @UiField
+ PushButton liveUpdatesOnButton;
+ @UiField
+ PushButton liveUpdatesOffButton;
@UiField
FlowPanel attributesBrowserContainer;
@@ -184,7 +189,6 @@ public class AssetViewImpl extends Composite implements AssetView {
public void setFormBusy(boolean busy) {
headline.setVisible(!busy);
form.setBusy(busy);
- attributesForm.setBusy(busy);
if (!busy && locationGroup.isVisible()) {
mapWidget.setVisible(true);
mapWidget.resize();
@@ -273,7 +277,6 @@ public class AssetViewImpl extends Composite implements AssetView {
headline.setIcon(icon);
// TODO: Should unknown/undefined asset type default to custom
AssetType assetType = AssetType.getByValue(type).orElse(AssetType.CUSTOM);
-
if (assetType == AssetType.CUSTOM) {
headline.setSub(type);
} else {
@@ -312,4 +315,31 @@ public class AssetViewImpl extends Composite implements AssetView {
this.attributesBrowser = browser;
attributesBrowserContainer.clear();
}
+
+ @UiHandler("refreshButton")
+ public void onRefreshButtonClicked(ClickEvent e) {
+ if (presenter != null)
+ presenter.refresh();
+ }
+
+ @Override
+ public boolean isLiveUpdatesEnabled() {
+ return liveUpdatesOnButton.isVisible();
+ }
+
+ @UiHandler("liveUpdatesOnButton")
+ public void onLiveUpdatesOnButtonClicked(ClickEvent e) {
+ if (presenter != null)
+ presenter.enableLiveUpdates(false);
+ liveUpdatesOnButton.setVisible(false);
+ liveUpdatesOffButton.setVisible(true);
+ }
+
+ @UiHandler("liveUpdatesOffButton")
+ public void onLiveUpdatesOffButtonClicked(ClickEvent e) {
+ if (presenter != null)
+ presenter.enableLiveUpdates(true);
+ liveUpdatesOnButton.setVisible(true);
+ liveUpdatesOffButton.setVisible(false);
+ }
}
diff --git a/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetViewImpl.ui.xml b/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetViewImpl.ui.xml
index 5f6cf7d3d..9ffe82721 100644
--- a/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetViewImpl.ui.xml
+++ b/manager/client/src/main/java/org/openremote/manager/client/assets/asset/AssetViewImpl.ui.xml
@@ -43,7 +43,7 @@
<w:FlexSplitPanel ui:field="splitPanel"
handleStyle="{widgetStyle.SplitPanelHandle}"
- firstPanelWidth="250"
+ firstPanelWidth="300"
firstPanelMinWidth="0"
secondPanelMinWidth="400">
@@ -65,6 +65,24 @@
text="{managerMessages.showDashboard}"/>
-->
+ <w:PushButton
+ ui:field="liveUpdatesOnButton"
+ visible="false"
+ addStyleNames="{style.navItem} {widgetStyle.SecondaryNavItem} primary"
+ icon="check-square"
+ text="{managerMessages.showLiveUpdates}"/>
+ <w:PushButton
+ ui:field="liveUpdatesOffButton"
+ addStyleNames="{style.navItem} {widgetStyle.SecondaryNavItem}"
+ icon="square-o"
+ text="{managerMessages.showLiveUpdates}"/>
+
+ <w:PushButton
+ ui:field="refreshButton"
+ addStyleNames="{style.navItem} {widgetStyle.SecondaryNavItem}"
+ icon="refresh"
+ text="{managerMessages.refreshAllAttributes}"/>
+
<w:Hyperlink
ui:field="editAssetLink"
addStyleNames="{style.navItem} {widgetStyle.SecondaryNavItem}"
@@ -77,18 +95,17 @@
icon="plus-square"
targetHistoryToken="assetEdit:"
text="{managerMessages.createAsset}"/>
-
</g:HTMLPanel>
- <div class="flex layout vertical {widgetStyle.MainContent}">
+ <w:Form ui:field="form" addStyleNames="flex">
- <div class="flex-none layout horizontal">
+ <g:HTMLPanel styleName="flex-none layout vertical {widgetStyle.MainContent}">
- <div class="layout vertical">
+ <div class="flex-none layout horizontal">
- <w:Headline ui:field="headline"/>
+ <div class="layout vertical">
- <w:Form ui:field="form">
+ <w:Headline ui:field="headline"/>
<w:FormGroup ui:field="createdOnGroup">
<w:label>
@@ -141,20 +158,19 @@
</w:actions>
</w:FormGroup>
- </w:Form>
+ </div>
+ <w:MapWidget ui:field="mapWidget"
+ visible="false"
+ addStyleNames="flex self-end {style.mapWidget} {widgetStyle.ItemWithBorder}"/>
</div>
- <w:MapWidget ui:field="mapWidget"
- visible="false"
- addStyleNames="flex self-end {style.mapWidget} {widgetStyle.ItemWithBorder}"/>
- </div>
+ </g:HTMLPanel>
- <w:Form ui:field="attributesForm" addStyleNames="flex">
- <g:FlowPanel ui:field="attributesBrowserContainer"/>
- </w:Form>
+ <g:FlowPanel ui:field="attributesBrowserContainer"
+ addStyleNames="flex layout vertical {widgetStyle.MainContent} {widgetStyle.FormList}"/>
- </div>
+ </w:Form>
</g:HTMLPanel>
</w:second>
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 9356ffaec..dab883b6d 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
@@ -32,11 +32,9 @@ import org.openremote.model.asset.ReadAssetAttributesEvent;
import org.openremote.model.attribute.AttributeEvent;
import org.openremote.model.attribute.AttributeExecuteStatus;
import org.openremote.model.attribute.AttributeState;
-import org.openremote.model.attribute.AttributeType;
import org.openremote.model.datapoint.DatapointInterval;
import org.openremote.model.datapoint.NumberDatapoint;
import org.openremote.model.event.bus.EventRegistration;
-import org.openremote.model.util.TextUtil;
import org.openremote.model.value.ValueType;
import java.util.ArrayList;
@@ -81,15 +79,6 @@ public abstract class AttributesBrowser
);
}
- @Override
- protected void createAttributeGroups() {
- if (getAttributes().size() > 0) {
- liveUpdatesGroup = createLiveUpdatesGroup();
- container.getPanel().add(liveUpdatesGroup);
- }
- super.createAttributeGroups();
- }
-
@Override
protected void sortAttributes(LinkedHashMap<AssetAttribute, FormGroup> attributeGroups) {
// Executable commands first, then sort form groups by label text ascending
@@ -215,37 +204,7 @@ public abstract class AttributesBrowser
/* ####################################################################### */
- protected FormGroup createLiveUpdatesGroup() {
- FormGroup formGroup = new FormGroup();
-
- FormLabel formLabel = new FormLabel(environment.getMessages().showLiveUpdates());
- formLabel.addStyleName("larger");
- formGroup.addFormLabel(formLabel);
-
- FormField formField = new FormField();
- formGroup.addFormField(formField);
-
- FormCheckBox liveUpdatesCheckBox = new FormCheckBox();
- liveUpdatesCheckBox.addValueChangeHandler(event -> subscribeToLiveUpdates(event.getValue()));
- formField.add(liveUpdatesCheckBox);
-
- if (attributes.size() > 0) {
- FormGroupActions formGroupActions = new FormGroupActions();
-
- FormButton readAllButton = new FormButton();
- readAllButton.setText(environment.getMessages().refreshAllAttributes());
- readAllButton.addClickHandler(event -> readAllAttributeValues());
- formGroupActions.add(readAllButton);
-
- readButtons.add(readAllButton);
-
- formGroup.addFormGroupActions(formGroupActions);
- }
-
- return formGroup;
- }
-
- protected void subscribeToLiveUpdates(boolean enable) {
+ public void subscribeToLiveUpdates(boolean enable) {
for (FormButton readButton : readButtons) {
readButton.setEnabled(!enable);
}
@@ -266,7 +225,7 @@ public abstract class AttributesBrowser
}
}
- protected void readAllAttributeValues() {
+ public void readAllAttributeValues() {
environment.getEventService().dispatch(
new ReadAssetAttributesEvent(asset.getId())
);
@@ -337,7 +296,7 @@ public abstract class AttributesBrowser
protected DatapointBrowser createDatapointBrowser(AssetAttribute attribute) {
if (attribute.isStoreDatapoints() && isAttributeTypeEqualTo(attribute, ValueType.NUMBER)) {
- return new DatapointBrowser(environment.getMessages(), 580, 220) {
+ return new DatapointBrowser(environment.getMessages(), 900, 200) {
@Override
protected void queryDatapoints(DatapointInterval interval,
long timestamp,
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 aa2317290..9f0fbf97a 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
@@ -28,7 +28,6 @@ import org.openremote.manager.client.widget.*;
import org.openremote.model.ValidationFailure;
import org.openremote.model.asset.AssetAttribute;
import org.openremote.model.asset.AssetMeta;
-import org.openremote.model.attribute.Attribute;
import org.openremote.model.attribute.AttributeType;
import org.openremote.model.attribute.MetaItem;
import org.openremote.model.util.TextUtil;
@@ -40,6 +39,7 @@ import java.util.function.Consumer;
import java.util.function.Supplier;
import static org.openremote.model.attribute.Attribute.ATTRIBUTE_NAME_VALIDATOR;
+import static org.openremote.model.attribute.Attribute.isAttributeNameEqualTo;
public class AttributesEditor
extends AttributesView<AttributesEditor.Container, AttributesEditor.Style> {
@@ -53,20 +53,12 @@ public class AttributesEditor
}
final protected boolean isCreate;
- protected FormGroup newAttributeGroup;
public AttributesEditor(Environment environment, Container container, List<AssetAttribute> attributes, boolean isCreate) {
super(environment, container, attributes);
this.isCreate = isCreate;
}
- @Override
- protected void createAttributeGroups() {
- newAttributeGroup = createNewAttributeEditor();
- container.getPanel().add(newAttributeGroup);
- super.createAttributeGroups();
- }
-
protected FormLabel createAttributeLabel(AssetAttribute attribute) {
FormLabel formLabel = new FormLabel(TextUtil.ellipsize(getAttributeLabel(attribute), 30));
formLabel.addStyleName("larger");
@@ -83,12 +75,6 @@ public class AttributesEditor
return Optional.empty();
}
- @Override
- public void setOpaque(boolean opaque) {
- super.setOpaque(opaque);
- newAttributeGroup.setOpaque(opaque);
- }
-
@Override
protected void addAttributeActions(AssetAttribute attribute,
FormGroup formGroup,
@@ -126,88 +112,46 @@ public class AttributesEditor
/* ####################################################################### */
- protected FormGroup createNewAttributeEditor() {
- AssetAttribute attribute = new AssetAttribute();
-
- FormGroup formGroup = createAttributeNameEditor(attribute);
+ public boolean addAttribute(String name, AttributeType type) {
- FormGroupActions formGroupActions = new FormGroupActions();
- FormButton addButton = new FormButton();
- addButton.setText(container.getMessages().addAttribute());
- addButton.setIcon("plus");
- addButton.addClickHandler(clickEvent -> {
-
- // Must initialize timestamp for proper attribute state (here it
- // means: "When was the initial 'empty' attribute value state created?")
- attribute.setValueTimestamp();
+ if (getAttributes().stream().anyMatch(isAttributeNameEqualTo(name))) {
+ showValidationError(environment.getMessages().duplicateAttributeName());
+ return false;
+ }
- List<ValidationFailure> failures = attribute.getValidationFailures();
- if (failures.isEmpty()) {
- formGroup.setError(false);
+ if (!ATTRIBUTE_NAME_VALIDATOR.test(name)) {
+ showValidationError(environment.getMessages().invalidAttributeName());
+ return false;
+ }
- attribute.getType().ifPresent(attributeType ->
- attribute.addMeta(attributeType.getDefaultMetaItems())
- );
+ AssetAttribute attribute = new AssetAttribute();
+ attribute.setName(name);
+ if (type != null) {
+ attribute.setTypeAndClearValue(type);
+ }
- getAttributes().add(attribute);
+ // Must initialize timestamp for proper attribute state (here it
+ // means: "When was the initial 'empty' attribute value state created?")
+ attribute.setValueTimestamp();
- showInfo(environment.getMessages().attributeAdded(attribute.getName().get()));
- build();
- } else {
- formGroup.setError(true);
- for (ValidationFailure failure : failures) {
- showValidationError(attribute.getLabelOrName().orElse(null), failure);
- }
+ List<ValidationFailure> failures = attribute.getValidationFailures();
+ if (!failures.isEmpty()) {
+ for (ValidationFailure failure : failures) {
+ showValidationError(attribute.getLabelOrName().orElse(null), failure);
}
- });
- formGroupActions.add(addButton);
- formGroup.addFormGroupActions(formGroupActions);
-
- return formGroup;
- }
-
- protected FormGroup createAttributeNameEditor(Attribute attribute) {
- FormGroup formGroup = new FormGroup();
+ return false;
+ }
- FormLabel label = new FormLabel(environment.getMessages().newAttribute());
- label.setIcon("plus-square");
- label.addStyleName("larger");
- formGroup.addFormLabel(label);
+ attribute.getType().ifPresent(attributeType ->
+ attribute.addMeta(attributeType.getDefaultMetaItems())
+ );
+ getAttributes().add(attribute);
- FormField formField = new FormField();
- formGroup.addFormField(formField);
+ showInfo(environment.getMessages().attributeAdded(name));
- FormInputText nameInput = createFormInputText(container.getStyle().stringEditor());
- nameInput.setPlaceholder(environment.getMessages().attributeName());
- nameInput.addValueChangeHandler(event -> {
- if (!ATTRIBUTE_NAME_VALIDATOR.test(event.getValue())) {
- formGroup.setError(true);
- attribute.clearName();
- showValidationError(environment.getMessages().invalidAttributeName());
- } else {
- formGroup.setError(false);
- attribute.setName(event.getValue());
- }
- });
- formField.add(nameInput);
-
- FormListBox typeListBox = new FormListBox();
- typeListBox.addItem(environment.getMessages().selectType());
- for (AttributeType attributeType : AttributeType.values()) {
- typeListBox.addItem(environment.getMessages().attributeType(attributeType.name()));
- }
- typeListBox.addChangeHandler(event -> {
- if (typeListBox.getSelectedIndex() > 0) {
- attribute.setTypeAndClearValue(
- AttributeType.values()[typeListBox.getSelectedIndex() - 1]
- );
- } else {
- attribute.clearType();
- }
- });
- formField.add(typeListBox);
+ build();
- return formGroup;
+ return true;
}
/* ####################################################################### */
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 1dac59647..d1b4b4aaf 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
@@ -20,10 +20,7 @@
package org.openremote.manager.client.assets.attributes;
import com.google.gwt.i18n.client.DateTimeFormat;
-import com.google.gwt.user.client.ui.FlowPanel;
-import com.google.gwt.user.client.ui.InsertPanel;
-import com.google.gwt.user.client.ui.IsWidget;
-import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.*;
import org.openremote.manager.client.Environment;
import org.openremote.manager.client.app.dialog.JsonEditor;
import org.openremote.manager.client.event.ShowFailureEvent;
@@ -280,14 +277,23 @@ public abstract class AttributesView<
sortAttributes(attributeGroups);
- for (FormGroup attributeGroup : attributeGroups.values()) {
- container.getPanel().add(attributeGroup);
+ if (attributeGroups.size() == 0) {
+ Label emptyLabel = new Label(environment.getMessages().noAttributes());
+ emptyLabel.addStyleName(environment.getWidgetStyle().FormListEmptyMessage());
+ container.getPanel().add(emptyLabel);
+ } else {
+ for (FormGroup attributeGroup : attributeGroups.values()) {
+ container.getPanel().add(attributeGroup);
+ }
}
}
protected FormGroup createAttributeGroup(AssetAttribute attribute) {
FormGroup formGroup = new FormGroup();
+ formGroup.addStyleName("flex-none");
+ formGroup.addStyleName(environment.getWidgetStyle().FormListItem());
+
if (attribute.hasAgentLink() || attribute.isProtocolConfiguration()) {
formGroup.addStyleName(container.getStyle().highlightAttribute());
formGroup.addStyleName(environment.getWidgetStyle().HighlightBorder());
@@ -397,6 +403,12 @@ public abstract class AttributesView<
return () -> unsupportedField;
}
+ protected IsWidget createNoValueWidget() {
+ return new FormOutputText(
+ environment.getMessages().noValue()
+ );
+ }
+
protected AttributeEditor createStringEditor(AssetAttribute attribute, Optional<MetaItem> defaultValueItem, S style, FormGroup formGroup) {
String currentValue = attribute.getValue().map(Object::toString).orElse(null);
Optional<String> defaultValue = defaultValueItem.flatMap(AbstractValueHolder::getValueAsString);
@@ -407,8 +419,11 @@ public abstract class AttributesView<
FlowPanel panel = new FlowPanel();
panel.setStyleName("flex layout horizontal center");
- FormInputText inputText = createStringEditorWidget(style, currentValue, defaultValue, updateConsumer);
- panel.add(inputText);
+ IsWidget widget = createStringEditorWidget(style, currentValue, defaultValue, updateConsumer);
+ FlowPanel widgetWrapper = new FlowPanel();
+ widgetWrapper.setStyleName("flex layout horizontal center");
+ widgetWrapper.add(widget);
+ panel.add(widgetWrapper);
if (isShowTimestamp(attribute)) {
TimestampLabel timestampLabel = new TimestampLabel(attribute.getValueTimestamp());
panel.add(timestampLabel);
@@ -417,15 +432,19 @@ public abstract class AttributesView<
return () -> panel;
}
- protected FormInputText createStringEditorWidget(S style,
- String currentValue,
- Optional<String> defaultValue,
- Consumer<String> updateConsumer) {
+ protected IsWidget createStringEditorWidget(S style,
+ String currentValue,
+ Optional<String> defaultValue,
+ Consumer<String> updateConsumer) {
FormInputText input = createFormInputText(style.stringEditor());
if (currentValue != null) {
- input.setValue(currentValue);
- } else defaultValue.ifPresent(input::setValue);
+ input.setValue(currentValue);
+ } else if (defaultValue.isPresent()) {
+ input.setValue(defaultValue.get());
+ } else if (updateConsumer == null) {
+ return createNoValueWidget();
+ }
if (updateConsumer != null) {
input.addValueChangeHandler(
@@ -449,8 +468,11 @@ public abstract class AttributesView<
FlowPanel panel = new FlowPanel();
panel.setStyleName("flex layout horizontal center");
- FormInputText inputText = createNumberEditorWidget(style, currentValue, defaultValue, updateConsumer);
- panel.add(inputText);
+ IsWidget widget = createNumberEditorWidget(style, currentValue, defaultValue, updateConsumer);
+ FlowPanel widgetWrapper = new FlowPanel();
+ widgetWrapper.setStyleName("flex layout horizontal center");
+ widgetWrapper.add(widget);
+ panel.add(widgetWrapper);
if (isShowTimestamp(attribute)) {
TimestampLabel timestampLabel = new TimestampLabel(attribute.getValueTimestamp());
panel.add(timestampLabel);
@@ -459,15 +481,19 @@ public abstract class AttributesView<
return () -> panel;
}
- protected FormInputText createNumberEditorWidget(S style,
- String currentValue,
- Optional<String> defaultValue,
- Consumer<String> updateConsumer) {
+ protected IsWidget createNumberEditorWidget(S style,
+ String currentValue,
+ Optional<String> defaultValue,
+ Consumer<String> updateConsumer) {
FormInputText input = createFormInputText(style.numberEditor());
if (currentValue != null) {
input.setValue(currentValue);
- } else defaultValue.ifPresent(input::setValue);
+ } else if (defaultValue.isPresent()) {
+ input.setValue(defaultValue.get());
+ } else if (updateConsumer == null) {
+ return createNoValueWidget();
+ }
if (updateConsumer != null) {
input.addValueChangeHandler(event -> {
@@ -482,7 +508,7 @@ public abstract class AttributesView<
}
protected AttributeEditor createBooleanEditor(AssetAttribute attribute, Optional<MetaItem> defaultValueItem, S style, FormGroup formGroup) {
- boolean currentValue = attribute.getValueAsBoolean().orElse(false); // An empty boolean attribute value is false
+ Boolean currentValue = attribute.getValueAsBoolean().orElse(null);
Optional<Boolean> defaultValue = defaultValueItem.flatMap(AbstractValueHolder::getValueAsBoolean);
Consumer<Boolean> updateConsumer = !isEditorReadOnly(attribute)
@@ -491,11 +517,11 @@ public abstract class AttributesView<
FlowPanel panel = new FlowPanel();
panel.setStyleName("flex layout horizontal center");
- FormCheckBox checkBox = createBooleanEditorWidget(style, currentValue, defaultValue, updateConsumer);
- FlowPanel checkBoxWrapper = new FlowPanel();
- checkBoxWrapper.setStyleName("flex layout horizontal center");
- checkBoxWrapper.add(checkBox);
- panel.add(checkBoxWrapper);
+ IsWidget widget = createBooleanEditorWidget(style, currentValue, defaultValue, updateConsumer);
+ FlowPanel widgetWrapper = new FlowPanel();
+ widgetWrapper.setStyleName("flex layout horizontal center");
+ widgetWrapper.add(widget);
+ panel.add(widgetWrapper);
if (isShowTimestamp(attribute)) {
TimestampLabel timestampLabel = new TimestampLabel(attribute.getValueTimestamp());
panel.add(timestampLabel);
@@ -504,10 +530,10 @@ public abstract class AttributesView<
return () -> panel;
}
- protected FormCheckBox createBooleanEditorWidget(S style,
- Boolean currentValue,
- Optional<Boolean> defaultValue,
- Consumer<Boolean> updateConsumer) {
+ protected IsWidget createBooleanEditorWidget(S style,
+ Boolean currentValue,
+ Optional<Boolean> defaultValue,
+ Consumer<Boolean> updateConsumer) {
FormCheckBox input = createFormInputCheckBox(style.booleanEditor());
Boolean value = null;
@@ -515,6 +541,8 @@ public abstract class AttributesView<
value = currentValue;
} else if (defaultValue.isPresent()) {
value = defaultValue.get();
+ } else if (updateConsumer == null) {
+ return createNoValueWidget();
}
input.setValue(value);
@@ -542,13 +570,13 @@ public abstract class AttributesView<
FlowPanel panel = new FlowPanel();
panel.setStyleName("flex layout horizontal center");
- IsWidget jsonEditorWidget = createJsonEditorWidget(
+ IsWidget widget = createJsonEditorWidget(
style, environment.getMessages().jsonArray(), title, currentValue.orElse(null), updateConsumer, resetSupplier
);
- FlowPanel wrapper = new FlowPanel();
- wrapper.setStyleName("flex layout horizontal center");
- wrapper.add(jsonEditorWidget);
- panel.add(wrapper);
+ FlowPanel widgetWrapper = new FlowPanel();
+ widgetWrapper.setStyleName("flex layout horizontal center");
+ widgetWrapper.add(widget);
+ panel.add(widgetWrapper);
if (isShowTimestamp(attribute)) {
TimestampLabel timestampLabel = new TimestampLabel(attribute.getValueTimestamp());
panel.add(timestampLabel);
@@ -572,13 +600,13 @@ public abstract class AttributesView<
FlowPanel panel = new FlowPanel();
panel.setStyleName("flex layout horizontal center");
- IsWidget jsonEditorWidget = createJsonEditorWidget(
+ IsWidget widget = createJsonEditorWidget(
style, environment.getMessages().jsonObject(), title, currentValue.orElse(null), updateConsumer, resetSupplier
);
- FlowPanel wrapper = new FlowPanel();
- wrapper.setStyleName("flex layout horizontal center");
- wrapper.add(jsonEditorWidget);
- panel.add(wrapper);
+ FlowPanel widgetWrapper = new FlowPanel();
+ widgetWrapper.setStyleName("flex layout horizontal center");
+ widgetWrapper.add(widget);
+ panel.add(widgetWrapper);
if (isShowTimestamp(attribute)) {
TimestampLabel timestampLabel = new TimestampLabel(attribute.getValueTimestamp());
panel.add(timestampLabel);
@@ -656,6 +684,12 @@ public abstract class AttributesView<
int attributeGroupIndex = container.getPanel().getWidgetIndex(attributeGroups.get(attribute));
container.getPanel().remove(attributeGroupIndex);
attributeGroups.remove(attribute);
+
+ if (attributeGroups.size() == 0) {
+ Label emptyLabel = new Label(environment.getMessages().noAttributes());
+ emptyLabel.addStyleName(environment.getWidgetStyle().FormListEmptyMessage());
+ container.getPanel().add(emptyLabel);
+ }
}
protected void showInfo(String text) {
@@ -670,7 +704,7 @@ public abstract class AttributesView<
environment.getEventBus().dispatch(new ShowFailureEvent(error, 5000));
}
- protected void showValidationError(String fieldLabel, ValidationFailure validationFailure) {
+ public void showValidationError(String fieldLabel, ValidationFailure validationFailure) {
StringBuilder error = new StringBuilder();
if (fieldLabel != null)
error.append(environment.getMessages().validationFailedFor(fieldLabel));
diff --git a/manager/client/src/main/java/org/openremote/manager/client/i18n/ManagerMessages.java b/manager/client/src/main/java/org/openremote/manager/client/i18n/ManagerMessages.java
index f88320ba1..9e0a93211 100644
--- a/manager/client/src/main/java/org/openremote/manager/client/i18n/ManagerMessages.java
+++ b/manager/client/src/main/java/org/openremote/manager/client/i18n/ManagerMessages.java
@@ -221,6 +221,8 @@ public interface ManagerMessages extends Messages {
String value();
+ String noValue();
+
String metaItems();
String or();
@@ -283,6 +285,8 @@ public interface ManagerMessages extends Messages {
String attributeWriteSent(String name);
+ String duplicateAttributeName();
+
String invalidAttributeName();
String editAsset();
@@ -386,4 +390,6 @@ public interface ManagerMessages extends Messages {
String eventsRemoved();
String settingsSaved();
+
+ String noAttributes();
}
diff --git a/manager/client/src/main/java/org/openremote/manager/client/rules/RulesEditorImpl.ui.xml b/manager/client/src/main/java/org/openremote/manager/client/rules/RulesEditorImpl.ui.xml
index bc738f632..284fc52cf 100644
--- a/manager/client/src/main/java/org/openremote/manager/client/rules/RulesEditorImpl.ui.xml
+++ b/manager/client/src/main/java/org/openremote/manager/client/rules/RulesEditorImpl.ui.xml
@@ -20,6 +20,8 @@
}
.rulesTextArea {
+ margin: 0 !important;
+ padding: 0 !important;
}
</ui:style>
@@ -34,8 +36,7 @@
<w:second>
<g:HTMLPanel styleName="flex layout vertical">
- <g:HTMLPanel
- styleName="layout horizontal center end-justified {style.rulesControls} {widgetStyle.SecondaryNavHorizontal}">
+ <div class="layout horizontal center end-justified {style.rulesControls} {widgetStyle.SecondaryNavHorizontal}">
<w:Hyperlink
addStyleNames="{style.navItem} {widgetStyle.SecondaryNavItem}"
@@ -43,29 +44,30 @@
targetHistoryToken="globalRules:"
text="{managerMessages.manageGlobalRulesets}"/>
- </g:HTMLPanel>
+ </div>
- <g:HTMLPanel styleName="flex layout vertical {widgetStyle.MainContent}">
+ <w:Form ui:field="form" addStyleNames="flex">
- <w:Headline ui:field="headline" icon="edit"/>
+ <g:HTMLPanel styleName="flex-none layout vertical {widgetStyle.MainContent}">
- <g:FlowPanel
- styleName="flex-none layout horizontal {style.formMessages} {widgetStyle.FormMessages} success"
- visible="false">
- <w:IconLabel icon="check"
- addStyleNames="{widgetStyle.MessagesIcon}"/>
- <g:FlowPanel ui:field="formMessagesSuccess"/>
- </g:FlowPanel>
+ <w:Headline ui:field="headline" icon="edit"/>
- <g:FlowPanel
- styleName="flex-none layout horizontal {style.formMessages} {widgetStyle.FormMessages} error"
- visible="false">
- <w:IconLabel icon="warning"
- addStyleNames="{widgetStyle.MessagesIcon}"/>
- <g:FlowPanel ui:field="formMessagesError"/>
- </g:FlowPanel>
+ <g:FlowPanel
+ styleName="flex-none layout horizontal {style.formMessages} {widgetStyle.FormMessages} success"
+ visible="false">
+ <w:IconLabel icon="check"
+ addStyleNames="{widgetStyle.MessagesIcon}"/>
+ <g:FlowPanel ui:field="formMessagesSuccess"/>
+ </g:FlowPanel>
+
+ <g:FlowPanel
+ styleName="flex-none layout horizontal {style.formMessages} {widgetStyle.FormMessages} error"
+ visible="false">
+ <w:IconLabel icon="warning"
+ addStyleNames="{widgetStyle.MessagesIcon}"/>
+ <g:FlowPanel ui:field="formMessagesError"/>
+ </g:FlowPanel>
- <w:Form ui:field="form" addStyleNames="flex">
<w:FormGroup ui:field="nameGroup">
<w:label>
<w:FormLabel text="{managerMessages.rulesetName}"/>
@@ -103,11 +105,15 @@
</w:FormGroup>
<assetBrowser:AssetSelector ui:field="templateAssetSelector"/>
+ </g:HTMLPanel>
+ <g:HTMLPanel addStyleNames="flex layout vertical {style.rulesTextArea} {widgetStyle.MainContent}">
<w:FormTextArea ui:field="rulesTextArea"
spellcheck="false"
- addStyleNames="{style.rulesTextArea} flex"/>
+ addStyleNames="flex"/>
+ </g:HTMLPanel>
+ <g:HTMLPanel addStyleNames="flex-none layout vertical {widgetStyle.MainContent}">
<w:FormGroup ui:field="submitButtonGroup">
<w:field>
<w:FormField>
@@ -126,10 +132,9 @@
</w:FormField>
</w:field>
</w:FormGroup>
+ </g:HTMLPanel>
- </w:Form>
-
- </g:HTMLPanel>
+ </w:Form>
</g:HTMLPanel>
diff --git a/manager/client/src/main/java/org/openremote/manager/client/rules/asset/AssetRulesEditorActivity.java b/manager/client/src/main/java/org/openremote/manager/client/rules/asset/AssetRulesEditorActivity.java
index ef361150a..cef0d1fc4 100644
--- a/manager/client/src/main/java/org/openremote/manager/client/rules/asset/AssetRulesEditorActivity.java
+++ b/manager/client/src/main/java/org/openremote/manager/client/rules/asset/AssetRulesEditorActivity.java
@@ -82,7 +82,6 @@ public class AssetRulesEditorActivity
200,
asset -> {
view.setHeadline(asset.getName(), environment.getMessages().editAssetRuleset());
- view.setFormBusy(false);
},
ex -> handleRequestException(ex, environment)
);
diff --git a/manager/client/src/main/java/org/openremote/manager/client/rules/tenant/TenantRulesEditorActivity.java b/manager/client/src/main/java/org/openremote/manager/client/rules/tenant/TenantRulesEditorActivity.java
index 7fb743cbd..805426efa 100644
--- a/manager/client/src/main/java/org/openremote/manager/client/rules/tenant/TenantRulesEditorActivity.java
+++ b/manager/client/src/main/java/org/openremote/manager/client/rules/tenant/TenantRulesEditorActivity.java
@@ -82,7 +82,6 @@ public class TenantRulesEditorActivity
200,
tenant -> {
view.setHeadline(tenant.getDisplayName(), environment.getMessages().editTenantRuleset());
- view.setFormBusy(false);
},
ex -> handleRequestException(ex, environment)
);
diff --git a/manager/client/src/main/java/org/openremote/manager/client/style/WidgetStyle.java b/manager/client/src/main/java/org/openremote/manager/client/style/WidgetStyle.java
index 2488304fc..7a424e2ff 100644
--- a/manager/client/src/main/java/org/openremote/manager/client/style/WidgetStyle.java
+++ b/manager/client/src/main/java/org/openremote/manager/client/style/WidgetStyle.java
@@ -389,6 +389,10 @@ public class WidgetStyle {
return "or-LeftGradient";
}
+ public String TopGradient() {
+ return "or-TopGradient";
+ }
+
public String HighlightBackground() {
return "or-HighlightBackground";
}
diff --git a/manager/client/src/main/resources/org/openremote/manager/client/i18n/ManagerMessages.properties b/manager/client/src/main/resources/org/openremote/manager/client/i18n/ManagerMessages.properties
index b4faf8b37..1c50b4a5e 100644
--- a/manager/client/src/main/resources/org/openremote/manager/client/i18n/ManagerMessages.properties
+++ b/manager/client/src/main/resources/org/openremote/manager/client/i18n/ManagerMessages.properties
@@ -146,6 +146,7 @@ editTenantRuleset=Edit tenant ruleset
editAssetRuleset=Edit asset ruleset
attributeWriteSent=Attribute write sent to server: {0}
invalidAttributeName=Invalid attribute name, use only alphanumeric and underscore characters.
+duplicateAttributeName=Duplicate attribute name, please change it.
editAsset=Edit asset
viewAsset=View asset
errorLoadingTenant=Error loading tenant/realm of authenticated user (status: {0}), please reload application.
@@ -165,7 +166,7 @@ noRulesetsFound=No rulesets found, please create a ruleset.
noTenantsFound=No tenants found, please create a tenant.
noUserFound=No users found, please create a user.
showLiveUpdates=Show live updates
-refreshAllAttributes=Read and refresh all attributes
+refreshAllAttributes=Refresh attributes
start=Start
repeat=Repeat
getStatus=Get Status
@@ -175,7 +176,7 @@ attributeType[STRING]=Text
attributeType[NUMBER]=Number
attributeType[BOOLEAN]=On/Off toggle
attributeType[PERCENTAGE]=Percentage
-attributeType[TIMESTAMP_MILLIS]=Timestamp milliseconds
+attributeType[TIMESTAMP_MILLIS]=Timestamp milliseconds since epoch
attributeType[DATETIME]=Timestamp in ISO 8601
attributeType[COLOR_RGB]=Color RGB
attributeType[COLOR_ARGB]=Color ARGB
@@ -250,4 +251,6 @@ hours=Hours
days=Days
eventsRemoved=All events removed.
settingsSaved=Settings saved.
+noValue=No value available.
+noAttributes=Asset has no attributes.
diff --git a/manager/client/src/main/webapp/css/style.html b/manager/client/src/main/webapp/css/style.html
index fd31dbfb5..63d44c7ac 100644
--- a/manager/client/src/main/webapp/css/style.html
+++ b/manager/client/src/main/webapp/css/style.html
@@ -91,7 +91,9 @@
}
.or-LeftGradient::before {
- background-image: -webkit-linear-gradient(right, rgba(255, 255, 255, 0) 0%, rgba(0, 0, 0, 0.5) 100%);
+ background: -moz-linear-gradient(right, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 100%);
+ background: -webkit-linear-gradient(right, rgba(0,0,0,0.65) 0%,rgba(0,0,0,0) 100%);
+ background: linear-gradient(to left, rgba(0,0,0,0.65) 0%,rgba(0,0,0,0) 100%);
content: "\00a0";
height: 100%;
position: absolute;
@@ -101,8 +103,20 @@
}
.or-MainContent {
+ padding: .8em .8em 0 .8em
+ }
+
+ .or-MainContent.scrollable {
overflow: auto;
- padding: 0.8em;
+ }
+
+ .or-MainContent.scrollable div {
+ -webkit-flex-shrink:0;
+ flex-shrink:0;
+ }
+
+ .or-MainContent:first-child {
+ z-index: 0;
}
.or-PushButton,
@@ -293,6 +307,7 @@
.or-FormGroupExtension .or-FormSectionLabel {
margin: 0.8em 0 0.4em 0;
font-size: inherit;
+ font-weight: 600;
}
.or-FormLabel {
@@ -392,8 +407,8 @@
.or-FormTextArea {
font-size: 1em;
font-family: monospace;
- padding: 0.4em;
- margin: 0 0 0.4em 0;
+ padding: 0.4em 1.4em;
+ margin: 0;
white-space: pre;
resize: none;
}
@@ -529,13 +544,16 @@
}
.or-FormList {
- padding: 0.4em 0;
+ overflow: auto;
+ }
+ .or-FormList .or-FormListItem:last-child {
+ margin-bottom: 1.2em;
}
.or-FormListItem {
- border-radius: 0.4em;
- margin: 0.4em 0.8em;
+ border-radius: 0.3em;
+ margin: 0.4em;
padding: 0.4em;
}
diff --git a/manager/client/src/main/webapp/css/theme.html b/manager/client/src/main/webapp/css/theme.html
index 388824084..a441051e3 100644
--- a/manager/client/src/main/webapp/css/theme.html
+++ b/manager/client/src/main/webapp/css/theme.html
@@ -69,6 +69,10 @@
color: var(--theme-white);
}
+ .or-SecondaryNavItem.or-PushButton.primary {
+ color: var(--theme-lightgreen);
+ }
+
.or-SecondaryNavItem.or-FormInputText,
.or-SecondaryNavItem.or-FormInputNumber {
background: var(--theme-white);
@@ -141,16 +145,13 @@
}
.or-FormGroup.expanded {
- background-image: -webkit-linear-gradient(45deg, var(--theme-lightergrey) 0%, var(--theme-white) 100%);
- background-image: -moz-linear-gradient(45deg, var(--theme-lightergrey) 0%, var(--theme-white) 100%);
}
.or-FormGroupExtension .or-FormGroup {
background-image: none;
- background: var(--theme-white);
}
- .or-Form .or-FormSectionLabel {
+ .or-FormSectionLabel {
color: var(--theme-mediumgrey);
}
@@ -321,12 +322,18 @@
color: var(--theme-mediumgrey);
}
+ .or-MainContent {
+ -webkit-box-shadow: 0px 2px 2px 0px rgba(44, 44, 44, 0.4);
+ -moz-box-shadow: 0px 2px 2px 0px rgba(44, 44, 44, 0.4);
+ box-shadow: 0px 2px 2px 0px rgba(44, 44, 44, 0.4);
+ }
+
.or-FormList {
background-color: var(--theme-lightgrey);
}
.or-FormListItem {
- background: var(--theme-brightgrey);
+ background: var(--theme-white);
}
.or-FormListItem .warn {
@@ -407,7 +414,6 @@
}
.or-DatapointBrowser {
- background-color: var(--theme-white);
}
</style>
\ No newline at end of file