mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-06 11:25:52 +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 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 {
|
||||
/// Get the primary IPv4 address of the local machine
|
||||
static func getLocalIPAddress() -> String? {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
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 {
|
||||
/// Centers a window on the active screen (where the mouse cursor is located)
|
||||
/// - Parameter window: The NSWindow to center
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
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 {
|
||||
@Environment(SessionMonitor.self)
|
||||
var sessionMonitor
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
import Observation
|
||||
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 {
|
||||
@State private var viewModel = ServerConsoleViewModel()
|
||||
@State private var autoScroll = true
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
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 {
|
||||
case general
|
||||
case dashboard
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
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 {
|
||||
@State private var selectedTab: SettingsTab = .general
|
||||
@State private var contentSize: CGSize = .zero
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
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 {
|
||||
@State private var currentPage = 0
|
||||
@Environment(\.dismiss)
|
||||
|
|
@ -101,7 +106,8 @@ struct WelcomeView: View {
|
|||
|
||||
// MARK: - Welcome Page
|
||||
|
||||
struct WelcomePageView: View {
|
||||
/// First page of the welcome flow introducing VibeTunnel.
|
||||
private struct WelcomePageView: View {
|
||||
var body: some View {
|
||||
VStack(spacing: 40) {
|
||||
Spacer()
|
||||
|
|
@ -141,7 +147,8 @@ struct WelcomePageView: View {
|
|||
|
||||
// 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 body: some View {
|
||||
|
|
@ -225,7 +232,8 @@ struct VTCommandPageView: View {
|
|||
|
||||
// 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 confirmPassword = ""
|
||||
@State private var showError = false
|
||||
|
|
@ -352,7 +360,8 @@ struct ProtectDashboardPageView: View {
|
|||
|
||||
// MARK: - Access Dashboard Page
|
||||
|
||||
struct AccessDashboardPageView: View {
|
||||
/// Fourth page showing how to access the dashboard and ngrok integration.
|
||||
private struct AccessDashboardPageView: View {
|
||||
@AppStorage("ngrokEnabled")
|
||||
private var ngrokEnabled = false
|
||||
@AppStorage("serverPort")
|
||||
|
|
|
|||
Loading…
Reference in a new issue