fix: 修复纯 Kafka Trace 与原始事件观察窗
This commit is contained in:
@@ -396,7 +396,12 @@ function workbenchRuntimeConfigFromEnv() {
|
||||
projectionRealtime: requiredWorkbenchRealtimeFeature(process.env.HWLAB_WORKBENCH_PROJECTION_REALTIME_ENABLED, "HWLAB_WORKBENCH_PROJECTION_REALTIME_ENABLED")
|
||||
},
|
||||
debugCapabilities: {
|
||||
isolatedKafka: requiredWorkbenchRealtimeFeature(process.env.HWLAB_WORKBENCH_KAFKA_DEBUG_REPLAY_ENABLED, "HWLAB_WORKBENCH_KAFKA_DEBUG_REPLAY_ENABLED")
|
||||
isolatedKafka: requiredWorkbenchRealtimeFeature(process.env.HWLAB_WORKBENCH_KAFKA_DEBUG_REPLAY_ENABLED, "HWLAB_WORKBENCH_KAFKA_DEBUG_REPLAY_ENABLED"),
|
||||
rawHwlabEventWindow: {
|
||||
enabled: requiredWorkbenchRealtimeFeature(process.env.HWLAB_WORKBENCH_RAW_HWLAB_EVENT_WINDOW_ENABLED, "HWLAB_WORKBENCH_RAW_HWLAB_EVENT_WINDOW_ENABLED"),
|
||||
maxEntries: requiredPositiveWorkbenchInteger(process.env.HWLAB_WORKBENCH_RAW_HWLAB_EVENT_WINDOW_MAX_ENTRIES, "HWLAB_WORKBENCH_RAW_HWLAB_EVENT_WINDOW_MAX_ENTRIES"),
|
||||
maxRetainedBytes: requiredPositiveWorkbenchInteger(process.env.HWLAB_WORKBENCH_RAW_HWLAB_EVENT_WINDOW_MAX_RETAINED_BYTES, "HWLAB_WORKBENCH_RAW_HWLAB_EVENT_WINDOW_MAX_RETAINED_BYTES")
|
||||
}
|
||||
}
|
||||
};
|
||||
const autoExpandRunning = parseEnvBoolean(process.env.HWLAB_WORKBENCH_TRACE_AUTO_EXPAND_RUNNING);
|
||||
@@ -416,6 +421,12 @@ function requiredWorkbenchRealtimeFeature(value, name) {
|
||||
throw new Error(`${name} is required and must be explicitly true or false`);
|
||||
}
|
||||
|
||||
function requiredPositiveWorkbenchInteger(value, name) {
|
||||
const number = Number(value);
|
||||
if (!Number.isInteger(number) || number <= 0) throw new Error(`${name} is required and must be a positive integer`);
|
||||
return number;
|
||||
}
|
||||
|
||||
function traceExplorerUrlTemplateFromEnv(value) {
|
||||
if (value === undefined || value === null || value === "") return null;
|
||||
const template = String(value).trim();
|
||||
|
||||
Reference in New Issue
Block a user