diff --git a/frontend/src/components/Spiner.tsx b/frontend/src/components/Spiner.tsx new file mode 100644 index 0000000000..ea2d02a1cb --- /dev/null +++ b/frontend/src/components/Spiner.tsx @@ -0,0 +1,42 @@ +import React from 'react'; +import { Spin } from 'antd'; +import styled from "styled-components"; +import { LoadingOutlined } from '@ant-design/icons'; +const antIcon = ; + +const SpinerStyle = styled.div` +position: fixed; +z-index: 999; +height: 4em; +// width: 4em; +overflow: visible; +margin: auto; +top: 0; +left: 50%; +bottom: 0; +right: 0; +`; + +export const CustomSpinner = ({ + size, + tip, +}:{ + size:string, + tip:string, +})=>{ + return( + <> + + + + + ) +} + +export const DefaultSpinner = ()=>{ + return( + <> + + + ) +} \ No newline at end of file diff --git a/frontend/src/modules/AppWrapper.tsx b/frontend/src/modules/AppWrapper.tsx index 79f69ce810..ac58479eb1 100644 --- a/frontend/src/modules/AppWrapper.tsx +++ b/frontend/src/modules/AppWrapper.tsx @@ -1,9 +1,9 @@ import React, { Suspense } from "react"; -import { Spin } from "antd"; import { useThemeSwitcher } from "react-css-theme-switcher"; import ROUTES from "Src/constants/routes"; import { IS_LOGGED_IN } from "Src/constants/auth"; import { BrowserRouter, Route, Switch, Redirect } from "react-router-dom"; +import { CustomSpinner } from "./../components/Spiner"; import BaseLayout from "./BaseLayout"; import { @@ -28,12 +28,12 @@ const App = () => { return ( - }> + }> - }> + }> { if (!initialDataFetch) { return ( - - - Fetching data - + ); } @@ -154,7 +152,7 @@ const _ServicesTable = (props: ServicesTableProps) => { allowFullScreen >
- +
No instrumentation data. diff --git a/frontend/src/modules/Servicemap/ServiceMap.tsx b/frontend/src/modules/Servicemap/ServiceMap.tsx index 27785f95c3..404b12e70e 100644 --- a/frontend/src/modules/Servicemap/ServiceMap.tsx +++ b/frontend/src/modules/Servicemap/ServiceMap.tsx @@ -7,7 +7,6 @@ import { getServiceMapItems, getDetailedServiceMapItems, } from "Src/store/actions"; -import { Spin } from "antd"; import styled from "styled-components"; import { StoreState } from "../../store/reducers"; @@ -15,6 +14,7 @@ import { getZoomPx, getGraphData, getTooltip, transformLabel } from "./utils"; import SelectService from "./SelectService"; import { ForceGraph2D } from "react-force-graph"; import { useRoute } from "../RouteProvider"; +import { CustomSpinner } from "../../components/Spiner"; const Container = styled.div` .force-graph-container .graph-tooltip { @@ -78,7 +78,7 @@ const ServiceMap = (props: ServiceMapProps) => { fgRef.current && fgRef.current.d3Force("charge").strength(-400); }); if (!serviceMap.items.length || !serviceMap.services.length) { - return ; + return ; } const zoomToService = (value: string) => {