Allow setting server url in settings

This commit is contained in:
Christoph Hagen
2024-03-01 17:37:10 +01:00
parent 1d992b0bd2
commit 3dc5674a3a
5 changed files with 82 additions and 28 deletions

View File

@@ -14,10 +14,6 @@ struct CapRowView: View {
@EnvironmentObject
var database: Database
var imageUrl: URL {
database.serverUrl.appendingPathComponent(cap.mainImagePath)
}
var body: some View {
HStack(alignment: .center) {
VStack(alignment: .leading, spacing: 0) {

View File

@@ -18,6 +18,18 @@ struct SettingsView: View {
var body: some View {
NavigationView {
VStack(alignment: .leading, spacing: 3) {
Text("Server")
.font(.footnote)
.textCase(.uppercase)
.foregroundColor(.secondary)
.padding(.top)
Group {
FancyTextField(
text: $database.serverPath,
icon: .globe,
placeholder: "Server url")
.keyboardType(.URL)
}.padding(.horizontal)
Text("Authentication")
.font(.footnote)
.textCase(.uppercase)
@@ -25,6 +37,7 @@ struct SettingsView: View {
.padding(.top)
Group {
FancyTextField(text: $serverAuthenticationKey, icon: .key, placeholder: "Server key")
.keyboardType(.asciiCapable)
}.padding(.horizontal)
Text("Statistics")
.font(.footnote)