feat: plan.md + minor fixes (stats, server, copilot rules)
This commit is contained in:
@@ -15,8 +15,8 @@ import (
|
||||
"fission-console/internal/auth"
|
||||
"fission-console/internal/billing"
|
||||
"fission-console/internal/cloud"
|
||||
"fission-console/internal/stats"
|
||||
"fission-console/internal/fission"
|
||||
"fission-console/internal/stats"
|
||||
"fission-console/ui"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
@@ -84,8 +84,8 @@ type Config struct {
|
||||
Authenticator auth.Authenticator // слой аутентификации
|
||||
LLMUrl string
|
||||
LLMKey string
|
||||
Billing billing.Store // слой статистики (NoopStore если не задан)
|
||||
Stats stats.StatsProvider // аналитика (NoopProvider если не настроен)
|
||||
Billing billing.Store // слой статистики (NoopStore если не задан)
|
||||
Stats stats.StatsProvider // аналитика (NoopProvider если не настроен)
|
||||
}
|
||||
|
||||
// NewServer создаёт и настраивает HTTP Server со всеми зависимостями.
|
||||
|
||||
@@ -28,9 +28,9 @@ type GrafanaProvider struct {
|
||||
adminPass string
|
||||
http *http.Client
|
||||
|
||||
mu sync.RWMutex
|
||||
tokens map[string]string // namespace → publicDashboardAccessToken
|
||||
orgIDs map[string]int64 // namespace → grafana orgId
|
||||
mu sync.RWMutex
|
||||
tokens map[string]string // namespace → publicDashboardAccessToken
|
||||
orgIDs map[string]int64 // namespace → grafana orgId
|
||||
}
|
||||
|
||||
// NewGrafanaProvider создаёт GrafanaProvider.
|
||||
@@ -178,8 +178,8 @@ func (g *GrafanaProvider) ensureDatasource(ctx context.Context, orgID int64) err
|
||||
return fmt.Errorf("get main datasource: %w", err)
|
||||
}
|
||||
var ds struct {
|
||||
URL string `json:"url"`
|
||||
JSONData json.RawMessage `json:"jsonData"`
|
||||
URL string `json:"url"`
|
||||
JSONData json.RawMessage `json:"jsonData"`
|
||||
SecureJSONData struct {
|
||||
Password string `json:"password"`
|
||||
} `json:"secureJsonData"`
|
||||
@@ -196,9 +196,9 @@ func (g *GrafanaProvider) ensureDatasource(ctx context.Context, orgID int64) err
|
||||
"url": ds.URL,
|
||||
"access": "proxy",
|
||||
"jsonData": map[string]any{
|
||||
"sslmode": "disable",
|
||||
"postgresVersion": 1700,
|
||||
"timescaledb": false,
|
||||
"sslmode": "disable",
|
||||
"postgresVersion": 1700,
|
||||
"timescaledb": false,
|
||||
},
|
||||
"secureJsonData": ds.SecureJSONData,
|
||||
}
|
||||
@@ -270,8 +270,8 @@ func (g *GrafanaProvider) ensurePublicDashboard(ctx context.Context, orgID int64
|
||||
|
||||
// Создаём
|
||||
payload := map[string]any{
|
||||
"isEnabled": true,
|
||||
"annotationsEnabled": false,
|
||||
"isEnabled": true,
|
||||
"annotationsEnabled": false,
|
||||
"timeSelectionEnabled": true,
|
||||
}
|
||||
resp, body, err = g.grafanaRequest(ctx, http.MethodPost, path, orgID, payload)
|
||||
|
||||
@@ -7,4 +7,4 @@ import "context"
|
||||
type NoopProvider struct{}
|
||||
|
||||
func (NoopProvider) EnsureOrgForNamespace(_ context.Context, _, _ string) error { return nil }
|
||||
func (NoopProvider) DashboardURL(_ context.Context, _ string) string { return "" }
|
||||
func (NoopProvider) DashboardURL(_ context.Context, _ string) string { return "" }
|
||||
|
||||
Reference in New Issue
Block a user