Issue #2: Moved BlocklistOption into its own file.
This commit is contained in:
parent
9d016eea17
commit
3ec25bc247
2 changed files with 69 additions and 61 deletions
69
dns/BlocklistOption.swift
Normal file
69
dns/BlocklistOption.swift
Normal file
|
|
@ -0,0 +1,69 @@
|
||||||
|
//
|
||||||
|
// BlocklistOption.swift
|
||||||
|
// dns
|
||||||
|
//
|
||||||
|
// Created by Benjamin Erhart on 14.04.26.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
enum BlocklistOption: String, CaseIterable, Identifiable {
|
||||||
|
case secure = "Secure"
|
||||||
|
case securePlusAdblock = "Secure + Adblock"
|
||||||
|
|
||||||
|
var id: String { rawValue }
|
||||||
|
|
||||||
|
var enabled: Bool {
|
||||||
|
switch self {
|
||||||
|
case .secure:
|
||||||
|
return true
|
||||||
|
case .securePlusAdblock:
|
||||||
|
return true //false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var description: String {
|
||||||
|
switch self {
|
||||||
|
case .secure:
|
||||||
|
return "Malware and phishing protection"
|
||||||
|
case .securePlusAdblock:
|
||||||
|
return "Security plus ad and tracker blocking"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var icon: String {
|
||||||
|
switch self {
|
||||||
|
case .secure:
|
||||||
|
return "shield"
|
||||||
|
case .securePlusAdblock:
|
||||||
|
return "shield.righthalf.filled"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var server: String {
|
||||||
|
switch self {
|
||||||
|
case .secure:
|
||||||
|
return "dns.sr2.uk"
|
||||||
|
case .securePlusAdblock:
|
||||||
|
return "dnsplus.sr2.uk"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var ipv4: String {
|
||||||
|
switch self {
|
||||||
|
case .secure:
|
||||||
|
return "144.76.160.194"
|
||||||
|
case .securePlusAdblock:
|
||||||
|
return "192.0.2.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var ipv6: String {
|
||||||
|
switch self {
|
||||||
|
case .secure:
|
||||||
|
return "2a01:4f8:2210:23ea::4"
|
||||||
|
case .securePlusAdblock:
|
||||||
|
return "2001:db8::1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,67 +1,6 @@
|
||||||
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
enum BlocklistOption: String, CaseIterable, Identifiable {
|
|
||||||
case secure = "Secure"
|
|
||||||
case securePlusAdblock = "Secure + Adblock"
|
|
||||||
|
|
||||||
var id: String { rawValue }
|
|
||||||
|
|
||||||
var enabled: Bool {
|
|
||||||
switch self {
|
|
||||||
case .secure:
|
|
||||||
return true
|
|
||||||
case .securePlusAdblock:
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var description: String {
|
|
||||||
switch self {
|
|
||||||
case .secure:
|
|
||||||
return "Malware and phishing protection"
|
|
||||||
case .securePlusAdblock:
|
|
||||||
return "Security plus ad and tracker blocking"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var icon: String {
|
|
||||||
switch self {
|
|
||||||
case .secure:
|
|
||||||
return "shield"
|
|
||||||
case .securePlusAdblock:
|
|
||||||
return "shield.righthalf.filled"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var server: String {
|
|
||||||
switch self {
|
|
||||||
case .secure:
|
|
||||||
return "dns.sr2.uk"
|
|
||||||
case .securePlusAdblock:
|
|
||||||
return "dnsplus.sr2.uk"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var ipv4: String {
|
|
||||||
switch self {
|
|
||||||
case .secure:
|
|
||||||
return "144.76.160.194"
|
|
||||||
case .securePlusAdblock:
|
|
||||||
return "192.0.2.1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var ipv6: String {
|
|
||||||
switch self {
|
|
||||||
case .secure:
|
|
||||||
return "2a01:4f8:2210:23ea::4"
|
|
||||||
case .securePlusAdblock:
|
|
||||||
return "2001:db8::1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
enum ServiceStatus {
|
enum ServiceStatus {
|
||||||
case pending
|
case pending
|
||||||
case operational
|
case operational
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue