-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from neozhu/feature/offline-access
Implement Offline Mode with IndexedDB Caching for Authentication
- Loading branch information
Showing
55 changed files
with
1,141 additions
and
361 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"version": "1.0.0", | ||
"clients": {}, | ||
"plugins": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
src/CleanAspire.ClientApp/Components/OfflineSyncStatus.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
@inject OfflineSyncService OfflineSyncService | ||
|
||
<div class="d-flex justify-center align-center flex-row gap-2"> | ||
@if (OfflineSyncService.CurrentStatus == SyncStatus.Idle) | ||
{ | ||
<MudIconButton Icon="@Icons.Material.Outlined.MoreVert" Color="Color.Inherit" /> | ||
} | ||
else if (OfflineSyncService.CurrentStatus == SyncStatus.Completed) | ||
{ | ||
<MudText Typo="Typo.caption">@OfflineSyncService.StatusMessage</MudText> | ||
<MudIcon> | ||
<svg width="24" height="24" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> | ||
<circle cx="50" cy="50" r="45" stroke="#2ecc71" stroke-width="9" fill="none"> | ||
<animate attributeName="stroke-dasharray" from="0, 283" to="283, 283" dur="0.6s" fill="freeze" /> | ||
</circle> | ||
<path d="M30 50 L45 65 L70 35" stroke="#2ecc71" stroke-width="10" fill="none" stroke-linecap="round" stroke-linejoin="round" | ||
stroke-dasharray="50, 50" stroke-dashoffset="50"> | ||
<animate attributeName="stroke-dashoffset" from="50" to="0" dur="0.4s" begin="0.6s" fill="freeze" /> | ||
</path> | ||
</svg> | ||
</MudIcon> | ||
}else | ||
{ | ||
<MudText Typo="Typo.caption">@OfflineSyncService.StatusMessage</MudText> | ||
<MudIcon> | ||
<svg width="24" height="24" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" transform="matrix(-1.8369701987210297e-16,-1,1,-1.8369701987210297e-16,0,0)"> | ||
<circle cx="50" cy="20" r="7" fill="#3498db"> | ||
<animateTransform attributeType="XML" attributeName="transform" type="rotate" from="0 50 50" to="360 50 50" dur="1.5s" repeatCount="indefinite"></animateTransform> | ||
</circle> | ||
<circle cx="80" cy="50" r="7" fill="#e74c3c"> | ||
<animateTransform attributeType="XML" attributeName="transform" type="rotate" from="0 50 50" to="360 50 50" dur="1.5s" begin="0.2s" repeatCount="indefinite"></animateTransform> | ||
</circle> | ||
<circle cx="50" cy="80" r="7" fill="#f1c40f"> | ||
<animateTransform attributeType="XML" attributeName="transform" type="rotate" from="0 50 50" to="360 50 50" dur="1.5s" begin="0.4s" repeatCount="indefinite"></animateTransform> | ||
</circle> | ||
<circle cx="20" cy="50" r="7" fill="#2ecc71"> | ||
<animateTransform attributeType="XML" attributeName="transform" type="rotate" from="0 50 50" to="360 50 50" dur="1.5s" begin="0.6s" repeatCount="indefinite"></animateTransform> | ||
</circle> | ||
</svg> | ||
</MudIcon> | ||
} | ||
</div> | ||
|
||
@code { | ||
protected override void OnInitialized() | ||
{ | ||
OfflineSyncService.OnSyncStateChanged += StateHasChanged; | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
OfflineSyncService.OnSyncStateChanged -= StateHasChanged; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.