site-agent-pro 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dashboard/server.js +4 -1
- package/package.json +1 -1
package/dist/dashboard/server.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import http from "node:http";
|
|
3
3
|
import path from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
4
5
|
import dotenv from "dotenv";
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = path.dirname(__filename);
|
|
5
8
|
import { buildRunDetail, buildStandaloneReportHtml, listVisibleRunSummaries } from "../backend/dashboardData.js";
|
|
6
9
|
import { artifactContentType, isAllowedDashboardArtifact, isImageArtifact, isVideoArtifact } from "../backend/runArtifacts.js";
|
|
7
10
|
import { createLocalRunRepository } from "../backend/runRepository.js";
|
|
@@ -195,7 +198,7 @@ async function handleRequest(req, res, args) {
|
|
|
195
198
|
if (dashboardScripts.includes(pathParts[0] || "")) {
|
|
196
199
|
const requestedName = pathParts[0];
|
|
197
200
|
const diskName = requestedName === "app.js" ? "client.js" : requestedName;
|
|
198
|
-
const distPath = path.join(
|
|
201
|
+
const distPath = path.join(__dirname, diskName);
|
|
199
202
|
if (fs.existsSync(distPath)) {
|
|
200
203
|
sendText(res, 200, fs.readFileSync(distPath, "utf8"), "application/javascript");
|
|
201
204
|
return;
|