8 changed files with 209 additions and 116 deletions
@ -0,0 +1,93 @@
|
||||
/* |
||||
------------------------------------------------------------------------------------------------------------------------ |
||||
####### gui ####### Copyright (c) 2021 mls-361 ##################################################### MIT License ####### |
||||
------------------------------------------------------------------------------------------------------------------------ |
||||
*/ |
||||
|
||||
package gui |
||||
|
||||
import ( |
||||
g "github.com/maragudk/gomponents" |
||||
. "github.com/maragudk/gomponents/html" |
||||
|
||||
"forge.chapril.org/armen/armen/internal/components" |
||||
) |
||||
|
||||
type dashboard struct { |
||||
app components.Application |
||||
storage components.Storage |
||||
} |
||||
|
||||
func newDashboard(ccs *components.Components) *dashboard { |
||||
return &dashboard{ |
||||
app: ccs.Application, |
||||
storage: ccs.Storage, |
||||
} |
||||
} |
||||
|
||||
func (d *dashboard) title(title string) g.Node { |
||||
return Div( |
||||
Class("title"), |
||||
g.Text(title), |
||||
) |
||||
} |
||||
|
||||
func (d *dashboard) empty() g.Node { |
||||
return Div( |
||||
Class("value"), |
||||
) |
||||
} |
||||
|
||||
func (d *dashboard) value(name string) g.Node { |
||||
return Div( |
||||
Class("value"), |
||||
Span( |
||||
Class("label"), |
||||
g.Text(name), |
||||
), |
||||
Span( |
||||
Class(name), |
||||
g.Text("0"), |
||||
), |
||||
) |
||||
} |
||||
|
||||
func (d *dashboard) content() g.Node { |
||||
return Div( |
||||
Class("dashboard"), |
||||
Div( |
||||
Class("panel"), |
||||
Div( |
||||
d.title("jobs"), |
||||
Hr(), |
||||
d.value("todo"), |
||||
d.value("pending"), |
||||
d.value("succeeded"), |
||||
d.value("failed"), |
||||
Hr(), |
||||
d.value("total"), |
||||
), |
||||
), |
||||
Div( |
||||
Class("panel"), |
||||
Div( |
||||
d.title("workflows"), |
||||
Hr(), |
||||
d.empty(), |
||||
d.value("running"), |
||||
d.value("succeeded"), |
||||
d.value("failed"), |
||||
Hr(), |
||||
d.value("total"), |
||||
), |
||||
), |
||||
) |
||||
} |
||||
|
||||
func (d *dashboard) build() g.Node { |
||||
return buildPage(d.app, "dashboard", d.content()) |
||||
} |
||||
|
||||
/* |
||||
######################################################################################################## @(°_°)@ ####### |
||||
*/ |
@ -1,44 +0,0 @@
|
||||
/* |
||||
------------------------------------------------------------------------------------------------------------------------ |
||||
####### gui ####### Copyright (c) 2021 mls-361 ##################################################### MIT License ####### |
||||
------------------------------------------------------------------------------------------------------------------------ |
||||
*/ |
||||
|
||||
package gui |
||||
|
||||
import ( |
||||
g "github.com/maragudk/gomponents" |
||||
. "github.com/maragudk/gomponents/html" |
||||
) |
||||
|
||||
func (gui *gui) Home() g.Node { |
||||
return page( |
||||
"home", |
||||
"workflows", |
||||
Div( |
||||
Class("dashboard"), |
||||
Div( |
||||
Class("total panel"), |
||||
P( |
||||
Class("value"), |
||||
g.Text("57"), |
||||
), |
||||
P( |
||||
g.Text("total"), |
||||
), |
||||
), |
||||
Div( |
||||
Class("failed panel"), |
||||
g.Text("failed"), |
||||
), |
||||
Div( |
||||
Class("running panel"), |
||||
g.Text("running"), |
||||
), |
||||
), |
||||
) |
||||
} |
||||
|
||||
/* |
||||
######################################################################################################## @(°_°)@ ####### |
||||
*/ |
@ -0,0 +1,50 @@
|
||||
/* |
||||
------------------------------------------------------------------------------------------------------------------------ |
||||
####### dashboard ####### Copyright (c) 2021 mls-361 ############################################### MIT License ####### |
||||
------------------------------------------------------------------------------------------------------------------------ |
||||
*/ |
||||
|
||||
@charset "utf-8"; |
||||
|
||||
@import url("normalize.css"); |
||||
@import url("common.css"); |
||||
|
||||
.dashboard { |
||||
display: flex; |
||||
flex-wrap: wrap; |
||||
justify-content: center; |
||||
} |
||||
|
||||
.panel { |
||||
margin: 5px; |
||||
background-color: #333333; |
||||
padding: 1rem; |
||||
} |
||||
|
||||
.title { |
||||
font-size: 3em; |
||||
} |
||||
|
||||
.value { |
||||
width: 300px; |
||||
height: 50px; |
||||
font-size: 1.5em; |
||||
} |
||||
|
||||
.label { |
||||
display: inline-block; |
||||
width: 180px; |
||||
} |
||||
|
||||
.todo, .pending, .running, .succeeded, .failed, .total { |
||||
display: inline-block; |
||||
padding: 5px; |
||||
width: 120px; |
||||
text-align: center; |
||||
background-color: gray; /*AFAC*/ |
||||
} |
||||
|
||||
/* |
||||
######################################################################################################## @(°_°)@ ####### |
||||
*/ |
||||
|
@ -1,15 +0,0 @@
|
||||
/* |
||||
------------------------------------------------------------------------------------------------------------------------ |
||||
####### css ####### Copyright (c) 2021 mls-361 ##################################################### MIT License ####### |
||||
------------------------------------------------------------------------------------------------------------------------ |
||||
*/ |
||||
|
||||
:root { |
||||
--color: #ffffff; |
||||
--bg-color: #1b2b34; |
||||
} |
||||
|
||||
/* |
||||
######################################################################################################## @(°_°)@ ####### |
||||
*/ |
||||
|
Loading…
Reference in new issue