Remove historical analytics from the registry page

This commit is contained in:
ayurishchev committed 2026-11-23 12:11:03 +03:00
1 parent b58d5f5b82
commit 7eeb8c4ae9
16 files changed
+16 -794

No files matched your search

-69
View File
@@ -331,75 +331,6 @@ func (c *client) GetRegistryBreakdownCSV(ctx context.Context, q registryQuery, k
return c.getCSV(ctx, registryBreakdownPath(q, key, true, true))
}
// GetRegistryTrend returns the checks of the query's direction (and protocol)
// per target or site in each finalized run, within the subnet and the period
// from/to (YYYY-MM-DD, empty = open). The run, status and address filters of
// the query do not apply to a history.
func (c *client) GetRegistryTrend(ctx context.Context, q registryQuery, from, to string) (registryTrend, error) {
v, f := url.Values{}, q.filter()
for _, k := range []string{"subnet", "direction", "protocol"} {
if x := f.Get(k); x != "" {
v.Set(k, x)
}
}
if from != "" {
v.Set("from", from)
}
if to != "" {
v.Set("to", to)
}
var out registryTrend
err := c.do(ctx, http.MethodGet, "/api/v1/admin/registry/trend?"+v.Encode(), nil, &out)
return out, err
}
// alwaysPassPath is the path of GET /admin/registry/always-pass, or of its list
// when list is set, as a CSV file when csv is. The query's subnet, direction,
// protocol and address search count, with the period from/to (YYYY-MM-DD).
func alwaysPassPath(q registryQuery, from, to string, list, csv bool) string {
v, f := url.Values{}, q.filter()
for _, k := range []string{"q", "subnet", "direction", "protocol"} {
if x := f.Get(k); x != "" {
v.Set(k, x)
}
}
if from != "" {
v.Set("from", from)
}
if to != "" {
v.Set("to", to)
}
p := "/api/v1/admin/registry/always-pass"
if list {
p += "/list"
if csv {
v.Set("format", "csv")
}
}
return p + "?" + v.Encode()
}
// GetRegistryAlwaysPass returns how many addresses never failed a check of the
// query's direction (and protocol) in the finalized runs of the period.
func (c *client) GetRegistryAlwaysPass(ctx context.Context, q registryQuery, from, to string) (registryAlwaysPass, error) {
var out registryAlwaysPass
err := c.do(ctx, http.MethodGet, alwaysPassPath(q, from, to, false, false), nil, &out)
return out, err
}
// GetRegistryAlwaysPassList returns the table (JSON) of those addresses.
func (c *client) GetRegistryAlwaysPassList(ctx context.Context, q registryQuery, from, to string) (json.RawMessage, error) {
var out json.RawMessage
err := c.do(ctx, http.MethodGet, alwaysPassPath(q, from, to, true, false), nil, &out)
return out, err
}
// GetRegistryAlwaysPassCSV returns the CSV file of that table, with the file
// name control-api proposed.
func (c *client) GetRegistryAlwaysPassCSV(ctx context.Context, q registryQuery, from, to string) ([]byte, string, error) {
return c.getCSV(ctx, alwaysPassPath(q, from, to, true, true))
}
// GetRegistryHistory returns one address's registry record plus its full
// retained check history across every cycle still kept.
func (c *client) GetRegistryHistory(ctx context.Context, ip string) (registryHistoryResponse, error) {