mirror of
https://github.com/yggdrasil-network/yggdrasil-ios.git
synced 2025-04-27 21:55:10 +03:00
Various updates
This commit is contained in:
parent
1b9e84d056
commit
2eabf7f5ee
5 changed files with 53 additions and 50 deletions
|
@ -15,6 +15,7 @@ import Yggdrasil
|
|||
import NetworkExtension
|
||||
import Foundation
|
||||
import CoreData
|
||||
import Combine
|
||||
|
||||
#if os(iOS)
|
||||
class PlatformItemSource: NSObject, UIActivityItemSource {
|
||||
|
@ -34,12 +35,12 @@ class ConfigurationProxy: PlatformItemSource {
|
|||
private var manager: NETunnelProviderManager?
|
||||
private var json: Data? = nil {
|
||||
didSet {
|
||||
summary = MobileSummaryFromConfig(json)
|
||||
//summary = MobileSummaryFromConfig(json)
|
||||
}
|
||||
}
|
||||
private var dict: [String: Any]? = [:]
|
||||
private var timer: Timer?
|
||||
public var summary: MobileParsedConfig?
|
||||
//public var summary: MobileParsedConfig?
|
||||
|
||||
init(manager: NETunnelProviderManager) {
|
||||
self.manager = manager
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
39BF9FC12A2E9E51000E7269 /* YggdrasilNetworkExtension-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "YggdrasilNetworkExtension-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
39CC924B221DEDCE004960DC /* IPCResponses.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IPCResponses.swift; sourceTree = "<group>"; };
|
||||
39DB9BEC2BCF28FA009BF2A4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||
39F0205B2996CD760093F603 /* YggdrasilSwiftUI.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = YggdrasilSwiftUI.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
39F0205B2996CD760093F603 /* Yggdrasil.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Yggdrasil.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
39F0205D2996CD760093F603 /* Application.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Application.swift; sourceTree = "<group>"; };
|
||||
39F0205F2996CD760093F603 /* StatusView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusView.swift; sourceTree = "<group>"; };
|
||||
39F020612996CD770093F603 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
|
@ -165,7 +165,7 @@
|
|||
isa = PBXGroup;
|
||||
children = (
|
||||
E593CE971DF905AF00D7265D /* YggdrasilNetworkExtension.appex */,
|
||||
39F0205B2996CD760093F603 /* YggdrasilSwiftUI.app */,
|
||||
39F0205B2996CD760093F603 /* Yggdrasil.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
|
@ -187,9 +187,9 @@
|
|||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
39F0205A2996CD760093F603 /* YggdrasilSwiftUI */ = {
|
||||
39F0205A2996CD760093F603 /* Yggdrasil */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 39F020672996CD770093F603 /* Build configuration list for PBXNativeTarget "YggdrasilSwiftUI" */;
|
||||
buildConfigurationList = 39F020672996CD770093F603 /* Build configuration list for PBXNativeTarget "Yggdrasil" */;
|
||||
buildPhases = (
|
||||
39F020572996CD760093F603 /* Sources */,
|
||||
39F020582996CD760093F603 /* Frameworks */,
|
||||
|
@ -201,9 +201,9 @@
|
|||
dependencies = (
|
||||
39F99B362A48F70F0045BD10 /* PBXTargetDependency */,
|
||||
);
|
||||
name = YggdrasilSwiftUI;
|
||||
name = Yggdrasil;
|
||||
productName = YggdrasilSwiftUI;
|
||||
productReference = 39F0205B2996CD760093F603 /* YggdrasilSwiftUI.app */;
|
||||
productReference = 39F0205B2996CD760093F603 /* Yggdrasil.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
E593CE961DF905AF00D7265D /* YggdrasilNetworkExtension */ = {
|
||||
|
@ -269,7 +269,7 @@
|
|||
projectRoot = "";
|
||||
targets = (
|
||||
E593CE961DF905AF00D7265D /* YggdrasilNetworkExtension */,
|
||||
39F0205A2996CD760093F603 /* YggdrasilSwiftUI */,
|
||||
39F0205A2996CD760093F603 /* Yggdrasil */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
@ -342,7 +342,7 @@
|
|||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_ENTITLEMENTS = YggdrasilSwiftUI/YggdrasilSwiftUI.entitlements;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
CURRENT_PROJECT_VERSION = 42;
|
||||
DEAD_CODE_STRIPPING = YES;
|
||||
DEVELOPMENT_ASSET_PATHS = "\"YggdrasilSwiftUI/Preview Content\"";
|
||||
DEVELOPMENT_TEAM = R9AV23TXF2;
|
||||
|
@ -396,7 +396,7 @@
|
|||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_ENTITLEMENTS = YggdrasilSwiftUI/YggdrasilSwiftUI.entitlements;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
CURRENT_PROJECT_VERSION = 42;
|
||||
DEAD_CODE_STRIPPING = YES;
|
||||
DEVELOPMENT_ASSET_PATHS = "\"YggdrasilSwiftUI/Preview Content\"";
|
||||
DEVELOPMENT_TEAM = R9AV23TXF2;
|
||||
|
@ -643,7 +643,7 @@
|
|||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
39F020672996CD770093F603 /* Build configuration list for PBXNativeTarget "YggdrasilSwiftUI" */ = {
|
||||
39F020672996CD770093F603 /* Build configuration list for PBXNativeTarget "Yggdrasil" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
39F020682996CD770093F603 /* Debug */,
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "39F0205A2996CD760093F603"
|
||||
BuildableName = "YggdrasilSwiftUI.app"
|
||||
BlueprintName = "YggdrasilSwiftUI"
|
||||
BuildableName = "Yggdrasil.app"
|
||||
BlueprintName = "Yggdrasil"
|
||||
ReferencedContainer = "container:Yggdrasil Network.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
|
@ -45,8 +45,8 @@
|
|||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "39F0205A2996CD760093F603"
|
||||
BuildableName = "YggdrasilSwiftUI.app"
|
||||
BlueprintName = "YggdrasilSwiftUI"
|
||||
BuildableName = "Yggdrasil.app"
|
||||
BlueprintName = "Yggdrasil"
|
||||
ReferencedContainer = "container:Yggdrasil Network.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
|
@ -62,8 +62,8 @@
|
|||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "39F0205A2996CD760093F603"
|
||||
BuildableName = "YggdrasilSwiftUI.app"
|
||||
BlueprintName = "YggdrasilSwiftUI"
|
||||
BuildableName = "Yggdrasil.app"
|
||||
BlueprintName = "Yggdrasil"
|
||||
ReferencedContainer = "container:Yggdrasil Network.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
|
|
|
@ -4,37 +4,6 @@
|
|||
<dict>
|
||||
<key>AvailableLibraries</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>BinaryPath</key>
|
||||
<string>Yggdrasil.framework/Versions/A/Yggdrasil</string>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>ios-arm64</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>Yggdrasil.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>ios</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>BinaryPath</key>
|
||||
<string>Yggdrasil.framework/Versions/A/Yggdrasil</string>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>ios-arm64_x86_64-simulator</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>Yggdrasil.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
<string>x86_64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>ios</string>
|
||||
<key>SupportedPlatformVariant</key>
|
||||
<string>simulator</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>BinaryPath</key>
|
||||
<string>Yggdrasil.framework/Versions/A/Yggdrasil</string>
|
||||
|
@ -50,6 +19,20 @@
|
|||
<key>SupportedPlatform</key>
|
||||
<string>macos</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>BinaryPath</key>
|
||||
<string>Yggdrasil.framework/Versions/A/Yggdrasil</string>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>ios-arm64</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>Yggdrasil.framework</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>ios</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XFWK</string>
|
||||
|
|
|
@ -13,6 +13,9 @@ struct PeersView: View {
|
|||
@Environment(\.editMode) var editMode
|
||||
#endif
|
||||
|
||||
@State private var isAddingPeer = false
|
||||
@State private var addPeerURI = ""
|
||||
|
||||
var body: some View {
|
||||
Form {
|
||||
Section(content: {
|
||||
|
@ -97,7 +100,16 @@ struct PeersView: View {
|
|||
.toolbar {
|
||||
if editMode!.wrappedValue.isEditing {
|
||||
Button("Add", systemImage: "plus") {
|
||||
appDelegate.yggdrasilConfig.peers.append("")
|
||||
//appDelegate.yggdrasilConfig.peers.append("")
|
||||
addPeerURI = ""
|
||||
isAddingPeer.toggle()
|
||||
}.alert("Add new peer", isPresented: $isAddingPeer) {
|
||||
TextField("tls://host:port", text: $addPeerURI)
|
||||
.textInputAutocapitalization(.never)
|
||||
Button("Add", action: addPeer)
|
||||
Button("Cancel", role: .cancel) { }
|
||||
} message: {
|
||||
Text("Specify the peer URI to add.")
|
||||
}
|
||||
}
|
||||
EditButton()
|
||||
|
@ -110,6 +122,13 @@ struct PeersView: View {
|
|||
.navigationBarTitleDisplayMode(.large)
|
||||
#endif
|
||||
}
|
||||
|
||||
func addPeer() {
|
||||
if addPeerURI != "" {
|
||||
appDelegate.yggdrasilConfig.peers.append(addPeerURI)
|
||||
}
|
||||
addPeerURI = ""
|
||||
}
|
||||
}
|
||||
|
||||
struct PeersView_Previews: PreviewProvider {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue