mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-15 05:04:15 +01:00
chore: better info about what blocks the installer
This commit is contained in:
parent
8cb28d0ebe
commit
3ec6d05ec0
3 changed files with 44 additions and 3 deletions
|
|
@ -265,7 +265,45 @@ namespace Dalamud.Interface.Internal.Windows.PluginInstaller
|
||||||
ImGuiHelpers.CenteredText("Installing plugin...");
|
ImGuiHelpers.CenteredText("Installing plugin...");
|
||||||
break;
|
break;
|
||||||
case LoadingIndicatorKind.Manager:
|
case LoadingIndicatorKind.Manager:
|
||||||
ImGuiHelpers.CenteredText("Loading repositories and plugins...");
|
{
|
||||||
|
if (pluginManager.PluginsReady && !pluginManager.ReposReady)
|
||||||
|
{
|
||||||
|
ImGuiHelpers.CenteredText("Loading repositories...");
|
||||||
|
}
|
||||||
|
else if (!pluginManager.PluginsReady && pluginManager.ReposReady)
|
||||||
|
{
|
||||||
|
ImGuiHelpers.CenteredText("Loading installed plugins...");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ImGuiHelpers.CenteredText("Loading repositories and plugins...");
|
||||||
|
}
|
||||||
|
|
||||||
|
var currentProgress = 0;
|
||||||
|
var total = 0;
|
||||||
|
|
||||||
|
var pendingRepos = pluginManager.Repos.ToArray()
|
||||||
|
.Where(x => (x.State != PluginRepositoryState.Success &&
|
||||||
|
x.State != PluginRepositoryState.Fail) &&
|
||||||
|
x.IsEnabled)
|
||||||
|
.ToArray();
|
||||||
|
var allRepoCount =
|
||||||
|
pluginManager.Repos.Count(x => x.State != PluginRepositoryState.Fail && x.IsEnabled);
|
||||||
|
|
||||||
|
foreach (var repo in pendingRepos)
|
||||||
|
{
|
||||||
|
ImGuiHelpers.CenteredText($"{repo.PluginMasterUrl}: {repo.State}");
|
||||||
|
}
|
||||||
|
|
||||||
|
currentProgress += allRepoCount - pendingRepos.Length;
|
||||||
|
total += allRepoCount;
|
||||||
|
|
||||||
|
if (currentProgress != total)
|
||||||
|
{
|
||||||
|
ImGui.ProgressBar(currentProgress / (float)total, new Vector2(windowSize.X / 3, 50));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new ArgumentOutOfRangeException();
|
throw new ArgumentOutOfRangeException();
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ internal partial class PluginManager : IDisposable, IServiceType
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether all added repos are not in progress.
|
/// Gets a value indicating whether all added repos are not in progress.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool ReposReady => this.Repos.All(repo => repo.State != PluginRepositoryState.InProgress);
|
public bool ReposReady => this.Repos.All(repo => repo.State != PluginRepositoryState.InProgress || repo.State != PluginRepositoryState.Fail);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether the plugin manager started in safe mode.
|
/// Gets a value indicating whether the plugin manager started in safe mode.
|
||||||
|
|
@ -492,7 +492,9 @@ internal partial class PluginManager : IDisposable, IServiceType
|
||||||
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
|
||||||
public async Task ReloadPluginMastersAsync(bool notify = true)
|
public async Task ReloadPluginMastersAsync(bool notify = true)
|
||||||
{
|
{
|
||||||
|
Log.Information("Now reloading all PluginMasters...");
|
||||||
await Task.WhenAll(this.Repos.Select(repo => repo.ReloadPluginMasterAsync()));
|
await Task.WhenAll(this.Repos.Select(repo => repo.ReloadPluginMasterAsync()));
|
||||||
|
Log.Information("PluginMasters reloaded, now refiltering...");
|
||||||
|
|
||||||
this.RefilterPluginMasters(notify);
|
this.RefilterPluginMasters(notify);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ internal class PluginRepository
|
||||||
|
|
||||||
private static readonly HttpClient HttpClient = new()
|
private static readonly HttpClient HttpClient = new()
|
||||||
{
|
{
|
||||||
|
Timeout = TimeSpan.FromSeconds(20),
|
||||||
DefaultRequestHeaders =
|
DefaultRequestHeaders =
|
||||||
{
|
{
|
||||||
CacheControl = new CacheControlHeaderValue
|
CacheControl = new CacheControlHeaderValue
|
||||||
|
|
@ -109,7 +110,7 @@ internal class PluginRepository
|
||||||
|
|
||||||
this.PluginMaster = pluginMaster.AsReadOnly();
|
this.PluginMaster = pluginMaster.AsReadOnly();
|
||||||
|
|
||||||
Log.Debug($"Successfully fetched repo: {this.PluginMasterUrl}");
|
Log.Information($"Successfully fetched repo: {this.PluginMasterUrl}");
|
||||||
this.State = PluginRepositoryState.Success;
|
this.State = PluginRepositoryState.Success;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue