Skip to content

Commit

Permalink
UI: regenerate yarn.lock to fix codemirror (#4384)
Browse files Browse the repository at this point in the history
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
  • Loading branch information
Nexucis committed Jun 29, 2021
1 parent 989147c commit 30a9c12
Show file tree
Hide file tree
Showing 7 changed files with 1,513 additions and 1,413 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re

### Added

- [#4384](https://github.com/thanos-io/thanos/pull/4384) Fix the experimental PromQL editor when used on multiple line.
- [#4299](https://github.com/thanos-io/thanos/pull/4299) Tracing: Add tracing to exemplar APIs.
- [#4327](https://github.com/thanos-io/thanos/pull/4327) Add environment variable substitution to all YAML configuration flags.
- [#4239](https://github.com/thanos-io/thanos/pull/4239) Add penalty based deduplication mode for compactor.
Expand Down
240 changes: 120 additions & 120 deletions pkg/ui/bindata.go

Large diffs are not rendered by default.

62 changes: 29 additions & 33 deletions pkg/ui/react-app/src/components/withStatusIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,33 @@ interface StatusIndicatorProps {
componentTitle?: string;
}

export const withStatusIndicator = <T extends any>(Component: ComponentType<T>): FC<StatusIndicatorProps & T> => ({
error,
isLoading,
customErrorMsg,
componentTitle,
...rest
}: StatusIndicatorProps) => {
if (error) {
return (
<UncontrolledAlert color="danger">
{customErrorMsg ? (
customErrorMsg
) : (
<>
<strong>Error:</strong> Error fetching {componentTitle || Component.displayName}: {error.message}
</>
)}
</UncontrolledAlert>
);
}
export const withStatusIndicator =
<T extends any>(Component: ComponentType<T>): FC<StatusIndicatorProps & T> =>
({ error, isLoading, customErrorMsg, componentTitle, ...rest }: StatusIndicatorProps) => {
if (error) {
return (
<UncontrolledAlert color="danger">
{customErrorMsg ? (
customErrorMsg
) : (
<>
<strong>Error:</strong> Error fetching {componentTitle || Component.displayName}: {error.message}
</>
)}
</UncontrolledAlert>
);
}

if (isLoading) {
return (
<FontAwesomeIcon
size="3x"
icon={faSpinner}
spin
className="position-absolute"
style={{ transform: 'translate(-50%, -50%)', top: '50%', left: '50%' }}
/>
);
}
return <Component {...(rest as any)} />;
};
if (isLoading) {
return (
<FontAwesomeIcon
size="3x"
icon={faSpinner}
spin
className="position-absolute"
style={{ transform: 'translate(-50%, -50%)', top: '50%', left: '50%' }}
/>
);
}
return <Component {...(rest as any)} />;
};
22 changes: 10 additions & 12 deletions pkg/ui/react-app/src/pages/graph/DataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,16 @@ const DataTable: FC<QueryResult> = ({ data }) => {
const doFormat = data.result.length <= maxFormattableSize;
switch (data.resultType) {
case 'vector':
rows = (limitSeries(data.result) as InstantSample[]).map(
(s: InstantSample, index: number): ReactNode => {
return (
<tr key={index}>
<td>
<SeriesName labels={s.metric} format={doFormat} />
</td>
<td>{s.value[1]}</td>
</tr>
);
}
);
rows = (limitSeries(data.result) as InstantSample[]).map((s: InstantSample, index: number): ReactNode => {
return (
<tr key={index}>
<td>
<SeriesName labels={s.metric} format={doFormat} />
</td>
<td>{s.value[1]}</td>
</tr>
);
});
limited = rows.length !== data.result.length;
break;
case 'matrix':
Expand Down
16 changes: 10 additions & 6 deletions pkg/ui/react-app/src/pages/graph/PanelList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,16 @@ const PanelList: FC<RouteComponentProps & PathPrefixProps> = ({ pathPrefix = ''
const [enableLinter, setEnableLinter] = useLocalStorage('enable-linter', true);

const { response: metricsRes, error: metricsErr } = useFetch<string[]>(`${pathPrefix}/api/v1/label/__name__/values`);
const { response: storesRes, error: storesErr, isLoading: storesLoading } = useFetch<StoreListProps>(
`${pathPrefix}/api/v1/stores`
);
const { response: flagsRes, error: flagsErr, isLoading: flagsLoading } = useFetch<FlagMap>(
`${pathPrefix}/api/v1/status/flags`
);
const {
response: storesRes,
error: storesErr,
isLoading: storesLoading,
} = useFetch<StoreListProps>(`${pathPrefix}/api/v1/stores`);
const {
response: flagsRes,
error: flagsErr,
isLoading: flagsLoading,
} = useFetch<FlagMap>(`${pathPrefix}/api/v1/status/flags`);
const defaultStep = flagsRes?.data?.['query.default-step'] || '1s';

const browserTime = new Date().getTime() / 1000;
Expand Down
10 changes: 6 additions & 4 deletions pkg/ui/react-app/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,9 @@ export const mapObjEntries = <T, key extends keyof T, Z>(
cb: ([k, v]: [string, T[key]], i: number, arr: [string, T[key]][]) => Z
) => Object.entries(o).map(cb);

export const callAll = (...fns: Array<(...args: any) => void>) => (...args: any) => {
// eslint-disable-next-line prefer-spread
fns.filter(Boolean).forEach((fn) => fn.apply(null, args));
};
export const callAll =
(...fns: Array<(...args: any) => void>) =>
(...args: any) => {
// eslint-disable-next-line prefer-spread
fns.filter(Boolean).forEach((fn) => fn.apply(null, args));
};
Loading

0 comments on commit 30a9c12

Please sign in to comment.