Přidání nového projektu - pokus o explorer

This commit is contained in:
Matěj Kubíček committed 2026-10-13 20:13:07 +02:00
1 parent b0b0b3ee34
commit d06a9f332b
48 files changed
+1429

No files matched your search

@@ -0,0 +1,33 @@
using System;
using winui_learning_2.Helpers;
using Windows.UI;
namespace winui_learning_2.Models;
public class ActivityDisplayItem
{
public string Username { get; init; } = string.Empty;
public string Action { get; init; } = string.Empty;
public string CategoryLabel { get; init; } = string.Empty;
public Color CategoryColor { get; init; }
public string TimestampText { get; init; } = string.Empty;
public static ActivityDisplayItem From(DashboardActivity activity) => new()
{
Username = activity.Username,
Action = activity.Action,
CategoryLabel = DashboardFormatting.CategoryLabel(activity.Category),
CategoryColor = GetCategoryColor(activity.Category),
TimestampText = DashboardFormatting.FormatDateTime(activity.Timestamp)
};
private static Color GetCategoryColor(string category) => category switch
{
"win" => Color.FromArgb(255, 25, 135, 84),
"loss" => Color.FromArgb(255, 220, 53, 69),
"bet" => Color.FromArgb(255, 255, 193, 7),
"payment" => Color.FromArgb(255, 13, 202, 240),
"team" => Color.FromArgb(255, 108, 117, 125),
_ => Color.FromArgb(255, 33, 37, 41)
};
}
@@ -0,0 +1,16 @@
using System.Collections.Generic;
namespace winui_learning_2.Models;
public class DashBoardViewModel
{
public int TotalUsers { get; set; }
public int ActiveChallenges { get; set; }
public int RegisteredGames { get; set; }
public decimal TotalNodCoins { get; set; }
public decimal ProfitNc { get; set; }
public int ActivityPage { get; set; }
public int ActivityMaxPages { get; set; }
public int TotalActivities { get; set; }
public List<DashboardActivity> RecentActivities { get; set; } = [];
}
@@ -0,0 +1,12 @@
using System;
namespace winui_learning_2.Models;
public class DashboardActivity
{
public int? UserId { get; set; }
public string Username { get; set; } = string.Empty;
public string Action { get; set; } = string.Empty;
public string Category { get; set; } = string.Empty;
public DateTime Timestamp { get; set; }
}
@@ -0,0 +1,27 @@
using System.Text.Json.Serialization;
namespace winui_learning_2.Models;
public class LoginResponse
{
[JsonPropertyName("token")]
public string? Token { get; set; }
[JsonPropertyName("accessToken")]
public string? AccessToken { get; set; }
[JsonPropertyName("access_token")]
public string? AccessTokenSnake { get; set; }
[JsonPropertyName("jwtToken")]
public string? JwtToken { get; set; }
[JsonPropertyName("jwt")]
public string? Jwt { get; set; }
[JsonPropertyName("username")]
public string? Username { get; set; }
public string? GetToken() =>
Token ?? AccessToken ?? AccessTokenSnake ?? JwtToken ?? Jwt;
}
@@ -0,0 +1,12 @@
using System.Text.Json.Serialization;
namespace winui_learning_2.Models;
public class UserLoginDto
{
[JsonPropertyName("username")]
public string Username { get; set; } = string.Empty;
[JsonPropertyName("password")]
public string Password { get; set; } = string.Empty;
}