Files
metabuilder/qml/MetaBuilder/CBackendDetailPanel.qml
johndoe6345789 7ce9667c58 feat(a11y): extend Accessible annotations to all widget + view QML files
Continues the a11y pass from the previous commit — adds objectName,
Accessible.role, Accessible.name to all remaining qml/MetaBuilder/,
qml/qt6/, and qml/widgets/ files. Widget files also get activeFocusOnTab
on interactive elements and dynamic Accessible.name bindings.

Cleans up redundant addImportPath(projectRoot) call in main.cpp.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-19 20:47:28 +00:00

126 lines
3.5 KiB
QML

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QmlComponents 1.0
CCard {
id: root
objectName: "panel_backend_detail"
Accessible.role: Accessible.Pane
Accessible.name: backend.name || "Backend"
Layout.fillWidth: true
Layout.fillHeight: true
property var backend: ({
name: "", key: "",
status: "disconnected",
description: "",
connectionString: "",
records: 0, sizeKb: 0,
lastBackup: "Never"
})
property bool isActive: false
property int testingIndex: -1
property int backendIndex: -1
property var testResult: undefined
signal testConnectionRequested()
signal setActiveRequested()
function formatSize(kb) {
if (kb < 1024) return kb + " KB"
return (kb / 1024).toFixed(1) + " MB"
}
Flickable {
anchors.fill: parent
anchors.margins: 16
contentHeight:
detailColumn.implicitHeight
clip: true
ColumnLayout {
id: detailColumn
width: parent.width
spacing: 16
FlexRow {
Layout.fillWidth: true
spacing: 12
CText {
variant: "h4"
text: root.backend.name
}
CStatusBadge {
status: root.backend.status
=== "connected"
? "success"
: (root.backend.status
=== "error"
? "error" : "warning")
text: root.backend.status
}
Item { Layout.fillWidth: true }
CBadge {
text: root.isActive
? "ACTIVE" : "INACTIVE"
accent: root.isActive
}
}
CText {
variant: "body1"
text: root.backend.description
wrapMode: Text.Wrap
Layout.fillWidth: true
}
CDivider { Layout.fillWidth: true }
CBackendConnectionSection {
Layout.fillWidth: true
connectionString:
root.backend.connectionString
isActive: root.isActive
isTesting: root.testingIndex
=== root.backendIndex
isConnected:
root.backend.status
=== "connected"
testResult: root.testResult
onTestConnectionRequested:
root.testConnectionRequested()
onSetActiveRequested:
root.setActiveRequested()
}
CDivider { Layout.fillWidth: true }
CText {
variant: "subtitle1"
text: "Storage Statistics"
}
FlexRow {
Layout.fillWidth: true
spacing: 12
CStatCell {
label: "Records"
value: root.backend
.records.toLocaleString()
}
CStatCell {
label: "Size"
value: root.formatSize(
root.backend.sizeKb)
}
CStatCell {
label: "Last Backup"
value: root.backend.lastBackup
valueVariant: "body2"
}
}
}
}
}