diff --git a/plugins/core/src/components/misc/Options.tsx b/plugins/core/src/components/misc/Options.tsx index 38ae1b873..649b4c27f 100644 --- a/plugins/core/src/components/misc/Options.tsx +++ b/plugins/core/src/components/misc/Options.tsx @@ -47,6 +47,26 @@ export type TTime = | 'last7Days' | 'last90Days'; +// TTimeOptions is an array with all available type for TTime. It is used to verify that the value of a string is an +//valid option for the TTime type. +export const TTimeOptions = [ + 'custom', + 'last12Hours', + 'last15Minutes', + 'last1Day', + 'last1Hour', + 'last1Year', + 'last2Days', + 'last30Days', + 'last30Minutes', + 'last3Hours', + 'last5Minutes', + 'last6Hours', + 'last6Months', + 'last7Days', + 'last90Days', +]; + // ITime is the interface for a time in the times map. It contains a label which should be displayed in the Options // component and the seconds between the start and the end time. interface ITime { @@ -88,6 +108,7 @@ interface IOptionsProps { timeEnd: number; timeStart: number; setOptions: ( + refresh: boolean, additionalFields: IOptionsAdditionalFields[] | undefined, time: TTime, timeEnd: number, @@ -142,6 +163,7 @@ export const Options: React.FunctionComponent
{description}
++
+
{error?.message}
+ + ); + } + + if (!data) { + return null; + } + + return{error?.message}
+{error?.message}
++ {!options.columns + ? 'You have to provide a list of columns in the options for the Pormetheus plugin.' + : error?.message} +
+