diff options
| author | vincent van beek <vincent@vlogic.nl> | 2026-04-15 16:19:02 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-15 16:19:02 +0200 |
| commit | 11e355321db20b70c76c35b6e8fc36dbb9d97fc6 (patch) | |
| tree | f12b8c8c2b6a642b315f2e4a7e54274bbcdb60be /opendc-web/opendc-web-server/src/main/webui/data/project.js | |
| parent | 3e52cd36bed9455105f4a8c3d83ec805c1fb7b70 (diff) | |
add a job report to the scenario overview with details and time data (#406)
* add a job report to the scenario overview with details and time data
* create Report data class
Diffstat (limited to 'opendc-web/opendc-web-server/src/main/webui/data/project.js')
| -rw-r--r-- | opendc-web/opendc-web-server/src/main/webui/data/project.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/opendc-web/opendc-web-server/src/main/webui/data/project.js b/opendc-web/opendc-web-server/src/main/webui/data/project.js index 60a8fab6..abef6189 100644 --- a/opendc-web/opendc-web-server/src/main/webui/data/project.js +++ b/opendc-web/opendc-web-server/src/main/webui/data/project.js @@ -164,3 +164,20 @@ export function useNewScenario() { export function useDeleteScenario() { return useMutation('deleteScenario') } + +/** + * Return the job report for the specified job. + */ +export function useJobReport(jobId, options = {}) { + return useQuery( + ['job-report', jobId], + async () => { + const response = await fetch(`/api/jobs/${jobId}/report`) + if (!response.ok) { + throw new Error('Failed to fetch job report') + } + return response.json() + }, + { enabled: !!jobId, ...options } + ) +} |
