mirror of
https://github.com/trafficlunar/statsys.git
synced 2026-03-28 11:13:17 +00:00
refactor: project structure
This commit is contained in:
parent
0942761cd8
commit
b6cf11f680
11 changed files with 23 additions and 18 deletions
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
themes/*.css linguist-detectable=false
|
||||
1
TODO.md
1
TODO.md
|
|
@ -3,3 +3,4 @@
|
|||
- [ ] View incidents
|
||||
- [ ] Latency graphs?
|
||||
- [ ] README
|
||||
- [ ] Site metadata
|
||||
|
|
|
|||
2
go.mod
2
go.mod
|
|
@ -1,4 +1,4 @@
|
|||
module status-page
|
||||
module statsys
|
||||
|
||||
go 1.25.4
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package main
|
||||
package internal
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package main
|
||||
package internal
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
|
|
@ -12,7 +12,7 @@ import (
|
|||
var STATUS_PRIORITY = map[string]int{"Offline": 2, "Degraded": 1, "Online": 0}
|
||||
var db *sql.DB
|
||||
|
||||
func InitializeDatabase() {
|
||||
func InitDatabase() {
|
||||
// open/create database
|
||||
var err error
|
||||
db, err = sql.Open("sqlite", "status.db")
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package main
|
||||
package internal
|
||||
|
||||
import (
|
||||
"html/template"
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package main
|
||||
package internal
|
||||
|
||||
import (
|
||||
"log"
|
||||
11
main.go
Normal file
11
main.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
package main
|
||||
|
||||
import "statsys/internal"
|
||||
|
||||
func main() {
|
||||
internal.LoadConfig()
|
||||
internal.InitDatabase()
|
||||
defer internal.CloseDatabase()
|
||||
internal.StartCheckingStatuses()
|
||||
internal.StartHttpServer()
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
package main
|
||||
|
||||
func main() {
|
||||
LoadConfig()
|
||||
InitializeDatabase()
|
||||
defer CloseDatabase()
|
||||
StartCheckingStatuses()
|
||||
StartHttpServer()
|
||||
}
|
||||
|
|
@ -18,6 +18,7 @@
|
|||
flex-direction: column;
|
||||
width: 100%;
|
||||
height: max-content;
|
||||
min-height: 100%;
|
||||
max-width: 40rem;
|
||||
padding: 4rem 2rem 1.5rem;
|
||||
background-color: white;
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ hr {
|
|||
}
|
||||
|
||||
.status-bar.Unknown {
|
||||
background: radial-gradient(circle at center, #94a3b8 3px, transparent 3px);
|
||||
background: radial-gradient(circle at center, rgba(0, 0, 0, 0.1) 3px, transparent 3px);
|
||||
}
|
||||
|
||||
.bars-footer {
|
||||
|
|
@ -111,7 +111,7 @@ footer a:hover {
|
|||
}
|
||||
|
||||
.combobox-trigger {
|
||||
background-color: white;
|
||||
background-color: #f8fafc;
|
||||
border: 1px solid rgba(15, 23, 42, 0.4);
|
||||
}
|
||||
|
||||
|
|
@ -124,7 +124,7 @@ footer a:hover {
|
|||
}
|
||||
|
||||
.combobox-dropdown {
|
||||
background-color: white;
|
||||
background-color: #f8fafc;
|
||||
border: 1px solid rgba(15, 23, 42, 0.4);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue