You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

251 lines
12 KiB

<reactive:ReactiveUserControl xmlns="https://github.com/avaloniaui"
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:MyAvaloniaApp.ViewModels.Pages"
xmlns:reactive="clr-namespace:Avalonia.ReactiveUI;assembly=Avalonia.ReactiveUI"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="600"
x:Class="MyAvaloniaApp.Views.Pages.DashboardPageView"
x:DataType="vm:DashboardPageViewModel">
<Design.DataContext>
<vm:DashboardPageViewModel />
</Design.DataContext>
<Grid>
<!-- 统计卡片 -->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- 统计卡片行 -->
<Grid Grid.Row="0" Margin="0,0,0,30">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- 总用户数卡片 -->
<Border Grid.Column="0"
Background="#3498DB"
CornerRadius="10"
Margin="0,0,15,0"
Padding="20">
<StackPanel>
<TextBlock Text="👥"
FontSize="32"
HorizontalAlignment="Center"
Margin="0,0,0,10"/>
<TextBlock Text="{Binding TotalUsers}"
FontSize="36"
FontWeight="Bold"
Foreground="White"
HorizontalAlignment="Center"/>
<TextBlock Text="总用户数"
FontSize="14"
Foreground="White"
HorizontalAlignment="Center"
Opacity="0.9"/>
</StackPanel>
</Border>
<!-- 活跃会话卡片 -->
<Border Grid.Column="1"
Background="#E74C3C"
CornerRadius="10"
Margin="5,0,10,0"
Padding="20">
<StackPanel>
<TextBlock Text="🔗"
FontSize="32"
HorizontalAlignment="Center"
Margin="0,0,0,10"/>
<TextBlock Text="{Binding ActiveSessions}"
FontSize="36"
FontWeight="Bold"
Foreground="White"
HorizontalAlignment="Center"/>
<TextBlock Text="活跃会话"
FontSize="14"
Foreground="White"
HorizontalAlignment="Center"
Opacity="0.9"/>
</StackPanel>
</Border>
<!-- 系统负载卡片 -->
<Border Grid.Column="2"
Background="#F39C12"
CornerRadius="10"
Margin="5,0,10,0"
Padding="20">
<StackPanel>
<TextBlock Text="⚡"
FontSize="32"
HorizontalAlignment="Center"
Margin="0,0,0,10"/>
<TextBlock Text="{Binding SystemLoad}"
FontSize="36"
FontWeight="Bold"
Foreground="White"
HorizontalAlignment="Center"/>
<TextBlock Text="系统负载 %"
FontSize="14"
Foreground="White"
HorizontalAlignment="Center"
Opacity="0.9"/>
</StackPanel>
</Border>
<!-- 欢迎消息卡片 -->
<Border Grid.Column="3"
Background="#27AE60"
CornerRadius="10"
Margin="5,0,0,0"
Padding="20">
<StackPanel>
<TextBlock Text="🎉"
FontSize="32"
HorizontalAlignment="Center"
Margin="0,0,0,10"/>
<TextBlock Text="欢迎"
FontSize="24"
FontWeight="Bold"
Foreground="White"
HorizontalAlignment="Center"/>
<TextBlock Text="使用系统"
FontSize="14"
Foreground="White"
HorizontalAlignment="Center"
Opacity="0.9"/>
</StackPanel>
</Border>
</Grid>
<!-- 详细信息区域 -->
<Border Grid.Row="1"
Background="#F8F9FA"
CornerRadius="10"
Padding="30">
<StackPanel>
<TextBlock Text="📈 系统状态"
FontSize="20"
FontWeight="Bold"
Foreground="#2C3E50"
Margin="0,0,0,20"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- 左侧信息 -->
<StackPanel Grid.Column="0" Margin="0,0,20,0">
<TextBlock Text="系统信息"
FontSize="16"
FontWeight="Bold"
Foreground="#34495E"
Margin="0,0,0,15"/>
<StackPanel Spacing="10">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0"
Text="操作系统:"
Foreground="#7F8C8D"
Width="100"/>
<TextBlock Grid.Column="1"
Text="Windows 11"
Foreground="#2C3E50"/>
</Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0"
Text="运行时间:"
Foreground="#7F8C8D"
Width="100"/>
<TextBlock Grid.Column="1"
Text="2天 14小时"
Foreground="#2C3E50"/>
</Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0"
Text="最后更新:"
Foreground="#7F8C8D"
Width="100"/>
<TextBlock Grid.Column="1"
Text="{Binding WelcomeMessage}"
Foreground="#2C3E50"/>
</Grid>
</StackPanel>
</StackPanel>
<!-- 右侧信息 -->
<StackPanel Grid.Column="1">
<TextBlock Text="快速操作"
FontSize="16"
FontWeight="Bold"
Foreground="#34495E"
Margin="0,0,0,15"/>
<StackPanel Spacing="10">
<Button Background="#3498DB"
Foreground="White"
BorderThickness="0"
CornerRadius="5"
Padding="15,10"
HorizontalAlignment="Stretch">
<StackPanel Orientation="Horizontal" Spacing="5">
<TextBlock Text="📊" FontSize="14"/>
<TextBlock Text="查看详细报表" FontSize="14"/>
</StackPanel>
</Button>
<Button Background="#E74C3C"
Foreground="White"
BorderThickness="0"
CornerRadius="5"
Padding="15,10"
HorizontalAlignment="Stretch">
<StackPanel Orientation="Horizontal" Spacing="5">
<TextBlock Text="👥" FontSize="14"/>
<TextBlock Text="管理用户" FontSize="14"/>
</StackPanel>
</Button>
<Button Background="#95A5A6"
Foreground="White"
BorderThickness="0"
CornerRadius="5"
Padding="15,10"
HorizontalAlignment="Stretch">
<StackPanel Orientation="Horizontal" Spacing="5">
<TextBlock Text="⚙️" FontSize="14"/>
<TextBlock Text="系统设置" FontSize="14"/>
</StackPanel>
</Button>
</StackPanel>
</StackPanel>
</Grid>
</StackPanel>
</Border>
</Grid>
</Grid>
</reactive:ReactiveUserControl>