3 struct AdvancedSettings: View {
5 @AppStorage("backendUrl") var backendUrl: String = ""
6 @AppStorage("backendFormat") var outputFormats: OutputFormatSetting = .gifOnly
7 @AppStorage("keepFiles") var keepFiles = true
9 var parsedBackendUrl: URL? {
10 URL(string: backendUrl)
15 VStack (alignment: .center) {
16 LabeledContent("Backend URL") {
17 TextField("", text: $backendUrl).font(.body)
19 .help("The Backend URL to use. If this is empty, no backend will be used and the options below won't have an effect.")
20 Picker(selection: $outputFormats, label: Text("Backend Format").font(.headline)) {
22 .tag(OutputFormatSetting.gifOnly)
23 .padding(.horizontal, 4.0)
24 .padding(.vertical, 2.0)
26 .tag(OutputFormatSetting.mp4Only)
27 .padding(.horizontal, 4.0)
28 .padding(.vertical, 2.0)
30 .pickerStyle(.radioGroup)
31 .disabled(parsedBackendUrl == nil)
32 .help("The format picked here will be generated regardless of what option you pick in the output settings. It doesn't prevent files from being rendered.")
33 Toggle("Keep Local Files", isOn: $keepFiles)
35 .disabled(parsedBackendUrl == nil)
36 .padding(.vertical, 8.0)
37 .help("If this is off, locally generated recordings will be deleted immediately after a successful upload.")
39 Text("These settings can break things! Please make sure you understand how to use them before enabling.")
41 Link(destination: URL(string: "https://captura.tranquil.systems")!) {
42 Image(systemName: "info.circle")
43 }.buttonStyle(.borderless)