Class AdminViewModel
Server administration for server admins, over the server's admin API: users' reports, accounts with suspension, locks, passwords, admin rights, notices and deactivation, and registration tokens.
Inheritance
AdminViewModel
Assembly: Uniform.Chat.Avalonia.dll
public sealed class AdminViewModel : ViewModelBase, INotifyPropertyChanged, INotifyPropertyChanging
Constructors
|
Edit this page
View Source
Create the panel over connection.
Declaration
public AdminViewModel(ClientConnection connection)
Parameters
Properties
|
Edit this page
View Source
Declaration
public ObservableCollection<AdminAccountItem> Accounts { get; }
Property Value
|
Edit this page
View Source
AdminText
Text of the admin button of the chosen account.
Declaration
public string AdminText { get; }
Property Value
Gets an IRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.AdminViewModel.CancelConfirmation().
Declaration
[ExcludeFromCodeCoverage]
public IRelayCommand CancelConfirmationCommand { get; }
Property Value
Gets an IRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.AdminViewModel.CloseAccount().
Declaration
[ExcludeFromCodeCoverage]
public IRelayCommand CloseAccountCommand { get; }
Property Value
Gets an IAsyncRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.AdminViewModel.ConfirmAsync().
Declaration
[ExcludeFromCodeCoverage]
public IAsyncRelayCommand ConfirmCommand { get; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[NotifyPropertyChangedFor("IsConfirming")]
[ExcludeFromCodeCoverage]
public string Confirmation { get; set; }
Property Value
Gets an IAsyncRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.AdminViewModel.CreateTokenAsync().
Declaration
[ExcludeFromCodeCoverage]
public IAsyncRelayCommand CreateTokenCommand { get; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[NotifyPropertyChangedFor("HasCreatedToken")]
[ExcludeFromCodeCoverage]
public string CreatedToken { get; set; }
Property Value
Gets an IRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.AdminViewModel.Deactivate().
Declaration
[ExcludeFromCodeCoverage]
public IRelayCommand DeactivateCommand { get; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public string Devices { get; set; }
Property Value
|
Edit this page
View Source
Whether a token was just made.
Declaration
public bool HasCreatedToken { get; }
Property Value
|
Edit this page
View Source
Whether an account is chosen.
Declaration
public bool HasSelectedAccount { get; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public bool IsBusy { get; set; }
Property Value
|
Edit this page
View Source
Whether a change waits for confirmation.
Declaration
public bool IsConfirming { get; }
Property Value
|
Edit this page
View Source
LockText
Text of the lock button of the chosen account.
Declaration
public string LockText { get; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public string Message { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public string NewPassword { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public string NewTokenDays { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public string NewTokenUses { get; set; }
Property Value
|
Edit this page
View Source
NoticeText
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public string NoticeText { get; set; }
Property Value
Declaration
[ExcludeFromCodeCoverage]
public IAsyncRelayCommand RefreshCommand { get; }
Property Value
|
Edit this page
View Source
Users' reports, newest first.
Declaration
public ObservableCollection<AdminReportItem> Reports { get; }
Property Value
Gets an IAsyncRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.AdminViewModel.ResetPasswordAsync().
Declaration
[ExcludeFromCodeCoverage]
public IAsyncRelayCommand ResetPasswordCommand { get; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public string Search { get; set; }
Property Value
Gets an IAsyncRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.AdminViewModel.SearchAccountsAsync().
Declaration
[ExcludeFromCodeCoverage]
public IAsyncRelayCommand SearchAccountsCommand { get; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[NotifyPropertyChangedFor("ShowsReports", new string[] { "ShowsAccounts", "ShowsTokens" })]
[ExcludeFromCodeCoverage]
public AdminSection Section { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[NotifyPropertyChangedFor("HasSelectedAccount", new string[] { "SuspendText", "LockText", "AdminText" })]
[ExcludeFromCodeCoverage]
public AdminAccountItem? SelectedAccount { get; set; }
Property Value
Gets an IAsyncRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.AdminViewModel.SendNoticeAsync().
Declaration
[ExcludeFromCodeCoverage]
public IAsyncRelayCommand SendNoticeCommand { get; }
Property Value
Declaration
[ExcludeFromCodeCoverage]
public IAsyncRelayCommand<AdminSection> ShowSectionCommand { get; }
Property Value
|
Edit this page
View Source
Whether the accounts are shown.
Declaration
public bool ShowsAccounts { get; }
Property Value
|
Edit this page
View Source
Whether the reports are shown.
Declaration
public bool ShowsReports { get; }
Property Value
|
Edit this page
View Source
Whether the tokens are shown.
Declaration
public bool ShowsTokens { get; }
Property Value
|
Edit this page
View Source
SuspendText
Text of the suspension button of the chosen account.
Declaration
public string SuspendText { get; }
Property Value
Gets an IAsyncRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.AdminViewModel.ToggleAdminAsync().
Declaration
[ExcludeFromCodeCoverage]
public IAsyncRelayCommand ToggleAdminCommand { get; }
Property Value
Gets an IAsyncRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.AdminViewModel.ToggleLockedAsync().
Declaration
[ExcludeFromCodeCoverage]
public IAsyncRelayCommand ToggleLockedCommand { get; }
Property Value
Gets an IAsyncRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.AdminViewModel.ToggleSuspendedAsync().
Declaration
[ExcludeFromCodeCoverage]
public IAsyncRelayCommand ToggleSuspendedCommand { get; }
Property Value
|
Edit this page
View Source
Declaration
public ObservableCollection<AdminTokenItem> Tokens { get; }
Property Value
Methods
|
Edit this page
View Source
Declaration
public Task DeleteReportAsync(AdminReportItem item)
Parameters
Returns
|
Edit this page
View Source
Delete a registration token.
Declaration
public Task DeleteTokenAsync(AdminTokenItem item)
Parameters
Returns
|
Edit this page
View Source
Load the shown section again.
Declaration
[RelayCommand]
public Task RefreshAsync()
Returns
|
Edit this page
View Source
Show the actions of an account, and its devices.
Declaration
public Task SelectAccountAsync(AdminAccountItem item)
Parameters
Returns
|
Edit this page
View Source
Ask to shut down the reported room, which cannot be undone.
Declaration
public void ShutDownRoom(AdminReportItem item)
Parameters
|
Edit this page
View Source
Suspend the reported user.
Declaration
public Task SuspendReportedAsync(AdminReportItem item)
Parameters
Returns
Implements