This commit is contained in:
2026-04-03 09:55:36 +04:00
parent 2465bc2ec3
commit 27143319e3
22 changed files with 2542 additions and 173 deletions

View File

@@ -6,7 +6,11 @@ import (
"time"
)
var scoreStages = []string{"preliminary", "prelim_tiebreak", "final", "final_tiebreak"}
var preliminaryRoundStages = []string{"prelim_r1", "prelim_r2", "prelim_r3"}
var finalRoundStages = []string{"final_r1", "final_r2"}
var tieBreakStages = []string{"prelim_tiebreak", "final_tiebreak"}
var scoreStages = append(append(append([]string{}, preliminaryRoundStages...), finalRoundStages...), tieBreakStages...)
type App struct {
db *sql.DB
@@ -90,7 +94,24 @@ type StateResponse struct {
}
type AppSettings struct {
ViewProofInView bool `json:"viewProofInView"`
ViewProofInView bool `json:"viewProofInView"`
LiveMode LiveModeSettings `json:"liveMode"`
}
type LiveModeSettings struct {
ActiveView string `json:"activeView"`
ShowGroupLive bool `json:"showGroupLive"`
GroupDisplayMode string `json:"groupDisplayMode"`
GroupFixedCode string `json:"groupFixedCode"`
ShowPrelimTie bool `json:"showPrelimTie"`
ShowPrelimOverall bool `json:"showPrelimOverall"`
ShowFinalGroups bool `json:"showFinalGroups"`
FinalDisplayMode string `json:"finalDisplayMode"`
FinalFixedGroup int `json:"finalFixedGroup"`
ShowFinalTie bool `json:"showFinalTie"`
ShowPodium bool `json:"showPodium"`
RotationIntervalSec int `json:"rotationIntervalSec"`
RotationPlayerCount int `json:"rotationPlayerCount"`
}
type AdminLoginRequest struct {
@@ -121,7 +142,24 @@ type ScoreProofUpdateRequest struct {
}
type AdminSettingsUpdateRequest struct {
ViewProofInView *bool `json:"viewProofInView"`
ViewProofInView *bool `json:"viewProofInView"`
LiveMode *LiveModeSettingsUpdateRequest `json:"liveMode"`
}
type LiveModeSettingsUpdateRequest struct {
ActiveView *string `json:"activeView"`
ShowGroupLive *bool `json:"showGroupLive"`
GroupDisplayMode *string `json:"groupDisplayMode"`
GroupFixedCode *string `json:"groupFixedCode"`
ShowPrelimTie *bool `json:"showPrelimTie"`
ShowPrelimOverall *bool `json:"showPrelimOverall"`
ShowFinalGroups *bool `json:"showFinalGroups"`
FinalDisplayMode *string `json:"finalDisplayMode"`
FinalFixedGroup *int `json:"finalFixedGroup"`
ShowFinalTie *bool `json:"showFinalTie"`
ShowPodium *bool `json:"showPodium"`
RotationIntervalSec *int `json:"rotationIntervalSec"`
RotationPlayerCount *int `json:"rotationPlayerCount"`
}
type ResetStageRequest struct {