shared: add independent IPv4 and IPv6 collection [CI]
ci/woodpecker/pr/verify Pipeline was successful
ci/woodpecker/pr/web-build Pipeline was successful

This commit is contained in:
justme committed 2026-10-07 11:44:01 +08:00
1 parent c974a7dddb
commit 0eda0600cc
60 files changed
+699 -137

No files matched your search

+23 -1
View File
@@ -1007,12 +1007,17 @@ export interface components {
created_at: unknown;
/** Format: date-time */
last_seen_at: unknown;
/** @default */
ipv6_host: string;
/** @default false */
ipv6_supported: boolean;
};
AgentPatchRequest: {
name: null | string;
labels: null | string[];
public_host: null | string;
public_visible: null | boolean;
ipv6_host?: null | string;
};
ApiTokenDto: {
id: string;
@@ -1075,6 +1080,8 @@ export interface components {
remote: null | string;
/** Format: date-time */
connected_since: unknown;
/** @default ipv4 */
ip_version: string;
};
CreateApiTokenRequest: {
name: string;
@@ -1285,6 +1292,10 @@ export interface components {
data_since: unknown;
kinds: string[];
last_test: null | components["schemas"]["TestSummaryDto"];
/** @default ipv4 */
ip_version: string;
/** @default false */
ipv6_available: boolean;
};
LinkDto: {
probe_id: string;
@@ -1408,6 +1419,8 @@ export interface components {
endpoint_changes: number | string;
summary: components["schemas"]["SummaryDto"];
last_test: null | components["schemas"]["TestSummaryDto"];
/** @default ipv4 */
ip_version: string;
};
PageDtoOfAgentDto: {
items: components["schemas"]["AgentDto"][];
@@ -1527,6 +1540,8 @@ export interface components {
remote: null | string;
/** Format: date-time */
connected_since: unknown;
/** @default ipv4 */
ip_version: string;
};
ProbeDto: {
id: string;
@@ -1642,6 +1657,8 @@ export interface components {
versions: {
[key: string]: string;
};
/** @default ipv4 */
ip_version: string;
};
SetLinkRequest: {
enabled: null | boolean;
@@ -1702,6 +1719,8 @@ export interface components {
/** Format: date-time */
finished_at: unknown;
result: null | components["schemas"]["TestResultDto"];
/** @default ipv4 */
ip_version: string;
};
TestResultDto: {
metrics: {
@@ -1762,6 +1781,7 @@ export interface operations {
metrics?: string;
sort?: string;
order?: string;
ip_version?: string;
};
header?: never;
path?: never;
@@ -2191,7 +2211,9 @@ export interface operations {
};
live_stream: {
parameters: {
query?: never;
query?: {
ip_version?: string;
};
header?: never;
path?: never;
cookie?: never;
+10
View File
@@ -0,0 +1,10 @@
import { Segmented } from './ui'
export type IpVersion = 'ipv4' | 'ipv6'
export const ipVersionOf = (value: string | null | undefined): IpVersion => value === 'ipv6' ? 'ipv6' : 'ipv4'
export const IP_VERSIONS: { value: IpVersion; label: string }[] = [{ value: 'ipv4', label: 'IPv4' }, { value: 'ipv6', label: 'IPv6' }]
export const lineIdFor = (id: string, version: IpVersion): string => id.replace(/~ipv6$/, '') + (version === 'ipv6' ? '~ipv6' : '')
export function IpVersionPicker({ value, onChange }: { value: IpVersion; onChange: (value: IpVersion) => void }) {
return <Segmented options={IP_VERSIONS} value={value} onChange={onChange} />
}