olish API provider configuration UI with consistent styling and improved layout
This commit is contained in:
parent
ae387ad351
commit
311ce83be2
@ -142,8 +142,10 @@ struct APIKeyManagementView: View {
|
|||||||
.help("Reset to default")
|
.help("Reset to default")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !ollamaModels.isEmpty {
|
if !ollamaModels.isEmpty {
|
||||||
|
Divider()
|
||||||
|
|
||||||
Picker("Model", selection: $selectedOllamaModel) {
|
Picker("Model", selection: $selectedOllamaModel) {
|
||||||
ForEach(ollamaModels) { model in
|
ForEach(ollamaModels) { model in
|
||||||
Text(model.name).tag(model.name)
|
Text(model.name).tag(model.name)
|
||||||
@ -153,16 +155,19 @@ struct APIKeyManagementView: View {
|
|||||||
aiService.updateSelectedOllamaModel(newValue)
|
aiService.updateSelectedOllamaModel(newValue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Button("Refresh Connection") {
|
|
||||||
checkOllamaConnection()
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if aiService.selectedProvider == .custom {
|
} else if aiService.selectedProvider == .custom {
|
||||||
// Custom Configuration inline
|
// Custom Configuration inline
|
||||||
TextField("API Endpoint URL", text: $aiService.customBaseURL)
|
TextField("API Endpoint URL", text: $aiService.customBaseURL)
|
||||||
|
.textFieldStyle(.roundedBorder)
|
||||||
|
|
||||||
|
Divider()
|
||||||
|
|
||||||
TextField("Model Name", text: $aiService.customModel)
|
TextField("Model Name", text: $aiService.customModel)
|
||||||
|
.textFieldStyle(.roundedBorder)
|
||||||
|
|
||||||
|
Divider()
|
||||||
|
|
||||||
if aiService.isAPIKeyValid {
|
if aiService.isAPIKeyValid {
|
||||||
HStack {
|
HStack {
|
||||||
Text("API Key Set")
|
Text("API Key Set")
|
||||||
@ -173,6 +178,8 @@ struct APIKeyManagementView: View {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
SecureField("API Key", text: $apiKey)
|
SecureField("API Key", text: $apiKey)
|
||||||
|
.textFieldStyle(.roundedBorder)
|
||||||
|
|
||||||
Button("Verify and Save") {
|
Button("Verify and Save") {
|
||||||
isVerifying = true
|
isVerifying = true
|
||||||
aiService.saveAPIKey(apiKey) { success, errorMessage in
|
aiService.saveAPIKey(apiKey) { success, errorMessage in
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user