Improvements for action logs

This commit is contained in:
Michael Zanetti 2023-04-25 15:08:42 +02:00
parent 32f08120c2
commit d0fed74a24
2 changed files with 11 additions and 8 deletions

View File

@ -358,8 +358,10 @@ ThingPageBase {
text: actionType.displayName text: actionType.displayName
} }
Button { ProgressButton {
Layout.fillWidth: true // Layout.fillWidth: true
imageSource: "send"
longpressEnabled: false
onClicked: { onClicked: {
if (actionDelegate.actionType.paramTypes.count === 0) { if (actionDelegate.actionType.paramTypes.count === 0) {
@ -423,6 +425,7 @@ ThingPageBase {
Item { Item {
Layout.preferredHeight: preferredSize Layout.preferredHeight: preferredSize
Layout.preferredWidth: preferredSize Layout.preferredWidth: preferredSize
visible: preferredSize > 0
property int preferredSize: actionDelegate.pendingActionId !== -1 || pendingTimer.running ? Style.iconSize : 0 property int preferredSize: actionDelegate.pendingActionId !== -1 || pendingTimer.running ? Style.iconSize : 0
Behavior on preferredSize { NumberAnimation { duration: 100 } } Behavior on preferredSize { NumberAnimation { duration: 100 } }

View File

@ -45,10 +45,11 @@ Page {
readonly property bool isLogged: thing.loggedStateTypeIds.indexOf(stateType.id) >= 0 readonly property bool isLogged: thing.loggedStateTypeIds.indexOf(stateType.id) >= 0
readonly property bool canShowGraph: { readonly property bool canShowGraph: {
switch (root.stateType.type) { switch (root.stateType.type.toLowerCase()) {
case "Int": case "int":
case "Double": case "uint":
case "Bool": case "double":
case "bool":
return true; return true;
} }
print("not showing graph for", root.stateType.type) print("not showing graph for", root.stateType.type)
@ -119,10 +120,9 @@ Page {
delegate: NymeaItemDelegate { delegate: NymeaItemDelegate {
width: listView.width width: listView.width
property NewLogEntry entry: logsModel.get(index) property NewLogEntry entry: logsModel.get(index)
text: entry.values[root.stateType.name] text: Types.toUiValue(entry.values[root.stateType.name], root.stateType.unit) + " " + Types.toUiUnit(root.stateType.unit)
subText: entry.timestamp.toLocaleString(Qt.locale()) subText: entry.timestamp.toLocaleString(Qt.locale())
progressive: false progressive: false
Component.onCompleted: print("delegate:", JSON.stringify(entry.values), root.stateType.name, entry.values[root.stateType.name])
} }
} }
} }