diff --git a/striker-ui-api/src/lib/request_handlers/server/getServerDetail.ts b/striker-ui-api/src/lib/request_handlers/server/getServerDetail.ts index c0f5e069..263c5629 100644 --- a/striker-ui-api/src/lib/request_handlers/server/getServerDetail.ts +++ b/striker-ui-api/src/lib/request_handlers/server/getServerDetail.ts @@ -57,7 +57,7 @@ export const getServerDetail: RequestHandler< } if (ss) { - const rsBody: ServerDetailScreenshot = { screenshot: '' }; + const rsBody: ServerDetailScreenshot = { screenshot: '', timestamp: 0 }; const ssDir = SERVER_PATHS.opt.alteeve.screenshots.self; let ssNames: string[]; @@ -95,13 +95,14 @@ export const getServerDetail: RequestHandler< stdoutVar(ssMetaLatest, `Latest server screenshot: `); if (ssMetaLatest) { - const { name } = ssMetaLatest; + const { name, timestamp } = ssMetaLatest; const ssLatest = readFileSync(path.join(ssDir, name), { encoding: 'base64', }); rsBody.screenshot = ssLatest; + rsBody.timestamp = timestamp; } return response.send(rsBody); diff --git a/striker-ui-api/src/types/ApiServer.d.ts b/striker-ui-api/src/types/ApiServer.d.ts index c7ba1850..d4d0d360 100644 --- a/striker-ui-api/src/types/ApiServer.d.ts +++ b/striker-ui-api/src/types/ApiServer.d.ts @@ -19,6 +19,7 @@ type ServerDetailParsedQs = { type ServerDetailScreenshot = { screenshot: string; + timestamp: number; }; type ServerDetailVncInfo = {