diff --git a/Passepartout-iOS/Scenes/ConfigurationViewController.swift b/Passepartout-iOS/Scenes/ConfigurationViewController.swift index dad0cff9..580850c6 100644 --- a/Passepartout-iOS/Scenes/ConfigurationViewController.swift +++ b/Passepartout-iOS/Scenes/ConfigurationViewController.swift @@ -87,6 +87,7 @@ class ConfigurationViewController: UIViewController, TableModelHost { } else { networkRows = [] } + networkRows.insert(.defaultGateway, at: 0) networkRows.append(.dnsDomain) networkRows.append(.httpProxy) networkRows.append(.httpsProxy) @@ -197,6 +198,8 @@ extension ConfigurationViewController: UITableViewDataSource, UITableViewDelegat case compressionAlgorithm + case defaultGateway + case dnsServer case dnsDomain @@ -304,12 +307,22 @@ extension ConfigurationViewController: UITableViewDataSource, UITableViewDelegat cell.accessoryType = .none cell.isTappable = false + case .defaultGateway: + cell.leftText = L10n.Configuration.Cells.DefaultGateway.caption + if let policies = configuration.routingPolicies { + cell.rightText = policies.map { $0.rawValue }.joined(separator: " / ") + } else { + cell.rightText = V.All.Value.none + } + cell.accessoryType = .none + cell.isTappable = false + case .dnsServer: guard let dnsServers = configuration.dnsServers else { fatalError("Showing DNS section without any custom server") } cell.leftText = L10n.Configuration.Cells.DnsServer.caption - cell.rightText = dnsServers[indexPath.row] + cell.rightText = dnsServers[indexPath.row - 1] cell.accessoryType = .none cell.isTappable = false diff --git a/Passepartout/Resources/en.lproj/Localizable.strings b/Passepartout/Resources/en.lproj/Localizable.strings index 2876518a..bda34dac 100644 --- a/Passepartout/Resources/en.lproj/Localizable.strings +++ b/Passepartout/Resources/en.lproj/Localizable.strings @@ -181,6 +181,7 @@ "configuration.cells.tls_wrapping.value.auth" = "Authentication"; "configuration.cells.tls_wrapping.value.crypt" = "Encryption"; "configuration.cells.eku.caption" = "Extended verification"; +"configuration.cells.default_gateway.caption" = "Default gateway"; "configuration.cells.dns_server.caption" = "DNS"; "configuration.cells.dns_domain.caption" = "Domain"; "configuration.cells.proxy_http.caption" = "Proxy"; diff --git a/Passepartout/Sources/SwiftGen+Strings.swift b/Passepartout/Sources/SwiftGen+Strings.swift index bb60cafc..49fb2e55 100644 --- a/Passepartout/Sources/SwiftGen+Strings.swift +++ b/Passepartout/Sources/SwiftGen+Strings.swift @@ -168,6 +168,10 @@ public enum L10n { public static let lzo = L10n.tr("Localizable", "configuration.cells.compression_framing.value.lzo") } } + public enum DefaultGateway { + /// Default gateway + public static let caption = L10n.tr("Localizable", "configuration.cells.default_gateway.caption") + } public enum Digest { /// Authentication public static let caption = L10n.tr("Localizable", "configuration.cells.digest.caption")