move some stuff for live radar for compiled views
add chat icon to send messages to servers on server view
This commit is contained in:
@ -203,5 +203,43 @@ namespace WebfrontCore.Controllers
|
||||
var state = Manager.TokenAuthenticator.GenerateNextToken(Client.NetworkId);
|
||||
return string.Format(Utilities.CurrentLocalization.LocalizationIndex["COMMANDS_GENERATETOKEN_SUCCESS"], state.Token, $"{state.RemainingTime} {Utilities.CurrentLocalization.LocalizationIndex["GLOBAL_MINUTES"]}", Client.ClientId);
|
||||
}
|
||||
|
||||
public IActionResult ChatForm(long id)
|
||||
{
|
||||
var info = new ActionInfo()
|
||||
{
|
||||
ActionButtonLabel = Localization["WEBFRONT_ACTION_LABEL_SUBMIT_MESSAGE"],
|
||||
Name = "Chat",
|
||||
Inputs = new List<InputInfo>
|
||||
{
|
||||
new InputInfo()
|
||||
{
|
||||
Name = "message",
|
||||
Type = "text",
|
||||
Label = Localization["WEBFRONT_ACTION_LABEL_MESSAGE"]
|
||||
},
|
||||
new InputInfo()
|
||||
{
|
||||
Name = "id",
|
||||
Value = id.ToString(),
|
||||
Type = "hidden"
|
||||
}
|
||||
},
|
||||
Action = "ChatAsync"
|
||||
};
|
||||
|
||||
return View("_ActionForm", info);
|
||||
}
|
||||
|
||||
public async Task<IActionResult> ChatAsync(long id, string message)
|
||||
{
|
||||
var server = Manager.GetServers().First(_server => _server.EndPoint == id);
|
||||
|
||||
return await Task.FromResult(RedirectToAction("ExecuteAsync", "Console", new
|
||||
{
|
||||
serverId = server.EndPoint,
|
||||
command = $"!say {message}"
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ namespace WebfrontCore.Controllers
|
||||
if (clientId > 0)
|
||||
{
|
||||
Client.ClientId = clientId;
|
||||
Client.NetworkId = User.Claims.First(_claim => _claim.Type == ClaimTypes.PrimarySid).Value.ConvertGuidToLong();
|
||||
Client.NetworkId = clientId == 1 ? 0 : User.Claims.First(_claim => _claim.Type == ClaimTypes.PrimarySid).Value.ConvertGuidToLong();
|
||||
Client.Level = (EFClient.Permission)Enum.Parse(typeof(EFClient.Permission), User.Claims.First(c => c.Type == ClaimTypes.Role).Value);
|
||||
Client.CurrentAlias = new EFAlias() { Name = User.Claims.First(c => c.Type == ClaimTypes.NameIdentifier).Value };
|
||||
Authorized = Client.ClientId >= 0;
|
||||
|
Reference in New Issue
Block a user