File size: 1,832 Bytes
1b888d2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using System.Collections.ObjectModel;
namespace SilkroadBot.UI.ViewModels;
public partial class MainViewModel : ObservableObject
{
[ObservableProperty] private string _currentPage = "Dashboard";
[ObservableProperty] private string _statusText = "Ready";
[ObservableProperty] private int _activeBotCount;
}
public partial class DashboardViewModel : ObservableObject
{
[ObservableProperty] private int _activeBotsCount;
[ObservableProperty] private int _connectedCount;
[ObservableProperty] private int _pluginsCount;
[ObservableProperty] private string _uptime = "00:00:00";
public ObservableCollection<string> RecentLogs { get; } = new();
}
public partial class ProfilesViewModel : ObservableObject
{
[ObservableProperty] private string _selectedProfileId = "";
public ObservableCollection<ProfileListItem> Profiles { get; } = new();
}
public record ProfileListItem(string Id, string Name, string Status);
public partial class PluginsViewModel : ObservableObject
{
public ObservableCollection<PluginListItem> Plugins { get; } = new();
}
public record PluginListItem(string Name, string Version, string Author, bool IsRunning, string Description);
public partial class PacketMonitorViewModel : ObservableObject
{
[ObservableProperty] private bool _isCapturing = true;
[ObservableProperty] private string _opcodeFilter = "";
public ObservableCollection<PacketEntry> Packets { get; } = new();
}
public record PacketEntry(string Time, string Direction, string Opcode, string Name, int Size, string HexData);
public partial class LogsViewModel : ObservableObject
{
[ObservableProperty] private string _levelFilter = "All";
public ObservableCollection<string> Logs { get; } = new();
}
|