mirror of
http://gogs.blitter.com:3000/Russtopia/bacillus.git
synced 2024-06-18 23:07:10 +00:00
Columnized Job section of main dashboard
This commit is contained in:
parent
5067b0494e
commit
6606d8caa1
2
Makefile
2
Makefile
|
@ -1,6 +1,6 @@
|
||||||
MAKEOPTS = $(MAKEOPTS)
|
MAKEOPTS = $(MAKEOPTS)
|
||||||
GIT_COMMIT := $(shell git rev-list -1 HEAD)
|
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)"
|
BUILDOPTS :=$(BUILDOPTS) -ldflags "-X main.version=$(VERSION) -X main.gitCommit=$(GIT_COMMIT)"
|
||||||
|
|
||||||
.PHONY: install all clean
|
.PHONY: install all clean
|
||||||
|
|
28
bacillus.go
28
bacillus.go
|
@ -470,7 +470,7 @@ func genParameterizedBuildForm(jobTag, scriptFName string) (ret string) {
|
||||||
}
|
}
|
||||||
lines := strings.Split(string(fileBytes), "\n")
|
lines := strings.Split(string(fileBytes), "\n")
|
||||||
for _, line := range lines {
|
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
|
// HTML page w/form to set params and pass to job
|
||||||
// via a submit link
|
// via a submit link
|
||||||
if hasParameterSpecifier(line) {
|
if hasParameterSpecifier(line) {
|
||||||
|
@ -481,7 +481,7 @@ func genParameterizedBuildForm(jobTag, scriptFName string) (ret string) {
|
||||||
// the final stage of same endpoint that
|
// the final stage of same endpoint that
|
||||||
// calls this func (launchJob)
|
// calls this func (launchJob)
|
||||||
//
|
//
|
||||||
// TODO: form action="%s"
|
// form action="%s"
|
||||||
ret += `
|
ret += `
|
||||||
<h2>` + jobTag + `</h2>
|
<h2>` + jobTag + `</h2>
|
||||||
<h3>Build with Parameters </h3>
|
<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 {
|
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)
|
ret += fmt.Sprintf("-- job script %s not found --\n", cmdMap[jobName].script)
|
||||||
} else {
|
} else {
|
||||||
|
var title string
|
||||||
|
var playGlyph string
|
||||||
|
fn := strings.Replace(jobName, "-", "", -1)
|
||||||
|
var paramOpt string
|
||||||
|
var jsOnClick string
|
||||||
if isParameterizedBuildScript(cmdMap[jobName].script) {
|
if isParameterizedBuildScript(cmdMap[jobName].script) {
|
||||||
ret += fmt.Sprintf("<a class='xhrlink' title='Play Job with Parameters' href='%s?param'>[▹] %s [action %s] [last status: %d/%v]</a>\n",
|
title = "Play Job with Parameters"
|
||||||
jobName, jobName, cmdMap[jobName].script, cmdMap[jobName].lastStatus, cmdMap[jobName].lastRunDuration)
|
playGlyph = "▹"
|
||||||
|
paramOpt = "?param"
|
||||||
} else {
|
} else {
|
||||||
fn := strings.Replace(jobName, "-", "", -1)
|
title = "Play Job"
|
||||||
ret += fmt.Sprintf(`<a class='xhrlink' onclick='%s(); return false;' title='Play Job' href='%s'>[▸] %s [action %s] [last status: %d/%v]</a>`+"\n",
|
playGlyph = "▸"
|
||||||
fn, jobName, jobName, cmdMap[jobName].script, cmdMap[jobName].lastStatus, cmdMap[jobName].lastRunDuration)
|
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>
|
<span id='liveRunLog'>`+liveRunLogHTML(6)+`</span>
|
||||||
|
|
||||||
|
<hr />
|
||||||
LEGEND
|
LEGEND
|
||||||
[▸] Start a job manually
|
[▸] Start a job manually
|
||||||
[▹] Start a job with parameters
|
[▹] Start a job, with parameters
|
||||||
[✗] Cancel a running job
|
[✗] Cancel a running job
|
||||||
[⩐] View completed job artifacts
|
[⩐] View completed job artifacts
|
||||||
[⩌] View partial artifacts for a failed job
|
[⩌] 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, ` <a href='`+logoutURI+`'>logout</a>
|
||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
writeStr(w, `
|
writeStr(w, `<hr />
|
||||||
Jobs Served (click Play to manually trigger)`+
|
Jobs Served (click Play to manually trigger)`+
|
||||||
manualJobTriggersHTML(false)+
|
manualJobTriggersHTML(false)+
|
||||||
sayingFooterHTML())
|
sayingFooterHTML())
|
||||||
|
|
|
@ -102,4 +102,5 @@ bacillus -D="${DEMO}"\
|
||||||
onPush-xs-build:kD:FOO=bar,BAZ=buzz:"../xs_pushbuild.sh" \
|
onPush-xs-build:kD:FOO=bar,BAZ=buzz:"../xs_pushbuild.sh" \
|
||||||
onPush-bacillus-artifact:kW:BACILLUS_FOO=foo,BACILLUS_BAR=bar:"../artifact.sh" \
|
onPush-bacillus-artifact:kW:BACILLUS_FOO=foo,BACILLUS_BAR=bar:"../artifact.sh" \
|
||||||
onPush-brevity-build:kD::"../brevity_pushbuild.sh" \
|
onPush-brevity-build:kD::"../brevity_pushbuild.sh" \
|
||||||
|
onPush-hopscotch-build:kD::"../hopscotch_pushbuild.sh" \
|
||||||
onPush-anyrepo-script:kD::"../pushbuild.sh"
|
onPush-anyrepo-script:kD::"../pushbuild.sh"
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 454 KiB After Width: | Height: | Size: 500 KiB |
Loading…
Reference in New Issue
Block a user