ui: problemconfig: support new CompilableSource

This commit is contained in:
undefined committed 2025-02-09 15:17:10 +00:00
1 parent 4a33816a37
commit 5c9cecc197
17 files changed
+252 -228

No files matched your search

+3 -5
View File
@@ -71,7 +71,6 @@ export interface HydroResponse {
etag?: string;
attachment: (name: string, stream?: any) => void;
addHeader: (name: string, value: string) => void;
serializer: typeof serializer;
}
export type RendererFunction = (name: string, context: Record<string, any>) => string | Promise<string>;
type HydroContext = {
@@ -171,7 +170,7 @@ export class HandlerCommon {
renderHTML(templateName: string, args: Record<string, any>) {
const type = templateName.split('.')[1];
const engine = this.ctx.server.renderers[type] || (() => JSON.stringify(args, this.response.serializer(false, this)));
const engine = this.ctx.server.renderers[type] || (() => JSON.stringify(args, serializer(false, this)));
return engine(templateName, {
handler: this,
UserContext: this.user,
@@ -266,7 +265,7 @@ export class ConnectionHandler extends HandlerCommon {
}
send(data: any) {
let payload = JSON.stringify(data, this.response.serializer(false, this));
let payload = JSON.stringify(data, serializer(false, this));
if (this.compression) {
if (this.counter > 1000) this.resetCompression();
payload = this.compression.deflate(payload);
@@ -328,7 +327,6 @@ export interface WebServiceConfig {
host?: string;
xff?: string;
xhost?: string;
serializer?: typeof serializer;
}
export class WebService extends Service {
@@ -443,7 +441,7 @@ ${c.response.status} ${endTime - startTime}ms ${c.response.length}`);
func: (t) => this.handleHttp(t, NotFoundHandler, () => true),
},
]));
this.addLayer('base', base(logger, this.config.xff, this.config.xhost, this.config.serializer));
this.addLayer('base', base(logger, this.config.xff, this.config.xhost));
wsServer.on('connection', async (socket, request) => {
socket.on('error', (err) => {
logger.warn('Websocket Error: %s', err.message);