Owner decision pending (STATE.md DC-100 tick): adopt/ship/park. Preserved from fragile git stash to named branch 2026-08-23. NOTE: requires a Windows build machine (WinUI XAML compiler + MSIX do not cross-build on Linux) — see WINDOWS_APP_BUILD.md in this tree. Secret-scanned clean 2026-08-23 (no keys/tokens/PEM in tree).
184 lines
12 KiB
XML
184 lines
12 KiB
XML
<Window
|
|
x:Class="DashCaddy.Desktop.MainWindow"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:vm="using:DashCaddy.Desktop.ViewModels"
|
|
xmlns:controls="using:Microsoft.UI.Xaml.Controls"
|
|
mc:Ignorable="d"
|
|
Title="DashCaddy"
|
|
ExtendsContentIntoTitleBar="True"
|
|
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
|
|
|
<Window.Resources>
|
|
<vm:StatusToColorConverter x:Key="StatusToColorConverter" />
|
|
<vm:StatusToTextConverter x:Key="StatusToTextConverter" />
|
|
</Window.Resources>
|
|
|
|
<Grid x:Name="RootGrid">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="48" /> <!-- Title bar area -->
|
|
<RowDefinition Height="*" /> <!-- Main content -->
|
|
<RowDefinition Height="Auto" /> <!-- Bottom bar -->
|
|
</Grid.RowDefinitions>
|
|
|
|
<!-- Custom Title Bar -->
|
|
<Grid Grid.Row="0" Background="{ThemeResource SystemControlBackgroundChromeMediumBrush}" x:Name="TitleBarGrid">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<!-- App Icon + Title -->
|
|
<StackPanel Grid.Column="0" Orientation="Horizontal" Margin="12,0,0,0" VerticalAlignment="Center">
|
|
<Image Source="Assets/dashcaddy.ico" Width="24" Height="24" Margin="0,0,8,0" />
|
|
<TextBlock Text="DashCaddy" FontSize="16" FontWeight="SemiBold" VerticalAlignment="Center" Foreground="{ThemeResource SystemControlForegroundBaseHighBrush}" />
|
|
<TextBlock Text="1.15.0" FontSize="12" FontWeight="Normal" VerticalAlignment="Center" Foreground="{ThemeResource SystemControlForegroundBaseMediumBrush}" Margin="8,0,0,0" />
|
|
</StackPanel>
|
|
|
|
<!-- Status Indicators -->
|
|
<StackPanel Grid.Column="2" Orientation="Horizontal" Margin="0,0,12,0" VerticalAlignment="Center" Spacing="16">
|
|
<StackPanel Orientation="Horizontal" Spacing="6" ToolTipService.ToolTip="Services">
|
|
<Ellipse Width="10" Height="10" Fill="{Binding ServicesHealthy, Converter={StaticResource StatusToColorConverter}, FallbackValue=Gray}" VerticalAlignment="Center" />
|
|
<TextBlock Text="{Binding ServicesSummary}" VerticalAlignment="Center" FontSize="13" Foreground="{ThemeResource SystemControlForegroundBaseHighBrush}" />
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" Spacing="6" ToolTipService.ToolTip="DNS">
|
|
<Ellipse Width="10" Height="10" Fill="{Binding DnsHealthy, Converter={StaticResource StatusToColorConverter}, FallbackValue=Gray}" VerticalAlignment="Center" />
|
|
<TextBlock Text="DNS" VerticalAlignment="Center" FontSize="13" Foreground="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" Spacing="6" ToolTipService.ToolTip="Certificates">
|
|
<Ellipse Width="10" Height="10" Fill="{Binding CertsHealthy, Converter={StaticResource StatusToColorConverter}, FallbackValue=Gray}" VerticalAlignment="Center" />
|
|
<TextBlock Text="{Binding CertsSummary}" VerticalAlignment="Center" FontSize="13" Foreground="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</Grid>
|
|
|
|
<!-- Main Content -->
|
|
<Grid Grid.Row="1" Margin="16">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<!-- Toolbar -->
|
|
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="0,0,0,12" Spacing="12">
|
|
<Button Content="+ Add Service" Click="AddService_Click" Style="{StaticResource AccentButtonStyle}"
|
|
ToolTipService.ToolTip="Add a new self-hosted service">
|
|
<Button.ContentTemplate>
|
|
<DataTemplate>
|
|
<StackPanel Orientation="Horizontal" Spacing="6">
|
|
<FontIcon Glyph="" FontSize="14" /> <!-- Add -->
|
|
<TextBlock Text="Add Service" />
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</Button.ContentTemplate>
|
|
</Button>
|
|
<Button Content="Import Compose" Click="ImportCompose_Click"
|
|
ToolTipService.ToolTip="Import Docker Compose file">
|
|
<Button.ContentTemplate>
|
|
<DataTemplate>
|
|
<StackPanel Orientation="Horizontal" Spacing="6">
|
|
<FontIcon Glyph="" FontSize="14" /> <!-- Import -->
|
|
<TextBlock Text="Import Compose" />
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</Button.ContentTemplate>
|
|
</Button>
|
|
<Button Content="Templates" Click="Templates_Click"
|
|
ToolTipService.ToolTip="Browse service templates (Plex, Home Assistant, etc.)">
|
|
<Button.ContentTemplate>
|
|
<DataTemplate>
|
|
<StackPanel Orientation="Horizontal" Spacing="6">
|
|
<FontIcon Glyph="" FontSize="14" /> <!-- Library -->
|
|
<TextBlock Text="Templates" />
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</Button.ContentTemplate>
|
|
</Button>
|
|
</StackPanel>
|
|
|
|
<!-- Services List -->
|
|
<Border Grid.Row="1" BorderBrush="{ThemeResource SystemControlForegroundBaseLowBrush}" BorderThickness="1" CornerRadius="8" Background="{ThemeResource SystemControlBackgroundAltHighBrush}">
|
|
<ListView x:Name="ServicesList" ItemsSource="{Binding Services}" SelectionMode="None"
|
|
Background="Transparent" BorderThickness="0">
|
|
<ListView.ItemContainerStyle>
|
|
<Style TargetType="ListViewItem">
|
|
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
|
<Setter Property="Padding" Value="12,8" />
|
|
<Setter Property="Margin" Value="0" />
|
|
</Style>
|
|
</ListView.ItemContainerStyle>
|
|
<ListView.ItemTemplate>
|
|
<DataTemplate x:DataType="vm:ServiceViewModel">
|
|
<Grid Margin="4,0">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<!-- Status Indicator -->
|
|
<Ellipse Grid.Column="0" Width="14" Height="14" Margin="0,0,12,0" VerticalAlignment="Center"
|
|
Fill="{Binding Health, Converter={StaticResource StatusToColorConverter}}"
|
|
ToolTipService.ToolTip="{Binding Health, Converter={StaticResource StatusToTextConverter}}" />
|
|
|
|
<!-- Service Info -->
|
|
<StackPanel Grid.Column="1" Orientation="Vertical" Spacing="2" VerticalAlignment="Center">
|
|
<TextBlock Text="{Binding Name}" FontSize="14" FontWeight="Medium" Foreground="{ThemeResource SystemControlForegroundBaseHighBrush}" />
|
|
<TextBlock Text="{Binding Url}" FontSize="12" Foreground="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
|
|
</StackPanel>
|
|
|
|
<!-- Type Badge -->
|
|
<Border Grid.Column="2" Background="{ThemeResource SystemControlBackgroundListLowBrush}" CornerRadius="4" Padding="6,2" Margin="12,0" VerticalAlignment="Center">
|
|
<TextBlock Text="{Binding Type}" FontSize="11" FontWeight="Medium" Foreground="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
|
|
</Border>
|
|
|
|
<!-- Actions Menu -->
|
|
<Button Grid.Column="3" Style="{StaticResource MinimalButtonStyle}" Margin="0,0,4,0" VerticalAlignment="Center"
|
|
Click="ServiceAction_Click" Tag="{Binding}">
|
|
<FontIcon Glyph="" FontSize="14" Foreground="{ThemeResource SystemControlForegroundBaseMediumBrush}" /> <!-- More -->
|
|
<Button.Flyout>
|
|
<MenuFlyout>
|
|
<MenuFlyoutItem Text="Open" Icon="Globe" Click="OpenService_Click" />
|
|
<MenuFlyoutItem Text="Logs" Icon="Document" Click="ViewLogs_Click" />
|
|
<MenuFlyoutItem Text="Restart" Icon="Refresh" Click="RestartService_Click" />
|
|
<MenuFlyoutItem Text="Stop" Icon="Stop" Click="StopService_Click" />
|
|
<MenuFlyoutSeparator />
|
|
<MenuFlyoutItem Text="Edit" Icon="Edit" Click="EditService_Click" />
|
|
<MenuFlyoutItem Text="Remove" Icon="Delete" Click="RemoveService_Click" />
|
|
</MenuFlyout>
|
|
</Button.Flyout>
|
|
</Button>
|
|
|
|
<!-- Toggle Switch -->
|
|
<ToggleSwitch Grid.Column="4" IsOn="{Binding IsRunning, Mode=TwoWay}"
|
|
OnContent="" OffContent="" MinWidth="56" VerticalAlignment="Center"
|
|
Toggled="ServiceToggled" Tag="{Binding}" />
|
|
</Grid>
|
|
</DataTemplate>
|
|
</ListView.ItemTemplate>
|
|
</ListView>
|
|
</Border>
|
|
</Grid>
|
|
|
|
<!-- Bottom Bar -->
|
|
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,12,16,16" Spacing="8">
|
|
<Button Content="Open Dashboard" Click="OpenDashboard_Click" Style="{StaticResource AccentButtonStyle}" />
|
|
<Button Content="View Logs" Click="ViewLogs_Click" />
|
|
<Button Content="Settings" Click="OpenSettings_Click" />
|
|
<Button Content="Help" Click="OpenHelp_Click" />
|
|
</StackPanel>
|
|
|
|
<!-- Loading Overlay -->
|
|
<Grid x:Name="LoadingOverlay" Grid.Row="0" Grid.RowSpan="3" Background="{ThemeResource SystemControlBackgroundAltHighBrush}" Opacity="0.9" Visibility="Collapsed">
|
|
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Spacing="16">
|
|
<ProgressRing Width="48" Height="48" IsActive="True" />
|
|
<TextBlock x:Name="LoadingText" Text="Loading..." FontSize="16" Foreground="{ThemeResource SystemControlForegroundBaseHighBrush}" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</Grid>
|
|
</Window> |