init
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
ApplicationWindow {
|
||||
id: win
|
||||
width: 420
|
||||
height: 320
|
||||
visible: true
|
||||
title: "Navidrome Login"
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 16
|
||||
spacing: 10
|
||||
|
||||
Label {
|
||||
text: "Server"
|
||||
font.bold: true
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: urlField
|
||||
Layout.fillWidth: true
|
||||
placeholderText: "https://navidrome.timvandenboom.eth64.de"
|
||||
text: "https://navidrome.timvandenboom.eth64.de"
|
||||
}
|
||||
|
||||
Label {
|
||||
text: "Username"
|
||||
font.bold: true
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: userField
|
||||
Layout.fillWidth: true
|
||||
placeholderText: "username"
|
||||
}
|
||||
|
||||
Label {
|
||||
text: "Password"
|
||||
font.bold: true
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: passField
|
||||
Layout.fillWidth: true
|
||||
placeholderText: "password"
|
||||
echoMode: TextInput.Password
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: 10
|
||||
|
||||
Button {
|
||||
text: navidromeApi.busy ? "Connecting..." : "Login (Ping)"
|
||||
enabled: !navidromeApi.busy
|
||||
Layout.fillWidth: true
|
||||
|
||||
onClicked: {
|
||||
navidromeApi.ping(urlField.text, userField.text, passField.text)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
height: 1
|
||||
opacity: 0.2
|
||||
color: "white"
|
||||
}
|
||||
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
wrapMode: Text.WordWrap
|
||||
|
||||
text: {
|
||||
if (navidromeApi.busy) return "Verbinde…"
|
||||
if (navidromeApi.lastError.length > 0) return "❌ " + navidromeApi.lastError
|
||||
if (navidromeApi.lastStatus.length > 0) return "✅ status: " + navidromeApi.lastStatus
|
||||
return "Noch nicht verbunden."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user