mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-27 15:17:38 +00:00
Add helper for differrent vt name
This commit is contained in:
parent
b58524750b
commit
1ffabb048b
1 changed files with 31 additions and 19 deletions
|
|
@ -17,6 +17,7 @@ struct AdvancedSettingsView: View {
|
||||||
@AppStorage("showInDock")
|
@AppStorage("showInDock")
|
||||||
private var showInDock = false
|
private var showInDock = false
|
||||||
@State private var cliInstaller = CLIInstaller()
|
@State private var cliInstaller = CLIInstaller()
|
||||||
|
@State private var showingVtConflictAlert = false
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationStack {
|
NavigationStack {
|
||||||
|
|
@ -74,7 +75,9 @@ struct AdvancedSettingsView: View {
|
||||||
Text(error)
|
Text(error)
|
||||||
.font(.caption)
|
.font(.caption)
|
||||||
.foregroundColor(.red)
|
.foregroundColor(.red)
|
||||||
} else if cliInstaller.isInstalled {
|
} else {
|
||||||
|
HStack(alignment: .center, spacing: 8) {
|
||||||
|
if cliInstaller.isInstalled {
|
||||||
Text("The 'vt' command line tool is installed at /usr/local/bin/vt")
|
Text("The 'vt' command line tool is installed at /usr/local/bin/vt")
|
||||||
.font(.caption)
|
.font(.caption)
|
||||||
.foregroundStyle(.secondary)
|
.foregroundStyle(.secondary)
|
||||||
|
|
@ -83,6 +86,18 @@ struct AdvancedSettingsView: View {
|
||||||
.font(.caption)
|
.font(.caption)
|
||||||
.foregroundStyle(.secondary)
|
.foregroundStyle(.secondary)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Spacer()
|
||||||
|
|
||||||
|
Button(action: {
|
||||||
|
showingVtConflictAlert = true
|
||||||
|
}) {
|
||||||
|
Text("Use a different name")
|
||||||
|
.font(.caption)
|
||||||
|
}
|
||||||
|
.buttonStyle(.link)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} header: {
|
} header: {
|
||||||
Text("Integration")
|
Text("Integration")
|
||||||
|
|
@ -137,6 +152,14 @@ struct AdvancedSettingsView: View {
|
||||||
.onAppear {
|
.onAppear {
|
||||||
cliInstaller.checkInstallationStatus()
|
cliInstaller.checkInstallationStatus()
|
||||||
}
|
}
|
||||||
|
.alert("Using a Different Command Name", isPresented: $showingVtConflictAlert) {
|
||||||
|
Button("OK") {}
|
||||||
|
Button("Copy to Clipboard") {
|
||||||
|
copyCommandToClipboard()
|
||||||
|
}
|
||||||
|
} message: {
|
||||||
|
Text(vtConflictMessage)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private var showInDockBinding: Binding<Bool> {
|
private var showInDockBinding: Binding<Bool> {
|
||||||
|
|
@ -159,12 +182,9 @@ struct AdvancedSettingsView: View {
|
||||||
|
|
||||||
private var vtConflictMessage: String {
|
private var vtConflictMessage: String {
|
||||||
"""
|
"""
|
||||||
If 'vt' is already in use on your system, you can copy the VibeTunnel command script with a different name.
|
You can install the `vt` bash script with a different name. For example:
|
||||||
|
|
||||||
Copy command:
|
|
||||||
cp "\(vtScriptPath)" /usr/local/bin/vtunnel && chmod +x /usr/local/bin/vtunnel
|
cp "\(vtScriptPath)" /usr/local/bin/vtunnel && chmod +x /usr/local/bin/vtunnel
|
||||||
|
|
||||||
This will create 'vtunnel' as an alternative command name.
|
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -294,14 +314,6 @@ private struct TerminalPreferenceSection: View {
|
||||||
.frame(maxWidth: .infinity)
|
.frame(maxWidth: .infinity)
|
||||||
.multilineTextAlignment(.center)
|
.multilineTextAlignment(.center)
|
||||||
}
|
}
|
||||||
.alert("Using a Different Command Name", isPresented: $showingVtConflictAlert) {
|
|
||||||
Button("OK") {}
|
|
||||||
Button("Copy to Clipboard") {
|
|
||||||
copyCommandToClipboard()
|
|
||||||
}
|
|
||||||
} message: {
|
|
||||||
Text(vtConflictMessage)
|
|
||||||
}
|
|
||||||
.alert(errorTitle, isPresented: $showingError) {
|
.alert(errorTitle, isPresented: $showingError) {
|
||||||
Button("OK") {}
|
Button("OK") {}
|
||||||
if errorTitle == "Permission Denied" {
|
if errorTitle == "Permission Denied" {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue