Skip to content

Commit

Permalink
Merge pull request #551 from MUnique/dev/adminpanel-breadcrumbs
Browse files Browse the repository at this point in the history
Implemented Breadcrumb navigation in AdminPanel
  • Loading branch information
sven-n authored Dec 9, 2024
2 parents 5b5703f + 763387a commit ac0e233
Show file tree
Hide file tree
Showing 51 changed files with 587 additions and 47 deletions.
1 change: 0 additions & 1 deletion src/DataModel/Attributes/PowerUpDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public override string ToString()
{
value = relation.InputAttribute?.Designation + relation.InputOperator.AsString() + relation.InputOperand;
}

}
else
{
Expand Down
6 changes: 6 additions & 0 deletions src/DataModel/Configuration/AreaSkillSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,10 @@ public partial class AreaSkillSettings
/// the chance to hit is 5^0.9 = 0.59.
/// </summary>
public float HitChancePerDistanceMultiplier { get; set; }

/// <inheritdoc />
public override string ToString()
{
return "Area Skill Settings";
}
}
6 changes: 6 additions & 0 deletions src/DataModel/Configuration/BattleZoneDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,10 @@ public partial class BattleZoneDefinition
/// </summary>
[MemberOfAggregate]
public virtual Rectangle? RightGoal { get; set; }

/// <inheritdoc />
public override string ToString()
{
return $"Battle Zone ({this.Type})";
}
}
6 changes: 6 additions & 0 deletions src/DataModel/Configuration/CharacterClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,10 @@ public partial class CharacterClass
{
return this.StatAttributes.FirstOrDefault(a => a.Attribute == attributeDefinition);
}

/// <inheritdoc />
public override string ToString()
{
return this.Name;
}
}
9 changes: 9 additions & 0 deletions src/DataModel/Configuration/ConnectServerDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ public partial class ConnectServerDefinition : IConnectServerSettings
/// </summary>
public int MaxServerListRequests { get; set; }

/// <summary>
/// Initializes the defaults.
/// </summary>
public void InitializeDefaults()
{
this.DisconnectOnUnknownPacket = true;
Expand All @@ -128,4 +131,10 @@ public void InitializeDefaults()
this.MaxIpRequests = 5;
this.MaxServerListRequests = 20;
}

/// <inheritdoc />
public override string ToString()
{
return this.Description;
}
}
6 changes: 6 additions & 0 deletions src/DataModel/Configuration/GameClientDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,10 @@ public partial class GameClientDefinition : IGameClientVersion
/// Gets or sets the description.
/// </summary>
public string Description { get; set; } = string.Empty;

/// <inheritdoc />
public override string ToString()
{
return this.Description;
}
}
2 changes: 1 addition & 1 deletion src/DataModel/Configuration/LevelDependentDamage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace MUnique.OpenMU.DataModel.Configuration;
using MUnique.OpenMU.Annotations;

/// <summary>
/// Defines a level dependent damage.
/// Defines a level-dependent damage.
/// </summary>
[Cloneable]
public partial class LevelDependentDamage
Expand Down
6 changes: 6 additions & 0 deletions src/DataModel/Configuration/MagicEffectDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,10 @@ public partial class MagicEffectDefinition
/// </summary>
[MemberOfAggregate]
public virtual ICollection<PowerUpDefinition> PowerUpDefinitions { get; protected set; } = null!;

/// <inheritdoc />
public override string ToString()
{
return $"{this.Name} ({this.Number})";
}
}
6 changes: 6 additions & 0 deletions src/DataModel/Configuration/MasterSkillDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,10 @@ public partial class MasterSkillDefinition
/// The attack damage is also inherited and increased by the damage AND value of the master skill.
/// </summary>
public virtual Skill? ReplacedSkill { get; set; }

/// <inheritdoc />
public override string ToString()
{
return "Master Skill Definition";
}
}
6 changes: 6 additions & 0 deletions src/DataModel/Configuration/MiniGameChangeEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,10 @@ public partial class MiniGameChangeEvent
/// </summary>
[MemberOfAggregate]
public virtual ICollection<MiniGameTerrainChange> TerrainChanges { get; protected set; } = null!;

/// <inheritdoc />
public override string ToString()
{
return $"{this.Index}: {this.Description}";
}
}
6 changes: 6 additions & 0 deletions src/DataModel/Configuration/MiniGameDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,10 @@ public partial class MiniGameDefinition
/// </summary>
[MemberOfAggregate]
public virtual ICollection<MiniGameChangeEvent> ChangeEvents { get; protected set; } = null!;

/// <inheritdoc />
public override string ToString()
{
return this.Name;
}
}
2 changes: 1 addition & 1 deletion src/DataModel/Configuration/MiniGameReward.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public override string ToString()
{
result.Append("Rank ").Append(this.Rank.Value).Append(": ");
}

if (this.RequiredSuccess > 0)
{
result.Append(this.RequiredSuccess).Append(": ");
Expand Down
6 changes: 6 additions & 0 deletions src/DataModel/Configuration/MiniGameSpawnWave.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,10 @@ public partial class MiniGameSpawnWave
/// Gets or sets the end time of the wave.
/// </summary>
public TimeSpan EndTime { get; set; }

/// <inheritdoc />
public override string ToString()
{
return $"Wave {this.WaveNumber}: {this.Description}";
}
}
1 change: 0 additions & 1 deletion src/DataModel/Configuration/MonsterDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ namespace MUnique.OpenMU.DataModel.Configuration;
using MUnique.OpenMU.AttributeSystem;
using MUnique.OpenMU.DataModel.Configuration.Quests;
using MUnique.OpenMU.DataModel.Entities;
using MUnique.OpenMU.Interfaces;

/// <summary>
/// Type of the window which will be openend when talking to the npc.
Expand Down
11 changes: 11 additions & 0 deletions src/DataModel/Configuration/Rectangle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,15 @@ public partial class Rectangle
/// Gets or sets the bottom right corner, y-coordinate.
/// </summary>
public byte Y2 { get; set; }

/// <inheritdoc />
public override string ToString()
{
if (this.X1 == this.X2 && this.Y1 == this.Y2)
{
return $"{this.X1} / {this.Y1}";
}

return $"{this.X1} / {this.Y1} to {this.X2} / {this.Y2}";
}
}
6 changes: 6 additions & 0 deletions src/DataModel/Configuration/Skill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -300,4 +300,10 @@ public partial class Skill
/// </summary>
[MemberOfAggregate]
public virtual AreaSkillSettings? AreaSkillSettings { get; set; }

/// <inheritdoc />
public override string ToString()
{
return this.Name;
}
}
6 changes: 6 additions & 0 deletions src/DataModel/Configuration/SkillComboDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,10 @@ public partial class SkillComboDefinition
/// </summary>
[MemberOfAggregate]
public virtual ICollection<SkillComboStep> Steps { get; protected set; } = null!;

/// <inheritdoc />
public override string ToString()
{
return this.Name;
}
}
6 changes: 6 additions & 0 deletions src/DataModel/Configuration/SkillComboStep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,10 @@ public partial class SkillComboStep
/// Gets or sets the skill of this step.
/// </summary>
public virtual Skill? Skill { get; set; }

/// <inheritdoc />
public override string ToString()
{
return $"{this.Order} - {this.Skill}";
}
}
6 changes: 6 additions & 0 deletions src/DataModel/Configuration/SystemConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,10 @@ public partial class SystemConfiguration
Description = nameof(Resources.SystemConfiguration_ReadConsoleInput_Description),
ResourceType = typeof(Resources))]
public bool ReadConsoleInput { get; set; }

/// <inheritdoc />
public override string ToString()
{
return "System Configuration";
}
}
6 changes: 6 additions & 0 deletions src/DataModel/Configuration/WarpInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,10 @@ public partial class WarpInfo
/// </summary>
[Required]
public virtual ExitGate? Gate { get; set; }

/// <inheritdoc />
public override string ToString()
{
return this.Name;
}
}
4 changes: 2 additions & 2 deletions src/DataModel/Entities/AppearanceData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace MUnique.OpenMU.DataModel.Entities;
using MUnique.OpenMU.DataModel.Configuration;

/// <summary>
/// The appearance data of an character.
/// The appearance data of a character.
/// </summary>
public class AppearanceData : IAppearanceData
{
Expand All @@ -25,7 +25,7 @@ public class AppearanceData : IAppearanceData
public virtual CharacterClass? CharacterClass { get; set; }

/// <summary>
/// Gets the character status.
/// Gets or sets the character status.
/// </summary>
public CharacterStatus CharacterStatus { get; set; }

Expand Down
6 changes: 6 additions & 0 deletions src/DataModel/Entities/Guild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,10 @@ public class Guild : OpenMU.Interfaces.Guild
/// Gets or sets the members.
/// </summary>
public virtual ICollection<GuildMember> Members { get; protected set; } = null!;

/// <inheritdoc />
public override string ToString()
{
return this.Name ?? "<Guild>";
}
}
6 changes: 6 additions & 0 deletions src/DataModel/Entities/QuestMonsterKillRequirementState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,10 @@ public class QuestMonsterKillRequirementState
/// Gets or sets the monster kill count for this <see cref="Requirement"/>.
/// </summary>
public int KillCount { get; set; }

/// <inheritdoc />
public override string ToString()
{
return $"{this.KillCount}/{this.Requirement?.MinimumNumber} {this.Requirement?.Monster}";
}
}
1 change: 1 addition & 0 deletions src/Web/AdminPanel/Components/ItemEdit/ItemEdit.razor
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
return;
}

<PageTitle>@this._viewModel.Definition?.Name</PageTitle>
<EditForm Model="_viewModel" OnValidSubmit="OnValidSubmit">
<DataAnnotationsValidator />
<ByteField @bind-Value="@_viewModel.ItemSlot" />
Expand Down
2 changes: 2 additions & 0 deletions src/Web/AdminPanel/Pages/Accounts.razor
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

@inject AccountService _accountService;

<PageTitle>OpenMU: Accounts</PageTitle>
<Breadcrumb IsFirstFromRoot="true" Caption="Accounts" />
<h1>Accounts</h1>

<div>
Expand Down
2 changes: 2 additions & 0 deletions src/Web/AdminPanel/Pages/AdminUsers.razor
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

@inject IUserService UserService;

<PageTitle>OpenMU: Admin Users</PageTitle>
<Breadcrumb IsFirstFromRoot="true" Caption="Admin Users"/>
<h1>Admin Users</h1>

<div>
Expand Down
2 changes: 2 additions & 0 deletions src/Web/AdminPanel/Pages/CreateConnectServerConfig.razor
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

@using MUnique.OpenMU.Persistence

<PageTitle>OpenMU: Create Connect Server</PageTitle>
<Breadcrumb Caption="Create Connect Server"/>
<h1>Create Connect Server Definition</h1>


Expand Down
2 changes: 2 additions & 0 deletions src/Web/AdminPanel/Pages/CreateGameServerConfig.razor
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

@using MUnique.OpenMU.Persistence

<PageTitle>OpenMU: Create Game Server</PageTitle>
<Breadcrumb Caption="Create Game Server"/>
<h1>Create Game Server Definition</h1>


Expand Down
26 changes: 19 additions & 7 deletions src/Web/AdminPanel/Pages/EditBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ private enum DataLoadingState
[Inject]
public NavigationManager NavigationManager { get; set; } = null!;

/// <summary>
/// Gets or sets the navigation history.
/// </summary>
[Inject]
public NavigationHistory NavigationHistory { get; set; } = null!;

/// <summary>
/// Gets or sets the java script runtime.
/// </summary>
Expand Down Expand Up @@ -172,13 +178,14 @@ protected override void BuildRenderTree(RenderTreeBuilder builder)

var downloadMarkup = this.GetDownloadMarkup();
var editorsMarkup = this.GetEditorsMarkup();
builder.AddMarkupContent(0, $"<h1>Edit {CaptionHelper.GetTypeCaption(this.Type!)}</h1>{downloadMarkup}{editorsMarkup}\r\n");
builder.OpenComponent<CascadingValue<IContext>>(1);
builder.AddAttribute(2, nameof(CascadingValue<IContext>.Value), this._persistenceContext);
builder.AddAttribute(3, nameof(CascadingValue<IContext>.IsFixed), this._isOwningContext);
builder.AddAttribute(4, nameof(CascadingValue<IContext>.ChildContent), (RenderFragment)(builder2 =>

builder.AddMarkupContent(10, $"<h1>Edit {CaptionHelper.GetTypeCaption(this.Type!)}</h1>{downloadMarkup}{editorsMarkup}\r\n");
builder.OpenComponent<CascadingValue<IContext>>(11);
builder.AddAttribute(12, nameof(CascadingValue<IContext>.Value), this._persistenceContext);
builder.AddAttribute(13, nameof(CascadingValue<IContext>.IsFixed), this._isOwningContext);
builder.AddAttribute(14, nameof(CascadingValue<IContext>.ChildContent), (RenderFragment)(builder2 =>
{
var sequence = 4;
var sequence = 14;
this.AddFormToRenderTree(builder2, ref sequence);
}));

Expand All @@ -198,7 +205,7 @@ protected override Task OnInitializedAsync()
/// <param name="builder">The builder.</param>
/// <param name="currentSequence">The current sequence.</param>
protected abstract void AddFormToRenderTree(RenderTreeBuilder builder, ref int currentSequence);

/// <inheritdoc />
protected override async Task OnAfterRenderAsync(bool firstRender)
{
Expand All @@ -222,6 +229,11 @@ await this.InvokeAsync(() =>
}).ConfigureAwait(false);
}

if (this._loadingState == DataLoadingState.Loaded && this.Model is { } model)
{
this.NavigationHistory.AddCurrentPageToHistory(model.GetName());
}

await base.OnAfterRenderAsync(firstRender).ConfigureAwait(true);
}

Expand Down
4 changes: 3 additions & 1 deletion src/Web/AdminPanel/Pages/EditConfigGrid.razor
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

@if (this.Type is not null)
{
<h1>@CaptionHelper.GetPluralizedTypeCaption(this.Type)</h1>
<h1>@CaptionHelper.GetPluralizedTypeCaption(this.Type)</h1>
<PageTitle>@CaptionHelper.GetPluralizedTypeCaption(this.Type)</PageTitle>
<Breadcrumb Caption=@CaptionHelper.GetPluralizedTypeCaption(this.Type) IsFirstFromRoot="true"></Breadcrumb>
}

@if (this.ViewModels is null)
Expand Down
Loading

0 comments on commit ac0e233

Please sign in to comment.