-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
131 additions
and
119 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
@page "/ChatHubPage" | ||
@using k8s.Models | ||
@using BlazorApp.Pages.Common | ||
<h3>ChatHubPage</h3> | ||
|
||
<div class="row"> | ||
|
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
File renamed without changes.
8 changes: 3 additions & 5 deletions
8
BlazorApp/Pages/ResourceWatcher.razor.cs → ...App/Pages/Common/ResourceWatcher.razor.cs
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 @@ | ||
@typeparam T |
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,52 @@ | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using AntDesign.TableModels; | ||
using BlazorApp.Service; | ||
using BlazorApp.Utils; | ||
using k8s; | ||
using k8s.Models; | ||
using Microsoft.AspNetCore.Components; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace BlazorApp.Pages.Common; | ||
|
||
public partial class TableBase<T> : ComponentBase where T : IKubernetesObject<V1ObjectMeta> | ||
{ | ||
[Inject] | ||
protected IPageDrawerService PageDrawerService { get; set; } | ||
|
||
protected ResourceCacheHelper<T> ItemList = ResourceCacheHelper<T>.Instance(); | ||
|
||
protected readonly TableDataHelper<T> TableDataHelper = new(); | ||
protected static readonly ILogger<TableBase<T>> Logger = LoggingHelper<TableBase<T>>.Logger(); | ||
private string _selectedNs = ""; | ||
|
||
|
||
protected async Task OnSearchHandler(string key) | ||
{ | ||
await TableDataHelper.SearchName(key); | ||
|
||
await InvokeAsync(StateHasChanged); | ||
} | ||
|
||
|
||
protected async Task OnNsSelectedHandler(string ns) | ||
{ | ||
_selectedNs = ns; | ||
await TableDataHelper.OnNsSelectedHandler(_selectedNs); | ||
await InvokeAsync(StateHasChanged); | ||
} | ||
|
||
|
||
protected async Task OnPageChangeHandler(QueryModel<T> queryModel) | ||
{ | ||
await TableDataHelper.OnChange(queryModel); | ||
await InvokeAsync(StateHasChanged); | ||
} | ||
|
||
|
||
public void RemoveSelection(string uid) | ||
{ | ||
TableDataHelper.SelectedRows = TableDataHelper.SelectedRows.Where(x => x.Metadata.Uid != uid); | ||
} | ||
} |
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
Oops, something went wrong.