1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

Merge branch 'master' into fork

This commit is contained in:
bdeshi
2022-04-24 03:56:18 +06:00
committed by GitHub
38 changed files with 1360 additions and 1135 deletions

View File

@ -8,8 +8,8 @@ import (
// https://shields.io/endpoint
const (
defaultLabel = "coding time"
defaultColor = "#2D3748" // not working
defaultLabel = "wakapi.dev"
defaultColor = "2F855A"
)
type BadgeData struct {

View File

@ -11,11 +11,11 @@ import (
type Heartbeat struct {
ID uint64 `gorm:"primary_key" hash:"ignore"`
User *User `json:"-" gorm:"not null; constraint:OnUpdate:CASCADE,OnDelete:CASCADE;" hash:"ignore"`
UserID string `json:"-" gorm:"not null; index:idx_time_user,idx_user_project"` // idx_user_project is for quickly fetching a user's project list (settings page)
UserID string `json:"-" gorm:"not null; index:idx_time_user; index:idx_user_project"` // idx_user_project is for quickly fetching a user's project list (settings page)
Entity string `json:"entity" gorm:"not null"`
Type string `json:"type"`
Category string `json:"category"`
Project string `json:"project" gorm:"index:idx_project,idx_user_project"`
Project string `json:"project" gorm:"index:idx_project; index:idx_user_project"`
Branch string `json:"branch" gorm:"index:idx_branch"`
Language string `json:"language" gorm:"index:idx_language"`
IsWrite bool `json:"is_write"`

View File

@ -29,6 +29,11 @@ type Interval struct {
End time.Time
}
type KeyedInterval struct {
Interval
Key *IntervalKey
}
// CustomTime is a wrapper type around time.Time, mainly used for the purpose of transparently unmarshalling Python timestamps in the format <sec>.<nsec> (e.g. 1619335137.3324468)
type CustomTime time.Time