This commit is contained in:
Paul Schneider 2026-02-28 21:17:54 +00:00
commit 40e8e08690
3487 changed files with 39 additions and 21 deletions

View file

@ -0,0 +1,14 @@
using System.ComponentModel.DataAnnotations;
namespace Yavsc.ViewModels.Account
{
public class LoginInputModel
{
[Required]
public string Username { get; set; }
[Required]
public string Password { get; set; }
public bool RememberLogin { get; set; }
public string ReturnUrl { get; set; }
}
}

View file

@ -0,0 +1,14 @@
namespace Yavsc.ViewModels.Account
{
public class LoginViewModel : LoginInputModel
{
public bool AllowRememberLogin { get; set; } = true;
public bool EnableLocalLogin { get; set; } = true;
public IEnumerable<ExternalProvider> ExternalProviders { get; set; } = Enumerable.Empty<ExternalProvider>();
public IEnumerable<ExternalProvider> VisibleExternalProviders => ExternalProviders.Where(x => !String.IsNullOrWhiteSpace(x.DisplayName));
public bool IsExternalLoginOnly => EnableLocalLogin == false && ExternalProviders?.Count() == 1;
public string ExternalLoginScheme => IsExternalLoginOnly ? ExternalProviders?.SingleOrDefault()?.AuthenticationScheme : null;
}
}

View file

@ -0,0 +1,7 @@
namespace Yavsc.ViewModels.Account
{
public class RedirectViewModel
{
public string RedirectUrl { get; set; }
}
}

View file

@ -0,0 +1,16 @@
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc.Rendering;
namespace Yavsc.ViewModels.Account
{
public class SendCodeViewModel
{
public string SelectedProvider { get; set; }
public ICollection<SelectListItem> Providers { get; set; }
public string ReturnUrl { get; set; }
public bool RememberMe { get; set; }
}
}

View file

@ -0,0 +1,15 @@
using System.ComponentModel.DataAnnotations;
using Yavsc.Attributes.Validation;
namespace Yavsc.ViewModels
{
public partial class EnrolerViewModel {
[Required]
public string EnroledUserId { get; set; }
[Required]
public string RoleName { get; set; }
}
}

View file

@ -0,0 +1,19 @@
using System.ComponentModel.DataAnnotations;
using Yavsc.Attributes.Validation;
namespace Yavsc.ViewModels
{
public partial class FireViewModel {
[Display(Name="EnroledLabel", ResourceType=typeof(EnrolerViewModel))]
public string EnroledUserName { get; set; }
[YaRequired]
public string EnroledUserId { get; set; }
[Display(Name="RoleNameLabel", ResourceType=typeof(EnrolerViewModel))]
[YaRequired]
public string RoleName { get; set; }
}
}

View file

@ -0,0 +1,21 @@
using System.ComponentModel.DataAnnotations;
using Microsoft.AspNetCore.Html;
using Microsoft.AspNetCore.Mvc.Rendering;
using Yavsc.Attributes.Validation;
namespace Yavsc.ViewModels.Gen
{
public class PdfGenerationViewModel
{
[YaRequired]
public string TeXSource { get; set; }
[YaRequired]
public string BaseFileName { get; set; }
[YaRequired]
public string DestDir { get; set; }
public bool Generated { get; set; }
public HtmlString GenerationErrorMessage { get; set; }
public string Temp { get; set; }
}
}

View file

@ -0,0 +1,12 @@
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc.Rendering;
namespace Yavsc.ViewModels.Manage
{
public class ConfigureTwoFactorViewModel
{
public string SelectedProvider { get; set; }
public ICollection<SelectListItem> Providers { get; set; }
}
}

View file

@ -0,0 +1,56 @@
using System.Collections.Generic;
using Microsoft.AspNetCore.Identity;
namespace Yavsc.ViewModels.Manage
{
using Models.Bank;
using Models;
using Models.Workflow;
public class IndexViewModel
{
public string UserName {get; set; }
public string Avatar { get; set; }
public string Address { get; set; }
public bool HasPassword { get; set; }
public IList<UserLoginInfo> Logins { get; set; }
public string PhoneNumber { get; set; }
public bool TwoFactor { get; set; }
public bool BrowserRemembered { get; set; }
public List<UserActivity> Activity { get; set; }
public bool HaveProfessionalSettings { get; set; }
public bool HaveActivityToConfigure { get; set; }
public long PostsCounter { get; set; }
public AccountBalance Balance { get; set; }
public long ActiveCommandCount { get; set; }
public bool HasDedicatedCalendar { get; set; }
public IEnumerable<string> Roles { get; set; }
public string FullName { get; set; }
public string PostalAddress { get; set; }
public List<BankIdentity> BankInfo { get; set; }
public long DiskQuota { get; set; }
public long DiskUsage { get; set; }
public string DedicatedCalendarId { get; set; }
public string EMail { get; set; }
public bool EmailConfirmed { get; set; }
public bool AllowMonthlyEmail { get; set; }
}
}

View file

@ -0,0 +1,10 @@
using System.Collections.Generic;
using Microsoft.AspNetCore.Identity;
namespace Yavsc.ViewModels.Manage
{
public class ManageLoginsViewModel
{
public IList<UserLoginInfo> CurrentLogins { get; set; }
}
}

View file

@ -0,0 +1,13 @@
using System.ComponentModel.DataAnnotations;
using Yavsc.Attributes.Validation;
namespace Yavsc.ViewModels.Manage
{
public class SetFullNameViewModel
{
[YaRequired]
[Display(Name = "Your full name"), YaStringLength(512)]
public string FullName { get; set; }
}
}

View file

@ -0,0 +1,14 @@
using System.ComponentModel.DataAnnotations;
using Yavsc.Attributes.Validation;
namespace Yavsc.ViewModels.Manage
{
public class SetUserNameViewModel
{
[Required]
[Display(Name = "User name"),RegularExpression(Constants.UserNameRegExp)]
public string UserName { get; set; }
}
}