[Infra UI] Adapt settings ui to saved object version type change (#30082)

This commit is contained in:
Felix Stürmer 2019-02-05 20:30:31 +01:00 committed by GitHub
parent 3d45d8dd70
commit fd061abd4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 74 additions and 6 deletions

View file

@ -19,7 +19,7 @@ export interface InfraSource {
/** The id of the source */
id: string;
/** The version number the source configuration was last persisted with */
version?: number | null;
version?: string | null;
/** The timestamp the source configuration was last persisted at */
updatedAt?: number | null;
/** The raw configuration of the source */
@ -34,6 +34,8 @@ export interface InfraSource {
logEntriesBetween: InfraLogEntryInterval;
/** A consecutive span of summary buckets within an interval */
logSummaryBetween: InfraLogSummaryInterval;
logItem: InfraLogItem;
/** A hierarchy of hosts, pods, containers, services or arbitrary groups */
map?: InfraResponse | null;
@ -177,6 +179,22 @@ export interface InfraLogSummaryBucket {
entriesCount: number;
}
export interface InfraLogItem {
/** The ID of the document */
id: string;
/** The index where the document was found */
index: string;
/** An array of flattened fields and values */
fields: InfraLogItemField[];
}
export interface InfraLogItemField {
/** The flattened field name */
field: string;
/** The value for the Field as a string */
value: string;
}
export interface InfraResponse {
nodes: InfraNode[];
}
@ -197,6 +215,10 @@ export interface InfraNodeMetric {
name: InfraMetricType;
value: number;
avg: number;
max: number;
}
export interface InfraMetricData {
@ -395,6 +417,9 @@ export interface LogSummaryBetweenInfraSourceArgs {
/** The query to filter the log entries by */
filterQuery?: string | null;
}
export interface LogItemInfraSourceArgs {
id: string;
}
export interface MapInfraSourceArgs {
timerange: InfraTimerangeInput;
@ -456,6 +481,7 @@ export enum InfraPathType {
hosts = 'hosts',
pods = 'pods',
containers = 'containers',
custom = 'custom',
}
export enum InfraMetricType {
@ -521,6 +547,45 @@ export type InfraLogMessageSegment = InfraLogMessageFieldSegment | InfraLogMessa
// Documents
// ====================================================
export namespace FlyoutItemQuery {
export type Variables = {
sourceId: string;
itemId: string;
};
export type Query = {
__typename?: 'Query';
source: Source;
};
export type Source = {
__typename?: 'InfraSource';
id: string;
logItem: LogItem;
};
export type LogItem = {
__typename?: 'InfraLogItem';
id: string;
index: string;
fields: Fields[];
};
export type Fields = {
__typename?: 'InfraLogItemField';
field: string;
value: string;
};
}
export namespace MetadataQuery {
export type Variables = {
sourceId: string;
@ -658,6 +723,10 @@ export namespace WaffleNodesQuery {
name: InfraMetricType;
value: number;
avg: number;
max: number;
};
}
@ -845,7 +914,7 @@ export namespace SourceFields {
id: string;
version?: number | null;
version?: string | null;
updatedAt?: number | null;

View file

@ -89,8 +89,7 @@ const createContainerProps = memoizeLast((sourceId: string, apolloClient: Apollo
undefined,
getDerivedIndexPattern: () => getDerivedIndexPattern,
getVersion: () => state => (state && state.source && state.source.version) || undefined,
getExists: () => state =>
(state && state.source && typeof state.source.version === 'number') || false,
getExists: () => state => (state && state.source && !!state.source.version) || false,
});
const effects = inferEffectMap<State>()({
@ -219,7 +218,7 @@ interface WithSourceProps {
metricIndicesExist?: boolean;
sourceId: string;
update: (changes: UpdateSourceInput[]) => Promise<any>;
version?: number;
version?: string;
}>;
}

View file

@ -914,7 +914,7 @@ export namespace SourceFields {
id: string;
version?: number | null;
version?: string | null;
updatedAt?: number | null;