Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit230bb09

Browse files
committed
review
1 parent2a91e6e commit230bb09

File tree

7 files changed

+75
-96
lines changed

7 files changed

+75
-96
lines changed

‎Coder-Desktop/Coder-Desktop/State.swift

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,6 @@ class AppState: ObservableObject {
6363
}
6464
}
6565

66-
// Temporary feature flag
67-
@PublishedvarshowFileSyncUI:Bool=UserDefaults.standard.bool(forKey:Keys.showFileSyncUI){
68-
didSet{
69-
guard persistentelse{return}
70-
UserDefaults.standard.set(showFileSyncUI, forKey:Keys.showFileSyncUI)
71-
}
72-
}
73-
7466
func tunnelProviderProtocol()->NETunnelProviderProtocol?{
7567
if !hasSession{returnnil}
7668
letproto=NETunnelProviderProtocol()
@@ -172,8 +164,6 @@ class AppState: ObservableObject {
172164
staticletliteralHeaders="LiteralHeaders"
173165
staticletstopVPNOnQuit="StopVPNOnQuit"
174166
staticletstartVPNOnLaunch="StartVPNOnLaunch"
175-
176-
staticletshowFileSyncUI="showFileSyncUI"
177167
}
178168
}
179169

‎Coder-Desktop/Coder-Desktop/Views/FileSync/FileSyncConfig.swift

Lines changed: 2 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,12 @@
11
import SwiftUI
22
import VPNLib
33

4-
structFileSyncRow:Identifiable{
5-
varid=UUID()
6-
varlocalPath:URL
7-
varworkspace:String
8-
// This is a string as to be host-OS agnostic
9-
varremotePath:String
10-
varstatus:FileSyncStatus
11-
varsize:String
12-
}
13-
14-
enumFileSyncStatus{
15-
case unknown
16-
case error(String)
17-
case okay
18-
case paused
19-
case needsAttention(String)
20-
case working(String)
21-
22-
varcolor:Color{
23-
switchself{
24-
case.okay:
25-
.white
26-
case.paused:
27-
.secondary
28-
case.unknown:
29-
.red
30-
case.error:
31-
.red
32-
case.needsAttention:
33-
.orange
34-
case.working:
35-
.white
36-
}
37-
}
38-
39-
vardescription:String{
40-
switchself{
41-
case.unknown:
42-
"Unknown"
43-
caselet.error(msg):
44-
msg
45-
case.okay:
46-
"OK"
47-
case.paused:
48-
"Paused"
49-
caselet.needsAttention(msg):
50-
msg
51-
caselet.working(msg):
52-
msg
53-
}
54-
}
55-
56-
varbody:someView{
57-
Text(description).foregroundColor(color)
58-
}
59-
}
60-
614
structFileSyncConfig<VPN:VPNService, FS:FileSyncDaemon>:View{
625
@EnvironmentObjectvarvpn:VPN
636

64-
@Stateprivatevarselection:FileSyncRow.ID?
7+
@Stateprivatevarselection:FileSyncSession.ID?
658
@StateprivatevaraddingNewSession:Bool=false
66-
@Stateprivatevaritems:[FileSyncRow]=[]
9+
@Stateprivatevaritems:[FileSyncSession]=[]
6710

6811
varbody:someView{
6912
Group{

‎Coder-Desktop/Coder-Desktop/Views/FileSync/FileSyncSessionModal.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import SwiftUI
22
import VPNLib
33

44
structFileSyncSessionModal<VPN:VPNService, FS:FileSyncDaemon>:View{
5-
varexistingSession:FileSyncRow?
5+
varexistingSession:FileSyncSession?
66
@Environment(\.dismiss)privatevardismiss
77
@EnvironmentObjectprivatevarvpn:VPN
88
@EnvironmentObjectprivatevarfileSync:FS

‎Coder-Desktop/Coder-Desktop/Views/Settings/GeneralTab.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ struct GeneralTab: View {
1818
Text("Start Coder Connect on launch")
1919
}
2020
}
21-
Section{
22-
Toggle(isOn: $state.showFileSyncUI){
23-
Text("Show experimental File Sync UI")
24-
}
25-
}
2621
}.formStyle(.grouped)
2722
}
2823
}

‎Coder-Desktop/Coder-Desktop/Views/VPN/VPNMenu.swift

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,21 @@ struct VPNMenu<VPN: VPNService, FS: FileSyncDaemon>: View {
6262
}.buttonStyle(.plain)
6363
TrayDivider()
6464
}
65-
if state.showFileSyncUI, vpn.state==.connected{
66-
Button{
67-
openWindow(id:.fileSync)
68-
} label:{
69-
ButtonRowView{
70-
HStack{
71-
StatusDot(color: fileSync.state.color)
72-
Text("Configure file sync")
65+
#if DEBUG
66+
if vpn.state==.connected{
67+
Button{
68+
openWindow(id:.fileSync)
69+
} label:{
70+
ButtonRowView{
71+
HStack{
72+
StatusDot(color: fileSync.state.color)
73+
Text("Configure file sync")
74+
}
7375
}
74-
}
75-
}.buttonStyle(.plain)
76-
TrayDivider()
77-
}
76+
}.buttonStyle(.plain)
77+
TrayDivider()
78+
}
79+
#endif
7880
if vpn.state==.failed(.systemExtensionError(.needsUserApproval)){
7981
Button{
8082
openSystemExtensionSettings()

‎Coder-Desktop/VPNLib/FileSync/FileSyncDaemon.swift

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,6 @@ public protocol FileSyncDaemon: ObservableObject {
1515
func createSession(with:FileSyncSession)asyncthrows
1616
}
1717

18-
publicstructFileSyncSession{
19-
publicletid:String
20-
publicletname:String
21-
publicletlocalPath:URL
22-
publicletworkspace:String
23-
publicletagent:String
24-
publicletremotePath:URL
25-
}
26-
2718
@MainActor
2819
publicclassMutagenDaemon:FileSyncDaemon{
2920
privateletlogger=Logger(subsystem:Bundle.main.bundleIdentifier!, category:"mutagen")
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import SwiftUI
2+
3+
publicstructFileSyncSession:Identifiable{
4+
publicletid:String
5+
publicletlocalPath:URL
6+
publicletworkspace:String
7+
// This is a string as to be host-OS agnostic
8+
publicletremotePath:String
9+
publicletstatus:FileSyncStatus
10+
publicletsize:String
11+
}
12+
13+
publicenumFileSyncStatus{
14+
case unknown
15+
case error(String)
16+
case ok
17+
case paused
18+
case needsAttention(String)
19+
case working(String)
20+
21+
publicvarcolor:Color{
22+
switchself{
23+
case.ok:
24+
.white
25+
case.paused:
26+
.secondary
27+
case.unknown:
28+
.red
29+
case.error:
30+
.red
31+
case.needsAttention:
32+
.orange
33+
case.working:
34+
.white
35+
}
36+
}
37+
38+
publicvardescription:String{
39+
switchself{
40+
case.unknown:
41+
"Unknown"
42+
caselet.error(msg):
43+
msg
44+
case.ok:
45+
"Watching"
46+
case.paused:
47+
"Paused"
48+
caselet.needsAttention(msg):
49+
msg
50+
caselet.working(msg):
51+
msg
52+
}
53+
}
54+
55+
publicvarbody:someView{
56+
Text(description).foregroundColor(color)
57+
}
58+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp