SmartLockerTools/Analyser/qml/ExtendedOperations.qml

79 lines
2.2 KiB
QML
Raw Permalink Normal View History

2024-09-25 18:44:04 +08:00
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Analyser
Item {
id: control
RowLayout {
anchors.fill: parent
enabled: App.connected
Column {
GroupBox {
title: "删除用户"
GridLayout {
columns: 2
Label {
text: qsTr("用户ID")
}
TextField {
id: deleteUserId
implicitWidth: 100
}
Button {
text: "删除"
onClicked: App.deleteUser(parseInt(deleteUserId.text))
}
Button {
text: "删除所有"
onClicked: App.deleteAll()
}
}
}
GroupBox {
title: "其它"
enabled: App.connected
GridLayout {
columns: 2
Button {
text: "复位"
onClicked: App.module.reset()
}
Button {
text: "状态查询"
onClicked: App.module.requestCurrentStatus()
}
Button {
text: "ID查询"
onClicked: App.module.requestUniqueId()
}
Button {
id: otaButton
text: "OTA升级"
onClicked: loader.active = true
}
}
}
}
}
MouseArea {
id: otaMouseArea
width: otaButton.width
height: otaButton.height
enabled: !App.connected
onClicked: {
loader.active = true
}
}
onVisibleChanged: {
if (!visible)
return
Qt.callLater(() => {
otaMouseArea.x = otaButton.mapToItem(control, 0, 0).x
otaMouseArea.y = otaButton.mapToItem(control, 0, 0).y
})
}
}