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
}
Button {
Layout.fillWidth: true
ProgressButton {
// Layout.fillWidth: true
imageSource: "send"
longpressEnabled: false
onClicked: {
if (actionDelegate.actionType.paramTypes.count === 0) {
@ -423,6 +425,7 @@ ThingPageBase {
Item {
Layout.preferredHeight: preferredSize
Layout.preferredWidth: preferredSize
visible: preferredSize > 0
property int preferredSize: actionDelegate.pendingActionId !== -1 || pendingTimer.running ? Style.iconSize : 0
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 canShowGraph: {
switch (root.stateType.type) {
case "Int":
case "Double":
case "Bool":
switch (root.stateType.type.toLowerCase()) {
case "int":
case "uint":
case "double":
case "bool":
return true;
}
print("not showing graph for", root.stateType.type)
@ -119,10 +120,9 @@ Page {
delegate: NymeaItemDelegate {
width: listView.width
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())
progressive: false
Component.onCompleted: print("delegate:", JSON.stringify(entry.values), root.stateType.name, entry.values[root.stateType.name])
}
}
}