mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-27 15:17:38 +00:00
add docs
This commit is contained in:
parent
ff5696d515
commit
fd9eb47b85
7 changed files with 42 additions and 10 deletions
|
|
@ -1,7 +1,11 @@
|
||||||
import Foundation
|
import Foundation
|
||||||
import Network
|
import Network
|
||||||
|
|
||||||
/// Utility for network-related operations
|
/// Utility for network-related operations.
|
||||||
|
///
|
||||||
|
/// Provides helper functions for network interface discovery and IP address resolution.
|
||||||
|
/// Primarily used to determine the local machine's network addresses for display
|
||||||
|
/// in the dashboard settings.
|
||||||
enum NetworkUtility {
|
enum NetworkUtility {
|
||||||
/// Get the primary IPv4 address of the local machine
|
/// Get the primary IPv4 address of the local machine
|
||||||
static func getLocalIPAddress() -> String? {
|
static func getLocalIPAddress() -> String? {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
import AppKit
|
import AppKit
|
||||||
|
|
||||||
/// Helper class for consistent window centering across the application
|
/// Helper class for consistent window centering across the application.
|
||||||
|
///
|
||||||
|
/// Provides utility methods for positioning windows on screen, including
|
||||||
|
/// centering on the active display and moving windows off-screen when needed.
|
||||||
|
/// Used throughout VibeTunnel to ensure consistent window placement behavior.
|
||||||
enum WindowCenteringHelper {
|
enum WindowCenteringHelper {
|
||||||
/// Centers a window on the active screen (where the mouse cursor is located)
|
/// Centers a window on the active screen (where the mouse cursor is located)
|
||||||
/// - Parameter window: The NSWindow to center
|
/// - Parameter window: The NSWindow to center
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
/// Main menu bar view displaying session status and app controls
|
/// Main menu bar view displaying session status and app controls.
|
||||||
|
///
|
||||||
|
/// Appears in the macOS menu bar and provides quick access to VibeTunnel's
|
||||||
|
/// key features including server status, dashboard access, session monitoring,
|
||||||
|
/// and application preferences. Updates in real-time to reflect server state.
|
||||||
struct MenuBarView: View {
|
struct MenuBarView: View {
|
||||||
@Environment(SessionMonitor.self)
|
@Environment(SessionMonitor.self)
|
||||||
var sessionMonitor
|
var sessionMonitor
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
import Observation
|
import Observation
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
/// View for displaying server console logs
|
/// View for displaying server console logs.
|
||||||
|
///
|
||||||
|
/// Provides a real-time console interface for monitoring server output with
|
||||||
|
/// filtering capabilities, auto-scroll functionality, and color-coded log levels.
|
||||||
|
/// Supports both Rust and Hummingbird server implementations.
|
||||||
struct ServerConsoleView: View {
|
struct ServerConsoleView: View {
|
||||||
@State private var viewModel = ServerConsoleViewModel()
|
@State private var viewModel = ServerConsoleViewModel()
|
||||||
@State private var autoScroll = true
|
@State private var autoScroll = true
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
/// Represents the available tabs in the Settings window
|
/// Represents the available tabs in the Settings window.
|
||||||
|
///
|
||||||
|
/// Each tab corresponds to a different configuration area of VibeTunnel,
|
||||||
|
/// with associated display names and SF Symbol icons for the tab bar.
|
||||||
enum SettingsTab: String, CaseIterable {
|
enum SettingsTab: String, CaseIterable {
|
||||||
case general
|
case general
|
||||||
case dashboard
|
case dashboard
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
/// Main settings window with tabbed interface
|
/// Main settings window with tabbed interface.
|
||||||
|
///
|
||||||
|
/// Provides a macOS-style preferences window with multiple tabs for different
|
||||||
|
/// configuration aspects of VibeTunnel. Dynamically adjusts window size based
|
||||||
|
/// on the selected tab and conditionally shows debug settings when enabled.
|
||||||
struct SettingsView: View {
|
struct SettingsView: View {
|
||||||
@State private var selectedTab: SettingsTab = .general
|
@State private var selectedTab: SettingsTab = .general
|
||||||
@State private var contentSize: CGSize = .zero
|
@State private var contentSize: CGSize = .zero
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,10 @@
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
|
/// Welcome onboarding view for first-time users.
|
||||||
|
///
|
||||||
|
/// Presents a multi-page onboarding experience that introduces VibeTunnel's features,
|
||||||
|
/// guides through CLI installation, and explains dashboard security best practices.
|
||||||
|
/// The view tracks completion state to ensure it's only shown once.
|
||||||
struct WelcomeView: View {
|
struct WelcomeView: View {
|
||||||
@State private var currentPage = 0
|
@State private var currentPage = 0
|
||||||
@Environment(\.dismiss)
|
@Environment(\.dismiss)
|
||||||
|
|
@ -101,7 +106,8 @@ struct WelcomeView: View {
|
||||||
|
|
||||||
// MARK: - Welcome Page
|
// MARK: - Welcome Page
|
||||||
|
|
||||||
struct WelcomePageView: View {
|
/// First page of the welcome flow introducing VibeTunnel.
|
||||||
|
private struct WelcomePageView: View {
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack(spacing: 40) {
|
VStack(spacing: 40) {
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
@ -141,7 +147,8 @@ struct WelcomePageView: View {
|
||||||
|
|
||||||
// MARK: - VT Command Page
|
// MARK: - VT Command Page
|
||||||
|
|
||||||
struct VTCommandPageView: View {
|
/// Second page explaining the VT command-line tool and installation.
|
||||||
|
private struct VTCommandPageView: View {
|
||||||
var cliInstaller: CLIInstaller
|
var cliInstaller: CLIInstaller
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
|
|
@ -225,7 +232,8 @@ struct VTCommandPageView: View {
|
||||||
|
|
||||||
// MARK: - Protect Dashboard Page
|
// MARK: - Protect Dashboard Page
|
||||||
|
|
||||||
struct ProtectDashboardPageView: View {
|
/// Third page explaining dashboard security and access protection.
|
||||||
|
private struct ProtectDashboardPageView: View {
|
||||||
@State private var password = ""
|
@State private var password = ""
|
||||||
@State private var confirmPassword = ""
|
@State private var confirmPassword = ""
|
||||||
@State private var showError = false
|
@State private var showError = false
|
||||||
|
|
@ -352,7 +360,8 @@ struct ProtectDashboardPageView: View {
|
||||||
|
|
||||||
// MARK: - Access Dashboard Page
|
// MARK: - Access Dashboard Page
|
||||||
|
|
||||||
struct AccessDashboardPageView: View {
|
/// Fourth page showing how to access the dashboard and ngrok integration.
|
||||||
|
private struct AccessDashboardPageView: View {
|
||||||
@AppStorage("ngrokEnabled")
|
@AppStorage("ngrokEnabled")
|
||||||
private var ngrokEnabled = false
|
private var ngrokEnabled = false
|
||||||
@AppStorage("serverPort")
|
@AppStorage("serverPort")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue