Improve groups
This commit is contained in:
@@ -66,7 +66,7 @@ public struct GroupListView: View {
|
|||||||
let goItem = itemIterator.next()!
|
let goItem = itemIterator.next()!
|
||||||
items.append(OutboundGroupItem(tag: goItem.tag, type: goItem.type, urlTestTime: Date(timeIntervalSince1970: Double(goItem.urlTestTime)), urlTestDelay: UInt16(goItem.urlTestDelay)))
|
items.append(OutboundGroupItem(tag: goItem.tag, type: goItem.type, urlTestTime: Date(timeIntervalSince1970: Double(goItem.urlTestTime)), urlTestDelay: UInt16(goItem.urlTestDelay)))
|
||||||
}
|
}
|
||||||
groups.append(OutboundGroup(tag: goGroup.tag, type: goGroup.type, selected: goGroup.selected, selectable: goGroup.selectable, isExpand: goGroup.isExpand(), items: items))
|
groups.append(OutboundGroup(tag: goGroup.tag, type: goGroup.type, selected: goGroup.selected, selectable: goGroup.selectable, isExpand: goGroup.isExpand, items: items))
|
||||||
}
|
}
|
||||||
self.groups = groups
|
self.groups = groups
|
||||||
isLoading = false
|
isLoading = false
|
||||||
|
|||||||
@@ -68,8 +68,19 @@ public struct GroupView: View {
|
|||||||
ForEach(Array(itemGroups.enumerated()), id: \.offset) { items in
|
ForEach(Array(itemGroups.enumerated()), id: \.offset) { items in
|
||||||
HStack(spacing: 5) {
|
HStack(spacing: 5) {
|
||||||
ForEach(items.element, id: \.tag) { it in
|
ForEach(items.element, id: \.tag) { it in
|
||||||
|
ZStack {
|
||||||
Rectangle()
|
Rectangle()
|
||||||
.fill(it.delayColor)
|
.fill(it.delayColor)
|
||||||
|
if it.tag == group.selected {
|
||||||
|
Rectangle()
|
||||||
|
.fill(Color.white)
|
||||||
|
#if !os(tvOS)
|
||||||
|
.frame(width: 5, height: 5)
|
||||||
|
#else
|
||||||
|
.frame(width: 15, height: 15)
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
#if !os(tvOS)
|
#if !os(tvOS)
|
||||||
.frame(width: 10, height: 10)
|
.frame(width: 10, height: 10)
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -59,23 +59,17 @@ public class CommandClient: ObservableObject {
|
|||||||
clientOptions.command = LibboxCommandLog
|
clientOptions.command = LibboxCommandLog
|
||||||
}
|
}
|
||||||
clientOptions.statusInterval = Int64(2 * NSEC_PER_SEC)
|
clientOptions.statusInterval = Int64(2 * NSEC_PER_SEC)
|
||||||
let client = LibboxNewCommandClient(FilePath.sharedDirectory.relativePath, clientHandler(self), clientOptions)!
|
let client = LibboxNewCommandClient(clientHandler(self), clientOptions)!
|
||||||
do {
|
do {
|
||||||
for i in 0 ..< 10 {
|
for i in 0 ..< 10 {
|
||||||
try await Task.sleep(nanoseconds: UInt64(Double(100 + (i * 50)) * Double(NSEC_PER_MSEC)))
|
try await Task.sleep(nanoseconds: UInt64(Double(100 + (i * 50)) * Double(NSEC_PER_MSEC)))
|
||||||
try Task.checkCancellation()
|
try Task.checkCancellation()
|
||||||
let isConnected: Bool
|
|
||||||
do {
|
do {
|
||||||
try client.connect()
|
try client.connect()
|
||||||
isConnected = true
|
|
||||||
} catch {
|
|
||||||
isConnected = false
|
|
||||||
}
|
|
||||||
try Task.checkCancellation()
|
|
||||||
if isConnected {
|
|
||||||
commandClient = client
|
commandClient = client
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
try Task.checkCancellation()
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
try? client.disconnect()
|
try? client.disconnect()
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public struct MainView: View {
|
|||||||
#if !DEBUG
|
#if !DEBUG
|
||||||
if Variant.useSystemExtension {
|
if Variant.useSystemExtension {
|
||||||
Task.detached {
|
Task.detached {
|
||||||
checkApplicationPath()
|
await checkApplicationPath()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -2551,7 +2551,7 @@
|
|||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 13.0;
|
MACOSX_DEPLOYMENT_TARGET = 13.0;
|
||||||
MARKETING_VERSION = "1.4.0-beta.5";
|
MARKETING_VERSION = "1.4.0-beta.6";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = io.nekohasekai.sfa.independent;
|
PRODUCT_BUNDLE_IDENTIFIER = io.nekohasekai.sfa.independent;
|
||||||
PRODUCT_NAME = SFM;
|
PRODUCT_NAME = SFM;
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
@@ -2590,7 +2590,7 @@
|
|||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 13.0;
|
MACOSX_DEPLOYMENT_TARGET = 13.0;
|
||||||
MARKETING_VERSION = "1.4.0-beta.5";
|
MARKETING_VERSION = "1.4.0-beta.6";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = io.nekohasekai.sfa.independent;
|
PRODUCT_BUNDLE_IDENTIFIER = io.nekohasekai.sfa.independent;
|
||||||
PRODUCT_NAME = SFM;
|
PRODUCT_NAME = SFM;
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
|
|||||||
@@ -1,77 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Scheme
|
|
||||||
LastUpgradeVersion = "1500"
|
|
||||||
version = "1.7">
|
|
||||||
<BuildAction
|
|
||||||
parallelizeBuildables = "YES"
|
|
||||||
buildImplicitDependencies = "YES">
|
|
||||||
<BuildActionEntries>
|
|
||||||
<BuildActionEntry
|
|
||||||
buildForTesting = "YES"
|
|
||||||
buildForRunning = "YES"
|
|
||||||
buildForProfiling = "YES"
|
|
||||||
buildForArchiving = "YES"
|
|
||||||
buildForAnalyzing = "YES">
|
|
||||||
<BuildableReference
|
|
||||||
BuildableIdentifier = "primary"
|
|
||||||
BlueprintIdentifier = "3AC03B952A72BF3300B7946F"
|
|
||||||
BuildableName = "sing-box.app"
|
|
||||||
BlueprintName = "SFT"
|
|
||||||
ReferencedContainer = "container:sing-box.xcodeproj">
|
|
||||||
</BuildableReference>
|
|
||||||
</BuildActionEntry>
|
|
||||||
</BuildActionEntries>
|
|
||||||
</BuildAction>
|
|
||||||
<TestAction
|
|
||||||
buildConfiguration = "Debug"
|
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
||||||
shouldAutocreateTestPlan = "YES">
|
|
||||||
</TestAction>
|
|
||||||
<LaunchAction
|
|
||||||
buildConfiguration = "Debug"
|
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
||||||
launchStyle = "0"
|
|
||||||
useCustomWorkingDirectory = "NO"
|
|
||||||
ignoresPersistentStateOnLaunch = "NO"
|
|
||||||
debugDocumentVersioning = "YES"
|
|
||||||
debugServiceExtension = "internal"
|
|
||||||
allowLocationSimulation = "YES">
|
|
||||||
<BuildableProductRunnable
|
|
||||||
runnableDebuggingMode = "0">
|
|
||||||
<BuildableReference
|
|
||||||
BuildableIdentifier = "primary"
|
|
||||||
BlueprintIdentifier = "3AC03B952A72BF3300B7946F"
|
|
||||||
BuildableName = "sing-box.app"
|
|
||||||
BlueprintName = "SFT"
|
|
||||||
ReferencedContainer = "container:sing-box.xcodeproj">
|
|
||||||
</BuildableReference>
|
|
||||||
</BuildableProductRunnable>
|
|
||||||
</LaunchAction>
|
|
||||||
<ProfileAction
|
|
||||||
buildConfiguration = "Release"
|
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
||||||
savedToolIdentifier = ""
|
|
||||||
useCustomWorkingDirectory = "NO"
|
|
||||||
debugDocumentVersioning = "YES">
|
|
||||||
<BuildableProductRunnable
|
|
||||||
runnableDebuggingMode = "0">
|
|
||||||
<BuildableReference
|
|
||||||
BuildableIdentifier = "primary"
|
|
||||||
BlueprintIdentifier = "3AC03B952A72BF3300B7946F"
|
|
||||||
BuildableName = "sing-box.app"
|
|
||||||
BlueprintName = "SFT"
|
|
||||||
ReferencedContainer = "container:sing-box.xcodeproj">
|
|
||||||
</BuildableReference>
|
|
||||||
</BuildableProductRunnable>
|
|
||||||
</ProfileAction>
|
|
||||||
<AnalyzeAction
|
|
||||||
buildConfiguration = "Debug">
|
|
||||||
</AnalyzeAction>
|
|
||||||
<ArchiveAction
|
|
||||||
buildConfiguration = "Release"
|
|
||||||
revealArchiveInOrganizer = "YES">
|
|
||||||
</ArchiveAction>
|
|
||||||
</Scheme>
|
|
||||||
Reference in New Issue
Block a user