eclipse/cmd/eclipse-httpd/html/pages/job.html.tmpl

62 lines
1.7 KiB
Cheetah

{{/*
* Copyright (C) 2024 Umorpha Systems
* SPDX-License-Identifier: AGPL-3.0-or-later
*/}}
{{- define "page-title" }}Job {{ .Job.ID }}{{ end }}
{{- define "page-content" }}
<section>
<dl class="job">
<dt class="job-status job-{{ .Job.Status }}">Status</dt>
<dd class="job-status job-{{ .Job.Status }}">{{ .Job.Status }}{{ if gt (len .Job.StatusMsg) 0 }}: {{ .Job.StatusMsg }}{{ end }}</dd>
<dt class="job-triggers">Triggers</dt>
<dd class="job-triggers">{{ template "triggers.html.tmpl" .Job }}</dd>
<dt class="job-command">Command</dt>
<dd class="job-command"><pre>{{ .Job.Command }}</pre></dd>
</dl>
</section>
<section>
<h2>Artifacts</h2>
{{- if .Job.Status.Finished }}
{{- if gt (len .ArtifactNames) 0 }}
<ul>
{{- range $name := .ArtifactNames }}
<li><a href="artifacts/{{ $name }}"><tt>{{ $name }}</tt></a></li>
{{- end }}
</ul>
{{- else }}
<p>This job had no artifacts.<p>
{{- end }}
{{- else }}
<p>Artifacts are not available until the job has finished.</p>
{{- end }}
</section>
<section>
<h2>Log</h2>
{{- if .Job.Status.HasLog }}
<iframe src="log.txt"></iframe>
<script>
var frame = document.getElementsByTagName('iframe')[0];
function resizeFrame() {
if (frame.contentWindow.document.documentElement) {
frame.style.height = frame.contentWindow.document.documentElement.offsetHeight + 'px';
}
requestAnimationFrame(resizeFrame);
};
resizeFrame();
{{- if not .Job.Status.Finished }}
frame.onload = () => {
location.reload();
};
{{- end }}
</script>
{{- else }}
<p>There is no log because the job has not started yet.</p>
{{- end }}
</section>
{{- end }}
{{- template "page.html.tmpl" . }}