feat: v0.1.0 — client Sailfish per hermes-webui con voce
- ApiClient HTTP/SSE: login, sessioni, chat/start, stream SSE, transcribe, tts - ChatModel: streaming live + risincronizzazione dallo stato del server - CookieJar persistente (0600, mai la password); Settings - Recorder OGG/Opus (fallback WAV/PCM, retry); Player TTS (QMediaPlayer) - UI Silica: splash, login, sessioni, chat (dettatura + read-aloud), settings, cover - Sailjail Internet;Audio;Microphone; icone; spec RPM; docs PROTOCOL/BUILD - tests/core_test: unit parser SSE + integrazione live (probe :8899)
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
import QtQuick 2.0
|
||||
import Sailfish.Silica 1.0
|
||||
|
||||
// Login alla Web UI di Hermes: URL del server + password.
|
||||
// La password non viene salvata: dopo il login resta il cookie di sessione.
|
||||
Page {
|
||||
id: page
|
||||
|
||||
Column {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
spacing: Theme.paddingLarge
|
||||
|
||||
PageHeader { title: qsTr("Sign in") }
|
||||
|
||||
Label {
|
||||
x: Theme.horizontalPageMargin
|
||||
width: parent.width - 2 * Theme.horizontalPageMargin
|
||||
wrapMode: Text.WordWrap
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.secondaryColor
|
||||
text: qsTr("Use the same password you use in the Hermes Web UI in your browser.")
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: urlField
|
||||
width: parent.width
|
||||
label: qsTr("Server")
|
||||
placeholderText: "https://hermes.example.com"
|
||||
inputMethodHints: Qt.ImhUrlCharactersOnly | Qt.ImhNoAutoUppercase
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: passField
|
||||
width: parent.width
|
||||
label: qsTr("Password")
|
||||
echoMode: TextInput.Password
|
||||
inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
|
||||
onAccepted: page.doLogin()
|
||||
}
|
||||
|
||||
Button {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: api.busy ? qsTr("Signing in…") : qsTr("Sign in")
|
||||
enabled: !api.busy && passField.text.length > 0
|
||||
onClicked: page.doLogin()
|
||||
}
|
||||
|
||||
Label {
|
||||
x: Theme.horizontalPageMargin
|
||||
width: parent.width - 2 * Theme.horizontalPageMargin
|
||||
wrapMode: Text.WordWrap
|
||||
visible: api.lastError.length > 0
|
||||
color: Theme.errorColor
|
||||
text: api.lastError
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: api
|
||||
onLoggedInChanged: {
|
||||
if (api.loggedIn)
|
||||
pageStack.replace(Qt.resolvedUrl("SessionsPage.qml"))
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: urlField.text = appSettings.baseUrl
|
||||
|
||||
function doLogin() {
|
||||
if (passField.text.length === 0)
|
||||
return
|
||||
api.clearError()
|
||||
appSettings.baseUrl = urlField.text
|
||||
api.login(passField.text)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user