all: imp code
Some checks failed
build / test (macOS-latest) (push) Has been cancelled
build / test (ubuntu-latest) (push) Has been cancelled
build / test (windows-latest) (push) Has been cancelled
lint / go-lint (push) Has been cancelled
lint / eslint (push) Has been cancelled
build / build-release (push) Has been cancelled
build / notify (push) Has been cancelled
lint / notify (push) Has been cancelled

This commit is contained in:
Stanislav Chzhen
2025-10-24 09:47:20 +03:00
parent 5e093562bb
commit a0466dd49a
3 changed files with 6 additions and 6 deletions

View File

@@ -108,7 +108,7 @@ type statusResponse struct {
ProtectionDisabledDuration int64 `json:"protection_disabled_duration"`
// StartTime is the start time of the web API server in Unix milliseconds.
StartTime int64 `json:"start_time"`
StartTime aghhttp.JSONTime `json:"start_time"`
ProtectionEnabled bool `json:"protection_enabled"`
// TODO(e.burkov): Inspect if front-end doesn't requires this field as
@@ -160,7 +160,7 @@ func (web *webAPI) handleStatus(w http.ResponseWriter, r *http.Request) {
DNSPort: config.DNS.Port,
HTTPPort: config.HTTPConfig.Address.Port(),
ProtectionDisabledDuration: protectionDisabledDuration,
StartTime: web.startTime,
StartTime: aghhttp.JSONTime(web.startTime),
ProtectionEnabled: protEnabled,
IsRunning: isRunning(),
}

View File

@@ -147,7 +147,7 @@ type webAPI struct {
httpsServer httpsServer
// startTime is the start time of the web API server in Unix milliseconds.
startTime int64
startTime time.Time
}
// newWebAPI creates a new instance of the web UI and API server. conf must be
@@ -165,7 +165,7 @@ func newWebAPI(ctx context.Context, conf *webConfig) (w *webAPI) {
baseLogger: conf.baseLogger,
tlsManager: conf.tlsManager,
auth: conf.auth,
startTime: time.Now().UnixMilli(),
startTime: time.Now(),
}
clientFS := http.FileServer(http.FS(conf.clientFS))

View File

@@ -1501,8 +1501,8 @@
'type': 'string'
'example': 'en'
'start_time':
'type': 'integer'
'format': 'int64'
'type': 'number'
'format': 'double'
'example': 1700000000000
'description': 'Start time of the web API server (Unix time in milliseconds).'
'DNSConfig':