feat(Permission) Added start of the Storage feature. Detailed/Plain default toggle

This commit is contained in:
2022-04-24 19:33:18 -04:00
parent 8a4d00054a
commit afaafbe713
20 changed files with 538 additions and 65 deletions
+56 -8
View File
@@ -1,20 +1,68 @@
@page "/storage"
@inject IStorageService StorageService
@using Services.Website
@implements IDisposable
@layout PageLayout
<LayoutMediumContentComponent>
<AlertComponent>
<Title>Not Implemented</Title>
<Message></Message>
</AlertComponent>
<PaperComponent>
TODO
</PaperComponent>
@if (!_enabledPermissions)
{
<AlertComponent Type="@SeverityType.Error">
<Title>Storage Disabled</Title>
<Message>Enable Storage on the Permissions Page.</Message>
</AlertComponent>
}
else
{
<PaperComponent>
<FormLayoutComponent>
<FormToggleComponent
Label="Is Plain View"
Value="@_isEntityPlainView"
OnChange="EntityViewChanged"/>
</FormLayoutComponent>
</PaperComponent>
}
<ContentDividerComponent/>
<PaperComponent>
</PaperComponent>
</LayoutMediumContentComponent>
</LayoutMediumContentComponent>
@code {
bool _enabledPermissions;
protected override void OnInitialized()
{
_enabledPermissions = StorageService.GetValue<bool>(StorageKeys.EnabledStorage);
Update();
StorageService.Subscribe(Update);
}
public void Dispose()
{
StorageService.Unsubscribe(Update);
}
void Update()
{
_isEntityPlainView = StorageService.GetValue<bool>(StorageKeys.IsPlainView);
StateHasChanged();
}
private bool _isEntityPlainView;
private void EntityViewChanged(ChangeEventArgs obj)
{
StorageService.SetValue(StorageKeys.IsPlainView, obj.Value);
}
}