Jobs & Workflows
https://armen.surge.sh
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
1.8 KiB
70 lines
1.8 KiB
/* |
|
------------------------------------------------------------------------------------------------------------------------ |
|
####### gui ####### Copyright (c) 2021 mls-361 ##################################################### MIT License ####### |
|
------------------------------------------------------------------------------------------------------------------------ |
|
*/ |
|
|
|
package gui |
|
|
|
import ( |
|
"fmt" |
|
|
|
g "github.com/maragudk/gomponents" |
|
c "github.com/maragudk/gomponents/components" |
|
. "github.com/maragudk/gomponents/html" |
|
|
|
"forge.chapril.org/armen/armen/internal/components" |
|
) |
|
|
|
func container(node g.Node) g.Node { |
|
return Div( |
|
Class("container"), |
|
node, |
|
) |
|
} |
|
|
|
func navbarLink(name, href, description, page string) g.Node { |
|
active := name == page |
|
|
|
return A( |
|
c.Classes{ |
|
"item": true, |
|
"active": active, |
|
}, |
|
g.Text(name), |
|
Href(href), |
|
TitleAttr(description), |
|
) |
|
} |
|
|
|
func buildPage(app components.Application, name string, content g.Node) g.Node { |
|
return Doctype( |
|
HTML( |
|
Lang("en"), |
|
Head( |
|
Meta(Charset("utf-8")), |
|
Meta(Name("viewport"), Content("width=device-width, initial-scale=1")), |
|
TitleEl(g.Textf("%s - %s", app.Name(), name)), |
|
Link(Rel("stylesheet"), Href(fmt.Sprintf("/static/css/%s.css", name)), Type("text/css")), |
|
), |
|
Body( |
|
Header( |
|
container( |
|
Div( |
|
Class("navbar"), |
|
navbarLink(app.Name(), "/", "home", name), |
|
navbarLink("dashboard", "/dashboard", "number of jobs and workflows per status", name), |
|
navbarLink("jobs", "/search/jobs", "search for jobs", name), |
|
navbarLink("workflows", "/search/workflows", "search for workflows", name), |
|
), |
|
), |
|
), |
|
container(Main(content)), |
|
), |
|
), |
|
) |
|
} |
|
|
|
/* |
|
######################################################################################################## @(°_°)@ ####### |
|
*/
|
|
|