feat: added api server port setting

This commit is contained in:
Daniel Alencar
2023-11-11 15:52:51 -03:00
committed by AT
parent 5c248dbec9
commit fe653d1489
4 changed files with 58 additions and 2 deletions

View File

@@ -254,9 +254,41 @@ MySettingsTab {
}
ToolTip.text: qsTr("WARNING: This enables the gui to act as a local REST web server(OpenAI API compliant) for API requests and will increase your RAM usage as well")
ToolTip.visible: hovered
}
Label {
id: serverPortLabel
text: qsTr("Server Port (Requires restart):")
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
Layout.row: 9
Layout.column: 0
}
MyTextField {
text: MySettings.networkPort
color: theme.textColor
font.pixelSize: theme.fontSizeLarge
ToolTip.text: qsTr("Api server port. WARNING: You need to restart the application for it to take effect")
ToolTip.visible: hovered
Layout.row: 9
Layout.column: 1
validator: IntValidator {
bottom: 1
}
onEditingFinished: {
var val = parseInt(text)
if (!isNaN(val)) {
MySettings.networkPort = val
focus = false
} else {
text = MySettings.networkPort
}
}
Accessible.role: Accessible.EditableText
Accessible.name: nServerPortLabel.text
Accessible.description: ToolTip.text
}
Rectangle {
Layout.row: 9
Layout.row: 10
Layout.column: 0
Layout.columnSpan: 3
Layout.fillWidth: true