Columnized Job section of main dashboard

This commit is contained in:
Russ Magee 2023-08-07 21:30:41 -07:00
parent 5067b0494e
commit 6606d8caa1
4 changed files with 21 additions and 10 deletions

View File

@ -1,6 +1,6 @@
MAKEOPTS = $(MAKEOPTS)
GIT_COMMIT := $(shell git rev-list -1 HEAD)
VERSION := 0.2.9.4
VERSION := 0.2.9.5
BUILDOPTS :=$(BUILDOPTS) -ldflags "-X main.version=$(VERSION) -X main.gitCommit=$(GIT_COMMIT)"
.PHONY: install all clean

View File

@ -470,7 +470,7 @@ func genParameterizedBuildForm(jobTag, scriptFName string) (ret string) {
}
lines := strings.Split(string(fileBytes), "\n")
for _, line := range lines {
// TODO: parse lines for "#-?" entries, build
// Parse lines for "#-?" entries, build
// HTML page w/form to set params and pass to job
// via a submit link
if hasParameterSpecifier(line) {
@ -481,7 +481,7 @@ func genParameterizedBuildForm(jobTag, scriptFName string) (ret string) {
// the final stage of same endpoint that
// calls this func (launchJob)
//
// TODO: form action="%s"
// form action="%s"
ret += `
<h2>` + jobTag + `</h2>
<h3>Build with Parameters </h3>
@ -592,14 +592,23 @@ func manualJobTriggersHTML(fullLogLink bool) (ret string) {
if _, e := os.Stat(strings.Replace(cmdMap[jobName].script, "..", jobHomeDir, -1)); e != nil {
ret += fmt.Sprintf("-- job script %s not found --\n", cmdMap[jobName].script)
} else {
var title string
var playGlyph string
fn := strings.Replace(jobName, "-", "", -1)
var paramOpt string
var jsOnClick string
if isParameterizedBuildScript(cmdMap[jobName].script) {
ret += fmt.Sprintf("<a class='xhrlink' title='Play Job with Parameters' href='%s?param'>[&rtri;] %s [action %s] [last status: %d/%v]</a>\n",
jobName, jobName, cmdMap[jobName].script, cmdMap[jobName].lastStatus, cmdMap[jobName].lastRunDuration)
title = "Play Job with Parameters"
playGlyph = "&rtri;"
paramOpt = "?param"
} else {
fn := strings.Replace(jobName, "-", "", -1)
ret += fmt.Sprintf(`<a class='xhrlink' onclick='%s(); return false;' title='Play Job' href='%s'>[&rtrif;] %s [action %s] [last status: %d/%v]</a>`+"\n",
fn, jobName, jobName, cmdMap[jobName].script, cmdMap[jobName].lastStatus, cmdMap[jobName].lastRunDuration)
title = "Play Job"
playGlyph = "&rtrif;"
jsOnClick = "onclick='" + fn + "(); return false;'"
}
ret += fmt.Sprintf(`<a class='xhrlink' %s title='%s' href='%s%s'>[%s]%-32s %-32s last status: %d/%v</a>`+"\n",
jsOnClick, title, jobName, paramOpt, playGlyph,
jobName, cmdMap[jobName].script, cmdMap[jobName].lastStatus, cmdMap[jobName].lastRunDuration)
}
}
}
@ -1261,9 +1270,10 @@ Latest Job Activity (Running jobs:<span id='liveRunLogCount'>`+fmt.Sprintf("%d",
...
<span id='liveRunLog'>`+liveRunLogHTML(6)+`</span>
<hr />
LEGEND
[&rtrif;] Start a job manually
[&rtri;] Start a job with parameters
[&rtri;] Start a job, with parameters
[&cross;] Cancel a running job
[&ccupssm;] View completed job artifacts
[&ccups;] View partial artifacts for a failed job
@ -1281,7 +1291,7 @@ Latest Job Activity (Running jobs:<span id='liveRunLogCount'>`+fmt.Sprintf("%d",
writeStr(w, ` <a href='`+logoutURI+`'>logout</a>
`)
}
writeStr(w, `
writeStr(w, `<hr />
Jobs Served (click Play to manually trigger)`+
manualJobTriggersHTML(false)+
sayingFooterHTML())

View File

@ -102,4 +102,5 @@ bacillus -D="${DEMO}"\
onPush-xs-build:kD:FOO=bar,BAZ=buzz:"../xs_pushbuild.sh" \
onPush-bacillus-artifact:kW:BACILLUS_FOO=foo,BACILLUS_BAR=bar:"../artifact.sh" \
onPush-brevity-build:kD::"../brevity_pushbuild.sh" \
onPush-hopscotch-build:kD::"../hopscotch_pushbuild.sh" \
onPush-anyrepo-script:kD::"../pushbuild.sh"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 454 KiB

After

Width:  |  Height:  |  Size: 500 KiB