Files
metabuilder/qml/MetaBuilder/CConnectionTest.qml
johndoe6345789 1fbf1a55b3 fix(qt6): build fixes — semicolons, JS import paths, duplicate signal, CMake regen
- Fix semicolons between child components in 5 view files
- Fix JS import paths (../MetaBuilder/ → qmllib/MetaBuilder/) in 7 files
- Fix CServiceConnectionRow duplicate signal (urlChanged → urlEdited)
- QmlComponents/ directory with forwarding qmldir (no symlink)
- CMake regenerated: 292 QML/JS files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 15:08:07 +00:00

69 lines
2.0 KiB
QML

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QmlComponents 1.0
import "../dbal"
/**
* CConnectionTest - DBAL connection test panel with URL input,
* test button, and status indicator.
*/
ColumnLayout {
id: root
spacing: 12
property bool isDark: Theme.mode === "dark"
DBALProvider { id: dbal }
property string dbalUrl: dbal.baseUrl
property string mediaServiceUrl: "http://localhost:9090"
property string dbalConnectionStatus: dbal.connected ? "connected" : "disconnected"
property string mediaConnectionStatus: "unknown"
function testDBALConnection() {
dbalConnectionStatus = "testing"
dbal.baseUrl = dbalUrl
dbal.ping(function(success, error) {
dbalConnectionStatus = success ? "connected" : "disconnected"
})
}
function testMediaConnection() {
mediaConnectionStatus = "testing"
var xhr = new XMLHttpRequest()
xhr.onreadystatechange = function() {
if (xhr.readyState === XMLHttpRequest.DONE) {
mediaConnectionStatus = (xhr.status >= 200 && xhr.status < 300)
? "connected" : "disconnected"
}
}
xhr.open("GET", mediaServiceUrl + "/health")
xhr.send()
}
CServiceConnectionRow {
Layout.fillWidth: true
label: "DBAL Server"
fieldLabel: "DBAL URL"
placeholder: "http://localhost:8080"
url: root.dbalUrl
connectionStatus: root.dbalConnectionStatus
onUrlEdited: function(newUrl) { root.dbalUrl = newUrl }
onTestRequested: root.testDBALConnection()
}
CDivider { Layout.fillWidth: true }
CServiceConnectionRow {
Layout.fillWidth: true
label: "Media Service"
fieldLabel: "Media Service URL"
placeholder: "http://localhost:9090"
url: root.mediaServiceUrl
connectionStatus: root.mediaConnectionStatus
onUrlEdited: function(newUrl) { root.mediaServiceUrl = newUrl }
onTestRequested: root.testMediaConnection()
}
}