mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-13 05:19:04 +08:00
Use API status for loading
This commit is contained in:
parent
b7dea68ff5
commit
2a039150a8
@ -1,4 +1,4 @@
|
|||||||
import React, { useEffect } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { useLocation } from "react-router-dom";
|
import { useLocation } from "react-router-dom";
|
||||||
import { NavLink } from "react-router-dom";
|
import { NavLink } from "react-router-dom";
|
||||||
import { Spin, Table } from "antd";
|
import { Spin, Table } from "antd";
|
||||||
@ -80,16 +80,19 @@ const columns = [
|
|||||||
const _ServicesTable = (props: ServicesTableProps) => {
|
const _ServicesTable = (props: ServicesTableProps) => {
|
||||||
const search = useLocation().search;
|
const search = useLocation().search;
|
||||||
const time_interval = new URLSearchParams(search).get("time");
|
const time_interval = new URLSearchParams(search).get("time");
|
||||||
|
const [dataFetched, setDataFetched] = useState(false)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
/*
|
/*
|
||||||
@Note - Change this from action to thunk
|
@Note - Change this from action to thunk
|
||||||
*/
|
*/
|
||||||
props.getServicesList(props.globalTime);
|
props.getServicesList(props.globalTime).then(()=>{
|
||||||
|
setDataFetched(true)
|
||||||
|
}).catch((e:string)=>{
|
||||||
|
alert(e)
|
||||||
|
});
|
||||||
}, [props.globalTime]);
|
}, [props.globalTime]);
|
||||||
|
|
||||||
const isDataAvailable = props.servicesList.length > 1;
|
if(!dataFetched){
|
||||||
if(!isDataAvailable){
|
|
||||||
return (
|
return (
|
||||||
<TableLoadingWrapper>
|
<TableLoadingWrapper>
|
||||||
<Spin/>
|
<Spin/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user