forked from xuri/aurora
-
Notifications
You must be signed in to change notification settings - Fork 0
/
currentTubeJobs.go
34 lines (31 loc) · 1.32 KB
/
currentTubeJobs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright 2016 - 2021 The aurora Authors. All rights reserved. Use of this
// source code is governed by a MIT license that can be found in the LICENSE
// file.
//
// The aurora is a web-based beanstalkd queue server console written in Go
// and works on macOS, Linux and Windows machines. Main idea behind using Go
// for backend development is to utilize ability of the compiler to produce
// zero-dependency binaries for multiple platforms. aurora was created as an
// attempt to build very simple and portable application to work with local or
// remote beanstalkd server.
package main
import "strings"
// currentTubeJobs call currentTubeJobsSummaryTable, currentTubeJobsActionsRow
// and currentTubeJobsShowcase functions by given server and tube config, and
// merge these functions return value.
func currentTubeJobs(server string, tube string) string {
var table = currentTubeJobsSummaryTable(server, tube)
buf := strings.Builder{}
if table == `` {
buf.WriteString(`Tube "`)
buf.WriteString(tube)
buf.WriteString(`" not found or it is empty <br><br><a href="./server?server=`)
buf.WriteString(server)
buf.WriteString(`"> << back </a>`)
return buf.String()
}
buf.WriteString(table)
buf.WriteString(currentTubeJobsActionsRow(server, tube))
buf.WriteString(currentTubeJobsShowcase(server, tube))
return buf.String()
}