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
|
- [ ] View incidents
|
||||||
- [ ] Latency graphs?
|
- [ ] Latency graphs?
|
||||||
- [ ] README
|
- [ ] README
|
||||||
|
- [ ] Site metadata
|
||||||
|
|
|
||||||
2
go.mod
2
go.mod
|
|
@ -1,4 +1,4 @@
|
||||||
module status-page
|
module statsys
|
||||||
|
|
||||||
go 1.25.4
|
go 1.25.4
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package main
|
package internal
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package main
|
package internal
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
|
|
@ -12,7 +12,7 @@ import (
|
||||||
var STATUS_PRIORITY = map[string]int{"Offline": 2, "Degraded": 1, "Online": 0}
|
var STATUS_PRIORITY = map[string]int{"Offline": 2, "Degraded": 1, "Online": 0}
|
||||||
var db *sql.DB
|
var db *sql.DB
|
||||||
|
|
||||||
func InitializeDatabase() {
|
func InitDatabase() {
|
||||||
// open/create database
|
// open/create database
|
||||||
var err error
|
var err error
|
||||||
db, err = sql.Open("sqlite", "status.db")
|
db, err = sql.Open("sqlite", "status.db")
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package main
|
package internal
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"html/template"
|
"html/template"
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package main
|
package internal
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"log"
|
"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;
|
flex-direction: column;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: max-content;
|
height: max-content;
|
||||||
|
min-height: 100%;
|
||||||
max-width: 40rem;
|
max-width: 40rem;
|
||||||
padding: 4rem 2rem 1.5rem;
|
padding: 4rem 2rem 1.5rem;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ hr {
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-bar.Unknown {
|
.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 {
|
.bars-footer {
|
||||||
|
|
@ -111,7 +111,7 @@ footer a:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
.combobox-trigger {
|
.combobox-trigger {
|
||||||
background-color: white;
|
background-color: #f8fafc;
|
||||||
border: 1px solid rgba(15, 23, 42, 0.4);
|
border: 1px solid rgba(15, 23, 42, 0.4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -124,7 +124,7 @@ footer a:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
.combobox-dropdown {
|
.combobox-dropdown {
|
||||||
background-color: white;
|
background-color: #f8fafc;
|
||||||
border: 1px solid rgba(15, 23, 42, 0.4);
|
border: 1px solid rgba(15, 23, 42, 0.4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue