2024-01-18 04:15:20 +00:00
|
|
|
{{/*
|
|
|
|
* 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>
|
2024-01-23 04:10:47 +00:00
|
|
|
<dd class="job-status job-{{ .Job.Status }}">{{ .Job.Status }}{{ if gt (len .Job.StatusMsg) 0 }}: {{ .Job.StatusMsg }}{{ end }}</dd>
|
2024-01-18 04:15:20 +00:00
|
|
|
|
|
|
|
<dt class="job-triggers">Triggers</dt>
|
|
|
|
<dd class="job-triggers">{{ template "triggers.html.tmpl" .Job }}</dd>
|
|
|
|
|
|
|
|
<dt class="job-command">Command</dt>
|
2024-01-23 01:31:22 +00:00
|
|
|
<dd class="job-command"><pre>{{ .Job.Command }}</pre></dd>
|
2024-01-28 00:18:22 +00:00
|
|
|
|
|
|
|
<dt class="job-created-at">Created At</dt>
|
|
|
|
<dd class="job-created-at">{{ fmtDatetime .Job.CreatedAt }}</dd>
|
|
|
|
|
|
|
|
<dt class="job-updated-at">Last Updated At</dt>
|
|
|
|
<dd class="job-updated-at">{{ fmtDatetime .Job.UpdatedAt }}</dd>
|
2024-01-18 04:15:20 +00:00
|
|
|
</dl>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<h2>Artifacts</h2>
|
2024-01-18 19:55:53 +00:00
|
|
|
{{- if .Job.Status.Finished }}
|
2024-01-18 21:17:26 +00:00
|
|
|
{{- if gt (len .ArtifactNames) 0 }}
|
2024-01-18 19:55:53 +00:00
|
|
|
<ul>
|
2024-01-18 21:17:26 +00:00
|
|
|
{{- range $name := .ArtifactNames }}
|
|
|
|
<li><a href="artifacts/{{ $name }}"><tt>{{ $name }}</tt></a></li>
|
2024-01-18 19:55:53 +00:00
|
|
|
{{- end }}
|
|
|
|
</ul>
|
2024-01-18 04:15:20 +00:00
|
|
|
{{- else }}
|
2024-01-19 01:23:49 +00:00
|
|
|
<p>This job had no artifacts.<p>
|
2024-01-18 21:17:26 +00:00
|
|
|
{{- end }}
|
|
|
|
{{- else }}
|
2024-01-18 04:15:20 +00:00
|
|
|
<p>Artifacts are not available until the job has finished.</p>
|
|
|
|
{{- end }}
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<h2>Log</h2>
|
2024-01-18 19:55:53 +00:00
|
|
|
{{- if .Job.Status.HasLog }}
|
2024-01-18 04:15:20 +00:00
|
|
|
<iframe src="log.txt"></iframe>
|
2024-01-19 05:22:24 +00:00
|
|
|
<script>
|
|
|
|
var frame = document.getElementsByTagName('iframe')[0];
|
|
|
|
function resizeFrame() {
|
|
|
|
if (frame.contentWindow.document.documentElement) {
|
2024-01-28 00:18:22 +00:00
|
|
|
frame.style.height = frame.contentWindow.document.documentElement.offsetHeight + 'px';
|
2024-01-19 05:22:24 +00:00
|
|
|
}
|
|
|
|
requestAnimationFrame(resizeFrame);
|
|
|
|
};
|
|
|
|
resizeFrame();
|
2024-01-27 23:30:52 +00:00
|
|
|
{{- if not .Job.Status.Finished }}
|
|
|
|
frame.onload = () => {
|
|
|
|
location.reload();
|
|
|
|
};
|
|
|
|
{{- end }}
|
2024-01-19 05:22:24 +00:00
|
|
|
</script>
|
2024-01-18 04:15:20 +00:00
|
|
|
{{- else }}
|
|
|
|
<p>There is no log because the job has not started yet.</p>
|
|
|
|
{{- end }}
|
|
|
|
</section>
|
|
|
|
{{- end }}
|
|
|
|
{{- template "page.html.tmpl" . }}
|