mirror of
https://github.com/BililiveRecorder/BililiveRecorder.git
synced 2024-11-16 11:42:22 +08:00
feat: update webui & injected script
This commit is contained in:
parent
ca755d5ec5
commit
7ddd782919
|
@ -15,7 +15,13 @@ namespace BililiveRecorder.Web
|
|||
[ApiExplorerSettings(IgnoreApi = true)]
|
||||
public sealed class DynamicHtmlController : Controller
|
||||
{
|
||||
private static readonly MinifyMarkupFormatter formatter = new MinifyMarkupFormatter
|
||||
{
|
||||
ShouldKeepEmptyAttributes = true,
|
||||
};
|
||||
|
||||
private static string? cachedIndexHtml;
|
||||
|
||||
private readonly CompositeFileProvider fileProvider;
|
||||
|
||||
public DynamicHtmlController(CompositeFileProvider fileProvider)
|
||||
|
@ -86,7 +92,7 @@ namespace BililiveRecorder.Web
|
|||
this.Response.ContentType = "text/html; encoding=utf-8";
|
||||
|
||||
using var writer = new StreamWriter(this.Response.Body);
|
||||
document.ToHtml(writer, new MinifyMarkupFormatter());
|
||||
document.ToHtml(writer, formatter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,22 +3,23 @@
|
|||
if (currentScript && "string" === typeof currentScript.dataset.href) {
|
||||
const SERVER_PATH = currentScript.dataset.href;
|
||||
const baseTag = document.getElementsByTagName('base')[0];
|
||||
console.log("SERVER_PATH: " + SERVER_PATH);
|
||||
const pathname = location.pathname;
|
||||
console.log("location.pathname: " + pathname);
|
||||
const log = console.log;
|
||||
log("SERVER_PATH: " + SERVER_PATH);
|
||||
log("location.pathname: " + pathname);
|
||||
if (SERVER_PATH.length === 0) {
|
||||
let BASE = pathname + '/';
|
||||
baseTag.href = BASE;
|
||||
console.log("base path: " + BASE);
|
||||
log("base path: " + BASE);
|
||||
} else if (pathname.endsWith(SERVER_PATH)) {
|
||||
var i = pathname.lastIndexOf(SERVER_PATH);
|
||||
if (i > -1) {
|
||||
let BASE = pathname.slice(0, i) + '/';
|
||||
baseTag.href = BASE;
|
||||
console.log("base path: " + BASE);
|
||||
log("base path: " + BASE);
|
||||
}
|
||||
} else {
|
||||
console.log('????');
|
||||
log('????');
|
||||
}
|
||||
}
|
||||
const init = document.getElementById('delayed-init');
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 517c2a659f26f4fea088036650de502aa7f8621f
|
||||
Subproject commit 9889bd1bd15ba56952fc6a0aa369da85f1c1d154
|
Loading…
Reference in New Issue
Block a user