169 lines
8.1 KiB
XML
169 lines
8.1 KiB
XML
<?xml version="1.0" encoding="utf-8" ?>
|
|
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
|
xmlns:controls="clr-namespace:IronServices.Maui.Controls"
|
|
x:Class="IronServices.Maui.Controls.AppLogView"
|
|
Title="App Logs">
|
|
|
|
<ContentPage.ToolbarItems>
|
|
<ToolbarItem x:Name="ClearToolbarItem"
|
|
Text="Clear"
|
|
Order="Secondary"
|
|
Clicked="OnClearClicked" />
|
|
<ToolbarItem x:Name="CopyForAIToolbarItem"
|
|
Text="Copy for AI"
|
|
Order="Primary"
|
|
Clicked="OnCopyForAIClicked" />
|
|
<ToolbarItem x:Name="ShareToolbarItem"
|
|
Text="Share"
|
|
Order="Primary"
|
|
Clicked="OnShareClicked" />
|
|
</ContentPage.ToolbarItems>
|
|
|
|
<Grid RowDefinitions="Auto,*,Auto">
|
|
|
|
<!-- Summary Bar -->
|
|
<Border Grid.Row="0"
|
|
Padding="16,12"
|
|
BackgroundColor="{AppThemeBinding Light={StaticResource Gray100}, Dark={StaticResource Gray800}}"
|
|
StrokeThickness="0">
|
|
<Grid ColumnDefinitions="*,Auto">
|
|
<Label x:Name="CountLabel"
|
|
Text="0 items"
|
|
FontSize="14"
|
|
TextColor="{AppThemeBinding Light={StaticResource Gray600}, Dark={StaticResource Gray400}}"
|
|
VerticalOptions="Center" />
|
|
<Button x:Name="RefreshButton"
|
|
Grid.Column="1"
|
|
Text="Refresh"
|
|
Clicked="OnRefreshClicked"
|
|
BackgroundColor="Transparent"
|
|
TextColor="{StaticResource Primary}"
|
|
FontSize="14"
|
|
Padding="8,4" />
|
|
</Grid>
|
|
</Border>
|
|
|
|
<!-- Log List -->
|
|
<CollectionView x:Name="LogList"
|
|
Grid.Row="1"
|
|
ItemsSource="{Binding}"
|
|
SelectionMode="Single"
|
|
SelectionChanged="OnLogSelected">
|
|
<CollectionView.EmptyView>
|
|
<VerticalStackLayout VerticalOptions="Center" HorizontalOptions="Center" Padding="32">
|
|
<Label Text="No logs captured"
|
|
FontSize="18"
|
|
TextColor="{AppThemeBinding Light={StaticResource Gray400}, Dark={StaticResource Gray500}}"
|
|
HorizontalOptions="Center" />
|
|
<Label Text="Exceptions and telemetry events will appear here"
|
|
FontSize="14"
|
|
TextColor="{AppThemeBinding Light={StaticResource Gray400}, Dark={StaticResource Gray500}}"
|
|
HorizontalOptions="Center"
|
|
HorizontalTextAlignment="Center"
|
|
Margin="0,8,0,0" />
|
|
</VerticalStackLayout>
|
|
</CollectionView.EmptyView>
|
|
<CollectionView.ItemTemplate>
|
|
<DataTemplate x:DataType="controls:LogItem">
|
|
<Border Padding="12"
|
|
Margin="8,4"
|
|
BackgroundColor="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Gray900}}"
|
|
Stroke="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray700}}"
|
|
StrokeShape="RoundRectangle 8">
|
|
<Grid RowDefinitions="Auto,Auto,Auto" ColumnDefinitions="Auto,*,Auto">
|
|
<!-- Type Badge -->
|
|
<Border Grid.Row="0" Grid.Column="0"
|
|
Padding="6,2"
|
|
StrokeThickness="0"
|
|
BackgroundColor="{Binding TypeColor}"
|
|
StrokeShape="RoundRectangle 4"
|
|
VerticalOptions="Start">
|
|
<Label Text="{Binding TypeDisplay}"
|
|
FontSize="10"
|
|
TextColor="White"
|
|
FontAttributes="Bold" />
|
|
</Border>
|
|
|
|
<!-- Timestamp -->
|
|
<Label Grid.Row="0" Grid.Column="2"
|
|
Text="{Binding TimestampDisplay}"
|
|
FontSize="11"
|
|
TextColor="{AppThemeBinding Light={StaticResource Gray500}, Dark={StaticResource Gray400}}"
|
|
VerticalOptions="Center" />
|
|
|
|
<!-- Title -->
|
|
<Label Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3"
|
|
Text="{Binding Title}"
|
|
FontSize="14"
|
|
FontAttributes="Bold"
|
|
LineBreakMode="TailTruncation"
|
|
MaxLines="1"
|
|
Margin="0,8,0,0" />
|
|
|
|
<!-- Message -->
|
|
<Label Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3"
|
|
Text="{Binding Message}"
|
|
FontSize="12"
|
|
TextColor="{AppThemeBinding Light={StaticResource Gray600}, Dark={StaticResource Gray400}}"
|
|
LineBreakMode="TailTruncation"
|
|
MaxLines="2"
|
|
Margin="0,4,0,0" />
|
|
</Grid>
|
|
</Border>
|
|
</DataTemplate>
|
|
</CollectionView.ItemTemplate>
|
|
</CollectionView>
|
|
|
|
<!-- Detail Panel -->
|
|
<Border x:Name="DetailPanel"
|
|
Grid.Row="2"
|
|
IsVisible="False"
|
|
Padding="16"
|
|
BackgroundColor="{AppThemeBinding Light={StaticResource Gray100}, Dark={StaticResource Gray800}}"
|
|
Stroke="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}"
|
|
StrokeShape="Rectangle">
|
|
<Grid RowDefinitions="Auto,Auto,*,Auto">
|
|
<Grid Grid.Row="0" ColumnDefinitions="*,Auto">
|
|
<Label x:Name="DetailTitle"
|
|
FontSize="16"
|
|
FontAttributes="Bold"
|
|
LineBreakMode="TailTruncation" />
|
|
<Button Grid.Column="1"
|
|
Text="Close"
|
|
Clicked="OnCloseDetailClicked"
|
|
BackgroundColor="Transparent"
|
|
TextColor="{StaticResource Primary}"
|
|
FontSize="12"
|
|
Padding="8,4" />
|
|
</Grid>
|
|
|
|
<!-- Message (full error details) -->
|
|
<ScrollView Grid.Row="1" MaximumHeightRequest="100" Margin="0,8">
|
|
<Label x:Name="DetailMessage"
|
|
FontSize="12"
|
|
TextColor="{AppThemeBinding Light={StaticResource Gray700}, Dark={StaticResource Gray300}}" />
|
|
</ScrollView>
|
|
|
|
<!-- Stack Trace -->
|
|
<ScrollView Grid.Row="2" MaximumHeightRequest="150" Margin="0,8">
|
|
<Label x:Name="DetailStackTrace"
|
|
FontFamily="Consolas"
|
|
FontSize="11"
|
|
TextColor="{AppThemeBinding Light={StaticResource Gray500}, Dark={StaticResource Gray400}}" />
|
|
</ScrollView>
|
|
|
|
<Button Grid.Row="3"
|
|
Text="Copy Full Log"
|
|
Clicked="OnCopyStackTraceClicked"
|
|
BackgroundColor="{StaticResource Primary}"
|
|
TextColor="White"
|
|
CornerRadius="8"
|
|
HeightRequest="40" />
|
|
</Grid>
|
|
</Border>
|
|
|
|
</Grid>
|
|
|
|
</ContentPage>
|