-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip: convert templates to pure crystal data
- Loading branch information
1 parent
96ca90b
commit bc295ce
Showing
13 changed files
with
173 additions
and
158 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: ecmo | ||
version: 0.9 | ||
version: 0.11 | ||
|
||
authors: | ||
- Gabriel Aires <[email protected]> | ||
|
@@ -10,37 +10,26 @@ description: | | |
dependencies: | ||
granite: | ||
github: amberframework/granite | ||
version: ~> 0.23 | ||
kilt: | ||
github: jeromegn/kilt | ||
version: ~> 0.6 | ||
slang: | ||
github: jeromegn/slang | ||
version: ~> 1.7 | ||
crikey: | ||
github: abidon/crikey | ||
action-controller: | ||
github: spider-gazelle/action-controller | ||
version: ~> 4.0 | ||
tasker: | ||
github: spider-gazelle/tasker | ||
version: ~> 2.0 | ||
ssh2: | ||
github: spider-gazelle/ssh2.cr | ||
version: ~> 1.5 | ||
sqlite3: | ||
github: crystal-lang/crystal-sqlite3 | ||
version: ~> 0.18 | ||
future: | ||
github: crystal-community/future.cr | ||
version: ~> 1.0 | ||
baked_file_system: | ||
github: schovi/baked_file_system | ||
version: ~> 0.10 | ||
hardware: | ||
github: gabriel-aires/hardware | ||
version: ~> 0.5 | ||
psutil: | ||
github: gabriel-aires/psutil.cr | ||
version: ~> 0.2 | ||
|
||
development_dependencies: | ||
ameba: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
class Load < Granite::Base | ||
connection embedded | ||
table load | ||
connection embedded | ||
table load | ||
|
||
column id : Int64, primary: true | ||
column seconds : Int64 | ||
column load1 : Float64 | ||
column load5 : Float64 | ||
column load15 : Float64 | ||
column id : Int64, primary: true | ||
column seconds : Int64 | ||
column load1 : Float64 | ||
column load5 : Float64 | ||
column load15 : Float64 | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
class Memory < Granite::Base | ||
connection embedded | ||
table memory | ||
connection embedded | ||
table memory | ||
|
||
column id : Int64, primary: true | ||
column seconds : Int64 | ||
column total_mb : Float64 | ||
column used_mb : Float64 | ||
column free_mb : Float64 | ||
column id : Int64, primary: true | ||
column seconds : Int64 | ||
column total_mb : Float64 | ||
column used_mb : Float64 | ||
column free_mb : Float64 | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
class Net < Granite::Base | ||
connection embedded | ||
table net | ||
connection embedded | ||
table net | ||
|
||
column id : Int64, primary: true | ||
column seconds : Int64 | ||
column received_mb : Float64 | ||
column sent_mb : Float64 | ||
column received_packets : Int64 | ||
column sent_packets : Int64 | ||
column id : Int64, primary: true | ||
column seconds : Int64 | ||
column received_mb : Float64 | ||
column sent_mb : Float64 | ||
column received_packets : Int64 | ||
column sent_packets : Int64 | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[ | ||
[:h4, "Database details"], | ||
[:table, | ||
[:thead, | ||
[:tr, | ||
[:th, "Size"], | ||
[:th, "File"]]], | ||
[:tbody, | ||
du_output.split("\n").map do |line| | ||
[:tr, | ||
line.split("\t").map do |field| | ||
[:td, field] | ||
end | ||
] | ||
end | ||
] | ||
], | ||
|
||
[:p, "Perform backup?"], | ||
|
||
[:form, {method: "post", action: Jobs.bkp_db}, | ||
[:p, | ||
[:a, {class: "btn #{tone}", href: Jobs.index}, "Cancel"]], | ||
[:p, | ||
[:input, {class: "btn solid #{tone}", type: "submit", value: "Start"}]]]] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
[ | ||
%|<!doctype html>|, | ||
[:html {lang: "en"}, | ||
|
||
[:head, | ||
[:title, "Ecmo"], | ||
[:meta, {charset: "UTF-8"}], | ||
[:link, {rel: "icon", href: Assets.show(id: "activity.svg")}], | ||
[:link, {rel: "stylesheet", href: Assets.show(id: "gralig.min.css")}], | ||
[:link, {rel: "stylesheet", href: Assets.show(id: "ecmo.css")}], | ||
[:script, {src: Assets.show(id: "dygraph.min.js")}], | ||
[:script, {src: Assets.show(id: "htmx.min.js")}], | ||
[:style, | ||
<<-CSS | ||
pre { | ||
color: black; | ||
background: rgb(245, 242, 240) none repeat scroll 0% 0%; | ||
text-shadow: white 0px 1px; | ||
font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; | ||
text-align: left; | ||
white-space: pre; | ||
word-spacing: normal; | ||
word-break: normal; | ||
overflow-wrap: normal; | ||
line-height: 1.5; | ||
tab-size: 4; | ||
hyphens: none; | ||
padding: 1em; | ||
margin: 0.5em; | ||
overflow: auto; | ||
} | ||
.dark pre { | ||
background : black; | ||
color: rgb(245, 242, 240); | ||
text-shadow: black 0px 1px; | ||
} | ||
CSS | ||
]] | ||
|
||
[:body, | ||
|
||
[:header, {class: "gra-navbar dark"}, | ||
[:div, {class: "gra-container gra-bold-text"}, | ||
[:div, {class: "gra-navbar-logo"}, | ||
[:a, {class: "gra-navbar-logo-link gra-pd-left-l", href: Home.index}, | ||
Storage.read("assets/activity.svg"), | ||
[:span, " " + App::NAME]]], | ||
|
||
[:div, {class: "gra-navbar-content"}, | ||
[:nav, | ||
[:ul, {class: "gra-nav"}, | ||
[:li, {class: "gra-nav-item"}, | ||
[:a, {class: "gra-nav-link", href: "#"}, | ||
[:div, {class: "user-text"}, | ||
"#{current_user.not_nil!.name}/#{current_user.not_nil!.type}", | ||
[:div, {class: "user-icon"}, Storage.read("assets/user.svg")]]]], | ||
|
||
[:li, {class: "gra-nav-item"}, | ||
[:a, {class: "gra-nav-link", "hx-delete": Sessions.destroy(id: "close"), "hx-target": "body"}, | ||
[:div, {class: "logoff-text"}, "Logout"], | ||
[:div, {class: "logoff-icon"}, Storage.read("assets/power.svg")]]], | ||
|
||
[:li, {class: "gra-nav-item"}, | ||
[:a, {class: "gra-nav-link", onclick: "toggleTheme();"}, | ||
[:div, {class: "sun"}, Storage.read("assets/sun.svg")], | ||
[:div, {class: "moon"}, Storage.read("assets/moon.svg")]]]]]]]], | ||
|
||
[:div, {class: "gra-container"}, | ||
|
||
[:div, {class: "row"}, | ||
[:div, {class: "col gra-center-text"}, [:span, {class: "gra-alert #{tone}", role: "alert"}, notice] if notice?]], | ||
|
||
[:div, {class: "row"}, | ||
[:div, {class: "col col-80 col-span-10 gra-center-text"}, | ||
[:h1, {class: "gra-heading"}, @title], | ||
[:h2, {class: "gra-subheading"}, @description]]], | ||
|
||
[:div, {class: "row"}, | ||
[:div, {class: "col col-80 col-span-10"}, content]], | ||
|
||
[:div, {class: "row"}]], | ||
|
||
[:footer, {class: "gra-footer"}, | ||
[:nav, | ||
[:ul, {class: "gra-nav gra-nav-fill"}, | ||
[:li, {class: "gra-nav-item"}, | ||
[:a, {class: "gra-nav-link", href: "https://spider-gazelle.net"}, "Built with S2 and Spider-Gazelle"]], | ||
[:li, {class: "gra-nav-item"}, | ||
[:a, {class: "gra-nav-link", href: "https://github.com/gabriel-aires/ecmo"}, "Check the Github Repo"]]]]], | ||
|
||
[:script, | ||
<<-JAVASCRIPT | ||
var notice = document.querySelector("span.gra-alert"); | ||
if (notice) { | ||
notice.addEventListener("click", function() { | ||
notice.style.display = "none"; | ||
}); | ||
} | ||
var pref = (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches); | ||
toggleTheme(); | ||
function toggleTheme() { | ||
var sun = document.querySelector(".sun"); | ||
var moon = document.querySelector(".moon"); | ||
document.body.className = pref ? "dark" : ""; | ||
sun.style.display = pref ? "none" : "block"; | ||
moon.style.display = pref ? "block" : "none"; | ||
pref = !pref | ||
} | ||
JAVASCRIPT | ||
]]]] |
Oops, something went wrong.