Allow setting server url in settings
This commit is contained in:
@@ -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) {
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user