huge commit for webfront facelift
This commit is contained in:
@ -14,5 +14,6 @@ namespace WebfrontCore.ViewModels
|
||||
public string Value { get; set; }
|
||||
public Dictionary<string, string> Values { get; set; }
|
||||
public bool Checked { get; set; }
|
||||
public bool Required { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,8 @@ namespace WebfrontCore.ViewModels
|
||||
/// number of items offset from the start of the list
|
||||
/// </summary>
|
||||
public int Offset { get; set; }
|
||||
|
||||
public int Count { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// show only a certain type of penalty
|
||||
|
@ -3,17 +3,16 @@ using SharedLibraryCore.Database.Models;
|
||||
|
||||
namespace WebfrontCore.ViewModels
|
||||
{
|
||||
|
||||
public class ScoreboardInfo
|
||||
{
|
||||
public string ServerName { get; set; }
|
||||
public long ServerId { get; set; }
|
||||
public string MapName { get; set; }
|
||||
public string OrderByKey { get; set; }
|
||||
public bool ShouldOrderDescending { get; set; }
|
||||
public List<ClientScoreboardInfo> ClientInfo { get; set; }
|
||||
public string ServerName { get; set; }
|
||||
public string ServerId { get; set; }
|
||||
public string MapName { get; set; }
|
||||
public string OrderByKey { get; set; }
|
||||
public bool ShouldOrderDescending { get; set; }
|
||||
public List<ClientScoreboardInfo> ClientInfo { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class ClientScoreboardInfo
|
||||
{
|
||||
public string ClientName { get; set; }
|
||||
|
21
WebfrontCore/ViewModels/SideContextMenuItem.cs
Normal file
21
WebfrontCore/ViewModels/SideContextMenuItem.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace WebfrontCore.ViewModels;
|
||||
|
||||
public class SideContextMenuItem
|
||||
{
|
||||
public bool IsLink { get; set; }
|
||||
public bool IsButton { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string Reference { get; set; }
|
||||
public string Icon { get; set; }
|
||||
public string Tooltip { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class SideContextMenuItems
|
||||
{
|
||||
public string MenuTitle { get; set; }
|
||||
public List<SideContextMenuItem> Items { get; set; } = new();
|
||||
}
|
54
WebfrontCore/ViewModels/TableInfo.cs
Normal file
54
WebfrontCore/ViewModels/TableInfo.cs
Normal file
@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace WebfrontCore.ViewModels;
|
||||
|
||||
public class TableInfo
|
||||
{
|
||||
public string Header { get; set; }
|
||||
public List<ColumnDefinition> Columns { get; } = new();
|
||||
public List<RowDefinition> Rows { get; } = new();
|
||||
public int InitialRowCount { get; }
|
||||
|
||||
public TableInfo(int initialRowCount = 0)
|
||||
{
|
||||
InitialRowCount = initialRowCount;
|
||||
}
|
||||
}
|
||||
|
||||
public class RowDefinition
|
||||
{
|
||||
public List<string> Datum { get; } = new();
|
||||
}
|
||||
|
||||
public class ColumnDefinition
|
||||
{
|
||||
public string Title { get; set; }
|
||||
public string ColumnSpan { get; set; }
|
||||
}
|
||||
|
||||
public static class TableInfoExtensions
|
||||
{
|
||||
public static TableInfo WithColumns(this TableInfo info, IEnumerable<string> columns)
|
||||
{
|
||||
info.Columns.AddRange(columns.Select(column => new ColumnDefinition
|
||||
{
|
||||
Title = column
|
||||
}));
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
public static TableInfo WithRows<T>(this TableInfo info, IEnumerable<T> source,
|
||||
Func<T, IEnumerable<string>> selector)
|
||||
{
|
||||
info.Rows.AddRange(source.Select(row =>
|
||||
{
|
||||
var rowDef = new RowDefinition();
|
||||
rowDef.Datum.AddRange(selector(row));
|
||||
return rowDef;
|
||||
}));
|
||||
return info;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user