- Fix links not showing up in webinterface
- Switch to debug logging
This commit is contained in:
@@ -241,14 +241,21 @@ export class ChatTwoWeb {
|
||||
|
||||
processUrlTemplate(template: Template, spanElement: HTMLSpanElement) {
|
||||
const urlElement = document.createElement('a');
|
||||
let url = template.content;
|
||||
if (!url.startsWith('https://')) {
|
||||
url = `https://${url}`;
|
||||
}
|
||||
|
||||
urlElement.innerText = template.content;
|
||||
urlElement.href = encodeURI(template.content);
|
||||
urlElement.href = encodeURI(url);
|
||||
urlElement.target = '_blank'
|
||||
|
||||
if (template.color !== 0)
|
||||
{
|
||||
this.processColor(template, spanElement);
|
||||
}
|
||||
|
||||
spanElement.appendChild(urlElement);
|
||||
}
|
||||
|
||||
// converts a RGBA uint number to components
|
||||
|
||||
@@ -45,7 +45,7 @@ public class HostContext
|
||||
Host.Settings.Debug.Responses = true;
|
||||
Host.Settings.Debug.AccessControl = true;
|
||||
#endif
|
||||
Host.Events.Logger = logMessage => Plugin.Log.Information(logMessage);
|
||||
Host.Events.Logger = logMessage => Plugin.Log.Debug(logMessage);
|
||||
|
||||
IsActive = true;
|
||||
return true;
|
||||
|
||||
@@ -233,7 +233,7 @@ public class RouteController
|
||||
{
|
||||
try
|
||||
{
|
||||
Plugin.Log.Information($"Client connected: {ctx.Guid}");
|
||||
Plugin.Log.Debug($"Client connected: {ctx.Guid}");
|
||||
|
||||
var sse = new SSEConnection(HostContext.TokenSource.Token);
|
||||
await HostContext.Core.PrepareNewClient(sse);
|
||||
|
||||
@@ -36,8 +36,8 @@ public class SSEConnection
|
||||
|
||||
if (!await ctx.Response.SendChunk(outgoingEvent.Build(), false, Token))
|
||||
{
|
||||
Plugin.Log.Information("SSE connection was unable to send new data");
|
||||
Plugin.Log.Information($"Client disconnected: {ctx.Guid}");
|
||||
Plugin.Log.Debug("SSE connection was unable to send new data");
|
||||
Plugin.Log.Debug($"Client disconnected: {ctx.Guid}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user