fix dependency injection of comands in webfront preventing ui actions from working
This commit is contained in:
@ -23,6 +23,7 @@ namespace WebfrontCore.Controllers
|
||||
private readonly string _kickCommandName;
|
||||
private readonly string _flagCommandName;
|
||||
private readonly string _unflagCommandName;
|
||||
private readonly string _setLevelCommandName;
|
||||
|
||||
public ActionController(IManager manager, IEnumerable<IManagerCommand> registeredCommands) : base(manager)
|
||||
{
|
||||
@ -55,6 +56,9 @@ namespace WebfrontCore.Controllers
|
||||
case nameof(UnflagClientCommand):
|
||||
_unflagCommandName = cmd.Name;
|
||||
break;
|
||||
case nameof(SetLevelCommand):
|
||||
_setLevelCommandName = cmd.Name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -230,7 +234,7 @@ namespace WebfrontCore.Controllers
|
||||
return await Task.FromResult(RedirectToAction("ExecuteAsync", "Console", new
|
||||
{
|
||||
serverId = server.EndPoint,
|
||||
command = $"{_appConfig.CommandPrefix}setlevel @{targetId} {level}"
|
||||
command = $"{_appConfig.CommandPrefix}{_setLevelCommandName} @{targetId} {level}"
|
||||
}));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user