Merge branch 'main' of https://git.azuze.fr/kawa/SharepointToolbox-Web
This commit is contained in:
@@ -15,13 +15,8 @@
|
||||
@if (UserContext.Role < UserRole.TechN1) { <WriteGuard /> return; }
|
||||
|
||||
<div class="card">
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Site URL</label>
|
||||
<input class="form-input" @bind="_siteUrl" placeholder="@Session.CurrentProfile!.TenantUrl" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-row">
|
||||
<SitePicker Profile="Session.CurrentProfile!" @bind-SelectedSites="_sites" Single="true" />
|
||||
<div class="flex-row mt-8">
|
||||
<button class="btn btn-secondary" @onclick="LoadLibraries" disabled="@_loading">
|
||||
@(_loading ? "Loading…" : "Load Libraries")
|
||||
</button>
|
||||
@@ -96,7 +91,7 @@
|
||||
}
|
||||
|
||||
@code {
|
||||
private string _siteUrl = string.Empty;
|
||||
private List<SiteInfo> _sites = new();
|
||||
private int _keepLast = 5; private bool _keepFirst;
|
||||
private List<string> _libraries = new(), _selectedLibs = new();
|
||||
private bool _running, _loading; private string _status = string.Empty, _error = string.Empty;
|
||||
@@ -109,8 +104,8 @@
|
||||
_loading = true; _error = string.Empty;
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(_siteUrl)) { _error = "Please enter a site URL."; return; }
|
||||
var siteUrl = _siteUrl.Trim();
|
||||
var siteUrl = _sites.FirstOrDefault()?.Url;
|
||||
if (string.IsNullOrWhiteSpace(siteUrl)) { _error = "Please select a site."; return; }
|
||||
_libraries = (await Elevation.RunAsync(async c =>
|
||||
{
|
||||
var ctx = await SessionMgr.GetOrCreateContextAsync(siteUrl, Session.CurrentProfile!, c);
|
||||
@@ -127,8 +122,8 @@
|
||||
{
|
||||
_error = string.Empty; _results.Clear(); _running = true;
|
||||
_cts = new CancellationTokenSource();
|
||||
if (string.IsNullOrWhiteSpace(_siteUrl)) { _error = "Please enter a site URL."; _running = false; return; }
|
||||
var siteUrl = _siteUrl.Trim();
|
||||
var siteUrl = _sites.FirstOrDefault()?.Url;
|
||||
if (string.IsNullOrWhiteSpace(siteUrl)) { _error = "Please select a site."; _running = false; return; }
|
||||
var progress = new Progress<OperationProgress>(p => { _status = p.Message; _current = p.Current; _total = p.Total; InvokeAsync(StateHasChanged); });
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user